zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ph...@apache.org
Subject svn commit: r1420548 - in /zookeeper/branches/branch-3.4: CHANGES.txt src/java/main/org/apache/zookeeper/version/util/VerGen.java src/java/test/org/apache/zookeeper/VerGenTest.java
Date Wed, 12 Dec 2012 07:21:02 GMT
Author: phunt
Date: Wed Dec 12 07:21:00 2012
New Revision: 1420548

URL: http://svn.apache.org/viewvc?rev=1420548&view=rev
Log:
ZOOKEEPER-1598. Ability to support more digits in the version string (Raja Aluri via phunt)

Modified:
    zookeeper/branches/branch-3.4/CHANGES.txt
    zookeeper/branches/branch-3.4/src/java/main/org/apache/zookeeper/version/util/VerGen.java
    zookeeper/branches/branch-3.4/src/java/test/org/apache/zookeeper/VerGenTest.java

Modified: zookeeper/branches/branch-3.4/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.4/CHANGES.txt?rev=1420548&r1=1420547&r2=1420548&view=diff
==============================================================================
--- zookeeper/branches/branch-3.4/CHANGES.txt (original)
+++ zookeeper/branches/branch-3.4/CHANGES.txt Wed Dec 12 07:21:00 2012
@@ -20,6 +20,9 @@ IMPROVEMENTS:
   ZOOKEEPER-1564. Allow JUnit test build with IBM Java
     (Paulo Ricardo Paz Vital via phunt)
 
+  ZOOKEEPER-1598. Ability to support more digits in the version string
+  (Raja Aluri via phunt)
+
 
 Release 3.4.5 - 2012-09-30
 

Modified: zookeeper/branches/branch-3.4/src/java/main/org/apache/zookeeper/version/util/VerGen.java
URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.4/src/java/main/org/apache/zookeeper/version/util/VerGen.java?rev=1420548&r1=1420547&r2=1420548&view=diff
==============================================================================
--- zookeeper/branches/branch-3.4/src/java/main/org/apache/zookeeper/version/util/VerGen.java
(original)
+++ zookeeper/branches/branch-3.4/src/java/main/org/apache/zookeeper/version/util/VerGen.java
Wed Dec 12 07:21:00 2012
@@ -112,11 +112,11 @@ public class VerGen {
         public int micro;
         public String qualifier;
     }
-    
+
     public static Version parseVersionString(String input) {
         Version result = new Version();
 
-        Pattern p = Pattern.compile("^(\\d+).(\\d+).(\\d+)(-(.+))?$");
+        Pattern p = Pattern.compile("^(\\d+)\\.(\\d+)\\.(\\d+)((\\.\\d+)*)(-(.+))?$");
         Matcher m = p.matcher(input);
 
         if (!m.matches()) {
@@ -125,8 +125,8 @@ public class VerGen {
         result.maj = Integer.parseInt(m.group(1));
         result.min = Integer.parseInt(m.group(2));
         result.micro = Integer.parseInt(m.group(3));
-        if (m.groupCount() == 5) {
-            result.qualifier = m.group(5);
+        if (m.groupCount() == 7) {
+            result.qualifier = m.group(7);
         } else {
             result.qualifier = null;
         }

Modified: zookeeper/branches/branch-3.4/src/java/test/org/apache/zookeeper/VerGenTest.java
URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.4/src/java/test/org/apache/zookeeper/VerGenTest.java?rev=1420548&r1=1420547&r2=1420548&view=diff
==============================================================================
--- zookeeper/branches/branch-3.4/src/java/test/org/apache/zookeeper/VerGenTest.java (original)
+++ zookeeper/branches/branch-3.4/src/java/test/org/apache/zookeeper/VerGenTest.java Wed Dec
12 07:21:00 2012
@@ -43,7 +43,10 @@ public class VerGenTest extends ZKTestCa
                             {"1.2.3", new Object[] {1, 2, 3, null}},
                             {"1.2.3-dev", new Object[] {1, 2, 3, "dev"}},
                             {"1.2.3-SNAPSHOT", new Object[] {1, 2, 3, "SNAPSHOT"}},
-                            {"1.2.3-foo-bar+123", new Object[] {1, 2, 3, "foo-bar+123"}}
+                            {"1.2.3-SNAPSHOT", new Object[] {1, 2, 3, "SNAPSHOT"}},
+                            {"1.2.3-foo-bar+123", new Object[] {1, 2, 3, "foo-bar+123"}},
+                            {"1.2.3.4.5-SNAPSHOT", new Object[] {1, 2, 3, "SNAPSHOT"}},
+                            {"1.2.3.4.5-foo-bar+123", new Object[] {1, 2, 3, "foo-bar+123"}}
             });
     }
 



Mime
View raw message