8049996: [macosx] test java/awt/image/ImageIconHang.java fails with NPE
authorpchelko
Fri, 11 Jul 2014 18:46:47 +0400
changeset 25773 07cae3ef5f57
parent 25772 73e0efa29d55
child 25774 21b78da4b2df
8049996: [macosx] test java/awt/image/ImageIconHang.java fails with NPE Reviewed-by: alexsch, azvegint
jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
--- 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(".");
     }
 }