You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2019/10/19 20:21:30 UTC

[maven-shared-jar] branch MSHARED-841 updated (54498b1 -> f399b81)

This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a change to branch MSHARED-841
in repository https://gitbox.apache.org/repos/asf/maven-shared-jar.git.


 discard 54498b1  [MSHARED-841] Upgrade to Commons Collections 4.2
     add cfd311c  [MSHARED-824] Move code to Java 7 level
     new f399b81  [MSHARED-841] Upgrade to Commons Collections 4.2

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (54498b1)
            \
             N -- N -- N   refs/heads/MSHARED-841 (f399b81)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/maven/shared/jar/JarAnalyzer.java   |  2 +-
 .../maven/shared/jar/classes/ImportVisitor.java    |  2 +-
 .../shared/jar/classes/JarClassesAnalysis.java     |  8 +++----
 .../jar/identification/JarIdentification.java      | 10 ++++-----
 .../exposers/EmbeddedMavenModelExposer.java        |  2 +-
 .../exposers/RepositorySearchExposer.java          |  2 +-
 .../identification/exposers/TextFileExposer.java   | 11 ++--------
 .../hash/JarBytecodeHashAnalyzer.java              | 25 +++++-----------------
 .../shared/jar/AbstractJarAnalyzerTestCase.java    | 15 +++++++------
 .../apache/maven/shared/jar/JarAnalyzerTest.java   |  1 -
 10 files changed, 28 insertions(+), 50 deletions(-)


[maven-shared-jar] 01/01: [MSHARED-841] Upgrade to Commons Collections 4.2

Posted by sl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch MSHARED-841
in repository https://gitbox.apache.org/repos/asf/maven-shared-jar.git

commit f399b81c7a4a95b48f8f196b1c581dc709bdf159
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Sat Oct 19 22:09:28 2019 +0200

    [MSHARED-841] Upgrade to Commons Collections 4.2
---
 pom.xml                                                        |  7 ++++---
 .../org/apache/maven/shared/jar/classes/ImportVisitor.java     |  4 ++--
 .../java/org/apache/maven/shared/jar/classes/JarClasses.java   | 10 +++++-----
 .../shared/jar/identification/exposers/TimestampExposer.java   | 10 +++++-----
 4 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/pom.xml b/pom.xml
index 27ef7ca..4689989 100644
--- a/pom.xml
+++ b/pom.xml
@@ -99,11 +99,12 @@
     </dependency>
 
     <dependency>
-      <groupId>commons-collections</groupId>
-      <artifactId>commons-collections</artifactId>
-      <version>3.1</version>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-collections4</artifactId>
+      <version>4.2</version><!-- Java 7 -->
     </dependency>
 
+
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
diff --git a/src/main/java/org/apache/maven/shared/jar/classes/ImportVisitor.java b/src/main/java/org/apache/maven/shared/jar/classes/ImportVisitor.java
index 94026d1..21edbbe 100644
--- a/src/main/java/org/apache/maven/shared/jar/classes/ImportVisitor.java
+++ b/src/main/java/org/apache/maven/shared/jar/classes/ImportVisitor.java
@@ -23,7 +23,7 @@ import org.apache.bcel.classfile.ConstantClass;
 import org.apache.bcel.classfile.ConstantUtf8;
 import org.apache.bcel.classfile.EmptyVisitor;
 import org.apache.bcel.classfile.JavaClass;
-import org.apache.commons.collections.list.SetUniqueList;
+import org.apache.commons.collections4.list.SetUniqueList;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -68,7 +68,7 @@ public class ImportVisitor
 
         // Create a list that is guaranteed to be unique while retaining it's list qualities (LinkedHashSet does not
         // expose the list interface even if natural ordering is retained)  
-        this.imports = SetUniqueList.decorate( new ArrayList<String>() );
+        this.imports = SetUniqueList.setUniqueList( new ArrayList<String>() );
     }
 
     /**
diff --git a/src/main/java/org/apache/maven/shared/jar/classes/JarClasses.java b/src/main/java/org/apache/maven/shared/jar/classes/JarClasses.java
index b17298e..a9744d0 100644
--- a/src/main/java/org/apache/maven/shared/jar/classes/JarClasses.java
+++ b/src/main/java/org/apache/maven/shared/jar/classes/JarClasses.java
@@ -19,7 +19,7 @@ package org.apache.maven.shared.jar.classes;
  * under the License.
  */
 
-import org.apache.commons.collections.list.SetUniqueList;
+import org.apache.commons.collections4.list.SetUniqueList;
 
 import java.util.ArrayList;
 import java.util.Collections;
@@ -71,10 +71,10 @@ public class JarClasses
     {
         // Unique list decorators are used to ensure natural ordering is retained, the list interface is availble, and
         // that duplicates are not entered.
-        imports = SetUniqueList.decorate( new ArrayList<String>() );
-        packages = SetUniqueList.decorate( new ArrayList<String>() );
-        classNames = SetUniqueList.decorate( new ArrayList<String>() );
-        methods = SetUniqueList.decorate( new ArrayList<String>() );
+        imports = SetUniqueList.setUniqueList( new ArrayList<String>() );
+        packages = SetUniqueList.setUniqueList( new ArrayList<String>() );
+        classNames = SetUniqueList.setUniqueList( new ArrayList<String>() );
+        methods = SetUniqueList.setUniqueList( new ArrayList<String>() );
     }
 
     /**
diff --git a/src/main/java/org/apache/maven/shared/jar/identification/exposers/TimestampExposer.java b/src/main/java/org/apache/maven/shared/jar/identification/exposers/TimestampExposer.java
index 5443985..ef67913 100644
--- a/src/main/java/org/apache/maven/shared/jar/identification/exposers/TimestampExposer.java
+++ b/src/main/java/org/apache/maven/shared/jar/identification/exposers/TimestampExposer.java
@@ -19,8 +19,8 @@ package org.apache.maven.shared.jar.identification.exposers;
  * under the License.
  */
 
-import org.apache.commons.collections.Bag;
-import org.apache.commons.collections.bag.HashBag;
+import org.apache.commons.collections4.Bag;
+import org.apache.commons.collections4.bag.HashBag;
 import org.apache.maven.shared.jar.JarAnalyzer;
 import org.apache.maven.shared.jar.identification.JarIdentification;
 import org.apache.maven.shared.jar.identification.JarIdentificationExposer;
@@ -44,7 +44,7 @@ public class TimestampExposer
     {
         List<JarEntry> entries = jarAnalyzer.getEntries();
         SimpleDateFormat tsformat = new SimpleDateFormat( "yyyyMMdd", Locale.US ); //$NON-NLS-1$
-        Bag timestamps = new HashBag();
+        Bag<String> timestamps = new HashBag<>();
         for ( JarEntry entry : entries )
         {
             long time = entry.getTime();
@@ -54,12 +54,12 @@ public class TimestampExposer
 
         String ts = "";
         int tsmax = 0;
-        for ( Object timestamp : timestamps )
+        for ( String timestamp : timestamps )
         {
             int count = timestamps.getCount( timestamp );
             if ( count > tsmax )
             {
-                ts = (String) timestamp;
+                ts = timestamp;
                 tsmax = count;
             }
         }