]> source.dussan.org Git - archiva.git/commitdiff
Switching to apache commons collections4
authorMartin Stockhammer <martin_s@apache.org>
Sun, 1 Apr 2018 15:21:48 +0000 (17:21 +0200)
committerMartin Stockhammer <martin_s@apache.org>
Sun, 1 Apr 2018 15:21:48 +0000 (17:21 +0200)
37 files changed:
archiva-modules/archiva-base/archiva-configuration/pom.xml
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/DefaultArchivaConfiguration.java
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/FileTypes.java
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/functors/FiletypeSelectionPredicate.java
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/functors/FiletypeToMapClosure.java
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/functors/NetworkProxySelectionPredicate.java
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/functors/ProxyConnectorSelectionPredicate.java
archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/pom.xml
archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/archiva/consumers/functors/ConsumerWantsFilePredicate.java
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/AbstractArtifactConsumerTest.java
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/RepositoryPurgeConsumerTest.java
archiva-modules/archiva-base/archiva-model/pom.xml
archiva-modules/archiva-base/archiva-proxy/pom.xml
archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/archiva/proxy/DefaultRepositoryProxyConnectors.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/pom.xml
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/proxyconnector/ProxyConnectorSelectionPredicate.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/admin/FiletypeToMapClosure.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/proxyconnector/DefaultProxyConnectorAdmin.java
archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/metadata/MetadataTools.java
archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/metadata/RepositoryMetadataWriter.java
archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/DefaultRepositoryScanner.java
archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryContentConsumers.java
archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryScanStatistics.java
archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryScannerInstance.java
archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/functors/ConsumerProcessFileClosure.java
archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/functors/TriggerBeginScanClosure.java
archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/functors/TriggerScanCompletedClosure.java
archiva-modules/archiva-base/archiva-xml-tools/pom.xml
archiva-modules/archiva-base/archiva-xml-tools/src/main/java/org/apache/archiva/xml/ElementTextListClosure.java
archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaAdministrationService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSearchService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/utils/AddAdminRepoConsumerClosure.java
archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/startup/SecuritySynchronization.java
archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/consumers/DuplicateArtifactsConsumer.java
pom.xml

index 08675581bb25d035774146e90410b090ec5affd2..72b129f2cd10d14113be80e754e46f246a15aaa6 100644 (file)
       <groupId>commons-io</groupId>
       <artifactId>commons-io</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-collections4</artifactId>
+    </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
       <artifactId>archiva-policies</artifactId>
index caedee3088bf84720418f8156896b4eb13a04d73..c19d12f7dea2633c75fbd1c83a4e2a650f71d9b6 100644 (file)
@@ -38,9 +38,9 @@ import org.apache.archiva.redback.components.registry.RegistryException;
 import org.apache.archiva.redback.components.registry.RegistryListener;
 import org.apache.archiva.redback.components.registry.commons.CommonsConfigurationRegistry;
 import org.apache.archiva.redback.components.springutils.ComponentContainer;
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.collections.ListUtils;
-import org.apache.commons.collections.MapUtils;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.ListUtils;
+import org.apache.commons.collections4.MapUtils;
 import org.apache.commons.configuration.BaseConfiguration;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang.StringUtils;
index 655ae69ee23eb59ff4c92722a9f17b0025d0e9d4..6eae941c4f9d32283fafd02b91bdf907a04c1f3c 100644 (file)
@@ -26,8 +26,8 @@ import org.apache.archiva.redback.components.registry.Registry;
 import org.apache.archiva.redback.components.registry.RegistryException;
 import org.apache.archiva.redback.components.registry.RegistryListener;
 import org.apache.archiva.redback.components.registry.commons.CommonsConfigurationRegistry;
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.collections.Predicate;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.Predicate;
 import org.apache.commons.configuration.CombinedConfiguration;
 import org.apache.tools.ant.types.selectors.SelectorUtils;
 import org.springframework.stereotype.Service;
index ce3d93a521739531ecd0028ea6bebef87ce970a4..2fa2d2bf34839ce33aabff928d3006295e5f58c5 100644 (file)
@@ -20,7 +20,7 @@ package org.apache.archiva.configuration.functors;
  */
 
 import org.apache.archiva.configuration.FileType;
