< prev index next >

src/java.compiler/share/classes/javax/tools/ToolProvider.java

Print this page

        

@@ -123,13 +123,12 @@
      * @return the specified implementation of the tool
      */
     private static <T> T getSystemTool(Class<T> clazz, String moduleName, String className) {
         if (useLegacy) {
             try {
-                @SuppressWarnings("deprecation")
-                T result = Class.forName(className, true, ClassLoader.getSystemClassLoader()).asSubclass(clazz).newInstance();
-                return result;
+                return Class.forName(className, true, ClassLoader.getSystemClassLoader()).
+                    asSubclass(clazz).getConstructor().newInstance();
             } catch (ReflectiveOperationException e) {
                 throw new Error(e);
             }
         }
 
< prev index next >