openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p..@apache.org
Subject svn commit: r610922 - /openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyCollections.java
Date Thu, 10 Jan 2008 20:37:37 GMT
Author: pcl
Date: Thu Jan 10 12:37:36 2008
New Revision: 610922

URL: http://svn.apache.org/viewvc?rev=610922&view=rev
Log:
proxy collection optimization for adding to the end of a list vs. adding elsewhere

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

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyCollections.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyCollections.java?rev=610922&r1=610921&r2=610922&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyCollections.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyCollections.java
Thu Jan 10 12:37:36 2008
@@ -38,7 +38,11 @@
      */
     public static void beforeAdd(ProxyCollection coll, int index, Object value){
         assertAllowedType(value, coll.getElementType());
-        dirty(coll, true);
+        if (index == coll.size())
+            // optimize for adding to the end
+            beforeAdd(coll, value);
+        else
+            dirty(coll, true);
     }
 
     /**



Mime
View raw message