karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1448013 - /karaf/trunk/tooling/exam/container/src/main/java/org/apache/karaf/tooling/exam/container/internal/adaptions/KarafManipulatorFactory.java
Date Wed, 20 Feb 2013 06:22:26 GMT
Author: ffang
Date: Wed Feb 20 06:22:25 2013
New Revision: 1448013

URL: http://svn.apache.org/r1448013
Log:
[KARAF-2167]org.apache.karaf.tooling.exam.container.internal.adaptions.KarafManipulatorFactory
creates invalid version qualifier

Modified:
    karaf/trunk/tooling/exam/container/src/main/java/org/apache/karaf/tooling/exam/container/internal/adaptions/KarafManipulatorFactory.java

Modified: karaf/trunk/tooling/exam/container/src/main/java/org/apache/karaf/tooling/exam/container/internal/adaptions/KarafManipulatorFactory.java
URL: http://svn.apache.org/viewvc/karaf/trunk/tooling/exam/container/src/main/java/org/apache/karaf/tooling/exam/container/internal/adaptions/KarafManipulatorFactory.java?rev=1448013&r1=1448012&r2=1448013&view=diff
==============================================================================
--- karaf/trunk/tooling/exam/container/src/main/java/org/apache/karaf/tooling/exam/container/internal/adaptions/KarafManipulatorFactory.java
(original)
+++ karaf/trunk/tooling/exam/container/src/main/java/org/apache/karaf/tooling/exam/container/internal/adaptions/KarafManipulatorFactory.java
Wed Feb 20 06:22:25 2013
@@ -28,7 +28,18 @@ public final class KarafManipulatorFacto
     }
 
     public static KarafManipulator createManipulator(String karafVersion) {
-        Version version = new Version(karafVersion.replaceFirst("-", "."));
+        int dots = 0;
+        int i = 0;
+        while ((i = karafVersion.indexOf('.', i)) != -1) {
+            dots++;
+            i++;
+        }
+        Version version;
+        if (dots < 3) {           
+            version = new Version(karafVersion.replaceFirst("-", "."));
+        } else {
+            version = new Version(karafVersion);
+        }        
         if (version.getMajor() < 2 || version.getMajor() == 2 && version.getMinor()
< 2) {
             throw new IllegalArgumentException("Karaf versions < 2.2.0 are not supported");
         }



Mime
View raw message