Repository: tomee Updated Branches: refs/heads/master 4606f67cc -> b14e14900
avoid reflection when not needed Project: http://git-wip-us.apache.org/repos/asf/tomee/repo Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/b14e1490 Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/b14e1490 Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/b14e1490 Branch: refs/heads/master Commit: b14e14900f9d8fce29535df6a71ddd603c367f3c Parents: 4606f67 Author: Romain Manni-Bucau <rmannibu...@apache.org> Authored: Tue Apr 14 23:04:55 2015 +0200 Committer: Romain Manni-Bucau <rmannibu...@apache.org> Committed: Tue Apr 14 23:04:55 2015 +0200 ---------------------------------------------------------------------- .../resource/thread/ManagedExecutorServiceImplFactory.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tomee/blob/b14e1490/container/openejb-core/src/main/java/org/apache/openejb/resource/thread/ManagedExecutorServiceImplFactory.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/main/java/org/apache/openejb/resource/thread/ManagedExecutorServiceImplFactory.java b/container/openejb-core/src/main/java/org/apache/openejb/resource/thread/ManagedExecutorServiceImplFactory.java index 198bcb2..4aea78e 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/resource/thread/ManagedExecutorServiceImplFactory.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/resource/thread/ManagedExecutorServiceImplFactory.java @@ -51,7 +51,9 @@ public class ManagedExecutorServiceImplFactory { ManagedThreadFactory managedThreadFactory; try { - managedThreadFactory = ManagedThreadFactory.class.cast(Thread.currentThread().getContextClassLoader().loadClass(threadFactory).newInstance()); + managedThreadFactory = "org.apache.openejb.threads.impl.ManagedThreadFactoryImpl".equals(threadFactory) ? + new ManagedThreadFactoryImpl() : + ManagedThreadFactory.class.cast(Thread.currentThread().getContextClassLoader().loadClass(threadFactory).newInstance()); } catch (final Exception e) { Logger.getInstance(LogCategory.OPENEJB, ManagedExecutorServiceImplFactory.class).warning("Can't create configured thread factory: " + threadFactory, e); managedThreadFactory = new ManagedThreadFactoryImpl();