You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2019/03/22 00:27:38 UTC

[GitHub] [maven] belingueres commented on a change in pull request #234: [MNG-6572] - use int or long instead of BigIntegers for little numbers in ComparableVersion

belingueres commented on a change in pull request #234: [MNG-6572] - use int or long instead of BigIntegers for little numbers in ComparableVersion
URL: https://github.com/apache/maven/pull/234#discussion_r268004441
 
 

 ##########
 File path: maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ComparableVersion.java
 ##########
 @@ -82,48 +92,174 @@
     }
 
     /**
-     * Represents a numeric item in the version item list.
+     * Represents a numeric item in the version item list that can be represented with an int.
      */
-    private static class IntegerItem
+    private static class IntItem
         implements Item
     {
-        private static final BigInteger BIG_INTEGER_ZERO = new BigInteger( "0" );
+        private final int value;
 
-        private final BigInteger value;
+        public static final IntItem ZERO = new IntItem();
+
+        private IntItem()
 
 Review comment:
   It construct a reusable Item instance representing a zero in a version string. If deleted, that instance must be constructed using an unnecessary string parse: new IntItem("0").

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services