Author: mcculls
Date: Tue Jul  8 07:14:08 2008
New Revision: 674836

URL: http://svn.apache.org/viewvc?rev=674836&view=rev
Log:
FELIX-547: fix VersionRange test to allow [1.0,1.0] ranges

Modified:
    
felix/trunk/bundleplugin/src/main/java/org/osgi/impl/bundle/obr/resource/VersionRange.java

Modified: 
felix/trunk/bundleplugin/src/main/java/org/osgi/impl/bundle/obr/resource/VersionRange.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/org/osgi/impl/bundle/obr/resource/VersionRange.java?rev=674836&r1=674835&r2=674836&view=diff
==============================================================================
--- 
felix/trunk/bundleplugin/src/main/java/org/osgi/impl/bundle/obr/resource/VersionRange.java
 (original)
+++ 
felix/trunk/bundleplugin/src/main/java/org/osgi/impl/bundle/obr/resource/VersionRange.java
 Tue Jul  8 07:14:08 2008
@@ -1,5 +1,5 @@
 /*
- * $Id: VersionRange.java 45 2007-10-01 12:56:02Z [EMAIL PROTECTED] $
+ * $Id: VersionRange.java 46 2008-01-17 19:05:21Z [EMAIL PROTECTED] $
  * 
  * Copyright (c) OSGi Alliance (2002, 2006, 2007). All Rights Reserved.
  * 
@@ -28,19 +28,19 @@
        char start = '[';
        char end = ']';
 
-       static String V = 
"\\s*[0-9]+(\\.[0-9]+(\\.[0-9]+(\\.[a-zA-Z0-9_-]+)?)?)?\\s*";
-       static Pattern RANGE = Pattern.compile("(\\(|\\[)(" + V + "),(" + V
-                       + ")(\\)|\\])");
+       static String V = "[0-9]+(\\.[0-9]+(\\.[0-9]+(\\.[a-zA-Z0-9_-]+)?)?)?";
+       static Pattern RANGE = Pattern.compile("(\\(|\\[)\\s*(" + V + 
")\\s*,\\s*(" + V
+                       + ")\\s*(\\)|\\])");
 
        public VersionRange(String string) {
                string = string.trim();
                Matcher m = RANGE.matcher(string);
                if (m.matches()) {
                        start = m.group(1).charAt(0);
-                       low = new Version(m.group(2).trim());
-                       high = new Version(m.group(6).trim());
+                       low = new Version(m.group(2));
+                       high = new Version(m.group(6));
                        end = m.group(10).charAt(0);
-                       if (low.compareTo(high) >= 0)
+                       if (low.compareTo(high) > 0)
                                throw new IllegalArgumentException(
                                                "Low Range is higher than High 
Range: " + low + "-"
                                                                + high);
@@ -116,4 +116,4 @@
                else
                        return 1;
        }
-}
\ No newline at end of file
+}


Reply via email to