Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

BundleWiring.listResources(...) does not consider embedded JARs #52

Closed
sjsf opened this issue Mar 16, 2018 · 4 comments
Closed

BundleWiring.listResources(...) does not consider embedded JARs #52

sjsf opened this issue Mar 16, 2018 · 4 comments
Assignees

Comments

@sjsf
Copy link
Contributor

sjsf commented Mar 16, 2018

When asking a bundle for its contained resources via bundle.adapt(BundleWiring.class).listResources(...), the content of embedded JARs is not considered.

I have to admit that so far I couldn't spot anything in the OSGi specs which explicitly states that it should do so - I merely noticed that this works on equinox. I have a corresponding test case in sjka/concierge@testListResources.

I'd be happy if any of you experts could have a quick look and advise on this.

@sjsf
Copy link
Contributor Author

sjsf commented Mar 16, 2018

PS: The best I could find is this from BundleWiring.listResources(...)'s JavaDoc:

Returns the names of resources visible to this bundle wiring's class loader

As the stuff within the JARs is visible to the class loader, my assumption was that it should work.

@rellermeyer
Copy link
Contributor

Thanks for reporting. I will check if we can change this and Tim needs to check if it breaks any of the TCK tests if we do but if you say that Equinox exposes embedded JARs this way then I would hope that it does not.

@JochenHiller JochenHiller self-assigned this Apr 20, 2018
@JochenHiller
Copy link
Contributor

@SJKA thanks for reporting that, and your test case.
@rellermeyer @tverbele I will run the test case and try to fix it.
I will also run again the TCK to sure that we do NOT break any existing tests.

@JochenHiller
Copy link
Contributor

I added a PR now to fix this issue.
I also re-run the TCK. There is the same test case failing as before doing the change.

The failing test case is related to a somehow related problem:
org.osgi.test.cases.framework.junit.wiring.BundleWiringTests.testListResources

I will look into that further on. But the test case from @SJKA does work now.

@rellermeyer Can you do a careful review of that?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants