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 2020/05/03 13:11:23 UTC

[maven-shared-jar] branch MSHARED-886 updated (6cb1fea -> 82fb660)

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

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


 discard 6cb1fea  [MSHARED-886] Require Java 8
     new 82fb660  [MSHARED-886] Require Java 8

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   (6cb1fea)
            \
             N -- N -- N   refs/heads/MSHARED-886 (82fb660)

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:
 Jenkinsfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[maven-shared-jar] 01/01: [MSHARED-886] Require Java 8

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

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

commit 82fb660c011f4900b278cccb7b7f3bfef4c753dc
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Sun May 3 14:28:39 2020 +0200

    [MSHARED-886] Require Java 8
---
 Jenkinsfile                                                      | 2 +-
 pom.xml                                                          | 2 +-
 src/main/java/org/apache/maven/shared/jar/JarAnalyzer.java       | 9 ++-------
 .../java/org/apache/maven/shared/jar/classes/ImportVisitor.java  | 2 +-
 .../java/org/apache/maven/shared/jar/classes/JarClasses.java     | 8 ++++----
 5 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 09ac70f..ab4282b 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -17,4 +17,4 @@
  * under the License.
  */
 
-asfMavenTlpStdBuild()
+asfMavenTlpStdBuild(jdk:['8','11','14','15'])
diff --git a/pom.xml b/pom.xml
index 72de993..aac629e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -59,7 +59,7 @@
 
   <properties>
     <mavenVersion>3.0</mavenVersion>
-    <javaVersion>7</javaVersion>
+    <javaVersion>8</javaVersion>
     <project.build.outputTimestamp>2020-04-04T09:03:59Z</project.build.outputTimestamp>
   </properties>
 
diff --git a/src/main/java/org/apache/maven/shared/jar/JarAnalyzer.java b/src/main/java/org/apache/maven/shared/jar/JarAnalyzer.java
index 077e0d9..c1c8980 100644
--- a/src/main/java/org/apache/maven/shared/jar/JarAnalyzer.java
+++ b/src/main/java/org/apache/maven/shared/jar/JarAnalyzer.java
@@ -31,6 +31,7 @@ import java.util.jar.JarFile;
 import java.util.jar.Manifest;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
+import java.util.zip.ZipEntry;
 import java.util.zip.ZipException;
 
 /**
@@ -115,13 +116,7 @@ public class JarAnalyzer
         List<JarEntry> entries = Collections.list( jarFile.entries() );
 
         // Sorting of list is done by name to ensure a bytecode hash is always consistent.
-        Collections.sort( entries, new Comparator<JarEntry>()
-        {
-            public int compare( JarEntry entry1, JarEntry entry2 )
-            {
-                return entry1.getName().compareTo( entry2.getName() );
-            }
-        } );
+        entries.sort( Comparator.comparing( ZipEntry::getName ) );
 
         Manifest manifest;
         try
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 21edbbe..ead553c 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
@@ -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.setUniqueList( new ArrayList<String>() );
+        this.imports = SetUniqueList.setUniqueList( new ArrayList<>() );
     }
 
     /**
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 a9744d0..4b6ac9b 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
@@ -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.setUniqueList( new ArrayList<String>() );
-        packages = SetUniqueList.setUniqueList( new ArrayList<String>() );
-        classNames = SetUniqueList.setUniqueList( new ArrayList<String>() );
-        methods = SetUniqueList.setUniqueList( new ArrayList<String>() );
+        imports = SetUniqueList.setUniqueList( new ArrayList<>() );
+        packages = SetUniqueList.setUniqueList( new ArrayList<>() );
+        classNames = SetUniqueList.setUniqueList( new ArrayList<>() );
+        methods = SetUniqueList.setUniqueList( new ArrayList<>() );
     }
 
     /**