changeset 9733:0228c31b3e8b

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 813b77e77de0
children 2dc468eab46c
files src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Tue Jul 01 16:51:44 2014 +0100
+++ b/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Fri Jul 11 18:46:47 2014 +0400
@@ -538,9 +538,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);
     }
 
@@ -891,6 +891,9 @@
     }
 
     private static boolean isValidPath(String path) {
-        return !path.isEmpty() && !path.endsWith("/") && !path.endsWith(".");
+        return path != null &&
+                !path.isEmpty() &&
+                !path.endsWith("/") &&
+                !path.endsWith(".");
     }
 }