< prev index next >
src/java.base/share/classes/sun/nio/ch/ThreadPool.java
Print this page
@@ -163,18 +163,15 @@
private static ThreadFactory getDefaultThreadPoolThreadFactory() {
String propValue = AccessController.doPrivileged(new
GetPropertyAction(DEFAULT_THREAD_POOL_THREAD_FACTORY));
if (propValue != null) {
try {
- Class<?> c = Class
- .forName(propValue, true, ClassLoader.getSystemClassLoader());
- return ((ThreadFactory)c.newInstance());
- } catch (ClassNotFoundException x) {
- throw new Error(x);
- } catch (InstantiationException x) {
- throw new Error(x);
- } catch (IllegalAccessException x) {
+ @SuppressWarnings("deprecation")
+ Object tmp = Class
+ .forName(propValue, true, ClassLoader.getSystemClassLoader()).newInstance();
+ return (ThreadFactory)tmp;
+ } catch (ClassNotFoundException | InstantiationException | IllegalAccessException x) {
throw new Error(x);
}
}
return null;
}
< prev index next >