From 5232b727949d00add9cb61e153cbbcdc9e13c769 Mon Sep 17 00:00:00 2001 From: Michael Dick Date: Mon, 3 Aug 2009 21:04:50 +0000 Subject: [PATCH] OPENJPA-1163: Add configuration option that allows the elements in a persistent map to be treated as the owners of the relationship (ie updates to the hashmap can add elements without removing old ones). Submitted By : Ravi Palacherla git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@800563 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/openjpa/conf/Compatibility.java | 17 +++++ .../apache/openjpa/kernel/DetachManager.java | 8 ++- .../openjpa/kernel/SingleFieldManager.java | 4 +- .../openjpa/kernel/StateManagerImpl.java | 6 +- .../util/AbstractLRSProxyCollection.java | 2 +- .../openjpa/util/AbstractLRSProxyMap.java | 2 +- .../util/CollectionChangeTrackerImpl.java | 3 +- .../openjpa/util/MapChangeTrackerImpl.java | 3 +- .../apache/openjpa/util/ProxyCollection.java | 2 +- .../org/apache/openjpa/util/ProxyManager.java | 6 +- .../apache/openjpa/util/ProxyManagerImpl.java | 24 +++---- .../org/apache/openjpa/util/ProxyMap.java | 2 +- .../apache/openjpa/util/TestProxyManager.java | 66 +++++++++---------- 13 files changed, 87 insertions(+), 58 deletions(-) diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/conf/Compatibility.java b/openjpa-kernel/src/main/java/org/apache/openjpa/conf/Compatibility.java index 3c1f49953..a3ba6d2c8 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/conf/Compatibility.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/conf/Compatibility.java @@ -60,6 +60,7 @@ public class Compatibility { private boolean _useJPA2DefaultOrderColumnName = true; private boolean _copyOnDetach = false; private boolean _privatePersistentProperties = false; + private boolean _autoOff = true; /** * Whether to require exact identity value types when creating object @@ -76,6 +77,22 @@ public class Compatibility { public void setStrictIdentityValues(boolean strictVals) { _strictIdValues = strictVals; } + + /** + * 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. diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachManager.java b/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachManager.java index 1839f0082..99a6c5ed7 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachManager.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachManager.java @@ -743,7 +743,9 @@ public class DetachManager 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); @@ -761,7 +763,9 @@ public class DetachManager 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); diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SingleFieldManager.java b/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SingleFieldManager.java index f06880c4a..ad49dcfde 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SingleFieldManager.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SingleFieldManager.java @@ -125,7 +125,9 @@ class SingleFieldManager return false; proxy = checkProxy(); if (proxy == null) { - proxy = getProxyManager().newCustomProxy(objval); + proxy = getProxyManager().newCustomProxy(objval, + _sm.getBroker().getConfiguration(). + getCompatibilityInstance().getAutoOff()); ret = proxy != null; } break; diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java b/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java index 6699811ed..c3941bde4 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java @@ -1813,12 +1813,14 @@ public class StateManagerImpl 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; } diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractLRSProxyCollection.java b/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractLRSProxyCollection.java index 7b23b88dd..f8eb1057b 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractLRSProxyCollection.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractLRSProxyCollection.java @@ -69,7 +69,7 @@ public abstract class AbstractLRSProxyCollection */ public AbstractLRSProxyCollection(Class elementType, boolean ordered) { _elementType = elementType; - _ct = new CollectionChangeTrackerImpl(this, false, ordered); + _ct = new CollectionChangeTrackerImpl(this, false, ordered,false); _ct.setAutoOff(false); } diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractLRSProxyMap.java b/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractLRSProxyMap.java index 4fa1186d2..b87388b79 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractLRSProxyMap.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractLRSProxyMap.java @@ -73,7 +73,7 @@ public abstract class AbstractLRSProxyMap public AbstractLRSProxyMap(Class keyType, Class valueType) { _keyType = keyType; _valueType = valueType; - _ct = new MapChangeTrackerImpl(this); + _ct = new MapChangeTrackerImpl(this,false); _ct.setAutoOff(false); } diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/util/CollectionChangeTrackerImpl.java b/openjpa-kernel/src/main/java/org/apache/openjpa/util/CollectionChangeTrackerImpl.java index 4412c911a..696783676 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/util/CollectionChangeTrackerImpl.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/util/CollectionChangeTrackerImpl.java @@ -43,10 +43,11 @@ public class CollectionChangeTrackerImpl * @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); } /** diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/util/MapChangeTrackerImpl.java b/openjpa-kernel/src/main/java/org/apache/openjpa/util/MapChangeTrackerImpl.java index a047c6bec..3f33b0637 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/util/MapChangeTrackerImpl.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/util/MapChangeTrackerImpl.java @@ -36,8 +36,9 @@ public class MapChangeTrackerImpl /** * Constructor; supply delegate map. */ - public MapChangeTrackerImpl(Map map) { + public MapChangeTrackerImpl(Map map, boolean autoOff) { _map = map; + this.setAutoOff(autoOff); } public boolean getTrackKeys() { diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyCollection.java b/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyCollection.java index 12a52d318..44e39d7cb 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyCollection.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyCollection.java @@ -38,5 +38,5 @@ public interface ProxyCollection * Create a new instance of this proxy type. */ public ProxyCollection newInstance(Class elementType, Comparator comp, - boolean trackChanges); + boolean trackChanges, boolean autoOff); } diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyManager.java b/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyManager.java index 1c59b5d37..2c88c1527 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyManager.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyManager.java @@ -82,7 +82,7 @@ public interface ProxyManager { * 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 @@ public interface ProxyManager { * 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 @@ public interface ProxyManager { * * @since 0.2.5 */ - public Proxy newCustomProxy (Object obj); + public Proxy newCustomProxy (Object obj, boolean autoOff); } diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyManagerImpl.java b/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyManagerImpl.java index 7bd0e375c..4ce438aee 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyManagerImpl.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyManagerImpl.java @@ -184,11 +184,11 @@ public class ProxyManagerImpl } 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 class ProxyManagerImpl } 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 @@ public class ProxyManagerImpl 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 @@ public class ProxyManagerImpl 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; } @@ -814,7 +814,7 @@ public class ProxyManagerImpl // 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); @@ -842,9 +842,10 @@ public class ProxyManagerImpl code.aload().setLocal(ret); code.constant().setValue(allowsDuplicates(type)); code.constant().setValue(isOrdered(type)); + code.aload().setParam(3); code.invokespecial().setMethod(CollectionChangeTrackerImpl.class, "", 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)); @@ -948,7 +949,7 @@ public class ProxyManagerImpl // 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); @@ -977,8 +978,9 @@ public class ProxyManagerImpl code.anew().setType(MapChangeTrackerImpl.class); code.dup(); code.aload().setLocal(ret); + code.aload().setParam(4); code.invokespecial().setMethod(MapChangeTrackerImpl.class, - "", void.class, new Class[] { Map.class }); + "", void.class, new Class[] { Map.class, boolean.class }); code.putfield().setField(changeTracker); ifins.setTarget(code.aload().setLocal(ret)); diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyMap.java b/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyMap.java index 19d064a8b..5c4c030d9 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyMap.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyMap.java @@ -43,5 +43,5 @@ public interface ProxyMap * 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); } diff --git a/openjpa-kernel/src/test/java/org/apache/openjpa/util/TestProxyManager.java b/openjpa-kernel/src/test/java/org/apache/openjpa/util/TestProxyManager.java index 53fa96c21..21037d9e8 100644 --- a/openjpa-kernel/src/test/java/org/apache/openjpa/util/TestProxyManager.java +++ b/openjpa-kernel/src/test/java/org/apache/openjpa/util/TestProxyManager.java @@ -173,12 +173,12 @@ public class TestProxyManager } 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 @@ public class TestProxyManager // 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 class TestProxyManager 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 class TestProxyManager 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 @@ public class TestProxyManager 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 class TestProxyManager 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 class TestProxyManager 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 class TestProxyManager } 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 class TestProxyManager } 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 class TestProxyManager } 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 @@ public class TestProxyManager 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 class TestProxyManager } 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 @@ public class TestProxyManager // 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 class TestProxyManager 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 class TestProxyManager 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 @@ public class TestProxyManager 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 class TestProxyManager } 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 class TestProxyManager 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); }