Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 104477

Summary: ClassLoader returns an Enumeration of only the first instance of a resouce under OSGi
Product: [Eclipse Project] Platform Reporter: David Knibb <dknibb>
Component: RuntimeAssignee: Thomas Watson <tjwatson>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.2 M1   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Attachments:
Description Flags
Test case for this bug
none
Proposed backport to R3_1_maintenance branch none

Description David Knibb CLA 2005-07-20 06:09:25 EDT
ClassLoader.getResources() should return all resources with the specified name.
Under OSGi only the first resource found is returned. An Example:

If 2 bundles contain the same file "org/aspectj/aop.xml" for example and both
export "org.aspectj" a 3rd bundle that requires both will only see one of the files.
Comment 1 David Knibb CLA 2005-07-20 06:20:25 EDT
Created attachment 25035 [details]
Test case for this bug

This zip contains three projects. Unpack it into an OSGi workspace. Each bundle
contains an aop.xml file, in the org.aspectj package. 

The project org.resourceloader.test contains a junit test case which can be run
to rest a fix to this bug. If the test case can see all three aop.xml files, it
will pass. Otherwise it will fail.
Comment 2 Thomas Watson CLA 2005-07-20 14:53:00 EDT
A fix has been released to the HEAD branch (this is for 3.2)
Comment 3 Thomas Watson CLA 2005-07-20 14:53:58 EDT
A fix has been released to the HEAD branch (fixed for 3.2)
Comment 4 Thomas Watson CLA 2005-07-20 14:54:48 EDT
should backport fix to 3.1.1
Comment 5 Thomas Watson CLA 2005-07-20 14:59:53 EDT
Created attachment 25076 [details]
Proposed backport to R3_1_maintenance branch
Comment 6 David Knibb CLA 2005-07-21 12:34:52 EDT
Thanks a lot for such a swift response on this fix - all now behaves exactly as 
I had hoped.