changeset 10230:325ce66dc2ab

8042094: Test javax/swing/JFileChooser/7036025/bug7036025.java fails with java.lang.NullPointerException on Windows x86 Reviewed-by: ahgross, art, pchelko, mschoene
author azvegint
date Tue, 24 Jun 2014 10:36:35 +0400
parents 982d48269751
children 00551446be0e
files src/share/classes/sun/awt/shell/ShellFolder.java src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java
diffstat 2 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/awt/shell/ShellFolder.java	Mon Jun 23 13:05:27 2014 -0700
+++ b/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/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java	Mon Jun 23 13:05:27 2014 -0700
+++ b/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