openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dez...@apache.org
Subject svn commit: r802218 - in /openjpa/branches/1.1.x: openjpa-kernel/src/main/java/org/apache/openjpa/conf/ openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ openjpa-kernel/src/main/java/org/apache/openjpa/util/ openjpa-kernel/src/test/java/org/apach...
Date Fri, 07 Aug 2009 21:36:03 GMT
Author: dezzio
Date: Fri Aug  7 21:36:02 2009
New Revision: 802218

URL: http://svn.apache.org/viewvc?rev=802218&view=rev
Log:
OpenJPA-1163: merged fix from trunk, revs 800563 and 800566: "Data consistency issues while
modifying collections"

Added:
    openjpa/branches/1.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/kernel/A.java
      - copied unchanged from r800566, openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/kernel/A.java
    openjpa/branches/1.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/kernel/TestCollectionTracking.java
      - copied unchanged from r800566, openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/kernel/TestCollectionTracking.java
Modified:
    openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/conf/Compatibility.java
    openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachManager.java
    openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SingleFieldManager.java
    openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java
    openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractLRSProxyCollection.java
    openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractLRSProxyMap.java
    openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/CollectionChangeTrackerImpl.java
    openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/MapChangeTrackerImpl.java
    openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyCollection.java
    openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyManager.java
    openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyManagerImpl.java
    openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyMap.java
    openjpa/branches/1.1.x/openjpa-kernel/src/test/java/org/apache/openjpa/util/TestProxyManager.java

Modified: openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/conf/Compatibility.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/conf/Compatibility.java?rev=802218&r1=802217&r2=802218&view=diff
==============================================================================
--- openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/conf/Compatibility.java
(original)
+++ openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/conf/Compatibility.java
Fri Aug  7 21:36:02 2009
@@ -56,6 +56,7 @@
     private int _jpql = JPQL_WARN;
     private boolean _storeMapCollectionInEntityAsBlob = false;
     private boolean _flushBeforeDetach = true; 
+    private boolean _autoOff = true;
 
     /**
      * Whether to require exact identity value types when creating object
@@ -74,6 +75,22 @@
     }
 
     /**
+     * Whether to turn collection/map tracing off in case of more number of modifications.
+     * Defaults to true.
+     */
+    public boolean getAutoOff() {
+        return _autoOff;
+    }
+
+    /**
+     * Whether to turn collection/map tracing off in case of more number of modifications.
+     * Defaults to true.
+     */
+    public void setAutoOff(boolean autoOff) {
+        _autoOff = autoOff;
+    }
+
+    /**
      * Whether to interpret quoted numbers in query strings as numbers.
      * OpenJPA versions 0.3.1 and prior treated them as numbers; more recent
      * versions treat them as strings.

Modified: openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachManager.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachManager.java?rev=802218&r1=802217&r2=802218&view=diff
==============================================================================
--- openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachManager.java
(original)
+++ openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachManager.java
Fri Aug  7 21:36:02 2009
@@ -719,7 +719,9 @@
                         newVal = _proxy.newCollectionProxy(fmd.getProxyType(),
                             fmd.getElement().getDeclaredType(),
                             fmd.getInitializer() instanceof Comparator ?
-                            (Comparator) fmd.getInitializer() : null);
+                            (Comparator) fmd.getInitializer() : null,
+                            sm.getBroker().getConfiguration().
+                            getCompatibilityInstance().getAutoOff());
                         ((Collection) newVal).addAll((Collection) curVal);
                     } else
                         newVal = _proxy.copyCollection((Collection) curVal);
@@ -734,7 +736,9 @@
                             fmd.getKey().getDeclaredType(),
                             fmd.getElement().getDeclaredType(),
                             fmd.getInitializer() instanceof Comparator ?
-                                (Comparator) fmd.getInitializer() : null);
+                                (Comparator) fmd.getInitializer() : null,
+                                sm.getBroker().getConfiguration().
+                                getCompatibilityInstance().getAutoOff());
                         ((Map) newVal).putAll((Map) curVal);
                     } else
                         newVal = _proxy.copyMap((Map) curVal);

Modified: openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SingleFieldManager.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SingleFieldManager.java?rev=802218&r1=802217&r2=802218&view=diff
==============================================================================
--- openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SingleFieldManager.java
(original)
+++ openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SingleFieldManager.java
Fri Aug  7 21:36:02 2009
@@ -125,7 +125,9 @@
                     return false;
                 proxy = checkProxy();
                 if (proxy == null) {
-                    proxy = getProxyManager().newCustomProxy(objval);
+                    proxy = getProxyManager().newCustomProxy(objval,
+                        _sm.getBroker().getConfiguration().
+                        getCompatibilityInstance().getAutoOff());
                     ret = proxy != null;
                 }
                 break;

Modified: openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java?rev=802218&r1=802217&r2=802218&view=diff
==============================================================================
--- openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java
(original)
+++ openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java
Fri Aug  7 21:36:02 2009
@@ -1697,12 +1697,14 @@
             case JavaTypes.COLLECTION:
                 return mgr.newCollectionProxy(fmd.getProxyType(),
                     fmd.getElement().getDeclaredType(),
-                    init instanceof Comparator ? (Comparator) init : null);
+                    init instanceof Comparator ? (Comparator) init : null,
+                        _broker.getConfiguration().getCompatibilityInstance().getAutoOff());
             case JavaTypes.MAP:
                 return mgr.newMapProxy(fmd.getProxyType(),
                     fmd.getKey().getDeclaredType(),
                     fmd.getElement().getDeclaredType(),
-                    init instanceof Comparator ? (Comparator) init : null);
+                    init instanceof Comparator ? (Comparator) init : null,
+                        _broker.getConfiguration().getCompatibilityInstance().getAutoOff());
         }
         return null;
     }

Modified: openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractLRSProxyCollection.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractLRSProxyCollection.java?rev=802218&r1=802217&r2=802218&view=diff
==============================================================================
--- openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractLRSProxyCollection.java
(original)
+++ openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractLRSProxyCollection.java
Fri Aug  7 21:36:02 2009
@@ -69,7 +69,7 @@
      */
     public AbstractLRSProxyCollection(Class elementType, boolean ordered) {
         _elementType = elementType;
-        _ct = new CollectionChangeTrackerImpl(this, false, ordered);
+        _ct = new CollectionChangeTrackerImpl(this, false, ordered,false);
         _ct.setAutoOff(false);
     }
 

