openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From solo...@apache.org
Subject svn commit: r1841941 - in /openjpa/trunk: ./ openjpa-features/src/main/feature/ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/ openjpa-kernel/src/main/java/org/apache/openjpa/datacache/ openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ ...
Date Tue, 25 Sep 2018 15:16:55 GMT
Author: solomax
Date: Tue Sep 25 15:16:54 2018
New Revision: 1841941

URL: http://svn.apache.org/viewvc?rev=1841941&view=rev
Log:
[OPENJPA-2748] commons-collection is updated to most recent version

Modified:
    openjpa/trunk/.gitignore
    openjpa/trunk/openjpa-features/src/main/feature/feature.xml
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/InformixDictionary.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/AbstractQueryCache.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/QueryCacheStoreQuery.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCRegistry.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/Reflection.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/event/SingleJVMRemoteCommitProvider.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractStoreQuery.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AttachManager.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DelegatingQuery.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachManager.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ExtentImpl.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ManagedCache.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryContext.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryStatistics.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StoreQuery.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/FieldMetaData.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ValueStrategies.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractChangeTracker.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractLRSProxyCollection.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractLRSProxyMap.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/BlacklistClassResolver.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/CacheMap.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ImplHelper.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/OpenJPAId.java
    openjpa/trunk/openjpa-lib/pom.xml
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ObjectValue.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/rop/SoftRandomAccessResultList.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/LRUMap.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashSet.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceMap.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/concurrent/ConcurrentReferenceHashMap.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/concurrent/ConcurrentReferenceHashSet.java
    openjpa/trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib/util/TestReferenceSet.java
    openjpa/trunk/openjpa-persistence-jdbc/pom.xml
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizRelation.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestProxies2.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/ProxiesPC.java
    openjpa/trunk/openjpa-project/assembly.xml
    openjpa/trunk/openjpa-project/bin-assembly.xml
    openjpa/trunk/pom.xml

Modified: openjpa/trunk/.gitignore
URL: http://svn.apache.org/viewvc/openjpa/trunk/.gitignore?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/.gitignore (original)
+++ openjpa/trunk/.gitignore Tue Sep 25 15:16:54 2018
@@ -5,3 +5,5 @@ target
 velocity.log
 derby.log
 *.iml
+dependency-reduced-pom.xml
+

Modified: openjpa/trunk/openjpa-features/src/main/feature/feature.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-features/src/main/feature/feature.xml?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-features/src/main/feature/feature.xml (original)
+++ openjpa/trunk/openjpa-features/src/main/feature/feature.xml Tue Sep 25 15:16:54 2018
@@ -26,7 +26,7 @@
         <bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-el_1.0_spec/1.0.1</bundle>
 		<bundle dependency="true">mvn:org.apache.commons/commons-pool2/2.6.0</bundle>
 		<bundle dependency="true">mvn:org.apache.commons/commons-dbcp2/2.5.0</bundle>
-		<bundle dependency="true">mvn:commons-collections/commons-collections/3.2.2</bundle>
+		<bundle dependency="true">mvn:commons-collections/commons-collections4/4.3</bundle>
         <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.serp/1.14.1_1</bundle>
         <bundle dependency="true">mvn:org.apache.xbean/xbean-asm6-shaded/4.9</bundle>
         <bundle>mvn:org.apache.openjpa/openjpa/${project.version}</bundle>

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/InformixDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/InformixDictionary.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/InformixDictionary.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/InformixDictionary.java Tue Sep 25 15:16:54 2018
@@ -31,6 +31,7 @@ import java.util.Collections;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceStrength;
 import org.apache.openjpa.jdbc.identifier.DBIdentifier;
 import org.apache.openjpa.jdbc.identifier.DBIdentifier.DBIdentifierType;
 import org.apache.openjpa.jdbc.kernel.exps.FilterValue;
@@ -84,7 +85,7 @@ public class InformixDictionary
     protected boolean useJCC = false;
     // weak set of connections we've already executed lock mode sql on
     private final Collection _seenConnections = Collections.synchronizedSet(
-    		new ReferenceHashSet(ReferenceHashSet.WEAK));
+            new ReferenceHashSet(ReferenceStrength.WEAK));
 
     public boolean disableRetainUpdateLocksSQL=false;
 

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java Tue Sep 25 15:16:54 2018
@@ -38,7 +38,7 @@ import java.util.SortedMap;
 import java.util.Stack;
 import java.util.TreeMap;
 
-import org.apache.commons.collections.iterators.EmptyIterator;
+import org.apache.commons.collections4.iterators.EmptyIterator;
 import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
 import org.apache.openjpa.jdbc.kernel.EagerFetchModes;

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/AbstractQueryCache.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/AbstractQueryCache.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/AbstractQueryCache.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/AbstractQueryCache.java Tue Sep 25 15:16:54 2018
@@ -31,6 +31,7 @@ import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 
+import org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceStrength;
 import org.apache.openjpa.conf.OpenJPAConfiguration;
 import org.apache.openjpa.event.RemoteCommitEvent;
 import org.apache.openjpa.event.RemoteCommitListener;
