Handle both nbres and nbresloc protocols in ImageUtilities.loadImage(URI)#8239
Handle both nbres and nbresloc protocols in ImageUtilities.loadImage(URI)#8239eirikbakke merged 1 commit intoapache:masterfrom
Conversation
…s.loadImage(URI) method.
mbien
left a comment
There was a problem hiding this comment.
looks good, thanks @eirikbakke!
|
btw good that you added the log warnings in the original PR, otherwise we probably wouldn't have noticed this ;) |
|
True! But either way it falls back to the old method that was used to load icons from URLs. It might have missed a localization, or used a bitmap icon instead of an SVG. |
|
I did see this similar log warning, but could not immediately figure out what the "ergoloc" protocol was:
|
|
|
|
Yeah, I'm just not sure whether ImageUtilities should do anything about it. We could exempt the warning message in case of an "ergoloc" protocol, but then I feel like we should know if it is actually working first... |
|
Other than ergoloc being a strange device trying to help with back pain I don't know anything about it + it seems to be not used for icons. Lets get this PR in :) |
|
Thanks for reporting the log message! |
The loadImage(URI) method was added in #8114 , as part of a broader consolidation of various icon loading methods. After seeing one log message, we see that both the
nbres:andnbresloc:protocols should be handled, not justnbresloc. The difference is in whether a given file should be loaded with localization suffixes or not, per this API documentation.The log message in question was as follows:
WARNING [org.openide.util.ImageUtilities]: loadImage(URI) called with unusual URI: nbres:/org/netbeans/modules/form/resources/palette/panel_16.pngThis PR adds handling of the
nbrescase, and changes the handling of thenbresloccase to enable loading with localization.A quick test of the IDE saw no new problems, including in the Matisse form builder.