mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 19:14:38 +02:00
8155516: Suppress warnings from uses of deprecated Class.newInstance langtools
Reviewed-by: jjg
This commit is contained in:
parent
325a065aff
commit
ae6a62a6c8
5 changed files with 13 additions and 5 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue