FELIX-547: fix VersionRange test to allow [1.0,1.0] ranges

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@674836 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundleplugin/src/main/java/org/osgi/impl/bundle/obr/resource/VersionRange.java b/bundleplugin/src/main/java/org/osgi/impl/bundle/obr/resource/VersionRange.java
index afc99fc..39e666e 100644
--- a/bundleplugin/src/main/java/org/osgi/impl/bundle/obr/resource/VersionRange.java
+++ b/bundleplugin/src/main/java/org/osgi/impl/bundle/obr/resource/VersionRange.java
@@ -1,5 +1,5 @@
 /*

- * $Id: VersionRange.java 45 2007-10-01 12:56:02Z peter.kriens@aqute.biz $

+ * $Id: VersionRange.java 46 2008-01-17 19:05:21Z peter.kriens@aqute.biz $

  * 

  * 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
+}