posted 17 years ago
Hi ranchers,
java -ea -da:com... net.example.LaunchTranslator
the first part is
-ea without specified packages or classes enables assertions in all classes in all packages and subpackages.
the second part
-da:com... disables assertions in package com and all of its sub-packages.
the third part
net.example.LaunchTranslator
runs class LaunchTranslator in package net.example
net.example as package name shows, that it isn't a subpackage of com, otherwise com would be part of the package name, so the class runs with assertions enabled.
a) com.example.Translator subpack of com -> disabled
b) java.lang.String not a subpack of com -> enabled
c) dot.com.Boot
Tricky. the package dot.com is not a subpackage of com!
It is a subpackage of dot. To disable assertions in this package, you'd need to write
java -ea -da:com... dot.com... net.example.LaunchTranslator
as we didn't write so, assertions are enabled.
d) net.example.LaunchTranslator not a subpack of com -> enabled, and this is the class that will run
e) java.lang.AssertionError not a subpack -> enabled.
I don't think that java.lang.String and java.lang.AssertionError actually have assertions, but if they had, they were enabled.
Yours,
Bu.
all events occur in real time