Modified: openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractLRSProxyMap.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractLRSProxyMap.java?rev=802218&r1=802217&r2=802218&view=diff
==============================================================================
--- openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractLRSProxyMap.java
(original)
+++ openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractLRSProxyMap.java
Fri Aug  7 21:36:02 2009
@@ -74,7 +74,7 @@
     public AbstractLRSProxyMap(Class keyType, Class valueType) {
         _keyType = keyType;
         _valueType = valueType;
-        _ct = new MapChangeTrackerImpl(this);
+        _ct = new MapChangeTrackerImpl(this,false);
         _ct.setAutoOff(false);
     }
 

Modified: openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/CollectionChangeTrackerImpl.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/CollectionChangeTrackerImpl.java?rev=802218&r1=802217&r2=802218&view=diff
==============================================================================
--- openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/CollectionChangeTrackerImpl.java
(original)
+++ openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/CollectionChangeTrackerImpl.java
Fri Aug  7 21:36:02 2009
@@ -43,10 +43,11 @@
      * @param order true if the collection is ordered, false otherwise
      */
     public CollectionChangeTrackerImpl(Collection coll, boolean dups,
-        boolean order) {
+        boolean order,boolean autoOff) {
         _coll = coll;
         _dups = dups;
         _order = order;
+        this.setAutoOff(autoOff);
     }
 
     /**

Modified: openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/MapChangeTrackerImpl.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/MapChangeTrackerImpl.java?rev=802218&r1=802217&r2=802218&view=diff
==============================================================================
--- openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/MapChangeTrackerImpl.java
(original)
+++ openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/MapChangeTrackerImpl.java
Fri Aug  7 21:36:02 2009
@@ -36,8 +36,9 @@
     /**
      * Constructor; supply delegate map.
      */
-    public MapChangeTrackerImpl(Map map) {
+    public MapChangeTrackerImpl(Map map, boolean autoOff) {
         _map = map;
+        this.setAutoOff(autoOff);
     }
 
     public boolean getTrackKeys() {

Modified: openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyCollection.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyCollection.java?rev=802218&r1=802217&r2=802218&view=diff
==============================================================================
--- openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyCollection.java
(original)
+++ openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyCollection.java
Fri Aug  7 21:36:02 2009
@@ -38,5 +38,5 @@
      * Create a new instance of this proxy type.
      */
     public ProxyCollection newInstance(Class elementType, Comparator comp,
-        boolean trackChanges);
+        boolean trackChanges, boolean autoOff);
 }

