Path: blob/master/src/java.base/share/classes/java/lang/Compiler.java
41152 views
/*1* Copyright (c) 1995, 2016, 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* The {@code Compiler} class is provided to support Java-to-native-code29* compilers and related services. By design, the {@code Compiler} class does30* nothing; it serves as a placeholder for a JIT compiler implementation.31* If no compiler is available, these methods do nothing.32*33* @deprecated JIT compilers and their technologies vary too widely to34* be controlled effectively by a standardized interface. As such, many35* JIT compiler implementations ignore this interface, and are instead36* controllable by implementation-specific mechanisms such as command-line37* options. This class is subject to removal in a future version of Java SE.38*39* @author Frank Yellin40* @since 1.041*/42@Deprecated(since="9", forRemoval=true)43public final class Compiler {44private Compiler() {} // don't make instances4546/**47* Compiles the specified class.48*49* @param clazz50* A class51*52* @return {@code true} if the compilation succeeded; {@code false} if the53* compilation failed or no compiler is available54*55* @throws NullPointerException56* If {@code clazz} is {@code null}57*/58public static boolean compileClass(Class<?> clazz) {59return false;60}6162/**63* Compiles all classes whose name matches the specified string.64*65* @param string66* The name of the classes to compile67*68* @return {@code true} if the compilation succeeded; {@code false} if the69* compilation failed or no compiler is available70*71* @throws NullPointerException72* If {@code string} is {@code null}73*/74public static boolean compileClasses(String string) {75return false;76}7778/**79* Examines the argument type and its fields and perform some documented80* operation. No specific operations are required.81*82* @param any83* An argument84*85* @return A compiler-specific value, or {@code null} if no compiler is86* available87*88* @throws NullPointerException89* If {@code any} is {@code null}90*/91public static Object command(Object any) {92return null;93}9495/**96* Cause the Compiler to resume operation.97*/98public static void enable() { }99100/**101* Cause the Compiler to cease operation.102*/103public static void disable() { }104}105106107