14:01:44 [Image Fetcher 3] [error] Image Fetcher 3: Uncaught error fetching image: 14:01:44 [Image Fetcher 3] [error] Image Fetcher 3: java.lang.NullPointerException 14:01:44 [Image Fetcher 3] [error] Image Fetcher 3: at sun.awt.image.InputStreamImageSource.getDecoder(InputStreamImageSource.java:214) 14:01:44 [Image Fetcher 3] [error] Image Fetcher 3: at sun.awt.image.URLImageSource.getDecoder(URLImageSource.java:159) 14:01:44 [Image Fetcher 3] [error] Image Fetcher 3: at sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.java:263) 14:01:44 [Image Fetcher 3] [error] Image Fetcher 3: at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:205) 14:01:44 [Image Fetcher 3] [error] Image Fetcher 3: at sun.awt.image.ImageFetcher.run(ImageFetcher.java:169)
java 8 on Mac OS X (10.10) tries to load bigger images for High DPI (retina) screens (or not: I don't have a retina screen but I'm hit by the bug).
Following a call to new ImageIcon(URL), LWCToolkit.getImage(URL) automatically tries to load an high-dpi version of the icon and falls back to normal if it's not found. high-dpi version of icon.png is firstname.lastname@example.org.
This is why it's only visible running java 8 on the mac, not on linux.
modifies the name of the image to append @2x
It then calls SunToolkit.imageExists() to check for existence of this
If it returns false, it carries on with the default image.
If it returns true, it uses the @2x image
calls url.openStream(), doesn't check the return value
returns true if no IOException is raised, returns false otherwise.
calls connect() to initialize the in field
and returns the in field
When the icon is from jedit.jar, it throws an IOException if in is null
resulting in LWCToolkit to switch to the normal image, which is loaded.
When the icon is from a plugin, it doesn't throw an IOException as long
as the plugin is found, even if the resource is not found (input stream is null).
Then LWCToolkit carries on with the non-existent email@example.com and hits a NullPointerException later when it tries to read from the InputStream.
- checking for null InputStream in PluginResURLConnection.connect() and
throwing an exception in this case fixes the issue (the dockable opens).
The java api doc is not specific about what kind of issue should trigger an
IOException but SunToolkit expects an IOException if resource is not found.
This conflict with [r22920]: I added a test for null InputStream; should try/catch
Log in to post a comment.