Modified: openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyManager.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyManager.java?rev=802218&r1=802217&r2=802218&view=diff
==============================================================================
--- openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyManager.java
(original)
+++ openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyManager.java
Fri Aug  7 21:36:02 2009
@@ -82,7 +82,7 @@
      * element type and will use the given comparator, if it is not null.
      */
     public Proxy newCollectionProxy(Class type, Class elementType,
-        Comparator compare);
+        Comparator compare, boolean autoOff);
 
     /**
      * Return a new map of the same type as the given one
@@ -96,7 +96,7 @@
      * keyType/valueType, and will use the given comparator, if it is not null.
      */
     public Proxy newMapProxy(Class type, Class keyType, Class valueType,
-        Comparator compare);
+        Comparator compare, boolean autoOff);
 
     /**
      * Return a copy of the given object with the same information, or null if
@@ -112,5 +112,5 @@
      *
      * @since 0.2.5
      */
-    public Proxy newCustomProxy (Object obj);
+    public Proxy newCustomProxy (Object obj, boolean autoOff);
 }

Modified: openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyManagerImpl.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyManagerImpl.java?rev=802218&r1=802217&r2=802218&view=diff
==============================================================================
--- openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyManagerImpl.java
(original)
+++ openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyManagerImpl.java
Fri Aug  7 21:36:02 2009
@@ -184,11 +184,11 @@
     }
 
     public Proxy newCollectionProxy(Class type, Class elementType,
-        Comparator compare) {
+        Comparator compare, boolean autoOff) {
         type = toProxyableCollectionType(type);
         ProxyCollection proxy = getFactoryProxyCollection(type);
         return proxy.newInstance((_assertType) ? elementType : null, compare,
-            _trackChanges);
+            _trackChanges, autoOff);
     }
 
     public Map copyMap(Map orig) {
@@ -202,11 +202,11 @@
     }
 
     public Proxy newMapProxy(Class type, Class keyType, 
-        Class elementType, Comparator compare) {
+        Class elementType, Comparator compare, boolean autoOff) {
         type = toProxyableMapType(type);
         ProxyMap proxy = getFactoryProxyMap(type);
         return proxy.newInstance((_assertType) ? keyType : null, 
-            (_assertType) ? elementType : null, compare, _trackChanges);
+            (_assertType) ? elementType : null, compare, _trackChanges, autoOff);
     }
 
     public Date copyDate(Date orig) {
@@ -263,7 +263,7 @@
         return (proxy == null) ? null : proxy.copy(orig); 
     }
 
-    public Proxy newCustomProxy(Object orig) {
+    public Proxy newCustomProxy(Object orig, boolean autoOff) {
         if (orig == null)
             return null;
         if (orig instanceof Proxy)
@@ -274,14 +274,14 @@
             Comparator comp = (orig instanceof SortedSet) 
                 ? ((SortedSet) orig).comparator() : null;
             Collection c = (Collection) newCollectionProxy(orig.getClass(), 
-                null, comp); 
+                null, comp, autoOff); 
             c.addAll((Collection) orig);
             return (Proxy) c;
         }
         if (orig instanceof Map) {
             Comparator comp = (orig instanceof SortedMap) 
                 ? ((SortedMap) orig).comparator() : null;
-            Map m = (Map) newMapProxy(orig.getClass(), null, null, comp);
+            Map m = (Map) newMapProxy(orig.getClass(), null, null, comp, autoOff);
             m.putAll((Map) orig);
             return (Proxy) m;
         }
@@ -813,7 +813,7 @@
 
         // new instance factory
         m = bc.declareMethod("newInstance", ProxyCollection.class, 
-            new Class[] { Class.class, Comparator.class, boolean.class });
+            new Class[] { Class.class, Comparator.class, boolean.class, boolean.class });
         m.makePublic();
         code = m.getCode(true);
 
@@ -841,9 +841,10 @@
         code.aload().setLocal(ret);
         code.constant().setValue(allowsDuplicates(type));
         code.constant().setValue(isOrdered(type));
