equal
deleted
inserted
replaced
121 * @return the specified implementation of the tool |
121 * @return the specified implementation of the tool |
122 */ |
122 */ |
123 private static <T> T getSystemTool(Class<T> clazz, String moduleName, String className) { |
123 private static <T> T getSystemTool(Class<T> clazz, String moduleName, String className) { |
124 if (useLegacy) { |
124 if (useLegacy) { |
125 try { |
125 try { |
126 return Class.forName(className, true, ClassLoader.getSystemClassLoader()).asSubclass(clazz).newInstance(); |
126 @SuppressWarnings("deprecation") |
|
127 T result = Class.forName(className, true, ClassLoader.getSystemClassLoader()).asSubclass(clazz).newInstance(); |
|
128 return result; |
127 } catch (ReflectiveOperationException e) { |
129 } catch (ReflectiveOperationException e) { |
128 throw new Error(e); |
130 throw new Error(e); |
129 } |
131 } |
130 } |
132 } |
131 |
133 |