8042094: Test javax/swing/JFileChooser/7036025/bug7036025.java fails with java.lang.NullPointerException on Windows x86
authorazvegint
Tue, 24 Jun 2014 10:36:35 +0400
changeset 25209 e9902dc8b9a0
parent 25208 f7fd86906713
child 25210 d2224e06e44f
8042094: Test javax/swing/JFileChooser/7036025/bug7036025.java fails with java.lang.NullPointerException on Windows x86 Reviewed-by: ahgross, art, pchelko, mschoene
jdk/src/share/classes/sun/awt/shell/ShellFolder.java
jdk/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java
--- a/jdk/src/share/classes/sun/awt/shell/ShellFolder.java	Mon Jun 23 13:05:27 2014 -0700
+++ b/jdk/src/share/classes/sun/awt/shell/ShellFolder.java	Tue Jun 24 10:36:35 2014 +0400
@@ -33,8 +33,6 @@
 import java.util.*;
 import java.util.concurrent.Callable;
 
-import sun.reflect.misc.ReflectUtil;
-
 /**
  * @author Michael Martak
  * @since 1.4
@@ -201,16 +199,19 @@
 
     // Static
 
-    private static ShellFolderManager shellFolderManager;
+    private static final ShellFolderManager shellFolderManager;
 
-    private static Invoker invoker;
+    private static final Invoker invoker;
 
     static {
         String managerClassName = (String)Toolkit.getDefaultToolkit().
                                       getDesktopProperty("Shell.shellFolderManager");
         Class<?> managerClass = null;
         try {
-            managerClass = ReflectUtil.forName(managerClassName);
+            managerClass = Class.forName(managerClassName, false, null);
+            if (!ShellFolderManager.class.isAssignableFrom(managerClass)) {
+                managerClass = null;
+            }
         // swallow the exceptions below and use default shell folder
         } catch(ClassNotFoundException e) {
         } catch(NullPointerException e) {
--- a/jdk/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java	Mon Jun 23 13:05:27 2014 -0700
+++ b/jdk/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java	Tue Jun 24 10:36:35 2014 +0400
@@ -51,7 +51,7 @@
  * @since 1.4
  */
 
-public class Win32ShellFolderManager2 extends ShellFolderManager {
+final class Win32ShellFolderManager2 extends ShellFolderManager {
 
     static {
         // Load library here