You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2019/04/24 17:38:37 UTC

[maven] branch MNG-6643 updated (b1d04de -> 9f864f7)

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

khmarbaise pushed a change to branch MNG-6643
in repository https://gitbox.apache.org/repos/asf/maven.git.


 discard b1d04de  [MNG-6643] - Version comparison CLI does not work anymore
     new 9f864f7  [MNG-6643] - Version comparison CLI does not work anymore

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   (b1d04de)
            \
             N -- N -- N   refs/heads/MNG-6643 (9f864f7)

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:
 .../apache/maven/artifact/versioning/ComparableVersion.java  | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)


[maven] 01/01: [MNG-6643] - Version comparison CLI does not work anymore

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

khmarbaise pushed a commit to branch MNG-6643
in repository https://gitbox.apache.org/repos/asf/maven.git

commit 9f864f760061737a2586dd3d18c41e040f1549d7
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Tue Apr 23 20:47:45 2019 +0200

    [MNG-6643] - Version comparison CLI does not work anymore
---
 .../maven/artifact/versioning/ComparableVersion.java       | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ComparableVersion.java b/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ComparableVersion.java
index c0ad57d..8d22af8 100644
--- a/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ComparableVersion.java
+++ b/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ComparableVersion.java
@@ -29,8 +29,6 @@ import java.util.List;
 import java.util.Locale;
 import java.util.Properties;
 
-import org.apache.commons.lang3.StringUtils;
-
 /**
  * <p>
  * Generic implementation of version comparison.
@@ -609,12 +607,18 @@ public class ComparableVersion
 
     private static String stripLeadingZeroes( String buf )
     {
-        String strippedBuf = StringUtils.stripStart( buf, "0" );
-        if ( strippedBuf.isEmpty() )
+        if ( buf == null || buf.isEmpty())
         {
             return "0";
         }
-        return strippedBuf;
+        for ( int i = 0; i < buf.length(); ++i )
+        {
+            char c = buf.charAt( i );
+            if ( c != '0' )
+            {
+                return buf.substring( i );
+            }
+        }
     }
 
     @Override