You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by pc...@apache.org on 2007/02/28 20:52:25 UTC

svn commit: r512934 - /incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/BrokerValue.java

Author: pcl
Date: Wed Feb 28 11:52:24 2007
New Revision: 512934

URL: http://svn.apache.org/viewvc?view=rev&rev=512934
Log:
OPENJPA-160. Removed BrokerImpl test to make this work properly for subclasses. Since BrokerImpl is cloneable, all subtypes will also be cloneable, so we don't really need to test for anything.

Modified:
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/BrokerValue.java

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/BrokerValue.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/BrokerValue.java?view=diff&rev=512934&r1=512933&r2=512934
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/BrokerValue.java (original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/BrokerValue.java Wed Feb 28 11:52:24 2007
@@ -30,20 +30,16 @@
 
     public Object newInstance(String clsName, Class type, Configuration conf,
         boolean fatal) {
-        if (BrokerImpl.class.getName().equals(clsName)) {
-            // This is not synchronized. If there are concurrent invocations
-            // while _templateBroker is null, we'll just end up with extra
-            // template brokers, which will get safely garbage collected.
-            if (_templateBroker == null)
-                _templateBroker = (BrokerImpl) super.newInstance(
-                    clsName, type, conf, fatal);
-            try {
-                return _templateBroker.clone();
-            } catch (CloneNotSupportedException e) {
-                throw new InternalException(e);
-            }
-        } else {
-            return super.newInstance(clsName, type, conf, fatal);
+        // This is not synchronized. If there are concurrent invocations
+        // while _templateBroker is null, we'll just end up with extra
+        // template brokers, which will get safely garbage collected.
+        if (_templateBroker == null)
+            _templateBroker = (BrokerImpl) super.newInstance(clsName, type,
+                conf, fatal);
+        try {
+            return _templateBroker.clone();
+        } catch (CloneNotSupportedException e) {
+            throw new InternalException(e);
         }
     }
-}
+}
\ No newline at end of file