| Summary: | Duplicate results returned by ClassLoader.getResources() | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [RT] Gemini.Web | Reporter: | Violeta Georgieva <milesg78> | ||||
| Component: | unknown | Assignee: | Violeta Georgieva <milesg78> | ||||
| Status: | CLOSED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | brad5620732, eclipse, glyn.normington | ||||
| Version: | unspecified | ||||||
| Target Milestone: | 2.0.0.M01 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 345220 | ||||||
| Attachments: |
|
||||||
|
Description
Violeta Georgieva
I identified that org.eclipse.gemini.web.tomcat.internal.loading.ChainedClassLoader.getResources(String) in some cases may return one and the same resource presented by more than one URL. We will introduce functionality to remove the duplicated URLs. Created attachment 196122 [details]
Patch
Could you please review the patch
Thanks
Comment on attachment 196122 [details]
Patch
The fix looks ok except I was a little puzzled why you chose url.getFile() to produce the String map key. Presumably this has some advantage over simply using the url. May be worth adding a comment.
(In reply to comment #3) > Comment on attachment 196122 [details] > Patch > The fix looks ok except I was a little puzzled why you chose url.getFile() to > produce the String map key. Presumably this has some advantage over simply > using the url. May be worth adding a comment. I didn't want to use URL.equals() because of the following in the java doc of the method: "Since hosts comparison requires name resolution, this operation is a blocking operation. Note: The defined behavior for equals is known to be inconsistent with virtual hosting in HTTP." I chose toFile() instead of toString(), because getFile() just returns the 'file' field that is initialized during URL construction. Method toString() does a lot of calculations. Commit Id: 927f4b0b7875c002656d40c7b0c35f16038dd432 |