langtools/src/java.compiler/share/classes/javax/tools/ToolProvider.java
author alanb
Fri, 07 Apr 2017 08:08:26 +0000
changeset 44573 245bb4e6f983
parent 42270 3bd3e7e378b5
permissions -rw-r--r--
8177530: Module system implementation refresh (4/2017) Reviewed-by: jjg Contributed-by: alan.bateman@oracle.com, jan.lahoda@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
36156
9ff93012d1e3 8149328: remove the dependency on java.logging from java.compiler
vromero
parents: 35426
diff changeset
     2
 * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 10
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 10
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
 *
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 10
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 10
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 10
diff changeset
    23
 * questions.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
package javax.tools;
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
    28
import java.lang.reflect.InvocationTargetException;
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
    29
import java.lang.reflect.Method;
37853
b4ea8806ad1a 8154190: Deprivilege java.compiler module
mchung
parents: 37759
diff changeset
    30
import java.security.AccessController;
b4ea8806ad1a 8154190: Deprivilege java.compiler module
mchung
parents: 37759
diff changeset
    31
import java.security.PrivilegedAction;
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
    32
import java.util.Iterator;
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
    33
import java.util.ServiceConfigurationError;
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
    34
import java.util.ServiceLoader;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
 * Provides methods for locating tool providers, for example,
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
 * providers of compilers.  This class complements the
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
 * functionality of {@link java.util.ServiceLoader}.
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
 * @author Peter von der Ahé
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
 * @since 1.6
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
public class ToolProvider {
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
    46
    private static final String systemJavaCompilerModule = "jdk.compiler";
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
    47
    private static final String systemJavaCompilerName   = "com.sun.tools.javac.api.JavacTool";
6577
96c6451389fc 6604599: ToolProvider should be less compiler-specific
jjg
parents: 5520
diff changeset
    48
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
    /**
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 22165
diff changeset
    50
     * Returns the Java™ programming language compiler provided
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
     * with this platform.
28332
cd3ea1087d2b 8059977: StandardJavaFileManager should support java.nio.file.Path
jjg
parents: 27579
diff changeset
    52
     * <p>The file manager returned by calling
cd3ea1087d2b 8059977: StandardJavaFileManager should support java.nio.file.Path
jjg
parents: 27579
diff changeset
    53
     * {@link JavaCompiler#getStandardFileManager getStandardFileManager}
cd3ea1087d2b 8059977: StandardJavaFileManager should support java.nio.file.Path
jjg
parents: 27579
diff changeset
    54
     * on this compiler supports paths provided by any
cd3ea1087d2b 8059977: StandardJavaFileManager should support java.nio.file.Path
jjg
parents: 27579
diff changeset
    55
     * {@linkplain java.nio.file.FileSystem filesystem}.</p>
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
     * @return the compiler provided with this platform or
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
     * {@code null} if no compiler is provided
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
    58
     * @implNote This implementation returns the compiler provided
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
    59
     * by the {@code jdk.compiler} module if that module is available,
42270
3bd3e7e378b5 8155765: javax.tools.ToolProvider::getSystemToolClassLoader returns app class loader even if no tool is available
jjg
parents: 38918
diff changeset
    60
     * and {@code null} otherwise.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
    public static JavaCompiler getSystemJavaCompiler() {
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
    63
        return getSystemTool(JavaCompiler.class,
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
    64
                systemJavaCompilerModule, systemJavaCompilerName);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
    67
    private static final String systemDocumentationToolModule = "jdk.javadoc";
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
    68
    private static final String systemDocumentationToolName = "jdk.javadoc.internal.api.JavadocTool";
14545
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents: 8032
diff changeset
    69
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents: 8032
diff changeset
    70
    /**
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 22165
diff changeset
    71
     * Returns the Java&trade; programming language documentation tool provided
14545
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents: 8032
diff changeset
    72
     * with this platform.
28332
cd3ea1087d2b 8059977: StandardJavaFileManager should support java.nio.file.Path
jjg
parents: 27579
diff changeset
    73
     * <p>The file manager returned by calling
cd3ea1087d2b 8059977: StandardJavaFileManager should support java.nio.file.Path
jjg
parents: 27579
diff changeset
    74
     * {@link DocumentationTool#getStandardFileManager getStandardFileManager}
cd3ea1087d2b 8059977: StandardJavaFileManager should support java.nio.file.Path
jjg
parents: 27579
diff changeset
    75
     * on this tool supports paths provided by any
cd3ea1087d2b 8059977: StandardJavaFileManager should support java.nio.file.Path
jjg
parents: 27579
diff changeset
    76
     * {@linkplain java.nio.file.FileSystem filesystem}.</p>
14545
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents: 8032
diff changeset
    77
     * @return the documentation tool provided with this platform or
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents: 8032
diff changeset
    78
     * {@code null} if no documentation tool is provided
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
    79
     * @implNote This implementation returns the tool provided
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
    80
     * by the {@code jdk.javadoc} module if that module is available,
42270
3bd3e7e378b5 8155765: javax.tools.ToolProvider::getSystemToolClassLoader returns app class loader even if no tool is available
jjg
parents: 38918
diff changeset
    81
     * and {@code null} otherwise.
14545
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents: 8032
diff changeset
    82
     */
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents: 8032
diff changeset
    83
    public static DocumentationTool getSystemDocumentationTool() {
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
    84
        return getSystemTool(DocumentationTool.class,
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
    85
                systemDocumentationToolModule, systemDocumentationToolName);
14545
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents: 8032
diff changeset
    86
    }
2e7bab0639b8 6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents: 8032
diff changeset
    87
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
    /**
42270
3bd3e7e378b5 8155765: javax.tools.ToolProvider::getSystemToolClassLoader returns app class loader even if no tool is available
jjg
parents: 38918
diff changeset
    89
     * Returns a class loader that may be used to load system tools,
3bd3e7e378b5 8155765: javax.tools.ToolProvider::getSystemToolClassLoader returns app class loader even if no tool is available
jjg
parents: 38918
diff changeset
    90
     * or {@code null} if no such special loader is provided.
3bd3e7e378b5 8155765: javax.tools.ToolProvider::getSystemToolClassLoader returns app class loader even if no tool is available
jjg
parents: 38918
diff changeset
    91
     * @implSpec This implementation always returns {@code null}.
3bd3e7e378b5 8155765: javax.tools.ToolProvider::getSystemToolClassLoader returns app class loader even if no tool is available
jjg
parents: 38918
diff changeset
    92
     * @deprecated This method is subject to removal in a future version of
3bd3e7e378b5 8155765: javax.tools.ToolProvider::getSystemToolClassLoader returns app class loader even if no tool is available
jjg
parents: 38918
diff changeset
    93
     * Java SE.
3bd3e7e378b5 8155765: javax.tools.ToolProvider::getSystemToolClassLoader returns app class loader even if no tool is available
jjg
parents: 38918
diff changeset
    94
     * Use the {@link java.util.spi.ToolProvider system tool provider} or
3bd3e7e378b5 8155765: javax.tools.ToolProvider::getSystemToolClassLoader returns app class loader even if no tool is available
jjg
parents: 38918
diff changeset
    95
     * {@link java.util.ServiceLoader service loader} mechanisms to
3bd3e7e378b5 8155765: javax.tools.ToolProvider::getSystemToolClassLoader returns app class loader even if no tool is available
jjg
parents: 38918
diff changeset
    96
     * locate system tools as well as user-installed tools.
3bd3e7e378b5 8155765: javax.tools.ToolProvider::getSystemToolClassLoader returns app class loader even if no tool is available
jjg
parents: 38918
diff changeset
    97
     * @return a class loader, or {@code null}
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
     */
42270
3bd3e7e378b5 8155765: javax.tools.ToolProvider::getSystemToolClassLoader returns app class loader even if no tool is available
jjg
parents: 38918
diff changeset
    99
    @Deprecated
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
    public static ClassLoader getSystemToolClassLoader() {
42270
3bd3e7e378b5 8155765: javax.tools.ToolProvider::getSystemToolClassLoader returns app class loader even if no tool is available
jjg
parents: 38918
diff changeset
   101
        return null;
6577
96c6451389fc 6604599: ToolProvider should be less compiler-specific
jjg
parents: 5520
diff changeset
   102
    }
96c6451389fc 6604599: ToolProvider should be less compiler-specific
jjg
parents: 5520
diff changeset
   103
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   104
    private static final boolean useLegacy;
6577
96c6451389fc 6604599: ToolProvider should be less compiler-specific
jjg
parents: 5520
diff changeset
   105
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   106
    static {
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   107
        Class<?> c = null;
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   108
        try {
44573
245bb4e6f983 8177530: Module system implementation refresh (4/2017)
alanb
parents: 42270
diff changeset
   109
            c = Class.forName("java.lang.Module");
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   110
        } catch (Throwable t) {
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   111
        }
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   112
        useLegacy = (c == null);
6577
96c6451389fc 6604599: ToolProvider should be less compiler-specific
jjg
parents: 5520
diff changeset
   113
    }
96c6451389fc 6604599: ToolProvider should be less compiler-specific
jjg
parents: 5520
diff changeset
   114
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   115
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   116
     * Get an instance of a system tool using the service loader.
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   117
     * @implNote         By default, this returns the implementation in the specified module.
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   118
     *                   For limited backward compatibility, if this code is run on an older version
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   119
     *                   of the Java platform that does not support modules, this method will
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   120
     *                   try and create an instance of the named class. Note that implies the
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   121
     *                   class must be available on the system class path.
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   122
     * @param <T>        the interface of the tool
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   123
     * @param clazz      the interface of the tool
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   124
     * @param moduleName the name of the module containing the desired implementation
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   125
     * @param className  the class name of the desired implementation
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   126
     * @return the specified implementation of the tool
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   127
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   128
    private static <T> T getSystemTool(Class<T> clazz, String moduleName, String className) {
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   129
        if (useLegacy) {
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   130
            try {
38918
bf1ed1a40f5b 8155880: Fix langtools usage of the deprecated Class.newInstance method
darcy
parents: 37853
diff changeset
   131
                return Class.forName(className, true, ClassLoader.getSystemClassLoader()).
bf1ed1a40f5b 8155880: Fix langtools usage of the deprecated Class.newInstance method
darcy
parents: 37853
diff changeset
   132
                    asSubclass(clazz).getConstructor().newInstance();
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   133
            } catch (ReflectiveOperationException e) {
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   134
                throw new Error(e);
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   135
            }
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   136
        }
6577
96c6451389fc 6604599: ToolProvider should be less compiler-specific
jjg
parents: 5520
diff changeset
   137
96c6451389fc 6604599: ToolProvider should be less compiler-specific
jjg
parents: 5520
diff changeset
   138
        try {
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   139
            ServiceLoader<T> sl = ServiceLoader.load(clazz, ClassLoader.getSystemClassLoader());
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   140
            for (Iterator<T> iter = sl.iterator(); iter.hasNext(); ) {
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   141
                T tool = iter.next();
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   142
                if (matches(tool, moduleName))
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   143
                    return tool;
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   144
            }
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   145
        } catch (ServiceConfigurationError e) {
36156
9ff93012d1e3 8149328: remove the dependency on java.logging from java.compiler
vromero
parents: 35426
diff changeset
   146
            throw new Error(e);
6577
96c6451389fc 6604599: ToolProvider should be less compiler-specific
jjg
parents: 5520
diff changeset
   147
        }
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   148
        return null;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   151
    /**
37853
b4ea8806ad1a 8154190: Deprivilege java.compiler module
mchung
parents: 37759
diff changeset
   152
     * Determine if this is the desired tool instance.
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   153
     * @param <T>        the interface of the tool
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   154
     * @param tool       the instance of the tool
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   155
     * @param moduleName the name of the module containing the desired implementation
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   156
     * @return true if and only if the tool matches the specified criteria
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   157
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents: 36156
diff changeset
   158
    private static <T> boolean matches(T tool, String moduleName) {
37853
b4ea8806ad1a 8154190: Deprivilege java.compiler module
mchung
parents: 37759
diff changeset
   159
        PrivilegedAction<Boolean> pa = () -> {
b4ea8806ad1a 8154190: Deprivilege java.compiler module
mchung
parents: 37759
diff changeset
   160
            // for now, use reflection to implement
b4ea8806ad1a 8154190: Deprivilege java.compiler module
mchung
parents: 37759
diff changeset
   161
            //      return moduleName.equals(tool.getClass().getModule().getName());
b4ea8806ad1a 8154190: Deprivilege java.compiler module
mchung
parents: 37759
diff changeset
   162
            try {
b4ea8806ad1a 8154190: Deprivilege java.compiler module
mchung
parents: 37759
diff changeset
   163
                Method getModuleMethod = Class.class.getDeclaredMethod("getModule");
b4ea8806ad1a 8154190: Deprivilege java.compiler module
mchung
parents: 37759
diff changeset
   164
                Object toolModule = getModuleMethod.invoke(tool.getClass());
b4ea8806ad1a 8154190: Deprivilege java.compiler module
mchung
parents: 37759
diff changeset
   165
                Method getNameMethod = toolModule.getClass().getDeclaredMethod("getName");
b4ea8806ad1a 8154190: Deprivilege java.compiler module
mchung
parents: 37759
diff changeset
   166
                String toolModuleName = (String) getNameMethod.invoke(toolModule);
b4ea8806ad1a 8154190: Deprivilege java.compiler module
mchung
parents: 37759
diff changeset
   167
                return moduleName.equals(toolModuleName);
b4ea8806ad1a 8154190: Deprivilege java.compiler module
mchung
parents: 37759
diff changeset
   168
            } catch (InvocationTargetException | NoSuchMethodException | IllegalAccessException e) {
b4ea8806ad1a 8154190: Deprivilege java.compiler module
mchung
parents: 37759
diff changeset
   169
                return false;
b4ea8806ad1a 8154190: Deprivilege java.compiler module
mchung
parents: 37759
diff changeset
   170
            }
b4ea8806ad1a 8154190: Deprivilege java.compiler module
mchung
parents: 37759
diff changeset
   171
        };
b4ea8806ad1a 8154190: Deprivilege java.compiler module
mchung
parents: 37759
diff changeset
   172
        return AccessController.doPrivileged(pa);
6577
96c6451389fc 6604599: ToolProvider should be less compiler-specific
jjg
parents: 5520
diff changeset
   173
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
}