From 2933147f53d43377613e9d51d51f9a55df75346e Mon Sep 17 00:00:00 2001 From: Patrick Linskey Date: Thu, 10 Jan 2008 20:37:36 +0000 Subject: [PATCH] proxy collection optimization for adding to the end of a list vs. adding elsewhere git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@610922 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/org/apache/openjpa/util/ProxyCollections.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyCollections.java b/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyCollections.java index b5f54cb25..eee99d684 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyCollections.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyCollections.java @@ -38,7 +38,11 @@ public class ProxyCollections */ 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); } /**