@@ -397,7 +398,7 @@ public abstract class AbstractQueryCache
      * the only reference is held by the list of expiration listeners.
      */
     protected Collection newListenerCollection() {
-        return new ConcurrentReferenceHashSet (ConcurrentReferenceHashSet.WEAK);
+        return new ConcurrentReferenceHashSet(ReferenceStrength.WEAK);
 	}
 
     /**
@@ -493,12 +494,12 @@ public abstract class AbstractQueryCache
 
         private void initializeMaps() {
             ConcurrentReferenceHashMap statsMap =
-                new ConcurrentReferenceHashMap(ReferenceMap.HARD, ReferenceMap.HARD, CONCURRENCY, LOAD_FACTOR);
+                new ConcurrentReferenceHashMap(ReferenceStrength.HARD, ReferenceStrength.HARD, CONCURRENCY, LOAD_FACTOR);
             statsMap.setMaxSize(FIXED_SIZE);
             stats = statsMap;
 
             ConcurrentReferenceHashMap aStatsMap =
-                new ConcurrentReferenceHashMap(ReferenceMap.HARD, ReferenceMap.HARD, CONCURRENCY, LOAD_FACTOR);
+                new ConcurrentReferenceHashMap(ReferenceStrength.HARD, ReferenceStrength.HARD, CONCURRENCY, LOAD_FACTOR);
             aStatsMap.setMaxSize(FIXED_SIZE);
             astats = aStatsMap;
         }

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/QueryCacheStoreQuery.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/QueryCacheStoreQuery.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/QueryCacheStoreQuery.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/QueryCacheStoreQuery.java Tue Sep 25 15:16:54 2018
@@ -30,7 +30,7 @@ import java.util.Map;
 import java.util.Set;
 import java.util.TreeMap;
 
-import org.apache.commons.collections.map.LinkedMap;
+import org.apache.commons.collections4.map.LinkedMap;
 import org.apache.openjpa.datacache.AbstractQueryCache.EvictPolicy;
 import org.apache.openjpa.kernel.FetchConfiguration;
 import org.apache.openjpa.kernel.LockLevels;

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCRegistry.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCRegistry.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCRegistry.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCRegistry.java Tue Sep 25 15:16:54 2018
@@ -22,6 +22,7 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.Map;
 
+import org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceStrength;
 import org.apache.openjpa.lib.util.Localizer;
 import org.apache.openjpa.lib.util.ReferenceMap;
 import org.apache.openjpa.lib.util.concurrent.ConcurrentReferenceHashMap;
@@ -40,14 +41,14 @@ public class PCRegistry {
     private static final Localizer _loc = Localizer.forPackage(PCRegistry.class);
 
     // map of persistent classes to meta structures; weak so the VM can GC classes
-    private static final Map<Class<?>,Meta> _metas = new ConcurrentReferenceHashMap(ReferenceMap.WEAK, 
-            ReferenceMap.HARD);
+    private static final Map<Class<?>,Meta> _metas = new ConcurrentReferenceHashMap(ReferenceStrength.WEAK,
+        ReferenceStrength.HARD);
     
     // register class listeners
     // Weak reference prevents OutOfMemeoryError as described in OPENJPA-2042
     private static final Collection<RegisterClassListener> _listeners =
         new ConcurrentReferenceHashSet<RegisterClassListener>(
-            ConcurrentReferenceHashSet.WEAK);
+                ReferenceStrength.WEAK);
 
     /**
      * Register a {@link RegisterClassListener}.

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/Reflection.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/Reflection.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/Reflection.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/Reflection.java Tue Sep 25 15:16:54 2018
@@ -30,6 +30,7 @@ import java.util.Set;
 import java.util.TreeSet;
 
 import org.apache.openjpa.lib.util.StringUtil;
+import org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceStrength;
 import org.apache.openjpa.lib.util.J2DoPrivHelper;
 import org.apache.openjpa.lib.util.Localizer;
 import org.apache.openjpa.lib.util.ReferenceMap;
@@ -52,11 +53,11 @@ public class Reflection {
 
     // Weak HashMap caches of getter/setter/beanProperty methods
     private static Map<Class<?>, Map<String, Method>> getterMethodCache = 
-        new ConcurrentReferenceHashMap(ReferenceMap.WEAK, ReferenceMap.HARD);
+        new ConcurrentReferenceHashMap(ReferenceStrength.WEAK, ReferenceStrength.HARD);
     private static Map<Class<?>, Map<String, Method>> setterMethodCache = 
-        new ConcurrentReferenceHashMap(ReferenceMap.WEAK, ReferenceMap.HARD);
+        new ConcurrentReferenceHashMap(ReferenceStrength.WEAK, ReferenceStrength.HARD);
     private static Map<Class<?>, Set<String>> beanPropertiesNameCache = 
-        new ConcurrentReferenceHashMap(ReferenceMap.WEAK, ReferenceMap.HARD);
+        new ConcurrentReferenceHashMap(ReferenceStrength.WEAK, ReferenceStrength.HARD);
     
     private static Method getGetterMethod(Class<?> cls, String prop) {
         Method rtnMethod = null;
@@ -71,8 +72,8 @@ public class Reflection {
         Method method) {
         Map<String, Method> clsMap = getterMethodCache.get(cls);
         if (clsMap == null) {
-            clsMap = new ConcurrentReferenceHashMap(ReferenceMap.HARD,
-                ReferenceMap.WEAK);
+            clsMap = new ConcurrentReferenceHashMap(ReferenceStrength.HARD,
+                ReferenceStrength.WEAK);
             getterMethodCache.put(cls, clsMap);
         }
         clsMap.put(prop, method);
@@ -91,8 +92,8 @@ public class Reflection {
         Method method) {
         Map<String, Method> clsMap = setterMethodCache.get(cls);
         if (clsMap == null) {
-            clsMap = new ConcurrentReferenceHashMap(ReferenceMap.HARD,
-                ReferenceMap.WEAK);
+            clsMap = new ConcurrentReferenceHashMap(ReferenceStrength.HARD,
+                ReferenceStrength.WEAK);
             setterMethodCache.put(cls, clsMap);
         }
         clsMap.put(prop, method);

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/event/SingleJVMRemoteCommitProvider.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/event/SingleJVMRemoteCommitProvider.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/event/SingleJVMRemoteCommitProvider.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/event/SingleJVMRemoteCommitProvider.java Tue Sep 25 15:16:54 2018
@@ -21,6 +21,7 @@ package org.apache.openjpa.event;
 import java.util.Iterator;
 import java.util.Set;
 
+import org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceStrength;
 import org.apache.openjpa.lib.util.concurrent.ConcurrentReferenceHashSet;
 
 /**
@@ -37,8 +38,7 @@ import org.apache.openjpa.lib.util.concu
 public class SingleJVMRemoteCommitProvider
     extends AbstractRemoteCommitProvider {
 
-    private static Set s_providers = new ConcurrentReferenceHashSet(
-        ConcurrentReferenceHashSet.HARD);
+    private static Set s_providers = new ConcurrentReferenceHashSet(ReferenceStrength.HARD);
 
     public SingleJVMRemoteCommitProvider() {
         s_providers.add(this);

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=1841941&r1=1841940&r2=1841941&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 Sep 25 15:16:54 2018
@@ -39,7 +39,8 @@ import javax.transaction.Synchronization
 import javax.transaction.Transaction;
 import javax.transaction.TransactionManager;
 
-import org.apache.commons.collections.set.MapBackedSet;
+import org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceStrength;
+import org.apache.commons.collections4.set.MapBackedSet;
 import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.audit.Auditor;
 import org.apache.openjpa.conf.BrokerValue;
@@ -489,9 +490,9 @@ public abstract class AbstractBrokerFact
             bv = (BrokerValue) _conf.getValue(BrokerValue.KEY);
 
         if (FinalizingBrokerImpl.class.isAssignableFrom(bv.getTemplateBrokerType(_conf))) {
-            return MapBackedSet.decorate(new ConcurrentHashMap(), new Object() { });
+            return MapBackedSet.mapBackedSet(new ConcurrentHashMap(), new Object() { });
         } else {
-            return new ConcurrentReferenceHashSet<Broker>(ConcurrentReferenceHashSet.WEAK);
+            return new ConcurrentReferenceHashSet<Broker>(ReferenceStrength.WEAK);
         }
     }
 
@@ -829,7 +830,7 @@ public abstract class AbstractBrokerFact
      */
     private Collection<ClassLoader> getPcClassLoaders() {
        if (_pcClassLoaders == null)
-         _pcClassLoaders = new ConcurrentReferenceHashSet<ClassLoader>(ConcurrentReferenceHashSet.WEAK);
+         _pcClassLoaders = new ConcurrentReferenceHashSet<ClassLoader>(ReferenceStrength.WEAK);
           
        return _pcClassLoaders;
     }

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractStoreQuery.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractStoreQuery.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractStoreQuery.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractStoreQuery.java Tue Sep 25 15:16:54 2018
@@ -20,7 +20,7 @@ package org.apache.openjpa.kernel;
 
 import java.util.Map;
 
-import org.apache.commons.collections.map.LinkedMap;
+import org.apache.commons.collections4.map.LinkedMap;
 import org.apache.openjpa.datacache.DataCache;
 import org.apache.openjpa.kernel.exps.AggregateListener;
 import org.apache.openjpa.kernel.exps.FilterListener;

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AttachManager.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AttachManager.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AttachManager.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AttachManager.java Tue Sep 25 15:16:54 2018
@@ -28,7 +28,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
-import org.apache.commons.collections.map.IdentityMap;
+import java.util.IdentityHashMap;
 import org.apache.openjpa.enhance.PersistenceCapable;
 import org.apache.openjpa.event.CallbackModes;
 import org.apache.openjpa.event.LifecycleEvent;
