Repository: james-project
Updated Branches:
  refs/heads/master 9c3aa9f50 -> 86debb669


JAMES-2472 Upgrade commons-collection to 4.2

Dependency can be simply dropped in many places


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/ac0c84c8
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/ac0c84c8
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/ac0c84c8

Branch: refs/heads/master
Commit: ac0c84c896e48e2e26fb5dc691445901910f381e
Parents: 325cb7a
Author: benwa <btell...@linagora.com>
Authored: Wed Jul 18 10:32:21 2018 +0700
Committer: Matthieu Baechler <matth...@apache.org>
Committed: Fri Jul 20 10:03:52 2018 +0200

----------------------------------------------------------------------
 mailet/mailetdocs-maven-plugin/pom.xml          |  4 ---
 .../james/mailet/AbstractMailetdocsReport.java  | 35 +++++---------------
 pom.xml                                         |  8 +----
 server/container/spring/pom.xml                 |  4 ---
 server/mailet/mailets/pom.xml                   |  4 ---
 5 files changed, 10 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/ac0c84c8/mailet/mailetdocs-maven-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/mailet/mailetdocs-maven-plugin/pom.xml 
b/mailet/mailetdocs-maven-plugin/pom.xml
index 6f3be1f..75adfac 100644
--- a/mailet/mailetdocs-maven-plugin/pom.xml
+++ b/mailet/mailetdocs-maven-plugin/pom.xml
@@ -50,10 +50,6 @@
             <artifactId>qdox</artifactId>
         </dependency>
         <dependency>
-            <groupId>commons-collections</groupId>
-            <artifactId>commons-collections</artifactId>
-        </dependency>
-        <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <scope>test</scope>

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac0c84c8/mailet/mailetdocs-maven-plugin/src/main/java/org/apache/james/mailet/AbstractMailetdocsReport.java
----------------------------------------------------------------------
diff --git 
a/mailet/mailetdocs-maven-plugin/src/main/java/org/apache/james/mailet/AbstractMailetdocsReport.java
 
b/mailet/mailetdocs-maven-plugin/src/main/java/org/apache/james/mailet/AbstractMailetdocsReport.java
index 0e11422..44b6ce2 100644
--- 
a/mailet/mailetdocs-maven-plugin/src/main/java/org/apache/james/mailet/AbstractMailetdocsReport.java
+++ 
b/mailet/mailetdocs-maven-plugin/src/main/java/org/apache/james/mailet/AbstractMailetdocsReport.java
@@ -23,8 +23,6 @@ import java.util.Comparator;
 import java.util.List;
 import java.util.Locale;
 
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.collections.Predicate;
 import org.apache.maven.doxia.siterenderer.Renderer;
 import org.apache.maven.plugins.annotations.Component;
 import org.apache.maven.plugins.annotations.Parameter;
@@ -32,6 +30,7 @@ import org.apache.maven.project.MavenProject;
 import org.apache.maven.reporting.AbstractMavenReport;
 import org.apache.maven.reporting.MavenReportException;
 
