felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r768904 - /felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/ModuleImpl.java
Date Mon, 27 Apr 2009 09:18:08 GMT
Author: rickhall
Date: Mon Apr 27 09:18:07 2009
New Revision: 768904

URL: http://svn.apache.org/viewvc?rev=768904&view=rev
Log:
Fixed boot delegation wildcard matching so that it doesn't match class
names, only packages. (FELIX-1034)

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

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/ModuleImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/ModuleImpl.java?rev=768904&r1=768903&r2=768904&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/ModuleImpl.java
(original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/ModuleImpl.java
Mon Apr 27 09:18:07 2009
@@ -1302,25 +1302,12 @@
             for (int i = 0; !result && (i < m_bootPkgs.length); i++)
             {
                 // Check if the boot package is wildcarded.
-                if (m_bootPkgWildcards[i])
+                // A wildcarded boot package will be in the form "foo.",
+                // so a matching subpackage will start with "foo.", e.g.,
+                // "foo.bar".
+                if (m_bootPkgWildcards[i] && pkgName.startsWith(m_bootPkgs[i]))
                 {
-                    // A wildcarded boot package will be in the form "foo.",
-                    // so a matching subpackage will start with "foo.", e.g.,
-                    // "foo.bar".
-                    if (pkgName.startsWith(m_bootPkgs[i]))
-                    {
-                        return true;
-                    }
-                    // If we have "foo." as our wildcarded boot package, then
-                    // the package "foo" should be delegated too, but we don't
-                    // want to delegate "foobar", so we check to make sure the
-                    // package names are the same length and then perform a
-                    // region match to ignore the "." on "foo.".
-                    else if ((pkgName.length() == m_bootPkgs[i].length() - 1)
-                        && pkgName.regionMatches(0, m_bootPkgs[i], 0, m_bootPkgs[i].length()
- 1))
-                    {
-                        return true;
-                    }
+                    return true;
                 }
                 // If not wildcarded, then check for an exact match.
                 else if (m_bootPkgs[i].equals(pkgName))



Mime
View raw message