-import org.apache.commons.collections.Predicate;
+import org.apache.commons.collections4.Predicate;
 import org.apache.commons.lang.StringUtils;
 
 /**
index 8d79937f1d85b682751c563993a69bc0ffe0722e..ad8ef5c97b48e66356d4562dcd7266ee6d44af92 100644 (file)
@@ -20,7 +20,7 @@ package org.apache.archiva.configuration.functors;
  */
 
 import org.apache.archiva.configuration.FileType;
-import org.apache.commons.collections.Closure;
+import org.apache.commons.collections4.Closure;
 
 import java.util.HashMap;
 import java.util.Map;
index f3bd35bd5099fc0b8e5cad540e3ca7fd72b2f9a2..ddbd6e0e260b3342f48b968bdb90da9d36d1c70a 100644 (file)
@@ -20,7 +20,7 @@ package org.apache.archiva.configuration.functors;
  */
 
 import org.apache.archiva.configuration.NetworkProxyConfiguration;
-import org.apache.commons.collections.Predicate;
+import org.apache.commons.collections4.Predicate;
 import org.apache.commons.lang.StringUtils;
 
 /**
index aec7c902fb885854ac401a27a3eb7069ae965f6c..4cc234a1070003387e3734729154f8530ccecfc0 100644 (file)
@@ -20,7 +20,7 @@ package org.apache.archiva.configuration.functors;
  */
 
 import org.apache.archiva.configuration.ProxyConnectorConfiguration;
