openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p..@apache.org
Subject svn commit: r512934 - /incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/BrokerValue.java
Date Wed, 28 Feb 2007 19:52:25 GMT
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



Mime
View raw message