Path: blob/master/src/java.base/share/classes/java/lang/AssertionStatusDirectives.java
41152 views
/*1* Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package java.lang;2627/**28* A collection of assertion status directives (such as "enable assertions29* in package p" or "disable assertions in class c"). This class is used by30* the JVM to communicate the assertion status directives implied by31* the {@code java} command line flags {@code -enableassertions}32* ({@code -ea}) and {@code -disableassertions} ({@code -da}).33*34* @since 1.435* @author Josh Bloch36*/37class AssertionStatusDirectives {38/**39* The classes for which assertions are to be enabled or disabled.40* The strings in this array are fully qualified class names (for41* example,"com.xyz.foo.Bar").42*/43String[] classes;4445/**46* A parallel array to {@code classes}, indicating whether each class47* is to have assertions enabled or disabled. A value of {@code true}48* for {@code classEnabled[i]} indicates that the class named by49* {@code classes[i]} should have assertions enabled; a value of50* {@code false} indicates that it should have classes disabled.51* This array must have the same number of elements as {@code classes}.52*53* <p>In the case of conflicting directives for the same class, the54* last directive for a given class wins. In other words, if a string55* {@code s} appears multiple times in the {@code classes} array56* and {@code i} is the highest integer for which57* {@code classes[i].equals(s)}, then {@code classEnabled[i]}58* indicates whether assertions are to be enabled in class {@code s}.59*/60boolean[] classEnabled;6162/**63* The package-trees for which assertions are to be enabled or disabled.64* The strings in this array are compete or partial package names65* (for example, "com.xyz" or "com.xyz.foo").66*/67String[] packages;6869/**70* A parallel array to {@code packages}, indicating whether each71* package-tree is to have assertions enabled or disabled. A value of72* {@code true} for {@code packageEnabled[i]} indicates that the73* package-tree named by {@code packages[i]} should have assertions74* enabled; a value of {@code false} indicates that it should have75* assertions disabled. This array must have the same number of76* elements as {@code packages}.77*78* In the case of conflicting directives for the same package-tree, the79* last directive for a given package-tree wins. In other words, if a80* string {@code s} appears multiple times in the {@code packages} array81* and {@code i} is the highest integer for which82* {@code packages[i].equals(s)}, then {@code packageEnabled[i]}83* indicates whether assertions are to be enabled in package-tree84* {@code s}.85*/86boolean[] packageEnabled;8788/**89* Whether or not assertions in non-system classes are to be enabled90* by default.91*/92boolean deflt;93}949596