8049996: [macosx] test java/awt/image/ImageIconHang.java fails with NPE
Reviewed-by: alexsch, azvegint
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java Fri Jul 11 16:44:11 2014 +0400
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java Fri Jul 11 18:46:47 2014 +0400
@@ -544,9 +544,9 @@
return super.getImage(filename);
}
- String fileneame2x = getScaledImageName(filename);
- return (imageExists(fileneame2x))
- ? getImageWithResolutionVariant(filename, fileneame2x)
+ String filename2x = getScaledImageName(filename);
+ return (imageExists(filename2x))
+ ? getImageWithResolutionVariant(filename, filename2x)
: super.getImage(filename);
}
@@ -908,6 +908,9 @@
}
private static boolean isValidPath(String path) {
- return !path.isEmpty() && !path.endsWith("/") && !path.endsWith(".");
+ return path != null &&
+ !path.isEmpty() &&
+ !path.endsWith("/") &&
+ !path.endsWith(".");
}
}