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:56:31 UTC

[maven] branch MNG-6643 updated (cb38a48 -> 80c6fe3)

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 cb38a48  [MNG-6643] - Version comparison CLI does not work anymore
     new 80c6fe3  [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   (cb38a48)
            \
             N -- N -- N   refs/heads/MNG-6643 (80c6fe3)

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:
 .../java/org/apache/maven/artifact/versioning/ComparableVersion.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[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 80c6fe3a01aac53c083f1ae21375e305f3ff7dcb
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      | 15 ++++++++++-----
 1 file changed, 10 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..568ee44 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,19 @@ 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 );
+            }
+        }
+        return buf;
     }
 
     @Override