Java Reference
In-Depth Information
This applies the option to the Evaluator class and any of its nested types.
If you are using assertions in your code, the obvious thing you should
do is always use ea with enough specificity to get all your relevant code.
Multiple options are evaluated in order from the command line. Class-
specific options take precedence over package ones, and a more specific
package option takes precedence over a less specific one. For example,
given
-da:com.acme.Plotter -ea:com.acme... -da:com.acme.products
-ea:com.acme.products.Rocket
assertions will be enabled for all classes and subpackages of com.acme ,
except the class com.acme.Plotter , and disabled for all classes and sub-
packages
of
com.acme.products ,
except
for
the
class
com.acme.products.Rocket .
The system classes are controlled separately because you are more
likely to be searching for bugs in your code than in the system code.
To affect system classes, use the "system" variants of the options:
- enablesystemassertions /- esa and - disablesystemassertions /- dsa (the latter
option is primarily for symmetry).
The assertion status of a class is determined when that class is initial-
izedsee " Preparing a Class for Use " on page 441 and never changes. This
determination is made before any static initializers for the class are ex-
ecuted, but after the initialization of the superclass. If a superclass static
initializer causes a static method of its own subclass to be executed, it is
possible for that static method to execute before its own class is initial-
ized, and before the assertion status of that class has been determined.
In such circumstances, the execution of any assert statements must be
dealt with as if assertions were enabled for the class.
 
Search WWH ::




Custom Search