felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r885949 - in /felix/trunk/framework/src/main/java/org/apache/felix/framework: ModuleImpl.java searchpolicy/Resolver.java
Date Tue, 01 Dec 2009 21:41:56 GMT
Author: rickhall
Date: Tue Dec  1 21:41:56 2009
New Revision: 885949

URL: http://svn.apache.org/viewvc?rev=885949&view=rev
Log:
Check for default package. (FELIX-1867)

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

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/ModuleImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/ModuleImpl.java?rev=885949&r1=885948&r2=885949&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/ModuleImpl.java (original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/ModuleImpl.java Tue Dec
 1 21:41:56 2009
@@ -1667,7 +1667,9 @@
                     if (m_logger.getLogLevel() >= Logger.LOG_DEBUG)
                     {
                         msg = diagnoseClassLoadError(m_resolver, ModuleImpl.this, name);
-                        ex = new ClassNotFoundException(msg, cnfe);
+                        ex = (msg != null)
+                            ? new ClassNotFoundException(msg, cnfe)
+                            : ex;
                     }
                     throw ex;
                 }
@@ -1996,6 +1998,10 @@
 
         // Get package name.
         String pkgName = Util.getClassPackage(name);
+        if (pkgName.length() == 0)
+        {
+            return null;
+        }
 
         // First, get the bundle ID of the module doing the class loader.
         long impId = module.getBundle().getBundleId();

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=885949&r1=885948&r2=885949&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
Tue Dec  1 21:41:56 2009
@@ -206,6 +206,12 @@
 
     public static IRequirement findAllowedDynamicImport(IModule importer, String pkgName)
     {
+        // We cannot import the default package, so return null in that case.
+        if (pkgName.length() == 0)
+        {
+            return null;
+        }
+
         // If any of the module exports this package, then we cannot
         // attempt to dynamically import it.
         ICapability[] caps = importer.getCapabilities();



Mime
View raw message