27 |
27 |
28 /** |
28 /** |
29 * A collection of assertion status directives (such as "enable assertions |
29 * A collection of assertion status directives (such as "enable assertions |
30 * in package p" or "disable assertions in class c"). This class is used by |
30 * in package p" or "disable assertions in class c"). This class is used by |
31 * the JVM to communicate the assertion status directives implied by |
31 * the JVM to communicate the assertion status directives implied by |
32 * the <tt>java</tt> command line flags <tt>-enableassertions</tt> |
32 * the {@code java} command line flags {@code -enableassertions} |
33 * (<tt>-ea</tt>) and <tt>-disableassertions</tt> (<tt>-da</tt>). |
33 * ({@code -ea}) and {@code -disableassertions} ({@code -da}). |
34 * |
34 * |
35 * @since 1.4 |
35 * @since 1.4 |
36 * @author Josh Bloch |
36 * @author Josh Bloch |
37 */ |
37 */ |
38 class AssertionStatusDirectives { |
38 class AssertionStatusDirectives { |
42 * example,"com.xyz.foo.Bar"). |
42 * example,"com.xyz.foo.Bar"). |
43 */ |
43 */ |
44 String[] classes; |
44 String[] classes; |
45 |
45 |
46 /** |
46 /** |
47 * A parallel array to <tt>classes</tt>, indicating whether each class |
47 * A parallel array to {@code classes}, indicating whether each class |
48 * is to have assertions enabled or disabled. A value of <tt>true</tt> |
48 * is to have assertions enabled or disabled. A value of {@code true} |
49 * for <tt>classEnabled[i]</tt> indicates that the class named by |
49 * for {@code classEnabled[i]} indicates that the class named by |
50 * <tt>classes[i]</tt> should have assertions enabled; a value of |
50 * {@code classes[i]} should have assertions enabled; a value of |
51 * <tt>false</tt> indicates that it should have classes disabled. |
51 * {@code false} indicates that it should have classes disabled. |
52 * This array must have the same number of elements as <tt>classes</tt>. |
52 * This array must have the same number of elements as {@code classes}. |
53 * |
53 * |
54 * <p>In the case of conflicting directives for the same class, the |
54 * <p>In the case of conflicting directives for the same class, the |
55 * last directive for a given class wins. In other words, if a string |
55 * last directive for a given class wins. In other words, if a string |
56 * <tt>s</tt> appears multiple times in the <tt>classes</tt> array |
56 * {@code s} appears multiple times in the {@code classes} array |
57 * and <tt>i</tt> is the highest integer for which |
57 * and {@code i} is the highest integer for which |
58 * <tt>classes[i].equals(s)</tt>, then <tt>classEnabled[i]</tt> |
58 * {@code classes[i].equals(s)}, then {@code classEnabled[i]} |
59 * indicates whether assertions are to be enabled in class <tt>s</tt>. |
59 * indicates whether assertions are to be enabled in class {@code s}. |
60 */ |
60 */ |
61 boolean[] classEnabled; |
61 boolean[] classEnabled; |
62 |
62 |
63 /** |
63 /** |
64 * The package-trees for which assertions are to be enabled or disabled. |
64 * The package-trees for which assertions are to be enabled or disabled. |
66 * (for example, "com.xyz" or "com.xyz.foo"). |
66 * (for example, "com.xyz" or "com.xyz.foo"). |
67 */ |
67 */ |
68 String[] packages; |
68 String[] packages; |
69 |
69 |
70 /** |
70 /** |
71 * A parallel array to <tt>packages</tt>, indicating whether each |
71 * A parallel array to {@code packages}, indicating whether each |
72 * package-tree is to have assertions enabled or disabled. A value of |
72 * package-tree is to have assertions enabled or disabled. A value of |
73 * <tt>true</tt> for <tt>packageEnabled[i]</tt> indicates that the |
73 * {@code true} for {@code packageEnabled[i]} indicates that the |
74 * package-tree named by <tt>packages[i]</tt> should have assertions |
74 * package-tree named by {@code packages[i]} should have assertions |
75 * enabled; a value of <tt>false</tt> indicates that it should have |
75 * enabled; a value of {@code false} indicates that it should have |
76 * assertions disabled. This array must have the same number of |
76 * assertions disabled. This array must have the same number of |
77 * elements as <tt>packages</tt>. |
77 * elements as {@code packages}. |
78 * |
78 * |
79 * In the case of conflicting directives for the same package-tree, the |
79 * In the case of conflicting directives for the same package-tree, the |
80 * last directive for a given package-tree wins. In other words, if a |
80 * last directive for a given package-tree wins. In other words, if a |
81 * string <tt>s</tt> appears multiple times in the <tt>packages</tt> array |
81 * string {@code s} appears multiple times in the {@code packages} array |
82 * and <tt>i</tt> is the highest integer for which |
82 * and {@code i} is the highest integer for which |
83 * <tt>packages[i].equals(s)</tt>, then <tt>packageEnabled[i]</tt> |
83 * {@code packages[i].equals(s)}, then {@code packageEnabled[i]} |
84 * indicates whether assertions are to be enabled in package-tree |
84 * indicates whether assertions are to be enabled in package-tree |
85 * <tt>s</tt>. |
85 * {@code s}. |
86 */ |
86 */ |
87 boolean[] packageEnabled; |
87 boolean[] packageEnabled; |
88 |
88 |
89 /** |
89 /** |
90 * Whether or not assertions in non-system classes are to be enabled |
90 * Whether or not assertions in non-system classes are to be enabled |