--- a/langtools/src/java.compiler/share/classes/javax/tools/ToolProvider.java Mon Jun 13 12:04:09 2016 +0100
+++ b/langtools/src/java.compiler/share/classes/javax/tools/ToolProvider.java Mon Jun 13 09:12:35 2016 -0700
@@ -125,9 +125,8 @@
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);
}