+        code.aload().setParam(3);
         code.invokespecial().setMethod(CollectionChangeTrackerImpl.class, 
             "<init>", void.class, new Class[] { Collection.class, 
-            boolean.class, boolean.class });
+            boolean.class, boolean.class, boolean.class });
         code.putfield().setField(changeTracker);
 
         ifins.setTarget(code.aload().setLocal(ret));
@@ -947,7 +948,7 @@
         // new instance factory
         m = bc.declareMethod("newInstance", ProxyMap.class, 
             new Class[] { Class.class, Class.class, Comparator.class, 
-            boolean.class });
+            boolean.class, boolean.class });
         m.makePublic();
         code = m.getCode(true);
 
@@ -976,8 +977,9 @@
         code.anew().setType(MapChangeTrackerImpl.class);
         code.dup();
         code.aload().setLocal(ret);
+        code.aload().setParam(4);
         code.invokespecial().setMethod(MapChangeTrackerImpl.class, 
-            "<init>", void.class, new Class[] { Map.class });
+            "<init>", void.class, new Class[] { Map.class, boolean.class });
         code.putfield().setField(changeTracker);
 
         ifins.setTarget(code.aload().setLocal(ret));

Modified: openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyMap.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyMap.java?rev=802218&r1=802217&r2=802218&view=diff
==============================================================================
--- openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyMap.java
(original)
+++ openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyMap.java
Fri Aug  7 21:36:02 2009
@@ -43,5 +43,5 @@
      * Create a new instance of this proxy type.
      */
     public ProxyMap newInstance(Class keyType, Class valueType,
-        Comparator compare, boolean trackChanges);
+        Comparator compare, boolean trackChanges, boolean autoOff);
 }

Modified: openjpa/branches/1.1.x/openjpa-kernel/src/test/java/org/apache/openjpa/util/TestProxyManager.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.1.x/openjpa-kernel/src/test/java/org/apache/openjpa/util/TestProxyManager.java?rev=802218&r1=802217&r2=802218&view=diff
==============================================================================
--- openjpa/branches/1.1.x/openjpa-kernel/src/test/java/org/apache/openjpa/util/TestProxyManager.java
(original)
+++ openjpa/branches/1.1.x/openjpa-kernel/src/test/java/org/apache/openjpa/util/TestProxyManager.java
Fri Aug  7 21:36:02 2009
@@ -173,12 +173,12 @@
     }
 
     public void testCopyProxyCollection() {
-        List orig = (List) _mgr.newCollectionProxy(ArrayList.class, null, null);
+        List orig = (List) _mgr.newCollectionProxy(ArrayList.class, null, null,true);
         populate(orig);
         assertListsEqual(new ArrayList(orig), (List) _mgr.copyCollection(orig));
 
         TreeSet torig = (TreeSet) _mgr.newCollectionProxy(TreeSet.class, null, 
-            new CustomComparator());
+            new CustomComparator(),true);
         assertTrue(torig.comparator() instanceof CustomComparator);
         populate(torig);
         assertSortedSetsEqual(new TreeSet(torig), (SortedSet) 
@@ -189,7 +189,7 @@
         // List doesn't support clone()
         
         TreeSet torig = (TreeSet) _mgr.newCollectionProxy(TreeSet.class, null, 
-            new CustomComparator());
+            new CustomComparator(),true);
         assertTrue(torig.comparator() instanceof CustomComparator);
         populate(torig);
         assertSortedSetsEquals(new TreeSet(torig), (SortedSet) torig.clone());
@@ -197,11 +197,11 @@
 
     public void testListMethodsProxied() 
         throws Exception {
-        Class proxy = _mgr.newCollectionProxy(ArrayList.class, null, null).
+        Class proxy = _mgr.newCollectionProxy(ArrayList.class, null, null,true).
             getClass();
         assertListMethodsProxied(proxy);
 
-        proxy = _mgr.newCollectionProxy(CustomList.class, null, null).
+        proxy = _mgr.newCollectionProxy(CustomList.class, null, null,true).
             getClass();
         assertListMethodsProxied(proxy);
     }