-import org.apache.commons.collections.Predicate;
+import org.apache.commons.collections4.Predicate;
 import org.apache.commons.lang.StringUtils;
 
 /**
index 4824291de70e69ab4838d0a28b1a51c5433e0324..abe893b9c3a386c10d937f18ad2b6bf5d1baac51 100644 (file)
@@ -42,8 +42,8 @@
       <artifactId>archiva-repository-layer</artifactId>
     </dependency>
     <dependency>
-      <groupId>commons-collections</groupId>
-      <artifactId>commons-collections</artifactId>
+      <groupId>org.apache.commons</groupId>
+       <artifactId>commons-collections4</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.ant</groupId>
index b7404e5b939aa2fc044aa4cb0eccb8f5d3d95c20..53267dc13dbe158a7e5d5cf3900d090d547b67d7 100644 (file)
@@ -23,7 +23,7 @@ import org.apache.archiva.common.utils.BaseFile;
 import org.apache.archiva.consumers.RepositoryContentConsumer;
 import org.apache.archiva.repository.ManagedRepository;
 import org.apache.archiva.repository.features.IndexCreationFeature;
-import org.apache.commons.collections.Predicate;
+import org.apache.commons.collections4.Predicate;
 import org.apache.commons.io.FilenameUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.tools.ant.types.selectors.SelectorUtils;
index dae8575e472f421d23aa2b52c82ba4ae66ae65b3..4d50b8ce024d9a3a3f681d2c9c28d28bb6fc8cb4 100644 (file)
@@ -68,6 +68,7 @@ public abstract class AbstractArtifactConsumerTest
     }
 
 
+    @SuppressWarnings( "deprecation" )
     @Test
     public void testConsumption()
     {
@@ -81,6 +82,7 @@ public abstract class AbstractArtifactConsumerTest
         assertFalse( predicate.evaluate( consumer ) );
     }
 
+    @SuppressWarnings( "deprecation" )
     @Test
     public void testConsumptionOfOtherMetadata()
     {
index 93e3e9ad6260739554f557726f0737e392763c6b..071268cd161b09d744f94f76427a926e24dbd804 100755 (executable)
@@ -34,8 +34,8 @@
       <artifactId>commons-lang</artifactId>
     </dependency>
     <dependency>
-      <groupId>commons-collections</groupId>
-      <artifactId>commons-collections</artifactId>
+      <groupId>org.apache.commons</groupId>
+       <artifactId>commons-collections4</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
index 85a3e608047da2a084f254f1c9b4e1b15b7c264a..dca7a31b99657df1e8623134165065383b4953bc 100644 (file)
@@ -94,8 +94,8 @@
       <artifactId>commons-lang</artifactId>
     </dependency>
     <dependency>
-      <groupId>commons-collections</groupId>
-      <artifactId>commons-collections</artifactId>
+      <groupId>org.apache.commons</groupId>
+       <artifactId>commons-collections4</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.ant</groupId>
index a68f01dcc9afc127f63b8537aff7b0446cdf4d3f..ebb5463a3b730507f811db2ec84d1258b0e28e4b 100644 (file)
@@ -65,7 +65,7 @@ import org.apache.archiva.repository.metadata.MetadataTools;
 import org.apache.archiva.repository.metadata.RepositoryMetadataException;
 import org.apache.archiva.scheduler.ArchivaTaskScheduler;
 import org.apache.archiva.scheduler.repository.model.RepositoryTask;
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.io.FilenameUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.SystemUtils;
index bf2868c42cbb8aacbed421aad00eec76b5afac79..33ee7b1302a01a03060177a2b7aa80ee6e8d1087 100644 (file)
@@ -34,8 +34,8 @@
       <artifactId>archiva-repository-layer</artifactId>
     </dependency>
     <dependency>
-      <groupId>commons-collections</groupId>
-      <artifactId>commons-collections</artifactId>
+      <groupId>org.apache.commons</groupId>
+       <artifactId>commons-collections4</artifactId>
     </dependency>
     <dependency>
       <groupId>commons-lang</groupId>
index 38d2b7ef8ba40b4d088b3d94660c4fe3291e2d01..52943c1c04c03ac0b0d5c67452007b26b3296d94 100644 (file)
@@ -29,7 +29,7 @@ import org.apache.archiva.configuration.ProxyConnectorConfiguration;
 import org.apache.archiva.configuration.functors.ProxyConnectorSelectionPredicate;
 import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.apache.archiva.repository.RepositoryRegistry;
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.stereotype.Service;
 
index 9bfcc2676f4c01f7b7f50727bdcee8762e17b305..4444e7cce140ba08afb041418b53aad8528c0896 100644 (file)
@@ -43,7 +43,7 @@ import org.apache.archiva.repository.LayoutException;
 import org.apache.archiva.repository.ManagedRepositoryContent;
 import org.apache.archiva.repository.RemoteRepositoryContent;
 import org.apache.archiva.xml.XMLException;
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.math.NumberUtils;
 import org.apache.commons.lang.time.DateUtils;
index 0e553f634a90f9e962585aabe020d393517ee94e..4585d59ff793812c1d06d5651c577fb4c30c6bfd 100644 (file)
@@ -24,7 +24,7 @@ import org.apache.archiva.model.ArchivaRepositoryMetadata;
 import org.apache.archiva.model.Plugin;
 import org.apache.archiva.xml.XMLException;
 import org.apache.archiva.xml.XMLWriter;
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.dom4j.Document;
 import org.dom4j.DocumentHelper;
index 7e080158d17f8656ebc7a2ef5572bb4ab5de6644..8df894ee6ca841d7ba72d274eca158382e48ff87 100644 (file)
@@ -25,7 +25,7 @@ import org.apache.archiva.consumers.InvalidRepositoryContentConsumer;
 import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
 import org.apache.archiva.consumers.RepositoryContentConsumer;
 import org.apache.archiva.repository.ManagedRepository;
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
index c03c5d111ce481f7c73140aba9ff30084b93c59c..b561c112bccef8ee3e643872e60f9347e71b5b61 100644 (file)
@@ -32,9 +32,10 @@ import org.apache.archiva.repository.ManagedRepository;
 import org.apache.archiva.repository.scanner.functors.ConsumerProcessFileClosure;
 import org.apache.archiva.repository.scanner.functors.TriggerBeginScanClosure;
 import org.apache.archiva.repository.scanner.functors.TriggerScanCompletedClosure;
-import org.apache.commons.collections.Closure;
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.collections.functors.IfClosure;
+import org.apache.commons.collections4.Closure;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
+import org.apache.commons.collections4.functors.IfClosure;
 import org.springframework.beans.BeansException;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.ApplicationContextAware;
@@ -296,8 +297,8 @@ public class RepositoryContentConsumers
             }
 
             List<InvalidRepositoryContentConsumer> selectedInvalidConsumers = getSelectedInvalidConsumers();
-            CollectionUtils.forAllDo( selectedKnownConsumers, triggerBeginScan );
-            CollectionUtils.forAllDo( selectedInvalidConsumers, triggerBeginScan );
+            IterableUtils.forEach( selectedKnownConsumers, triggerBeginScan );
+            IterableUtils.forEach( selectedInvalidConsumers, triggerBeginScan );
 
             // yuck. In case you can't read this, it says
             // "process the file if the consumer has it in the includes list, and not in the excludes list"
@@ -311,25 +312,25 @@ public class RepositoryContentConsumers
             closure.setBasefile( baseFile );
             closure.setExecuteOnEntireRepo( false );
 
-            Closure processIfWanted = IfClosure.getInstance( predicate, closure );
+            Closure processIfWanted = IfClosure.ifClosure( predicate, closure );
 
-            CollectionUtils.forAllDo( selectedKnownConsumers, processIfWanted );
+            IterableUtils.forEach( selectedKnownConsumers, processIfWanted );
 
             if ( predicate.getWantedFileCount() <= 0 )
             {
                 // Nothing known processed this file.  It is invalid!
-                CollectionUtils.forAllDo( selectedInvalidConsumers, closure );
+                IterableUtils.forEach( selectedInvalidConsumers, closure );
             }
 
             TriggerScanCompletedClosure scanCompletedClosure = new TriggerScanCompletedClosure( repository, false );
 
-            CollectionUtils.forAllDo( selectedKnownConsumers, scanCompletedClosure );
+            IterableUtils.forEach( selectedKnownConsumers, scanCompletedClosure );
         }
         finally
         {
             /* TODO: This is never called by the repository scanner instance, so not calling here either - but it probably should be?
-                        CollectionUtils.forAllDo( availableKnownConsumers, triggerCompleteScan );
-                        CollectionUtils.forAllDo( availableInvalidConsumers, triggerCompleteScan );
+                        IterableUtils.forEach( availableKnownConsumers, triggerCompleteScan );
+                        IterableUtils.forEach( availableInvalidConsumers, triggerCompleteScan );
             */
             releaseSelectedKnownConsumers( selectedKnownConsumers );
         }
