[
https://issues.apache.org/jira/browse/FELIX-467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12561130#action_12561130
]
Richard S. Hall commented on FELIX-467:
---------------------------------------
I have some doubts about the proposed solution the more I think about it. I am
not sure what we can do about this issue, but think about the case we are
proposing where we aggregate results from the boot class path as well as from
imports and local class path.
If we think about it logically, findResources() returns resources that are
accessible from the bundle's class path. However, it would never be possible
for the bundle to access classes from the boot class path, imports, and local
class path at the same time.
Consider a hypothetical case, where we want to query for some component.xml
file which gives us information about component classes we can load and
instantiate. If we aggregate everything, it is possible that we will return
/org/foo/component.xml from the boot class path, imports, and the local class
path, where each one defines potentially different classes (e.g.,
BootClass.class, ImportClass.class, LocalClass.class) to be loaded. If the
bundle then tried to load class corresponding to each resource, the class load
will only be delegated to the boot class path, it would never search imports or
the local class path and thus never be able to load those classes even though
it discovered the corresponding resources. Likewise if we were only talking
about imports and the local class path.
In short, it almost seems like our result needs to be filtered so that first
found package wins and we filter out later discovered resources of the same
package, i.e., the same behavior for resources as for classes. Of course, this
would be a pain in the butt.
As a side note, I applied these patches locally and we still pass our normal
TCK tests, so we could just go with the proposed approach and not be so
pedantic.
Or perhaps my reasoning is just all wrong...anyone?
> R4SearchPolicyCore.findResources(String) do not aggregate the Enumeration
> founds
> --------------------------------------------------------------------------------
>
> Key: FELIX-467
> URL: https://issues.apache.org/jira/browse/FELIX-467
> Project: Felix
> Issue Type: Bug
> Components: Framework
> Affects Versions: 1.0.0
> Reporter: Guillaume Sauthier
> Attachments: FELIX-467-tests-bundles.zip, FELIX-467.patch
>
>
> This issue is linked to FELIX-466
> The R4SearchPolicyCore.findResources(String) method just exits early on a
> first hit, and doesn't continue into imported packages.
> It should aggregate the different hits and return all matching resources.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.