Skip to content

Conversation

@eirikbakke
Copy link
Contributor

The ImageUtilities.loadImage(URL) method was added earlier to help migrate Toolkit.getImage(URL) calls to ImageUtilities-based loading (to support SVG icons etc.).

As mentioned here, there are occasionally icon loading attempts with the special URL scheme "ergoloc", which caused some warnings in the IDE log.

This PR suppresses said warning messages, while adding a softer INFO log entry for a more specific case that we have yet to observe.

…oloc:/...', and add some comments about this URL scheme.
@eirikbakke eirikbakke added the Platform [ci] enable platform tests (platform/*) label Oct 15, 2025
@jtulach jtulach self-requested a review October 15, 2025 07:01
Copy link
Member

@mbien mbien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! makes sense. (haven't tested it)

@eirikbakke eirikbakke merged commit a2a2958 into apache:master Oct 15, 2025
60 of 62 checks passed
@neilcsmith-net
Copy link
Member

Post merge approval! 😄 Thanks.

Notes make sense - at some point we need to look at all the icons in the ergonomics module and how they're generated / included, should include any SVGs, etc.

@neilcsmith-net
Copy link
Member

Actually, I'm not sure this is the right approach? @jtulach ? Looking at https://github.com/apache/netbeans/blob/master/ergonomics/ide.ergonomics/src/org/netbeans/modules/ide/ergonomics/fod/FoDURLStreamHandler.java#L44 this just delegates to nbresloc directly for anything that isn't HTML? In which case, can we just use the same nbresloc behaviour for ergoloc too in https://github.com/apache/netbeans/blob/master/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java#L232 ?

A bit ugly that the platform needs to know about ergoloc at all, but it has to do that to suppress the message too.

@eirikbakke
Copy link
Contributor Author

I don't quite understand what the ergoloc scheme is used for, or how the "ergoloc:/org/netbeans/modules/ide/ergonomics/enterprise/org-netbeans-modules-websvc-core-client-resources-ws_client_16.png" URL arose in the first place; it doesn't point to a valid image, and it comes from a layer attribute that was auto-generated by an ant script somewhere. Reading through FoDURLStreamHandler it could appear that ergoloc is really only meant to be used for HTML files? Or not...

So anyway, the current PR just maintains the status quo for ergoloc URLs, and suppresses the warning.

@neilcsmith-net
Copy link
Member

neilcsmith-net commented Oct 15, 2025

Have you looked inside the compiled ergonomics module JAR? That file is in there as far as I can see, as are many icons.

EDIT : this fix is great for NB28 though. It might be better to look at ergonomics generation in that module, and only route URLs through that protocol that really need to be in future?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Platform [ci] enable platform tests (platform/*)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants