You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Richard S. Hall (JIRA)" <ji...@apache.org> on 2008/11/08 17:26:44 UTC

[jira] Assigned: (FELIX-808) The method R4SearchPolicyCore.searchDynamicImports( IModule module, String name, String pkgName, boolean isClass) always load a class by using the current thrad class loader even if the object to load is a resource.

     [ https://issues.apache.org/jira/browse/FELIX-808?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard S. Hall reassigned FELIX-808:
-------------------------------------

    Assignee: Richard S. Hall

> The method R4SearchPolicyCore.searchDynamicImports(         IModule module, String name, String pkgName, boolean isClass) always load a class by using the current thrad class loader even if  the object to load is a resource.
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-808
>                 URL: https://issues.apache.org/jira/browse/FELIX-808
>             Project: Felix
>          Issue Type: Bug
>    Affects Versions: felix-1.4.0
>            Reporter: eyindanga
>            Assignee: Richard S. Hall
>
> The method R4SearchPolicyCore.searchDynamicImports( IModule module, String name, String pkgName, boolean isClass) always load a class by using the current thrad class loader even if  the object to laod is a resource.
> This code may chek if the object is a class or a resource, and invoke the coresponding method on the classloader.
>                // If there are no bundles providing exports for this
>                 // package and if the instigating class was not from a
>                 // bundle, then delegate to the parent class loader.
>                 // Otherwise, break out of loop and return null.
>                 boolean delegate = true;
>                 for (ClassLoader cl = classes[i].getClassLoader(); cl != null; cl = cl.getClass().getClassLoader())
>                 {
>                     if (ContentClassLoader.class.isInstance(cl))
>                     {
>                         delegate = false;
>                         break;
>                     }
>                 }
>                 if (delegate)
>                 {
>                     return this.getClass().getClassLoader().loadClass(name);
>                 }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.