index 1d9ebbeeb7de3c8322e05db4b112b4f8d34352c4..7c915cabb79633e621e80fd0ec81e2d896a7ef93 100644 (file)
@@ -20,7 +20,7 @@ package org.apache.archiva.repository.scanner;
  */
 
 import org.apache.archiva.repository.ManagedRepository;
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 
 import javax.xml.bind.annotation.XmlRootElement;
 import java.text.SimpleDateFormat;
index 6d2616696244760400a2629573fb0be1e1b761d4..cbe66d75fb354c16a83f0e79853f505978386a0b 100644 (file)
@@ -28,9 +28,10 @@ import org.apache.archiva.repository.ManagedRepository;
 import org.apache.archiva.repository.scanner.functors.ConsumerProcessFileClosure;
 import org.apache.archiva.repository.scanner.functors.TriggerBeginScanClosure;
 import org.apache.archiva.repository.scanner.functors.TriggerScanCompletedClosure;
-import org.apache.commons.collections.Closure;
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.collections.functors.IfClosure;
+import org.apache.commons.collections4.Closure;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
+import org.apache.commons.collections4.functors.IfClosure;
 import org.apache.commons.lang.SystemUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -120,8 +121,8 @@ public class RepositoryScannerInstance
         Closure triggerBeginScan =
             new TriggerBeginScanClosure( repository, new Date( System.currentTimeMillis() ), true );
 
-        CollectionUtils.forAllDo( knownConsumerList, triggerBeginScan );
-        CollectionUtils.forAllDo( invalidConsumerList, triggerBeginScan );
+        IterableUtils.forEach( knownConsumerList, triggerBeginScan );
+        IterableUtils.forEach( invalidConsumerList, triggerBeginScan );
 
         if ( SystemUtils.IS_OS_WINDOWS )
         {
@@ -239,13 +240,13 @@ public class RepositoryScannerInstance
             consumerProcessFile.setBasefile( basefile );
             consumerWantsFile.setBasefile( basefile );
 
-            Closure processIfWanted = IfClosure.getInstance( consumerWantsFile, consumerProcessFile );
-            CollectionUtils.forAllDo( this.knownConsumers, processIfWanted );
+            Closure processIfWanted = IfClosure.ifClosure( consumerWantsFile, consumerProcessFile );
+            IterableUtils.forEach( this.knownConsumers, processIfWanted );
 
             if ( consumerWantsFile.getWantedFileCount() <= 0 )
             {
                 // Nothing known processed this file.  It is invalid!
-                CollectionUtils.forAllDo( this.invalidConsumers, consumerProcessFile );
+                IterableUtils.forEach( this.invalidConsumers, consumerProcessFile );
             }
 
         }
