| Summary: | BundleWiring.listResources does not work properly for directoy classpath entries | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Equinox | Reporter: | Thomas Watson <tjwatson> | ||||||||||||
| Component: | Framework | Assignee: | Thomas Watson <tjwatson> | ||||||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||||||
| Severity: | normal | ||||||||||||||
| Priority: | P3 | CC: | hargrave, jwross | ||||||||||||
| Version: | 3.7 | Flags: | hargrave:
review+
jwross: review+ |
||||||||||||
| Target Milestone: | 3.7 RC2 | ||||||||||||||
| Hardware: | PC | ||||||||||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||||||||||
| Whiteboard: | |||||||||||||||
| Attachments: |
|
||||||||||||||
Created attachment 195601 [details]
Patch + test
This patch implements the org.eclipse.osgi.baseadaptor.bundlefile.NestedDirBundleFile.getEntryPaths(String) method properly.
This bug is important to fix. One of the important usecases of BundleWiring.listResources method is to enable the classpath scanning of Web Application Bundles. John and BJ, please review for RC2. I would make new prependNestedDir method private access. Allows the compiler to inline it. (In reply to comment #4) > I would make new prependNestedDir method private access. Allows the compiler to > inline it. Otherwise, looks okay to me. Created attachment 195610 [details]
updated patch and tests
Updated patch to make prependNestedDir private. I also made the cp and baseBundleFile fields final privates.
(In reply to comment #6) > Created attachment 195610 [details] > updated patch and tests > Updated patch to make prependNestedDir private. I also made the cp and > baseBundleFile fields final privates. What's this stuff for in the patch? Index: bundles_src/test2/stuff/data/resource2 =================================================================== RCS file: bundles_src/test2/stuff/data/resource2 diff -N bundles_src/test2/stuff/data/resource2 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ bundles_src/test2/stuff/data/resource2 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,1 @@ +stuff classpath test2 \ No newline at end of file Index: bundles_src/test2/stuff/resource2 =================================================================== RCS file: bundles_src/test2/stuff/resource2 diff -N bundles_src/test2/stuff/resource2 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ bundles_src/test2/stuff/resource2 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,1 @@ +stuff classpath test2 \ No newline at end of file Created attachment 195617 [details] updated patch and tests (In reply to comment #7) > What's this stuff for in the patch? > Just junk from another test I was writing. It is not in this updated patch. This patch avoids the synthetic access to the private final cp field. Created attachment 195618 [details]
updated patch and tests
Sigh, I am not having good luck at getting the right patch attached. Lets try that again.
Created attachment 195622 [details] updated patch and tests (In reply to comment #7) > What's this stuff for in the patch? > You know what. This stuff is needed in the patch. That is the resource I am searching for in the test! patch released. |
When a bundle has a nested directory as a Bundle-ClassPath entry the BundleWiring.listResources method does not find any resources from the directory class path entry. This will be very problematic for scenarios that want to do classpath scanning on a web application bundle. In this case the Bundle-ClassPath will have the following: Bundle-ClassPath: WEB-INF/classes/ This is because the NestedDirBundleFile.getEntryPaths method does nothing: public Enumeration<String> getEntryPaths(String path) { // getEntryPaths is only valid if this is a root bundle file. return null; } The comment is obviously no longer correct ;-) This method gets used by BundleWiring.listResources now.