This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 154971 - ProjectClassLoader overwrites findResource but not findResources
Summary: ProjectClassLoader overwrites findResource but not findResources
Status: RESOLVED FIXED
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-08 22:13 UTC by schulte2004
Modified: 2009-02-19 20:49 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Patch to also overwrite method findResources in class ProjectClassLoader (1.62 KB, patch)
2008-12-08 22:17 UTC, schulte2004
Details | Diff
Updated patch to merge resources from the project with the resource of its classpath. (2.49 KB, patch)
2008-12-27 07:09 UTC, schulte2004
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description schulte2004 2008-12-08 22:13:20 UTC
I have an issue with the form editor when using beans depending on resources from a project's classpath by looking them
up using ClassLoader.getResources() instead of ClassLoader.getResource(). The problem is in class ProjectClassLoader
which overwrites method findResource but does not overwrite method findResources. That makes all resources disappear
from a project's classpath when they are accessed by getResources instead of getResource. The attached patch fixes this.
Comment 1 schulte2004 2008-12-08 22:17:24 UTC
Created attachment 74723 [details]
Patch to also overwrite method findResources in class ProjectClassLoader
Comment 2 schulte2004 2008-12-27 07:09:18 UTC
Created attachment 75322 [details]
Updated patch to merge resources from the project with the resource of its classpath.
Comment 3 Jan Stola 2008-12-29 10:44:14 UTC
Thank you for the patch, it seems to be correct. I have integrated the suggested changes. Please, check one of the 
upcoming development builds to verify that the fix works as you expect. Thank you in advance.

Modified files: http://hg.netbeans.org/main?cmd=changeset;node=b506b06ea917