< prev index next >

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

Print this page

        

@@ -123,13 +123,14 @@
      * @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(new Class<?>[0]).newInstance((Object[])null);
             } catch (ReflectiveOperationException e) {
                 throw new Error(e);
             }
         }
 
< prev index next >