openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppod...@apache.org
Subject svn commit: r618741 - /openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java
Date Tue, 05 Feb 2008 18:50:06 GMT
Author: ppoddar
Date: Tue Feb  5 10:50:02 2008
New Revision: 618741

URL: http://svn.apache.org/viewvc?rev=618741&view=rev
Log:
Get the key from config only once as it is costly

Modified:
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java?rev=618741&r1=618740&r2=618741&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java
Tue Feb  5 10:50:02 2008
@@ -114,10 +114,8 @@
      * @since 1.1.0
      */
     protected static Object toPoolKey(Map map) {
-        if (Configurations.getProperty("Id", map) != null)
-            return Configurations.getProperty("Id", map);
-        else
-            return map;
+        Object key = Configurations.getProperty("Id", map);
+        return ( key != null) ? key : map;
     }
 
     /**



Mime
View raw message