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 113332

Summary: Core editor classes shouldn't use nbresloc
Product: editor Reporter: emi <emi>
Component: -- Other --Assignee: David Strupl <dstrupl>
Status: RESOLVED FIXED    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description emi 2007-08-21 12:47:27 UTC
As the Editor API is also supposed to be usable as a standalone, classes shouldn't load resources with the nbresloc://
protocol (as it needs the context provided by the Platform that will not exist in standalone usage).

GlyphGutter is the most important culprit (needed for the sidebar). AnnotationTypes is another class that seems to use it.

I think using the openide-util Utilities class to load the resources might be a better move as openide-util is a strong
dependency anyhow that's not going to be missing in either scenario (Platform or standalone).
Comment 1 Vitezslav Stejskal 2007-08-21 13:48:32 UTC
I can't see any usages of nbresloc: in GlyphGutter. There is one in AnnotationTypes, that IMO could simply be rewritten
to use ClassLoader.getResource(). I'll fix it. At the best the problem deserves P3 though.
Comment 2 emi 2007-08-21 17:51:06 UTC
This is what grep gives me on the 6.0 M10 sources (I don't know about the situation in the current dev branch):

libsrc/org/netbeans/editor/AnnotationTypes.java:                defaultGlyphIcon = new
URL("nbresloc:/org/netbeans/editor/resources/defaultglyph.gif"); // NOI18N
libsrc/org/netbeans/editor/GlyphGutter.java:            imageURL = new
URL("nbresloc:/org/netbeans/editor/resources/glyphbutton.gif"); // NOI18N
options/src/org/netbeans/modules/options/colors/ColorModel.java:            if (iconURL.getProtocol ().equals
("nbresloc")) { // NOI18N
src/org/netbeans/modules/editor/options/AnnotationTypesNode.java:                if
(iconURL.getProtocol().equals("nbresloc")) { // NOI18N

The ones in "options" seem rather safe as they are IDE-dependent anyhow. But GlyphGutter /AnnotationTypes don't look so
good. If it's already fixed in the trunk, then even better.
Comment 3 Vitezslav Stejskal 2007-08-22 11:32:44 UTC
Thanks for the list, I'll see what we can do.
Comment 4 Jiri Prox 2008-04-11 00:42:12 UTC
moving opened issues from TM <= 6.1 to TM=Dev
Comment 5 Alexei Mokeev 2009-04-10 10:22:57 UTC
In current 6.7 trunk nbresloc is used in AnnotationTypes, original point of this bug is yet valid.
Comment 6 David Strupl 2010-10-05 12:30:12 UTC
http://hg.netbeans.org/jet-main/rev/5808758b6f21