Substring parsing was incorrectly disallowing parentheses characters. (FELIX-2762)


git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1163265 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/capabilityset/SimpleFilter.java b/framework/src/main/java/org/apache/felix/framework/capabilityset/SimpleFilter.java
index 92c6254..cc4e0fe 100644
--- a/framework/src/main/java/org/apache/felix/framework/capabilityset/SimpleFilter.java
+++ b/framework/src/main/java/org/apache/felix/framework/capabilityset/SimpleFilter.java
@@ -401,12 +401,7 @@
 
             // Read the next character and account for escapes.
             char c = value.charAt(idx++);
-            if (!escaped && ((c == '(') || (c == ')')))
-            {
-                throw new IllegalArgumentException(
-                    "Illegal value: " + value);
-            }
-            else if (!escaped && (c == '*'))
+            if (!escaped && (c == '*'))
             {
                 if (wasStar)
                 {
diff --git a/framework/src/test/java/org/apache/felix/framework/capabilityset/SimpleFilterTest.java b/framework/src/test/java/org/apache/felix/framework/capabilityset/SimpleFilterTest.java
index f604ba5..d7e85a6 100644
--- a/framework/src/test/java/org/apache/felix/framework/capabilityset/SimpleFilterTest.java
+++ b/framework/src/test/java/org/apache/felix/framework/capabilityset/SimpleFilterTest.java
@@ -70,5 +70,8 @@
         assertTrue("Should match!", SimpleFilter.compareSubstring(pieces, "sdffoobsdfbar"));
         assertTrue("Should match!", SimpleFilter.compareSubstring(pieces, "sdffoobsdfbarlj"));
         assertFalse("Should not match!", SimpleFilter.compareSubstring(pieces, "sdffobsdfbarlj"));
+
+        pieces = SimpleFilter.parseSubstring("*foo(*bar*");
+        assertTrue("Should match!", SimpleFilter.compareSubstring(pieces, "foo()bar"));
     }
 }