+import com.github.steveash.guavate.Guavate;
 import com.google.common.base.Strings;
 
 /**
@@ -58,23 +57,6 @@ public abstract class AbstractMailetdocsReport extends 
AbstractMavenReport {
     @Component
     private Renderer siteRenderer;
 
-    /**
-     * Extracts only a given type from a list.
-     */
-    private static final class TypePredicate implements Predicate {
-        
-        private final MailetMatcherDescriptor.Type type;
-
-        public TypePredicate(MailetMatcherDescriptor.Type typeMatcher) {
-            this.type = typeMatcher;
-        }
-
-        @Override
-        public boolean evaluate(Object subject) {
-            return ((MailetMatcherDescriptor) subject).getType() == type;
-        }
-    }
-
     @Override
     protected void executeReport(Locale locale) throws MavenReportException {
         
@@ -106,13 +88,14 @@ public abstract class AbstractMailetdocsReport extends 
AbstractMavenReport {
     private void writeDescriptions() {
         
         final List<MailetMatcherDescriptor> descriptors = 
buildSortedDescriptors();
-        
-        @SuppressWarnings("unchecked")
-        final List<MailetMatcherDescriptor> matchers = 
(List<MailetMatcherDescriptor>) CollectionUtils.select(descriptors,
-                new TypePredicate(MailetMatcherDescriptor.Type.MATCHER));
-        @SuppressWarnings("unchecked")
-        final List<MailetMatcherDescriptor> mailets = 
(List<MailetMatcherDescriptor>) CollectionUtils.select(descriptors,
-                new TypePredicate(MailetMatcherDescriptor.Type.MAILET));
+
+        final List<MailetMatcherDescriptor> matchers = descriptors.stream()
+            .filter(descriptor -> descriptor.getType() == 
MailetMatcherDescriptor.Type.MATCHER)
+            .collect(Guavate.toImmutableList());
+
+        final List<MailetMatcherDescriptor> mailets = descriptors.stream()
+            .filter(descriptor -> descriptor.getType() == 
MailetMatcherDescriptor.Type.MAILET)
+            .collect(Guavate.toImmutableList());
         
         final boolean matchersExist = matchers.size() > 0;
         final boolean mailetsExist = mailets.size() > 0;

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac0c84c8/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 3bc991a..ab09f25 100644
--- a/pom.xml
+++ b/pom.xml
@@ -604,7 +604,6 @@
         <slf4j.version>1.7.25</slf4j.version>
         <servlet-api.version>2.4</servlet-api.version>
         <commons-daemon.version>1.0.10</commons-daemon.version>
-        <commons-collections.version>3.2.2</commons-collections.version>
         <commons-lang.version>2.6</commons-lang.version>
         <commons-cli.version>1.4</commons-cli.version>
         <commons-pool.version>1.6</commons-pool.version>
@@ -1748,11 +1747,6 @@
                 <version>${commons-cli.version}</version>
             </dependency>
             <dependency>
-                <groupId>commons-collections</groupId>
-                <artifactId>commons-collections</artifactId>
-                <version>${commons-collections.version}</version>
-            </dependency>
-            <dependency>
                 <groupId>commons-configuration</groupId>
                 <artifactId>commons-configuration</artifactId>
                 <version>${commons-configuration.version}</version>
@@ -2011,7 +2005,7 @@
             <dependency>
                 <groupId>org.apache.commons</groupId>
                 <artifactId>commons-collections4</artifactId>
-                <version>4.1</version>
+                <version>4.2</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.commons</groupId>

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac0c84c8/server/container/spring/pom.xml
----------------------------------------------------------------------
diff --git a/server/container/spring/pom.xml b/server/container/spring/pom.xml
index 152ab21..0598fd0 100644
--- a/server/container/spring/pom.xml
+++ b/server/container/spring/pom.xml
@@ -89,10 +89,6 @@
             <artifactId>javax.mail</artifactId>
         </dependency>
         <dependency>
-            <groupId>commons-collections</groupId>
-            <artifactId>commons-collections</artifactId>
-        </dependency>
-        <dependency>
             <groupId>commons-configuration</groupId>
             <artifactId>commons-configuration</artifactId>
         </dependency>

http://git-wip-us.apache.org/repos/asf/james-project/blob/ac0c84c8/server/mailet/mailets/pom.xml
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/pom.xml b/server/mailet/mailets/pom.xml
index e48611b..d60eba1 100644
--- a/server/mailet/mailets/pom.xml
+++ b/server/mailet/mailets/pom.xml
@@ -191,10 +191,6 @@
             <artifactId>javax.mail</artifactId>
         </dependency>
         <dependency>
-            <groupId>commons-collections</groupId>
-            <artifactId>commons-collections</artifactId>
-        </dependency>
-        <dependency>
             <groupId>javax.inject</groupId>
             <artifactId>javax.inject</artifactId>
         </dependency>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to