author | darcy |
Wed, 15 Aug 2018 10:44:56 -0700 | |
changeset 51413 | 43e41800d579 |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
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 |
|
32033
bf24e33c7919
8132468: docs: replace <tt> tags (obsolete in html5) for java.io, java.lang, java.math
avstepan
parents:
25859
diff
changeset
|
32 |
* the {@code java} command line flags {@code -enableassertions} |
bf24e33c7919
8132468: docs: replace <tt> tags (obsolete in html5) for java.io, java.lang, java.math
avstepan
parents:
25859
diff
changeset
|
33 |
* ({@code -ea}) and {@code -disableassertions} ({@code -da}). |
2 | 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 |
/** |
|
32033
bf24e33c7919
8132468: docs: replace <tt> tags (obsolete in html5) for java.io, java.lang, java.math
avstepan
parents:
25859
diff
changeset
|
47 |
* A parallel array to {@code classes}, indicating whether each class |
bf24e33c7919
8132468: docs: replace <tt> tags (obsolete in html5) for java.io, java.lang, java.math
avstepan
parents:
25859
diff
changeset
|
48 |
* is to have assertions enabled or disabled. A value of {@code true} |
bf24e33c7919
8132468: docs: replace <tt> tags (obsolete in html5) for java.io, java.lang, java.math
avstepan
parents:
25859
diff
changeset
|
49 |
* for {@code classEnabled[i]} indicates that the class named by |
bf24e33c7919
8132468: docs: replace <tt> tags (obsolete in html5) for java.io, java.lang, java.math
avstepan
parents:
25859
diff
changeset
|
50 |
* {@code classes[i]} should have assertions enabled; a value of |
bf24e33c7919
8132468: docs: replace <tt> tags (obsolete in html5) for java.io, java.lang, java.math
avstepan
parents:
25859
diff
changeset
|
51 |
* {@code false} indicates that it should have classes disabled. |
bf24e33c7919
8132468: docs: replace <tt> tags (obsolete in html5) for java.io, java.lang, java.math
avstepan
parents:
25859
diff
changeset
|
52 |
* This array must have the same number of elements as {@code classes}. |
2 | 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 |
|
32033
bf24e33c7919
8132468: docs: replace <tt> tags (obsolete in html5) for java.io, java.lang, java.math
avstepan
parents:
25859
diff
changeset
|
56 |
* {@code s} appears multiple times in the {@code classes} array |
bf24e33c7919
8132468: docs: replace <tt> tags (obsolete in html5) for java.io, java.lang, java.math
avstepan
parents:
25859
diff
changeset
|
57 |
* and {@code i} is the highest integer for which |
bf24e33c7919
8132468: docs: replace <tt> tags (obsolete in html5) for java.io, java.lang, java.math
avstepan
parents:
25859
diff
changeset
|
58 |
* {@code classes[i].equals(s)}, then {@code classEnabled[i]} |
bf24e33c7919
8132468: docs: replace <tt> tags (obsolete in html5) for java.io, java.lang, java.math
avstepan
parents:
25859
diff
changeset
|
59 |
* indicates whether assertions are to be enabled in class {@code s}. |
2 | 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 |
/** |
|
32033
bf24e33c7919
8132468: docs: replace <tt> tags (obsolete in html5) for java.io, java.lang, java.math
avstepan
parents:
25859
diff
changeset
|
71 |
* A parallel array to {@code packages}, indicating whether each |
2 | 72 |
* package-tree is to have assertions enabled or disabled. A value of |
32033
bf24e33c7919
8132468: docs: replace <tt> tags (obsolete in html5) for java.io, java.lang, java.math
avstepan
parents:
25859
diff
changeset
|
73 |
* {@code true} for {@code packageEnabled[i]} indicates that the |
bf24e33c7919
8132468: docs: replace <tt> tags (obsolete in html5) for java.io, java.lang, java.math
avstepan
parents:
25859
diff
changeset
|
74 |
* package-tree named by {@code packages[i]} should have assertions |
bf24e33c7919
8132468: docs: replace <tt> tags (obsolete in html5) for java.io, java.lang, java.math
avstepan
parents:
25859
diff
changeset
|
75 |
* enabled; a value of {@code false} indicates that it should have |
2 | 76 |
* assertions disabled. This array must have the same number of |
32033
bf24e33c7919
8132468: docs: replace <tt> tags (obsolete in html5) for java.io, java.lang, java.math
avstepan
parents:
25859
diff
changeset
|
77 |
* elements as {@code packages}. |
2 | 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 |
|
32033
bf24e33c7919
8132468: docs: replace <tt> tags (obsolete in html5) for java.io, java.lang, java.math
avstepan
parents:
25859
diff
changeset
|
81 |
* string {@code s} appears multiple times in the {@code packages} array |
bf24e33c7919
8132468: docs: replace <tt> tags (obsolete in html5) for java.io, java.lang, java.math
avstepan
parents:
25859
diff
changeset
|
82 |
* and {@code i} is the highest integer for which |
bf24e33c7919
8132468: docs: replace <tt> tags (obsolete in html5) for java.io, java.lang, java.math
avstepan
parents:
25859
diff
changeset
|
83 |
* {@code packages[i].equals(s)}, then {@code packageEnabled[i]} |
2 | 84 |
* indicates whether assertions are to be enabled in package-tree |
32033
bf24e33c7919
8132468: docs: replace <tt> tags (obsolete in html5) for java.io, java.lang, java.math
avstepan
parents:
25859
diff
changeset
|
85 |
* {@code s}. |
2 | 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 |
} |