8155516: Suppress warnings from uses of deprecated Class.newInstance langtools

Reviewed-by: jjg
This commit is contained in:
Joe Darcy 2016-05-02 18:10:36 -07:00
parent 325a065aff
commit ae6a62a6c8
5 changed files with 13 additions and 5 deletions

View file

@ -123,7 +123,9 @@ public class ToolProvider {
private static <T> T getSystemTool(Class<T> clazz, String moduleName, String className) {
if (useLegacy) {
try {
return Class.forName(className, true, ClassLoader.getSystemClassLoader()).asSubclass(clazz).newInstance();
@SuppressWarnings("deprecation")
T result = Class.forName(className, true, ClassLoader.getSystemClassLoader()).asSubclass(clazz).newInstance();
return result;
} catch (ReflectiveOperationException e) {
throw new Error(e);
}