@@ -255,19 +255,19 @@
 
     public void testSetMethodsProxied() 
         throws Exception {
-        Class proxy = _mgr.newCollectionProxy(HashSet.class, null, null).
+        Class proxy = _mgr.newCollectionProxy(HashSet.class, null, null,true).
             getClass();
         assertCollectionMethodsProxied(proxy);
 
-        proxy = _mgr.newCollectionProxy(CustomSet.class, null, null).getClass();
+        proxy = _mgr.newCollectionProxy(CustomSet.class, null, null,true).getClass();
         assertCollectionMethodsProxied(proxy);
 
-        proxy = _mgr.newCollectionProxy(CustomSortedSet.class, null, null).
+        proxy = _mgr.newCollectionProxy(CustomSortedSet.class, null, null,true).
             getClass();
         assertCollectionMethodsProxied(proxy);
 
         proxy = _mgr.newCollectionProxy(CustomComparatorSortedSet.class, null, 
-            new CustomComparator()).getClass();
+            new CustomComparator(),true).getClass();
         assertCollectionMethodsProxied(proxy);
     }
 
@@ -277,7 +277,7 @@
         if (queue == null)
             return;
 
-        Class proxy = _mgr.newCollectionProxy(LinkedList.class, null, null).
+        Class proxy = _mgr.newCollectionProxy(LinkedList.class, null, null,true).
             getClass();
         assertTrue(queue.isAssignableFrom(proxy));        
         assertCollectionMethodsProxied(proxy);
