You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by ri...@apache.org on 2009/04/27 11:28:22 UTC

svn commit: r768907 - /felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/Resolver.java

Author: rickhall
Date: Mon Apr 27 09:28:22 2009
New Revision: 768907

URL: http://svn.apache.org/viewvc?rev=768907&view=rev
Log:
Modified dynamic import wildcard matching to not match classes, only packages.
(FELIX-1059)

Modified:
    felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/Resolver.java

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/Resolver.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/Resolver.java?rev=768907&r1=768906&r2=768907&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/Resolver.java (original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/Resolver.java Mon Apr 27 09:28:22 2009
@@ -218,13 +218,14 @@
         // package name; this means we have to do wildcard matching.
         String dynPkgName = ((Requirement) dynReq).getPackageName();
         boolean wildcard = (dynPkgName.lastIndexOf(".*") >= 0);
+        // Remove the "*", but keep the "." if wildcarded.
         dynPkgName = (wildcard)
-            ? dynPkgName.substring(0, dynPkgName.length() - 2) : dynPkgName;
+            ? dynPkgName.substring(0, dynPkgName.length() - 1) : dynPkgName;
         // If the dynamic requirement matches the package name, then
         // create a new requirement for the specific package.
         if (dynPkgName.equals("*") ||
             pkgName.equals(dynPkgName) ||
-            (wildcard && pkgName.startsWith(dynPkgName + ".")))
+            (wildcard && pkgName.startsWith(dynPkgName)))
         {
             // Create a new requirement based on the dynamic requirement,
             // but substitute the precise package name for which we are