@@ -272,8 +273,8 @@ public class RepositoryScannerInstance
     private void finishWalk() {
         this.isRunning = false;
         TriggerScanCompletedClosure scanCompletedClosure = new TriggerScanCompletedClosure( repository, true );
-        CollectionUtils.forAllDo( knownConsumers, scanCompletedClosure );
-        CollectionUtils.forAllDo( invalidConsumers, scanCompletedClosure );
+        IterableUtils.forEach( knownConsumers, scanCompletedClosure );
+        IterableUtils.forEach( invalidConsumers, scanCompletedClosure );
 
         stats.setConsumerTimings( consumerTimings );
         stats.setConsumerCounts( consumerCounts );
index a6e5f77396c9acec66787fef30ba441289b890a1..6cd9b21cf8a60fce12bf0949f58af8cfd2b57593 100644 (file)
@@ -21,7 +21,7 @@ package org.apache.archiva.repository.scanner.functors;
 
 import org.apache.archiva.common.utils.BaseFile;
 import org.apache.archiva.consumers.RepositoryContentConsumer;
-import org.apache.commons.collections.Closure;
+import org.apache.commons.collections4.Closure;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index b1e164bc62929386d5ad8dfbd35cf6c6c57682ee..8bd6d8e9a34bced0270f0f4183e855480fa46722 100644 (file)
@@ -22,7 +22,7 @@ package org.apache.archiva.repository.scanner.functors;
 import org.apache.archiva.consumers.ConsumerException;
 import org.apache.archiva.consumers.RepositoryContentConsumer;
 import org.apache.archiva.repository.ManagedRepository;
-import org.apache.commons.collections.Closure;
+import org.apache.commons.collections4.Closure;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index d14af691758cd6ec75e8f4ce7fe30100fc3a5260..79909f8f9796e5cba44df7e65ab783231cb1730c 100644 (file)
@@ -21,7 +21,7 @@ package org.apache.archiva.repository.scanner.functors;
 
 import org.apache.archiva.consumers.RepositoryContentConsumer;
 import org.apache.archiva.repository.ManagedRepository;
-import org.apache.commons.collections.Closure;
+import org.apache.commons.collections4.Closure;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index b91c663bb3d9ceaedd2ca1c9cbf1aba740ff5dfb..190beb869858599ca3b71c2bc58c04a516d39369 100644 (file)
@@ -34,8 +34,8 @@
       <artifactId>archiva-common</artifactId>
     </dependency>
     <dependency>
-      <groupId>commons-collections</groupId>
-      <artifactId>commons-collections</artifactId>
+      <groupId>org.apache.commons</groupId>
+       <artifactId>commons-collections4</artifactId>
     </dependency>
     <dependency>
       <groupId>commons-io</groupId>
index 80a81558859bcf0465885cb3bc0d9bb258da35e0..10adbd85c7283ae1023150523bffc75fc9a2c697 100644 (file)
@@ -19,7 +19,7 @@ package org.apache.archiva.xml;
  * under the License.
  */
 
-import org.apache.commons.collections.Closure;
+import org.apache.commons.collections4.Closure;
 import org.dom4j.Element;
 
 import java.util.ArrayList;
index 719a19aa12f870127cc428b7458b1b911409d454..5c3f3bc7eb3f7de2d00aaf125ff3bdfd5a27bb98 100644 (file)
@@ -157,7 +157,7 @@ public class ArchivaIndexingTaskExecutorTest
 
         assertTrue( Files.exists(basePath.resolve( ".indexer" )) );
         assertTrue( Files.exists(basePath.resolve(".index" )) );
-        assertEquals( 1, response.getTotalHits() );
+        assertEquals( 1, response.getTotalHitsCount());
 
         Set<ArtifactInfo> results = response.getResults();
 
index ff1d3fd1895924f4b0bd3a2645b93f15da784d7f..56235d6f6d3f9db70247991fb621459472eadbc2 100644 (file)
@@ -31,7 +31,8 @@ import org.apache.archiva.rest.api.services.ArchivaAdministrationService;
 import org.apache.archiva.rest.api.services.ArchivaRestServiceException;
 import org.apache.archiva.rest.services.utils.AddAdminRepoConsumerClosure;
 import org.apache.archiva.rest.services.utils.AdminRepositoryConsumerComparator;
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.stereotype.Service;
 
@@ -412,7 +413,7 @@ public class DefaultArchivaAdministrationService
         {
             AddAdminRepoConsumerClosure addAdminRepoConsumer =
                 new AddAdminRepoConsumerClosure( archivaAdministration.getKnownContentConsumers() );
-            CollectionUtils.forAllDo( repoConsumerUtil.getAvailableKnownConsumers(), addAdminRepoConsumer );
+            IterableUtils.forEach( repoConsumerUtil.getAvailableKnownConsumers(), addAdminRepoConsumer );
             List<AdminRepositoryConsumer> knownContentConsumers = addAdminRepoConsumer.getList();
             Collections.sort( knownContentConsumers, AdminRepositoryConsumerComparator.getInstance() );
             return knownContentConsumers;
@@ -431,7 +432,7 @@ public class DefaultArchivaAdministrationService
         {
             AddAdminRepoConsumerClosure addAdminRepoConsumer =
                 new AddAdminRepoConsumerClosure( archivaAdministration.getInvalidContentConsumers() );
-            CollectionUtils.forAllDo( repoConsumerUtil.getAvailableInvalidConsumers(), addAdminRepoConsumer );
+            IterableUtils.forEach( repoConsumerUtil.getAvailableInvalidConsumers(), addAdminRepoConsumer );
             List<AdminRepositoryConsumer> invalidContentConsumers = addAdminRepoConsumer.getList();
             Collections.sort( invalidContentConsumers, AdminRepositoryConsumerComparator.getInstance() );
             return invalidContentConsumers;
index 55cfbf5ecda48baaa0a05e6db700b9c6b44fb6f1..0e3a7773589be41df578b088b2a20a9f53e76877 100644 (file)
@@ -58,7 +58,7 @@ import org.apache.archiva.rest.api.services.BrowseService;
 import org.apache.archiva.rest.services.utils.ArtifactContentEntryComparator;
 import org.apache.archiva.security.ArchivaSecurityException;
 import org.apache.archiva.xml.XMLException;
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.stereotype.Service;
index 68631041ea9bcd1d1bc4f87c68df207ec508721f..7a12256ca2fc573cf7d938a8862c5d429b8126ff 100644 (file)
@@ -38,7 +38,7 @@ import org.apache.archiva.rest.api.model.SearchRequest;
 import org.apache.archiva.rest.api.model.StringList;
 import org.apache.archiva.rest.api.services.ArchivaRestServiceException;
 import org.apache.archiva.rest.api.services.SearchService;
-import org.apache.commons.collections.ListUtils;
+import org.apache.commons.collections4.ListUtils;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.stereotype.Service;
 
index 77de7a0d53a220869b410baa0ab2a64c7b011841..b757819f89e47e6006c9a16165d52f3e2ba6024d 100644 (file)
@@ -21,7 +21,7 @@ package org.apache.archiva.rest.services.utils;
 
 import org.apache.archiva.consumers.RepositoryContentConsumer;
 import org.apache.archiva.rest.api.model.AdminRepositoryConsumer;
-import org.apache.commons.collections.Closure;
+import org.apache.commons.collections4.Closure;
 
 import java.util.ArrayList;
 import java.util.List;
index 931cab4d1fe8824431ed4ce0a012aa67ef5c068c..4428130fc9e7531fa76d32ac7306e879a6d69df5 100644 (file)
@@ -32,7 +32,7 @@ import org.apache.archiva.redback.role.RoleManagerException;
 import org.apache.archiva.redback.system.check.EnvironmentCheck;
 import org.apache.archiva.redback.users.UserManager;
 import org.apache.archiva.security.common.ArchivaRoleConstants;
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.time.StopWatch;
 import org.slf4j.Logger;
index ea8e0631569e34c5f01619ce0e8b0306c89d8d05..95c5ac3d2edc04a1bfbf677eacf6b1100323322e 100644 (file)
@@ -37,7 +37,7 @@ import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator;
 import org.apache.archiva.redback.components.registry.Registry;
 import org.apache.archiva.redback.components.registry.RegistryListener;
 import org.apache.archiva.repository.ManagedRepository;
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.context.annotation.Scope;
diff --git a/pom.xml b/pom.xml
index 33f8dcb9af7e031eb07f8f8d2fef8f1784f4de22..d177f345a777a0f0dc059b30b4ff3354f7620535 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -49,7 +49,7 @@
 
   <properties>
     <commons-codec.version>1.6</commons-codec.version>
-    <commons-collections.version>3.2.1</commons-collections.version>
+    <commons-collections.version>4.1</commons-collections.version>
     <commons-fileupload.version>1.2.2</commons-fileupload.version>
     <commons-io.version>2.5</commons-io.version>
     <commons-lang.version>2.6</commons-lang.version>
         </exclusions>
       </dependency>
       <dependency>
-        <groupId>commons-collections</groupId>
-        <artifactId>commons-collections</artifactId>
+        <groupId>org.apache.commons</groupId>
+        <artifactId>commons-collections4</artifactId>
         <version>${commons-collections.version}</version>
       </dependency>
       <dependency>