@@ -295,7 +295,7 @@
 
     public void testLinkedListMethodsProxied() 
         throws Exception {
-        Class proxy = _mgr.newCollectionProxy(LinkedList.class, null, null).
+        Class proxy = _mgr.newCollectionProxy(LinkedList.class, null, null,true).
             getClass();
         assertListMethodsProxied(proxy);
         assertNotNull(proxy.getDeclaredMethod("addFirst", 
@@ -308,7 +308,7 @@
 
     public void testVectorMethodsProxied() 
         throws Exception {
-         Class proxy = _mgr.newCollectionProxy(Vector.class, null, null).
+         Class proxy = _mgr.newCollectionProxy(Vector.class, null, null,true).
             getClass();
         assertListMethodsProxied(proxy);
         assertNotNull(proxy.getDeclaredMethod("addElement", 
@@ -326,7 +326,7 @@
     }
 
     public void testListChangeTracker() {
-        Proxy coll = _mgr.newCollectionProxy(ArrayList.class, null, null);
+        Proxy coll = _mgr.newCollectionProxy(ArrayList.class, null, null,true);
         assertNotNull(coll);
         assertNotNull(coll.getChangeTracker());
         assertTrue(coll.getChangeTracker() 
@@ -338,7 +338,7 @@
     }
     
     public void testSetChangeTracker() {
-        Proxy coll = _mgr.newCollectionProxy(HashSet.class, null, null);
+        Proxy coll = _mgr.newCollectionProxy(HashSet.class, null, null,true);
         assertNotNull(coll);
         assertNotNull(coll.getChangeTracker());
         assertTrue(coll.getChangeTracker() 
@@ -350,25 +350,25 @@
     }
  
     public void testCollectionInterfaceProxy() {
-        Proxy coll = _mgr.newCollectionProxy(Collection.class, null, null);
+        Proxy coll = _mgr.newCollectionProxy(Collection.class, null, null,true);
         assertNotNull(coll);
     }
 
     public void testListInterfaceProxy() {
-        Proxy coll = _mgr.newCollectionProxy(List.class, null, null);
+        Proxy coll = _mgr.newCollectionProxy(List.class, null, null,true);
         assertNotNull(coll);
         assertTrue(coll instanceof List);
     }
 
     public void testSetInterfaceProxy() {
-        Proxy coll = _mgr.newCollectionProxy(Set.class, null, null);
+        Proxy coll = _mgr.newCollectionProxy(Set.class, null, null,true);
         assertNotNull(coll);
         assertTrue(coll instanceof Set);
         assertFalse(coll instanceof SortedSet);
     }
 
     public void testSortedSetInterfaceProxy() {
-        Proxy coll = _mgr.newCollectionProxy(SortedSet.class, null, null);
+        Proxy coll = _mgr.newCollectionProxy(SortedSet.class, null, null,true);
         assertNotNull(coll);
         assertTrue(coll instanceof SortedSet);
     }
@@ -378,7 +378,7 @@
         if (queue == null)
             return;
 
-        Proxy coll = _mgr.newCollectionProxy(queue, null, null);
+        Proxy coll = _mgr.newCollectionProxy(queue, null, null,true);
         assertNotNull(coll);
         assertTrue(queue.isInstance(coll));
     }
@@ -479,12 +479,12 @@
     }
 
     public void testCopyProxyMap() {
-        Map orig = (Map) _mgr.newMapProxy(HashMap.class, null, null, null);
+        Map orig = (Map) _mgr.newMapProxy(HashMap.class, null, null, null,true);
         populate(orig);
         assertMapsEqual(new HashMap(orig), (Map) _mgr.copyMap(orig));
 
         TreeMap torig = (TreeMap) _mgr.newMapProxy(TreeMap.class, null, null, 
-            new CustomComparator());
+            new CustomComparator(),true);
         assertTrue(torig.comparator() instanceof CustomComparator);
         populate(torig);
         assertSortedMapsEqual(new TreeMap(torig), (SortedMap) 
@@ -495,7 +495,7 @@
         // Map does not support clone()
         
         TreeMap torig = (TreeMap) _mgr.newMapProxy(TreeMap.class, null, null, 
-            new CustomComparator());
+            new CustomComparator(),true);
         assertTrue(torig.comparator() instanceof CustomComparator);
         populate(torig);
         assertSortedMapsEquals(new TreeMap(torig), (SortedMap) torig.clone());
@@ -503,26 +503,26 @@
 
     public void testMapMethodsProxied() 
         throws Exception {
-        Class proxy = _mgr.newMapProxy(HashMap.class, null, null, null).
+        Class proxy = _mgr.newMapProxy(HashMap.class, null, null, null,true).
             getClass();
         assertMapMethodsProxied(proxy);
 
-        proxy = _mgr.newMapProxy(TreeMap.class, null, null, null).getClass();
+        proxy = _mgr.newMapProxy(TreeMap.class, null, null, null,true).getClass();
         assertMapMethodsProxied(proxy);
 
         proxy = _mgr.newMapProxy(TreeMap.class, null, null, 
-            new CustomComparator()).getClass();
+            new CustomComparator(),true).getClass();
         assertMapMethodsProxied(proxy);
 
-        proxy = _mgr.newMapProxy(CustomMap.class, null, null, null).getClass();
+        proxy = _mgr.newMapProxy(CustomMap.class, null, null, null,true).getClass();
         assertMapMethodsProxied(proxy);
 
-        proxy = _mgr.newMapProxy(CustomSortedMap.class, null, null, null).
+        proxy = _mgr.newMapProxy(CustomSortedMap.class, null, null, null,true).
             getClass();
         assertMapMethodsProxied(proxy);
 
         proxy = _mgr.newMapProxy(CustomComparatorSortedMap.class, null, null, 
-            new CustomComparator()).getClass();
+            new CustomComparator(),true).getClass();
         assertMapMethodsProxied(proxy);
     }
 
@@ -554,7 +554,7 @@
 
     public void testPropertiesMethodsProxied() 
         throws Exception {
-        Class proxy = _mgr.newMapProxy(Properties.class, null, null, null).
+        Class proxy = _mgr.newMapProxy(Properties.class, null, null, null,true).
             getClass();
         assertMapMethodsProxied(proxy);
         assertNotNull(proxy.getDeclaredMethod("setProperty", 
@@ -797,7 +797,7 @@
         NonproxyableBean orig = new NonproxyableBean(1);
         populate(orig);
         assertNull(_mgr.copyCustom(orig));
-        assertNull(_mgr.newCustomProxy(orig));
+        assertNull(_mgr.newCustomProxy(orig,true));
     }
 
 
@@ -815,7 +815,7 @@
     }
 
     public void testCopyProxyBean() {
-        CustomBean orig = (CustomBean) _mgr.newCustomProxy(new CustomBean());
+        CustomBean orig = (CustomBean) _mgr.newCustomProxy(new CustomBean(),true);
         populate(orig);
         CustomBean comp = new CustomBean();
         populate(comp);
@@ -824,11 +824,11 @@
 
     public void testBeanMethodsProxied()
         throws Exception {
-        Class proxy = _mgr.newCustomProxy(new CustomBean()).getClass();
+        Class proxy = _mgr.newCustomProxy(new CustomBean(),true).getClass();
         assertBeanMethodsProxied(proxy);
 
         proxy = _mgr.newCustomProxy(new CustomCopyConstructorBean
-            (new CustomBean())).getClass();
+            (new CustomBean()),true).getClass();
         assertBeanMethodsProxied(proxy);
     }
 



Mime
View raw message