@@ -59,7 +59,7 @@ public class AttachManager {
     private final OpCallbacks _call;
     private final boolean _copyNew;
     private final boolean _failFast;
-    private final IdentityMap _attached = new IdentityMap();
+    private final IdentityHashMap _attached = new IdentityHashMap();
     private final Collection<StateManagerImpl> _visitedNodes = new ArrayList();
 
     // reusable strategies

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java Tue Sep 25 15:16:54 2018
@@ -44,9 +44,10 @@ import java.util.concurrent.locks.Reentr
 import javax.transaction.Status;
 import javax.transaction.Synchronization;
 
-import org.apache.commons.collections.iterators.IteratorChain;
-import org.apache.commons.collections.map.LinkedMap;
-import org.apache.commons.collections.set.MapBackedSet;
+import org.apache.commons.collections4.iterators.IteratorChain;
+import org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceStrength;
+import org.apache.commons.collections4.map.LinkedMap;
+import org.apache.commons.collections4.set.MapBackedSet;
 import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.conf.Compatibility;
 import org.apache.openjpa.conf.OpenJPAConfiguration;
@@ -404,7 +405,7 @@ public class BrokerImpl implements Broke
     private void initializeOperatingSet() {
         if(_operatingDirty) {
             _operatingDirty = false;
-            _operating = MapBackedSet.decorate(new IdentityHashMap<Object, Object>());
+            _operating = MapBackedSet.mapBackedSet(new IdentityHashMap<Object, Object>());
         }
     }
     
@@ -430,7 +431,7 @@ public class BrokerImpl implements Broke
      * {@link ReferenceMap} with soft values.
      */
     protected Map<?,?> newManagedObjectCache() {
-        return new ReferenceHashMap(ReferenceMap.HARD, ReferenceMap.SOFT);
+        return new ReferenceHashMap(ReferenceStrength.HARD, ReferenceStrength.SOFT);
     }
 
     //////////////////////////////////
@@ -3749,7 +3750,7 @@ public class BrokerImpl implements Broke
         try {
             ExtentImpl extent = new ExtentImpl(this, type, subclasses, fetch);
             if (_extents == null)
-                _extents = new ReferenceHashSet(ReferenceHashSet.WEAK);
+                _extents = new ReferenceHashSet(ReferenceStrength.WEAK);
             _extents.add(extent);
 
             return extent;
@@ -3800,7 +3801,7 @@ public class BrokerImpl implements Broke
 
             // track queries
             if (_queries == null)
-                _queries = new ReferenceHashSet(ReferenceHashSet.WEAK);
+                _queries = new ReferenceHashSet(ReferenceStrength.WEAK);
             _queries.add(q);
             return q;
         } catch (OpenJPAException ke) {
@@ -4906,7 +4907,7 @@ public class BrokerImpl implements Broke
 
         private boolean addCleanInternal(StateManagerImpl sm) {
             if (_clean == null)
-                _clean = new ReferenceHashSet(ReferenceHashSet.SOFT);
+                _clean = new ReferenceHashSet(ReferenceStrength.SOFT);
             return _clean.add(sm);
         }
 
@@ -4916,7 +4917,7 @@ public class BrokerImpl implements Broke
         public void addDirty(StateManagerImpl sm) {
             if (_dirty == null) {
                 if (_orderDirty)
-                    _dirty = MapBackedSet.decorate(new LinkedMap());
+                    _dirty = MapBackedSet.mapBackedSet(new LinkedMap());
                 else
                     _dirty = new HashSet<StateManagerImpl>();
             }

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DelegatingQuery.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DelegatingQuery.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DelegatingQuery.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DelegatingQuery.java Tue Sep 25 15:16:54 2018
@@ -21,7 +21,7 @@ package org.apache.openjpa.kernel;
 import java.util.Collection;
 import java.util.Map;
 
-import org.apache.commons.collections.map.LinkedMap;
+import org.apache.commons.collections4.map.LinkedMap;
 import org.apache.openjpa.kernel.exps.AggregateListener;
 import org.apache.openjpa.kernel.exps.FilterListener;
 import org.apache.openjpa.lib.util.OrderedMap;

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachManager.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachManager.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachManager.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachManager.java Tue Sep 25 15:16:54 2018
@@ -33,7 +33,7 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.commons.collections.map.IdentityMap;
+import java.util.IdentityHashMap;
 import org.apache.openjpa.conf.Compatibility;
 import org.apache.openjpa.conf.DetachOptions;
 import org.apache.openjpa.enhance.PersistenceCapable;
@@ -75,7 +75,7 @@ public class DetachManager
     // if we're not detaching full, we need to track all detached objects;
     // if we are, then we use a special field manager for more efficient
     // detachment than the standard one
-    private final IdentityMap _detached;
+    private final IdentityHashMap _detached;
     private final DetachFieldManager _fullFM;
 
     /**
@@ -279,7 +279,7 @@ public class DetachManager
             _detached = null;
             _fullFM = new DetachFieldManager();
         } else {
-            _detached = new IdentityMap();
+            _detached = new IdentityHashMap();
             _fullFM = null;
         }
         Compatibility compatibility = 

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ExtentImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ExtentImpl.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ExtentImpl.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ExtentImpl.java Tue Sep 25 15:16:54 2018
@@ -23,9 +23,10 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.NoSuchElementException;
 
-import org.apache.commons.collections.Predicate;
-import org.apache.commons.collections.iterators.FilterIterator;
-import org.apache.commons.collections.iterators.IteratorChain;
+import org.apache.commons.collections4.Predicate;
+import org.apache.commons.collections4.iterators.FilterIterator;
+import org.apache.commons.collections4.iterators.IteratorChain;
+import org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceStrength;
 import org.apache.openjpa.lib.rop.ResultObjectProvider;
 import org.apache.openjpa.lib.rop.ResultObjectProviderIterator;
 import org.apache.openjpa.lib.util.Closeable;
@@ -156,7 +157,7 @@ public class ExtentImpl<T>
         lock();
         try {
             if (_openItrs == null)
-                _openItrs = new ReferenceHashSet(ReferenceHashSet.WEAK);
+                _openItrs = new ReferenceHashSet(ReferenceStrength.WEAK);
             _openItrs.add(citr);
         } finally {
             unlock();
@@ -263,7 +264,7 @@ public class ExtentImpl<T>
             }
 
             _closed = true;
-            for (Iterator itr = getIterators().iterator(); itr.hasNext();)
+            for (Iterator itr = this; itr.hasNext();)
                 ((Closeable) itr.next()).close();
         }
     }

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ManagedCache.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ManagedCache.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ManagedCache.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ManagedCache.java Tue Sep 25 15:16:54 2018
@@ -27,6 +27,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceStrength;
 import org.apache.openjpa.lib.util.Localizer;
 import org.apache.openjpa.lib.util.ReferenceHashSet;
 import org.apache.openjpa.util.Exceptions;
@@ -105,7 +106,7 @@ class ManagedCache implements Serializab
 
         if (!sm.isPersistent() || sm.isEmbedded()) {
             if (_embeds == null)
-                _embeds = new ReferenceHashSet(ReferenceHashSet.WEAK);
+                _embeds = new ReferenceHashSet(ReferenceStrength.WEAK);
             _embeds.add(sm);
             return;
         }

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryContext.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryContext.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryContext.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryContext.java Tue Sep 25 15:16:54 2018
@@ -21,7 +21,7 @@ package org.apache.openjpa.kernel;
 import java.util.Collection;
 import java.util.Map;
 
-import org.apache.commons.collections.map.LinkedMap;
+import org.apache.commons.collections4.map.LinkedMap;
 import org.apache.openjpa.kernel.exps.AggregateListener;
 import org.apache.openjpa.kernel.exps.Constant;
 import org.apache.openjpa.kernel.exps.FilterListener;

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java Tue Sep 25 15:16:54 2018
@@ -32,7 +32,8 @@ import java.util.Map;
 import java.util.Map.Entry;
 import java.util.concurrent.locks.ReentrantLock;
 
-import org.apache.commons.collections.map.LinkedMap;
+import org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceStrength;
+import org.apache.commons.collections4.map.LinkedMap;
 import java.util.Objects;
 
 import org.apache.openjpa.lib.util.StringUtil;
@@ -129,7 +130,7 @@ public class QueryImpl
     // remember the list of all the results we have returned so we
     // can free their resources when close or closeAll is called
     private transient final Collection<RemoveOnCloseResultList> _resultLists = 
-        new ReferenceHashSet(ReferenceHashSet.WEAK);
+        new ReferenceHashSet(ReferenceStrength.WEAK);
 
     private boolean _printParameters = false;
     /**

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryStatistics.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryStatistics.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryStatistics.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryStatistics.java Tue Sep 25 15:16:54 2018
@@ -25,6 +25,7 @@ import java.util.Date;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceStrength;
 import org.apache.openjpa.lib.util.ReferenceMap;
 import org.apache.openjpa.lib.util.concurrent.ConcurrentReferenceHashMap;
 
@@ -165,12 +166,12 @@ public interface QueryStatistics<T> exte
 
         private void initializeMaps() {
             ConcurrentReferenceHashMap statsMap =
-                new ConcurrentReferenceHashMap(ReferenceMap.HARD, ReferenceMap.HARD, CONCURRENCY, LOAD_FACTOR);
+                new ConcurrentReferenceHashMap(ReferenceStrength.HARD, ReferenceStrength.HARD, CONCURRENCY, LOAD_FACTOR);
             statsMap.setMaxSize(FIXED_SIZE);
             stats = statsMap;
 
             ConcurrentReferenceHashMap aStatsMap =
-                new ConcurrentReferenceHashMap(ReferenceMap.HARD, ReferenceMap.HARD, CONCURRENCY, LOAD_FACTOR);
+                new ConcurrentReferenceHashMap(ReferenceStrength.HARD, ReferenceStrength.HARD, CONCURRENCY, LOAD_FACTOR);
             aStatsMap.setMaxSize(FIXED_SIZE);
             astats = aStatsMap;
         }

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StoreQuery.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StoreQuery.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StoreQuery.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StoreQuery.java Tue Sep 25 15:16:54 2018
@@ -22,7 +22,7 @@ import java.io.Serializable;
 import java.util.Iterator;
 import java.util.Map;
 
-import org.apache.commons.collections.map.LinkedMap;
+import org.apache.commons.collections4.map.LinkedMap;
 import org.apache.openjpa.kernel.exps.AggregateListener;
 import org.apache.openjpa.kernel.exps.Constant;
 import org.apache.openjpa.kernel.exps.FilterListener;

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/FieldMetaData.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/FieldMetaData.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/FieldMetaData.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/FieldMetaData.java Tue Sep 25 15:16:54 2018
@@ -45,7 +45,7 @@ import java.util.Properties;
 import java.util.Set;
 import java.util.TimeZone;
 
-import org.apache.commons.collections.comparators.ComparatorChain;
+import org.apache.commons.collections4.comparators.ComparatorChain;
 import org.apache.openjpa.conf.OpenJPAConfiguration;
 import org.apache.openjpa.kernel.OpenJPAStateManager;
 import org.apache.openjpa.kernel.StoreContext;

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ValueStrategies.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ValueStrategies.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ValueStrategies.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ValueStrategies.java Tue Sep 25 15:16:54 2018
@@ -18,7 +18,7 @@
  */
 package org.apache.openjpa.meta;
 
-import org.apache.commons.collections.bidimap.TreeBidiMap;
+import org.apache.commons.collections4.bidimap.TreeBidiMap;
 import org.apache.openjpa.conf.OpenJPAConfiguration;
 import org.apache.openjpa.lib.util.Localizer;
 import org.apache.openjpa.lib.util.StringDistance;

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractChangeTracker.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractChangeTracker.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractChangeTracker.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractChangeTracker.java Tue Sep 25 15:16:54 2018
@@ -24,7 +24,7 @@ import java.util.HashSet;
 import java.util.IdentityHashMap;
 import java.util.Set;
 
-import org.apache.commons.collections.set.MapBackedSet;
+import org.apache.commons.collections4.set.MapBackedSet;
 
 /**
  * Base class that provides utilities to change trackers.
@@ -186,7 +186,7 @@ public abstract class AbstractChangeTrac
      */
     protected Set newSet() {
         if (_identity == Boolean.TRUE)
-            return MapBackedSet.decorate(new IdentityHashMap());
+            return MapBackedSet.mapBackedSet(new IdentityHashMap());
         return new HashSet();
     }
 
@@ -220,7 +220,7 @@ public abstract class AbstractChangeTrac
         if (identity && cur instanceof HashSet) {
             if (cur.isEmpty())
                 return null;
-            Set replace = MapBackedSet.decorate(new IdentityHashMap());
+            Set replace = MapBackedSet.mapBackedSet(new IdentityHashMap());
             replace.addAll(cur);
             return replace;
         }

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractLRSProxyCollection.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractLRSProxyCollection.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractLRSProxyCollection.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractLRSProxyCollection.java Tue Sep 25 15:16:54 2018
@@ -26,9 +26,9 @@ import java.util.List;
 import java.util.NoSuchElementException;
 import java.util.Set;
 
-import org.apache.commons.collections.Predicate;
-import org.apache.commons.collections.iterators.FilterIterator;
-import org.apache.commons.collections.iterators.IteratorChain;
+import org.apache.commons.collections4.Predicate;
+import org.apache.commons.collections4.iterators.FilterIterator;
+import org.apache.commons.collections4.iterators.IteratorChain;
 import org.apache.openjpa.kernel.OpenJPAStateManager;
 import org.apache.openjpa.lib.util.Closeable;
 import org.apache.openjpa.lib.util.Localizer;
@@ -410,10 +410,8 @@ public abstract class AbstractLRSProxyCo
             if (_state != OPEN)
                 return;
 
-            List itrs = _itr.getIterators();
-            Iterator itr;
-            for (int i = 0; i < itrs.size(); i++) {
-                itr = (Iterator) itrs.get(i);
+            for (Iterator itr = _itr; itr.hasNext();) {
+                itr.next();
                 if (itr instanceof FilterIterator)
                     itr = ((FilterIterator) itr).getIterator();
                 ImplHelper.close(itr);

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractLRSProxyMap.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractLRSProxyMap.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractLRSProxyMap.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractLRSProxyMap.java Tue Sep 25 15:16:54 2018
@@ -30,9 +30,9 @@ import java.util.Map;
 import java.util.NoSuchElementException;
 import java.util.Set;
 
-import org.apache.commons.collections.Predicate;
-import org.apache.commons.collections.iterators.FilterIterator;
-import org.apache.commons.collections.iterators.IteratorChain;
+import org.apache.commons.collections4.Predicate;
+import org.apache.commons.collections4.iterators.FilterIterator;
+import org.apache.commons.collections4.iterators.IteratorChain;
 import org.apache.openjpa.kernel.OpenJPAStateManager;
 import org.apache.openjpa.lib.util.Closeable;
 import org.apache.openjpa.lib.util.Localizer;
@@ -507,10 +507,8 @@ public abstract class AbstractLRSProxyMa
             if (_state != OPEN)
                 return;
 
-            List itrs = _itr.getIterators();
-            Iterator itr;
-            for (int i = 0; i < itrs.size(); i++) {
-                itr = (Iterator) itrs.get(i);
+            for (Iterator itr = _itr; itr.hasNext();) {
+                itr.next();
                 if (itr instanceof FilterIterator)
                     itr = ((FilterIterator) itr).getIterator();
                 ImplHelper.close(itr);

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/BlacklistClassResolver.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/BlacklistClassResolver.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/BlacklistClassResolver.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/BlacklistClassResolver.java Tue Sep 25 15:16:54 2018
@@ -22,7 +22,7 @@ public class BlacklistClassResolver {
     public static final BlacklistClassResolver DEFAULT = new BlacklistClassResolver(
         toArray(System.getProperty(
             "openjpa.serialization.class.blacklist",
-            "org.codehaus.groovy.runtime.,org.apache.commons.collections.functors.,org.apache.xalan")),
+            "org.codehaus.groovy.runtime.,org.apache.commons.collections4.functors.,org.apache.xalan")),
         toArray(System.getProperty("openjpa.serialization.class.whitelist")));
 
     private final String[] blacklist;
@@ -59,6 +59,3 @@ public class BlacklistClassResolver {
         return false;
     }
 }
-
-
-

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/CacheMap.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/CacheMap.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/CacheMap.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/CacheMap.java Tue Sep 25 15:16:54 2018
@@ -26,9 +26,10 @@ import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 
-import org.apache.commons.collections.Predicate;
-import org.apache.commons.collections.iterators.FilterIterator;
-import org.apache.commons.collections.iterators.IteratorChain;
+import org.apache.commons.collections4.Predicate;
+import org.apache.commons.collections4.iterators.FilterIterator;
+import org.apache.commons.collections4.iterators.IteratorChain;
+import org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceStrength;
 import org.apache.openjpa.lib.util.LRUMap;
 import org.apache.openjpa.lib.util.ReferenceMap;
 import org.apache.openjpa.lib.util.SizedMap;
@@ -112,8 +113,8 @@ public class CacheMap
         if (size < 0)
             size = 500;
 
-        softMap = new ConcurrentReferenceHashMap(ReferenceMap.HARD,
-            ReferenceMap.SOFT, size, load) {
+        softMap = new ConcurrentReferenceHashMap(ReferenceStrength.HARD,
+            ReferenceStrength.SOFT, size, load) {
             public void overflowRemoved(Object key, Object value) {
                 softMapOverflowRemoved(key, value);
             }

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ImplHelper.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ImplHelper.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ImplHelper.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ImplHelper.java Tue Sep 25 15:16:54 2018
@@ -46,6 +46,7 @@ import org.apache.openjpa.meta.FieldMeta
 import org.apache.openjpa.meta.JavaTypes;
 import org.apache.openjpa.meta.SequenceMetaData;
 import org.apache.openjpa.meta.ValueStrategies;
+import org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceStrength;
 import org.apache.openjpa.conf.OpenJPAConfiguration;
 
 /**
@@ -58,11 +59,11 @@ public class ImplHelper {
 
     // Cache for from/to type assignments
     private static final Map _assignableTypes =
-        new ConcurrentReferenceHashMap(ReferenceMap.WEAK, ReferenceMap.HARD);
+        new ConcurrentReferenceHashMap(ReferenceStrength.WEAK, ReferenceStrength.HARD);
 
     // map of all new unenhanced instances active in this classloader
     public static final Map _unenhancedInstanceMap =
-        new ConcurrentReferenceHashMap(ReferenceMap.WEAK, ReferenceMap.HARD) {
+        new ConcurrentReferenceHashMap(ReferenceStrength.WEAK, ReferenceStrength.HARD) {
 
             protected boolean eq(Object x, Object y) {
                 // the Entries in ConcurrentReferenceHashMap delegate back to
@@ -252,8 +253,8 @@ public class ImplHelper {
         Boolean isAssignable = null;
         Map assignableTo = (Map) _assignableTypes.get(from);
         if (assignableTo == null) { // "to" cache doesn't exist, so create it...
-            assignableTo = new ConcurrentReferenceHashMap(ReferenceMap.WEAK,
-                    ReferenceMap.HARD);
+            assignableTo = new ConcurrentReferenceHashMap(ReferenceStrength.WEAK,
+                ReferenceStrength.HARD);
             _assignableTypes.put(from, assignableTo);
         } else { // "to" cache exists...
             isAssignable = (Boolean) assignableTo.get(to);

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/OpenJPAId.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/OpenJPAId.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/OpenJPAId.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/OpenJPAId.java Tue Sep 25 15:16:54 2018
@@ -20,6 +20,7 @@ package org.apache.openjpa.util;
 
 import java.io.Serializable;
 
+import org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceStrength;
 import org.apache.openjpa.lib.util.ReferenceMap;
 import org.apache.openjpa.lib.util.concurrent.ConcurrentReferenceHashMap;
 
@@ -35,7 +36,7 @@ public abstract class OpenJPAId
     
     // cache the types' generated hash codes
     private static ConcurrentReferenceHashMap _typeCache =
-        new ConcurrentReferenceHashMap(ReferenceMap.WEAK, ReferenceMap.HARD);
+        new ConcurrentReferenceHashMap(ReferenceStrength.WEAK, ReferenceStrength.HARD);
 
     protected Class type;
     protected boolean subs = true;

Modified: openjpa/trunk/openjpa-lib/pom.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/pom.xml?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/pom.xml (original)
+++ openjpa/trunk/openjpa-lib/pom.xml Tue Sep 25 15:16:54 2018
@@ -66,8 +66,8 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>commons-collections</groupId>
-            <artifactId>commons-collections</artifactId>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-collections4</artifactId>
         </dependency>
         <dependency>
             <groupId>net.sourceforge.serp</groupId>

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java Tue Sep 25 15:16:54 2018
@@ -35,6 +35,7 @@ import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 
+import org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceStrength;
 import org.apache.openjpa.lib.log.Log;
 import org.apache.openjpa.lib.util.ClassUtil;
 import org.apache.openjpa.lib.util.J2DoPrivHelper;
@@ -53,12 +54,10 @@ import org.apache.openjpa.lib.util.concu
  */
 public class Configurations {
 
-    private static final Localizer _loc = Localizer.forPackage
-        (Configurations.class);
-    
+    private static final Localizer _loc = Localizer.forPackage(Configurations.class);
+
     private static final ConcurrentReferenceHashMap _loaders = new
-        ConcurrentReferenceHashMap(ConcurrentReferenceHashMap.WEAK, 
-                ConcurrentReferenceHashMap.HARD);
+        ConcurrentReferenceHashMap(ReferenceStrength.WEAK, ReferenceStrength.HARD);
 
     private static final Object NULL_LOADER = "null-loader";
 
@@ -195,8 +194,8 @@ public class Configurations {
         Map<String,Class<?>> loaderCache = (Map<String,Class<?>>) _loaders.get(key);
         if (loaderCache == null) { // We don't have a cache for this loader.
             //OPENJPA-2636: Changed to HARD/WEAK to avoid Classloader leak:
-            loaderCache = new ConcurrentReferenceHashMap(ConcurrentReferenceHashMap.HARD,
-                    ConcurrentReferenceHashMap.WEAK);            
+            loaderCache = new ConcurrentReferenceHashMap(ReferenceStrength.HARD,
+                ReferenceStrength.WEAK);
             _loaders.put(key, loaderCache);
         } else {  // We have a cache for this loader.
             cls = (Class<?>) loaderCache.get(clsName);

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ObjectValue.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ObjectValue.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ObjectValue.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ObjectValue.java Tue Sep 25 15:16:54 2018
@@ -21,6 +21,7 @@ package org.apache.openjpa.lib.conf;
 import java.security.AccessController;
 import java.util.Objects;
 
+import org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceStrength;
 import org.apache.openjpa.lib.util.J2DoPrivHelper;
 import org.apache.openjpa.lib.util.Localizer;
 import org.apache.openjpa.lib.util.ReferenceMap;
@@ -38,7 +39,7 @@ public class ObjectValue extends Value {
 
     // cache the types' classloader
     private static ConcurrentReferenceHashMap _classloaderCache =
-        new ConcurrentReferenceHashMap(ReferenceMap.HARD, ReferenceMap.WEAK);
+        new ConcurrentReferenceHashMap(ReferenceStrength.HARD, ReferenceStrength.WEAK);
 
     private Object _value = null;
 

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/rop/SoftRandomAccessResultList.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/rop/SoftRandomAccessResultList.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/rop/SoftRandomAccessResultList.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/rop/SoftRandomAccessResultList.java Tue Sep 25 15:16:54 2018
@@ -20,7 +20,7 @@ package org.apache.openjpa.lib.rop;
 
 import java.util.Map;
 
-import org.apache.commons.collections.ReferenceMap;
+import org.apache.commons.collections4.map.ReferenceMap;
 
 /**
  * Specialization of the {@link RandomAccessResultList} that only maintains

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/LRUMap.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/LRUMap.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/LRUMap.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/LRUMap.java Tue Sep 25 15:16:54 2018
@@ -29,7 +29,7 @@ import java.util.Map;
  *
  * @author Abe White
  */
-public class LRUMap extends org.apache.commons.collections.map.LRUMap
+public class LRUMap extends org.apache.commons.collections4.map.LRUMap
     implements SizedMap {
 
     private int _max = -1;

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java Tue Sep 25 15:16:54 2018
@@ -30,33 +30,18 @@ import java.lang.ref.Reference;
  * @since 0.4.0
  */
 public class ReferenceHashMap
-    extends org.apache.commons.collections.map.ReferenceMap
+    extends org.apache.commons.collections4.map.ReferenceMap
     implements ReferenceMap, SizedMap {
 
     private int _maxSize = Integer.MAX_VALUE;
 
-    public ReferenceHashMap(int keyType, int valueType) {
-        super(toReferenceConstant(keyType), toReferenceConstant(valueType));
+    public ReferenceHashMap(ReferenceStrength keyType, ReferenceStrength valueType) {
+        super(keyType, valueType);
     }
 
-    public ReferenceHashMap(int keyType, int valueType, int capacity,
+    public ReferenceHashMap(ReferenceStrength keyType, ReferenceStrength valueType, int capacity,
         float loadFactor) {
-        super(toReferenceConstant(keyType), toReferenceConstant(valueType),
-            capacity, loadFactor);
-    }
-
-    /**
-     * Concver our reference constants to Apache's.
-     */
-    private static int toReferenceConstant(int type) {
-        switch (type) {
-            case ReferenceMap.HARD:
-                return org.apache.commons.collections.map.ReferenceMap. HARD;
-            case ReferenceMap.SOFT:
-                return org.apache.commons.collections.map.ReferenceMap. SOFT;
-            default:
-                return org.apache.commons.collections.map.ReferenceMap. WEAK;
-        }
+        super(keyType, valueType, capacity, loadFactor);
     }
 
     public int getMaxSize() {
@@ -104,63 +89,11 @@ public class ReferenceHashMap
         super.addMapping(hashIndex, hashCode, key, value);
     }
 
-    protected HashEntry createEntry(HashEntry next, int hashCode, Object key,
+    protected ReferenceEntry createEntry(HashEntry next, int hashCode, Object key,
         Object value) {
         return new AccessibleEntry(this, next, hashCode, key, value);
     }
 
-    protected void purge(Reference ref) {
-        // the logic for this method is taken from the original purge method
-        // we're overriding, with added logic to track the expired key/value
-        int index = hashIndex(ref.hashCode(), data.length);
-        AccessibleEntry entry = (AccessibleEntry) data[index];
-        AccessibleEntry prev = null;
-        Object key = null, value = null;
-        while (entry != null) {
-            if (purge(entry, ref)) {
-                if (isHard(keyType))
-                    key = entry.key();
-                else if (isHard(valueType))
-                    value = entry.value();
-
-                if (prev == null)
-                    data[index] = entry.nextEntry();
-                else
-                    prev.setNextEntry(entry.nextEntry());
-                size--;
-                break;
-            }
-            prev = entry;
-            entry = entry.nextEntry();
-        }
-
-        if (key != null)
-            valueExpired(key);
-        else if (value != null)
-            keyExpired(value);
-    }
-
-    /**
-     * See the code for <code>ReferenceMap.ReferenceEntry.purge</code>.
-     */
-    private boolean purge(AccessibleEntry entry, Reference ref) {
-        boolean match = (!isHard(keyType) && entry.key() == ref)
-            || (!isHard(valueType) && entry.value() == ref);
-        if (match) {
-            if (!isHard(keyType))
-                ((Reference) entry.key()).clear();
-            if (!isHard(valueType))
-                ((Reference) entry.value()).clear();
-            else if (purgeValues)
-                entry.nullValue();
-        }
-        return match;
-    }
-
-    private static boolean isHard(int type) {
-        return type == org.apache.commons.collections.map. ReferenceMap.HARD;
-    }
-
     protected void doWriteObject(ObjectOutputStream out) throws IOException {
         out.writeInt(_maxSize);
         super.doWriteObject(out);
@@ -177,11 +110,13 @@ public class ReferenceHashMap
      * protected state.
      */
     private static class AccessibleEntry extends ReferenceEntry {
+        private final ReferenceHashMap parent;
 
-        public AccessibleEntry(org.apache.commons.collections.map.
+        public AccessibleEntry(org.apache.commons.collections4.map.
             AbstractReferenceMap map, HashEntry next,
             int hashCode, Object key, Object value) {
             super(map, next, hashCode, key, value);
+            parent = (ReferenceHashMap)map;
         }
 
         public Object key() {
@@ -192,10 +127,6 @@ public class ReferenceHashMap
             return value;
         }
 
-        public void nullValue() {
-            value = null;
-        }
-
         public AccessibleEntry nextEntry() {
             return (AccessibleEntry) next;
         }
@@ -203,5 +134,14 @@ public class ReferenceHashMap
         public void setNextEntry(AccessibleEntry next) {
             this.next = next;
         }
+
+        @Override
+        protected void onPurge() {
+            if (parent.isKeyType(ReferenceStrength.HARD)) {
+                parent.valueExpired(key);
+            } else if (parent.isValueType(ReferenceStrength.HARD)) {
+                parent.keyExpired(value);
+            }
+        }
     }
 }

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashSet.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashSet.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashSet.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashSet.java Tue Sep 25 15:16:54 2018
@@ -24,7 +24,8 @@ import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Set;
 
-import org.apache.commons.collections.set.MapBackedSet;
+import org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceStrength;
+import org.apache.commons.collections4.set.MapBackedSet;
 
 /**
  * A set whose values may be stored as weak or soft references.
@@ -32,22 +33,6 @@ import org.apache.commons.collections.se
  * @author Abe White
  */
 public class ReferenceHashSet implements Set, Serializable {
-
-    /**
-     * Hard reference marker.
-     */
-    public static final int HARD = 0;
-
-    /**
-     * Soft reference marker.
-     */
-    public static final int SOFT = 1;
-
-    /**
-     * Weak reference marker.
-     */
-    public static final int WEAK = 2;
-
     private static final Object DUMMY_VAL = new Serializable() {
         public String toString() {
             return ReferenceHashSet.class.getName() + ".DUMMY_VAL";
@@ -59,17 +44,12 @@ public class ReferenceHashSet implements
     /**
      * Construct a set with the given reference type.
      */
-    public ReferenceHashSet(int refType) {
-        if (refType == HARD)
+    public ReferenceHashSet(ReferenceStrength refType) {
+        if (refType == ReferenceStrength.HARD)
             _set = new HashSet();
         else {
-            int mapRefType = (refType == WEAK) ? org.apache.commons.
-                collections.map.ReferenceMap.WEAK : org.apache.
-                commons.collections.map.ReferenceMap.SOFT;
-            _set = MapBackedSet.decorate(new org.apache.commons.
-                collections.map.ReferenceMap(mapRefType,
-                org.apache.commons.collections.map.
-                    ReferenceMap.HARD), DUMMY_VAL);
+            _set = MapBackedSet.mapBackedSet(new org.apache.commons.
+                collections4.map.ReferenceMap(refType, ReferenceStrength.HARD), DUMMY_VAL);
         }
     }
 

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceMap.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceMap.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceMap.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceMap.java Tue Sep 25 15:16:54 2018
@@ -27,11 +27,6 @@ import java.util.Map;
  * @author Abe White
  */
 public interface ReferenceMap extends Map {
-
-    public static final int HARD = 0;
-    public static final int WEAK = 1;
-    public static final int SOFT = 2;
-
     /**
      * Purge stale entries.
      */

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/concurrent/ConcurrentReferenceHashMap.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/concurrent/ConcurrentReferenceHashMap.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/concurrent/ConcurrentReferenceHashMap.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/concurrent/ConcurrentReferenceHashMap.java Tue Sep 25 15:16:54 2018
@@ -29,6 +29,7 @@ import java.util.NoSuchElementException;
 import java.util.Random;
 import java.util.Set;
 
+import org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceStrength;
 import org.apache.openjpa.lib.util.ReferenceMap;
 import org.apache.openjpa.lib.util.SizedMap;
 
@@ -83,12 +84,12 @@ public class ConcurrentReferenceHashMap
     /**
      * The key reference type.
      */
-    private int keyType;
+    private ReferenceStrength keyType;
 
     /**
      * The value reference type.
      */
-    private int valueType;
+    private ReferenceStrength valueType;
 
     /**
      * Reference queue for cleared Entries
@@ -138,7 +139,7 @@ public class ConcurrentReferenceHashMap
      * references, if the initial capacity is less than or equal to zero, or if
      * the load factor is less than or equal to zero
      */
-    public ConcurrentReferenceHashMap(int keyType, int valueType,
+    public ConcurrentReferenceHashMap(ReferenceStrength keyType, ReferenceStrength valueType,
         int initialCapacity, float loadFactor) {
         if (initialCapacity < 0) {
             throw new IllegalArgumentException("Illegal Initial Capacity: " +
@@ -148,7 +149,7 @@ public class ConcurrentReferenceHashMap
             throw new IllegalArgumentException("Illegal Load factor: " +
                 loadFactor);
         }
-        if (keyType != HARD && valueType != HARD) {
+        if (keyType != ReferenceStrength.HARD && valueType != ReferenceStrength.HARD) {
             throw new IllegalArgumentException("Either keys or values must " +
                 "use hard references.");
         }
@@ -167,7 +168,7 @@ public class ConcurrentReferenceHashMap
      * @param valueType the reference type of map values
      * @param initialCapacity the initial capacity of the HashMap.
      */
-    public ConcurrentReferenceHashMap(int keyType, int valueType,
+    public ConcurrentReferenceHashMap(ReferenceStrength keyType, ReferenceStrength valueType,
         int initialCapacity) {
         this(keyType, valueType, initialCapacity, 0.75f);
     }
@@ -178,7 +179,7 @@ public class ConcurrentReferenceHashMap
      * @param keyType the reference type of map keys
      * @param valueType the reference type of map values
      */
-    public ConcurrentReferenceHashMap(int keyType, int valueType) {
+    public ConcurrentReferenceHashMap(ReferenceStrength keyType, ReferenceStrength valueType) {
         this(keyType, valueType, 11, 0.75f);
     }
 
@@ -191,7 +192,7 @@ public class ConcurrentReferenceHashMap
      * @param keyType the reference type of map keys
      * @param valueType the reference type of map values
      */
-    public ConcurrentReferenceHashMap(int keyType, int valueType, Map t) {
+    public ConcurrentReferenceHashMap(ReferenceStrength keyType, ReferenceStrength valueType, Map t) {
         this(keyType, valueType, Math.max(3 * t.size(), 11), 0.75f);
         putAll(t);
     }
@@ -243,7 +244,7 @@ public class ConcurrentReferenceHashMap
         Entry[] tab = table;
 
         if (value == null) {
-            if (valueType != HARD)
+            if (valueType != ReferenceStrength.HARD)
                 return false;
             for (int i = tab.length; i-- > 0;)
                 for (Entry e = tab[i]; e != null; e = e.getNext())
@@ -264,7 +265,7 @@ public class ConcurrentReferenceHashMap
      * @param key key whose presence in this Map is to be tested.
      */
     public boolean containsKey(Object key) {
-        if (key == null && keyType != HARD)
+        if (key == null && keyType != ReferenceStrength.HARD)
             return false;
 
         Entry[] tab = table;
@@ -283,7 +284,7 @@ public class ConcurrentReferenceHashMap
      * @param key key whose associated value is to be returned.
      */
     public Object get(Object key) {
-        if (key == null && keyType != HARD)
+        if (key == null && keyType != ReferenceStrength.HARD)
             return null;
 
         Entry[] tab = table;
@@ -311,8 +312,8 @@ public class ConcurrentReferenceHashMap
 
         for (int i = oldCapacity; i-- > 0;) {
             for (Entry old = oldMap[i]; old != null;) {
-                if ((keyType != HARD && old.getKey() == null)
-                    || valueType != HARD && old.getValue() == null) {
+                if ((keyType != ReferenceStrength.HARD && old.getKey() == null)
+                    || valueType != ReferenceStrength.HARD && old.getValue() == null) {
                     Entry e = old;
                     old = old.getNext();
                     e.setNext(null);
@@ -344,8 +345,8 @@ public class ConcurrentReferenceHashMap
      * the HashMap previously associated null with the specified key.
      */
     public Object put(Object key, Object value) {
-        if ((key == null && keyType != HARD)
-            || (value == null && valueType != HARD))
+        if ((key == null && keyType != ReferenceStrength.HARD)
+            || (value == null && valueType != ReferenceStrength.HARD))
             throw new IllegalArgumentException("Null references not supported");
 
         int hash = hc(key);
@@ -360,7 +361,7 @@ public class ConcurrentReferenceHashMap
                 e = e.getNext()) {
                 if ((e.getHash() == hash) && eq(key, e.getKey())) {
                     Object old = e.getValue();
-                    if (valueType == HARD)
+                    if (valueType == ReferenceStrength.HARD)
                         e.setValue(value);
                     else {
                         e = newEntry(hash, e.getKey(), value, e.getNext());
@@ -393,7 +394,7 @@ public class ConcurrentReferenceHashMap
      * Creates a new entry.
      */
     private Entry newEntry(int hash, Object key, Object value, Entry next) {
-        int refType = (keyType != HARD) ? keyType : valueType;
+        ReferenceStrength refType = (keyType != ReferenceStrength.HARD) ? keyType : valueType;
         switch (refType) {
             case WEAK:
                 return new WeakEntry(hash, key, value, refType == keyType, next,
@@ -427,7 +428,7 @@ public class ConcurrentReferenceHashMap
      * the HashMap previously associated null with the specified key.
      */
     public Object remove(Object key) {
-        if (key == null && keyType != HARD)
+        if (key == null && keyType != ReferenceStrength.HARD)
             return null;
 
         int hash = hc(key);
@@ -748,7 +749,7 @@ public class ConcurrentReferenceHashMap
                         tab[index] = e.getNext();
 
                     count--;
-                    if (keyType == HARD)
+                    if (keyType == ReferenceStrength.HARD)
                         valueExpired(e.getKey());
                     else
                         keyExpired(e.getValue());

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/concurrent/ConcurrentReferenceHashSet.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/concurrent/ConcurrentReferenceHashSet.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/concurrent/ConcurrentReferenceHashSet.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/concurrent/ConcurrentReferenceHashSet.java Tue Sep 25 15:16:54 2018
@@ -24,7 +24,8 @@ import java.util.Iterator;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 
-import org.apache.commons.collections.set.MapBackedSet;
+import org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceStrength;
+import org.apache.commons.collections4.set.MapBackedSet;
 
 /**
  * A concurrent set whose values may be stored as weak or soft references. If
@@ -36,22 +37,6 @@ import org.apache.commons.collections.se
  */
 @SuppressWarnings("serial")
 public class ConcurrentReferenceHashSet<E> implements Set<E>, Serializable {
-
-    /**
-     * Hard reference marker.
-     */
-    public static final int HARD = 0;
-
-    /**
-     * Soft reference marker.
-     */
-    public static final int SOFT = 1;
-
-    /**
-     * Weak reference marker.
-     */
-    public static final int WEAK = 2;
-
     private static final Object DUMMY_VAL = new Object();
 
     private final Set<E> _set;
@@ -59,14 +44,12 @@ public class ConcurrentReferenceHashSet<
     /**
      * Construct a set with the given reference type.
      */
-    public ConcurrentReferenceHashSet(int refType) {
-        if (refType == HARD)
-            _set = MapBackedSet.decorate(new ConcurrentHashMap(), DUMMY_VAL);
+    public ConcurrentReferenceHashSet(ReferenceStrength refType) {
+        if (refType == ReferenceStrength.HARD)
+            _set = MapBackedSet.mapBackedSet(new ConcurrentHashMap(), DUMMY_VAL);
         else {
-            int mapRefType = (refType == WEAK) ? ConcurrentReferenceHashMap.WEAK
-                : ConcurrentReferenceHashMap.SOFT;
-            _set = MapBackedSet.decorate(new ConcurrentReferenceHashMap
-                (mapRefType, ConcurrentReferenceHashMap.HARD), DUMMY_VAL);
+            _set = MapBackedSet.mapBackedSet(new ConcurrentReferenceHashMap
+                (refType, ReferenceStrength.HARD), DUMMY_VAL);
         }
     }
 

Modified: openjpa/trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib/util/TestReferenceSet.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib/util/TestReferenceSet.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib/util/TestReferenceSet.java (original)
+++ openjpa/trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib/util/TestReferenceSet.java Tue Sep 25 15:16:54 2018
@@ -21,6 +21,8 @@ package org.apache.openjpa.lib.util;
 import java.util.Collection;
 import java.util.Iterator;
 
+import org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceStrength;
+
 import junit.framework.TestCase;
 
 /**
@@ -30,8 +32,7 @@ import junit.framework.TestCase;
  */
 public class TestReferenceSet extends TestCase {
 
-    private ReferenceHashSet _coll = new ReferenceHashSet
-        (ReferenceHashSet.WEAK);
+    private ReferenceHashSet _coll = new ReferenceHashSet(ReferenceStrength.WEAK);
 
     private Object _heldValue = new Integer(2);
 
@@ -48,7 +49,7 @@ public class TestReferenceSet extends Te
      * Tests basic add/contains/remove functionality.
      */
     public void testBasics() {
-        Collection coll = new ReferenceHashSet(ReferenceHashSet.WEAK);
+        Collection coll = new ReferenceHashSet(ReferenceStrength.WEAK);
         assertEquals(0, coll.size());
         assertTrue(!coll.contains("foo"));
 

Modified: openjpa/trunk/openjpa-persistence-jdbc/pom.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/pom.xml?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/pom.xml (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/pom.xml Tue Sep 25 15:16:54 2018
@@ -852,8 +852,8 @@
             <version>${project.version}</version>
         </dependency>
         <dependency>
-            <groupId>commons-collections</groupId>
-            <artifactId>commons-collections</artifactId>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-collections4</artifactId>
             <scope>test</scope>
         </dependency>
         <dependency>

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizRelation.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizRelation.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizRelation.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/common/apps/HorizRelation.java Tue Sep 25 15:16:54 2018
@@ -18,12 +18,16 @@
  */
 package org.apache.openjpa.persistence.jdbc.common.apps;
 
-import java.io.*;
-import java.util.*;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.Vector;
 
 import javax.persistence.Entity;
 
-import org.apache.commons.collections.*;
+import org.apache.commons.collections4.map.LinkedMap;
 
 /**
  * Normal class that has relations to and from various horizontal
@@ -107,7 +111,7 @@ public class HorizRelation
     private ArrayList cHorizInterVerticalD = new ArrayList();
 
     public Map getCollections() {
-        Map map = new SequencedHashMap();
+        Map map = new LinkedMap();
         map.put("HorizA", cHorizA);
         map.put("HorizB", cHorizB);
         map.put("HorizC", cHorizC);

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestProxies2.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestProxies2.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestProxies2.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestProxies2.java Tue Sep 25 15:16:54 2018
@@ -29,7 +29,7 @@ import java.util.TreeSet;
 
 
 import org.apache.openjpa.persistence.kernel.common.apps.ProxiesPC;
-import org.apache.commons.collections.comparators.ComparableComparator;
+import org.apache.commons.collections4.comparators.ComparableComparator;
 import org.apache.openjpa.persistence.OpenJPAEntityManager;
 import org.apache.openjpa.util.Proxy;
 

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/ProxiesPC.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/ProxiesPC.java?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/ProxiesPC.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/common/apps/ProxiesPC.java Tue Sep 25 15:16:54 2018
@@ -40,7 +40,7 @@ import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
 
 import org.apache.openjpa.persistence.jdbc.KeyColumn;
-import org.apache.commons.collections.comparators.ComparableComparator;
+import org.apache.commons.collections4.comparators.ComparableComparator;
 import org.apache.openjpa.persistence.PersistentCollection;
 import org.apache.openjpa.persistence.PersistentMap;
 

Modified: openjpa/trunk/openjpa-project/assembly.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/assembly.xml?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-project/assembly.xml (original)
+++ openjpa/trunk/openjpa-project/assembly.xml Tue Sep 25 15:16:54 2018
@@ -133,8 +133,7 @@
                 <include>net.sourceforge.serp:serp</include>
                 <include>org.apache.derby:derby</include>
 
-                <include>commons-lang:commons-lang</include>
-                <include>commons-collections:commons-collections</include>
+                <include>org.apache.commons:commons-collections4</include>
                 <include>org.apache.commons:commons-pool2</include>
                 <include>commons-logging:commons-logging</include>
                 <include>org.apache.commons:commons-dbcp2</include>

Modified: openjpa/trunk/openjpa-project/bin-assembly.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/bin-assembly.xml?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/openjpa-project/bin-assembly.xml (original)
+++ openjpa/trunk/openjpa-project/bin-assembly.xml Tue Sep 25 15:16:54 2018
@@ -72,8 +72,7 @@
                 <include>net.sourceforge.serp:serp</include>
                 <include>org.apache.derby:derby</include>
 
-                <include>commons-lang:commons-lang</include>
-                <include>commons-collections:commons-collections</include>
+                <include>org.apache.commons:commons-collections4</include>
                 <include>org.apache.commons:commons-pool2</include>
                 <include>commons-logging:commons-logging</include>
                 <include>org.apache.commons:commons-dbcp2</include>

Modified: openjpa/trunk/pom.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/pom.xml?rev=1841941&r1=1841940&r2=1841941&view=diff
==============================================================================
--- openjpa/trunk/pom.xml (original)
+++ openjpa/trunk/pom.xml Tue Sep 25 15:16:54 2018
@@ -508,9 +508,9 @@
                 <version>1.2</version>
             </dependency>
             <dependency>
-                <groupId>commons-collections</groupId>
-                <artifactId>commons-collections</artifactId>
-                <version>3.2.2</version>
+                <groupId>org.apache.commons</groupId>
+                <artifactId>commons-collections4</artifactId>
+                <version>4.3-SNAPSHOT</version>
             </dependency>
             <dependency>
                 <groupId>net.sourceforge.serp</groupId>



Mime
View raw message