From 6ea5a81c9380521adb3c0c7839a06194c9e148f3 Mon Sep 17 00:00:00 2001 From: Pinaki Poddar Date: Tue, 20 Nov 2007 23:12:33 +0000 Subject: [PATCH] OPENJPA-449 : initializing _pcClassLoaders in constructor instead of conditionally inside loadPersistentTypes(). Saves NPE on new Broker construction in multi-threaded scenarios' openjpa-kernel\src\main\java\org\apache\openjpa\kernel\AbstractBrokerFactory.java git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@596871 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/openjpa/kernel/AbstractBrokerFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java b/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java index e5cb9fe81..6d15b736a 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java @@ -134,6 +134,7 @@ public abstract class AbstractBrokerFactory */ protected AbstractBrokerFactory(OpenJPAConfiguration config) { _conf = config; + _pcClassLoaders = new ReferenceHashSet(ReferenceHashSet.WEAK); } /** @@ -255,7 +256,6 @@ public abstract class AbstractBrokerFactory if (needsSub(cls)) toRedefine.add(cls); } - _pcClassLoaders = new ReferenceHashSet(ReferenceHashSet.WEAK); _pcClassLoaders.add(loader); } } else {