< prev index next >

jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/pipe/ThreadHelper.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 66,78 **** // constructor newly added in Java SE 9 } Class<?> cls = Class.forName(SAFE_THREAD_NAME); Constructor<?> ctr = cls.getConstructor(Runnable.class); return new SunMiscThreadFactory(ctr); ! } catch (ClassNotFoundException ignored) { ! } catch (NoSuchMethodException ignored) { ! } return new LegacyThreadFactory(); } } ); } --- 66,76 ---- // constructor newly added in Java SE 9 } Class<?> cls = Class.forName(SAFE_THREAD_NAME); Constructor<?> ctr = cls.getConstructor(Runnable.class); return new SunMiscThreadFactory(ctr); ! } catch (ClassNotFoundException | NoSuchMethodException ignored) {} return new LegacyThreadFactory(); } } ); }
*** 88,107 **** JDK9ThreadFactory(Constructor<Thread> ctr) { this.ctr = ctr; } @Override public Thread newThread(Runnable r) { try { return ctr.newInstance(null, r, "toBeReplaced", 0, false); } catch (ReflectiveOperationException x) { ! throw new InternalError(x); } } } // A Thread factory backed by sun.misc.ManagedLocalsThread private static class SunMiscThreadFactory implements ThreadFactory { final Constructor<?> ctr; SunMiscThreadFactory(Constructor<?> ctr) { this.ctr = ctr; } ! @Override public Thread newThread(Runnable r) { return AccessController.doPrivileged( new PrivilegedAction<Thread>() { @Override public Thread run() { try { --- 86,107 ---- JDK9ThreadFactory(Constructor<Thread> ctr) { this.ctr = ctr; } @Override public Thread newThread(Runnable r) { try { return ctr.newInstance(null, r, "toBeReplaced", 0, false); } catch (ReflectiveOperationException x) { ! InternalError ie = new InternalError(x.getMessage()); ! ie.initCause(ie); ! throw ie; } } } // A Thread factory backed by sun.misc.ManagedLocalsThread private static class SunMiscThreadFactory implements ThreadFactory { final Constructor<?> ctr; SunMiscThreadFactory(Constructor<?> ctr) { this.ctr = ctr; } ! @Override public Thread newThread(final Runnable r) { return AccessController.doPrivileged( new PrivilegedAction<Thread>() { @Override public Thread run() { try {
< prev index next >