changeset 25773:07cae3ef5f57

8049996: [macosx] test java/awt/image/ImageIconHang.java fails with NPE Reviewed-by: alexsch, azvegint
author pchelko
date Fri, 11 Jul 2014 18:46:47 +0400
parents 73e0efa29d55
children 21b78da4b2df
files jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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(".");
     }
 }