2
|
1 |
/*
|
5506
|
2 |
* Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
|
2
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
4 |
*
|
|
5 |
* This code is free software; you can redistribute it and/or modify it
|
|
6 |
* under the terms of the GNU General Public License version 2 only, as
|
5506
|
7 |
* published by the Free Software Foundation. Oracle designates this
|
2
|
8 |
* particular file as subject to the "Classpath" exception as provided
|
5506
|
9 |
* by Oracle in the LICENSE file that accompanied this code.
|
2
|
10 |
*
|
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that
|
|
15 |
* accompanied this code).
|
|
16 |
*
|
|
17 |
* You should have received a copy of the GNU General Public License version
|
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
20 |
*
|
5506
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
22 |
* or visit www.oracle.com if you need additional information or have any
|
|
23 |
* questions.
|
2
|
24 |
*/
|
|
25 |
|
|
26 |
package java.lang;
|
|
27 |
|
|
28 |
/**
|
|
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
|
|
31 |
* the JVM to communicate the assertion status directives implied by
|
|
32 |
* the <tt>java</tt> command line flags <tt>-enableassertions</tt>
|
|
33 |
* (<tt>-ea</tt>) and <tt>-disableassertions</tt> (<tt>-da</tt>).
|
|
34 |
*
|
|
35 |
* @since 1.4
|
|
36 |
* @author Josh Bloch
|
|
37 |
*/
|
|
38 |
class AssertionStatusDirectives {
|
|
39 |
/**
|
|
40 |
* The classes for which assertions are to be enabled or disabled.
|
|
41 |
* The strings in this array are fully qualified class names (for
|
|
42 |
* example,"com.xyz.foo.Bar").
|
|
43 |
*/
|
|
44 |
String[] classes;
|
|
45 |
|
|
46 |
/**
|
|
47 |
* A parallel array to <tt>classes</tt>, indicating whether each class
|
|
48 |
* is to have assertions enabled or disabled. A value of <tt>true</tt>
|
|
49 |
* for <tt>classEnabled[i]</tt> indicates that the class named by
|
|
50 |
* <tt>classes[i]</tt> should have assertions enabled; a value of
|
|
51 |
* <tt>false</tt> indicates that it should have classes disabled.
|
|
52 |
* This array must have the same number of elements as <tt>classes</tt>.
|
|
53 |
*
|
|
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
|
|
56 |
* <tt>s</tt> appears multiple times in the <tt>classes</tt> array
|
|
57 |
* and <tt>i</tt> is the highest integer for which
|
|
58 |
* <tt>classes[i].equals(s)</tt>, then <tt>classEnabled[i]</tt>
|
|
59 |
* indicates whether assertions are to be enabled in class <tt>s</tt>.
|
|
60 |
*/
|
|
61 |
boolean[] classEnabled;
|
|
62 |
|
|
63 |
/**
|
|
64 |
* The package-trees for which assertions are to be enabled or disabled.
|
|
65 |
* The strings in this array are compete or partial package names
|
|
66 |
* (for example, "com.xyz" or "com.xyz.foo").
|
|
67 |
*/
|
|
68 |
String[] packages;
|
|
69 |
|
|
70 |
/**
|
|
71 |
* A parallel array to <tt>packages</tt>, indicating whether each
|
|
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
|
|
74 |
* package-tree named by <tt>packages[i]</tt> should have assertions
|
|
75 |
* enabled; a value of <tt>false</tt> indicates that it should have
|
|
76 |
* assertions disabled. This array must have the same number of
|
|
77 |
* elements as <tt>packages</tt>.
|
|
78 |
*
|
|
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
|
|
81 |
* string <tt>s</tt> appears multiple times in the <tt>packages</tt> array
|
|
82 |
* and <tt>i</tt> is the highest integer for which
|
|
83 |
* <tt>packages[i].equals(s)</tt>, then <tt>packageEnabled[i]</tt>
|
|
84 |
* indicates whether assertions are to be enabled in package-tree
|
|
85 |
* <tt>s</tt>.
|
|
86 |
*/
|
|
87 |
boolean[] packageEnabled;
|
|
88 |
|
|
89 |
/**
|
|
90 |
* Whether or not assertions in non-system classes are to be enabled
|
|
91 |
* by default.
|
|
92 |
*/
|
|
93 |
boolean deflt;
|
|
94 |
}
|