openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p..@apache.org
Subject svn commit: r454053 - /incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/BrokerFactoryValue.java
Date Sun, 08 Oct 2006 00:55:36 GMT
Author: pcl
Date: Sat Oct  7 17:55:35 2006
New Revision: 454053

URL: http://svn.apache.org/viewvc?view=rev&rev=454053
Log:
avoid duplicate alias key-value pairs. We really need to move this aliasing system to a map
at some point.

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

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/BrokerFactoryValue.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/BrokerFactoryValue.java?view=diff&rev=454053&r1=454052&r2=454053
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/BrokerFactoryValue.java
(original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/BrokerFactoryValue.java
Sat Oct  7 17:55:35 2006
@@ -50,8 +50,12 @@
      * of default aliases for new values created after this invocation.
      */
     public static void addDefaultAlias(String alias, String cls) {
-        _aliases.add(alias);
-        _aliases.add(cls);
+        if (_aliases.contains(alias)) {
+            _aliases.set(_aliases.indexOf(alias), cls);
+        } else {
+            _aliases.add(alias);
+            _aliases.add(cls);
+        }
     }
 
     /**



Mime
View raw message