Path: blob/master/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/shared/Constants.java
41161 views
/*1* Copyright (c) 2013, 2018, 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.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223package vm.runtime.defmeth.shared;2425import static java.lang.String.format;2627/**28* Set of constants which are used in the test suite.29* The actual values can be changed through corresponding property.30*/31public class Constants {32static public final boolean PRINT_ASSEMBLY = getValue("vm.runtime.defmeth.printAssembly", false);33static public final boolean PRINT_TESTS = getValue("vm.runtime.defmeth.printTests", false);34static public final boolean ASMIFY = getValue("vm.runtime.defmeth.printASMify", false);35static public final boolean DUMP_CLASSES = getValue("vm.runtime.defmeth.dumpClasses", false);36static public final boolean PRINT_STACK_TRACE = getValue("vm.runtime.defmeth.printStackTrace", false);37static public final boolean TRACE_CLASS_REDEF = getValue("vm.runtime.defmeth.traceClassRedefinition", false);3839/**40* Get value of the test suite's property41* Supported values:42* "" == true43* "true" == true44* "false" == false45* undefined == default value46*/47static boolean getValue(String property, boolean defaultValue) {48String value = System.getProperty(property);4950if ("false".equals(value)) return false;51if ("true".equals(value)) return true;52if ("".equals(value)) return true;53if (value == null ) return defaultValue;5455throw new IllegalArgumentException(format("Unknown value: -D%s=%s", property, value));56}57}585960