-
Bug
-
Resolution: Fixed
-
P3
-
8, 9
-
b65
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8084905 | emb-9 | Anton Nashatyrev | P3 | Resolved | Fixed | team |
JDK-8086868 | 8u65 | Anton Nashatyrev | P3 | Resolved | Fixed | b01 |
JDK-8078522 | 8u60 | Anton Nashatyrev | P3 | Closed | Fixed | b14 |
JDK-8138219 | emb-8u65 | Unassigned | P3 | Resolved | Fixed | b01 |
JDK-8079970 | emb-8u60 | Anton Nashatyrev | P3 | Resolved | Fixed | team |
The default toolkit under macos is LWCToolkit. It JDK8 this overrides getImage:
public Image getImage(URL url) {
if (imageCached(url)) {
return super.getImage(url);
}
URL url2x = getScaledImageURL(url);
return (imageExists(url2x))
? getImageWithResolutionVariant(url, url2x) :super.getImage(url);
}
getScaledImageURL may return null. While SunToolkit.imageExists does checkfor null, it does this after a call to checkPermissions:
protected static boolean imageExists(URL url) {
checkPermissions(url);
if (url != null) {
try (InputStream is = url.openStream()) {
return true;
}catch(IOException e){
return false;
}
}
return false;
}
Unfortunately, if there's a SecurityManager that checkPermissions call eventually ends up in URLUtil:
public static Permission getConnectPermission(URL url) throws IOException
{
String urlStringLowerCase = url.toString().toLowerCase();
Where the null url gets dereferenced.
public Image getImage(URL url) {
if (imageCached(url)) {
return super.getImage(url);
}
URL url2x = getScaledImageURL(url);
return (imageExists(url2x))
? getImageWithResolutionVariant(url, url2x) :super.getImage(url);
}
getScaledImageURL may return null. While SunToolkit.imageExists does checkfor null, it does this after a call to checkPermissions:
protected static boolean imageExists(URL url) {
checkPermissions(url);
if (url != null) {
try (InputStream is = url.openStream()) {
return true;
}catch(IOException e){
return false;
}
}
return false;
}
Unfortunately, if there's a SecurityManager that checkPermissions call eventually ends up in URLUtil:
public static Permission getConnectPermission(URL url) throws IOException
{
String urlStringLowerCase = url.toString().toLowerCase();
Where the null url gets dereferenced.
- backported by
-
JDK-8079970 [macosx] NPE when attempting to get image from toolkit
-
- Resolved
-
-
JDK-8084905 [macosx] NPE when attempting to get image from toolkit
-
- Resolved
-
-
JDK-8086868 [macosx] NPE when attempting to get image from toolkit
-
- Resolved
-
-
JDK-8138219 [macosx] NPE when attempting to get image from toolkit
-
- Resolved
-
-
JDK-8078522 [macosx] NPE when attempting to get image from toolkit
-
- Closed
-