langtools/src/java.compiler/share/classes/javax/tools/ToolProvider.java
changeset 37759 f0b5daef41b6
parent 36526 3b41f1c69604
child 37853 b4ea8806ad1a
equal deleted inserted replaced
37758:3ecf9b414e05 37759:f0b5daef41b6
   121      * @return the specified implementation of the tool
   121      * @return the specified implementation of the tool
   122      */
   122      */
   123     private static <T> T getSystemTool(Class<T> clazz, String moduleName, String className) {
   123     private static <T> T getSystemTool(Class<T> clazz, String moduleName, String className) {
   124         if (useLegacy) {
   124         if (useLegacy) {
   125             try {
   125             try {
   126                 return Class.forName(className, true, ClassLoader.getSystemClassLoader()).asSubclass(clazz).newInstance();
   126                 @SuppressWarnings("deprecation")
       
   127                 T result = Class.forName(className, true, ClassLoader.getSystemClassLoader()).asSubclass(clazz).newInstance();
       
   128                 return result;
   127             } catch (ReflectiveOperationException e) {
   129             } catch (ReflectiveOperationException e) {
   128                 throw new Error(e);
   130                 throw new Error(e);
   129             }
   131             }
   130         }
   132         }
   131 
   133