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 2010/09/21 23:11:32 UTC

[jira] Resolved: (FELIX-2569) Felix bundle classloader always delegates to parent loader in getResources()

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

Richard S. Hall resolved FELIX-2569.
------------------------------------

      Assignee: Richard S. Hall
    Resolution: Fixed

I've created a new module class loader inner class for Java5 that overrides getResources() in addition to the old module class loader. Now depending on the platform we use the appropriate class loader. Please close this bug if satisfied.

> Felix bundle classloader always delegates to parent loader in getResources()
> ----------------------------------------------------------------------------
>
>                 Key: FELIX-2569
>                 URL: https://issues.apache.org/jira/browse/FELIX-2569
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: framework-3.0.2
>            Reporter: Sahoo
>            Assignee: Richard S. Hall
>             Fix For: framework-3.0.3
>
>         Attachments: FELIX-2569.test.patch
>
>
> Felix's bundle class loader does not override getResources(); instead it overrides findResources(). As a result of this, it always delegates to parent class loader. I see the following interesting comment in the code:
>         // The findResources() method should only look at the module itself, but
>         // instead it tries to delegate because in Java version prior to 1.5 the
>         // getResources() method was final and could not be overridden. We should
>         // override getResources() like getResource() to make it delegate, but we
>         // can't. As a workaround, we make findResources() delegate instead.
>         protected Enumeration findResources(String name)
>         {
>             return getResourcesByDelegation(name);
>         } 
> Can we have something like two different implementations targeting pre and post JRE 1.5 and let runtime select appropriate one? If there is a better way, then even better.

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