Fixed another issue with the dynamic import optimization patch.


git-svn-id: https://svn.apache.org/repos/asf/incubator/felix/trunk@499541 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java b/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java
index 7545461..c1837f4 100755
--- a/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java
+++ b/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java
@@ -509,10 +509,10 @@
                 String dynPkgName = ((Requirement) dynamics[i]).getPackageName();
                 boolean wildcard = (dynPkgName.lastIndexOf(".*") >= 0);
                 dynPkgName = (wildcard)
-                    ? dynPkgName.substring(0, dynPkgName.length() - 1) : dynPkgName;
+                    ? dynPkgName.substring(0, dynPkgName.length() - 2) : dynPkgName;
                 if (dynPkgName.equals("*") ||
                     pkgName.equals(dynPkgName) ||
-                    (wildcard && pkgName.startsWith(dynPkgName)))
+                    (wildcard && pkgName.startsWith(dynPkgName + ".")))
                 {
                     // Constrain the current dynamic requirement to include
                     // the precise package name for which we are searching; this