|
Reflection
If option -d is supplied, Autojar scans the bytecode of every class for
invocations of Class.forName() and warns about any occurence. In
cases where the method's parameter is a string literal, Autojar knows the class
in advance; the message will then look like this:
If option -a is present (implies -d), Autojar tries to find and
include this class in the usual way. If it succeeds, the message reads
If, however, Class.forName() is called with a string reference,
Autojar can't find out the class name. Such calls are printed at the end
of the run in a separate list. Example:
The resulting archive may then be incomplete, and using it may lead to ClassNotFound exceptions, provided that the corresponding
Class.forName() calls actually get executed.
Compiler generated |