8042094: Test javax/swing/JFileChooser/7036025/bug7036025.java fails with java.lang.NullPointerException on Windows x86
Reviewed-by: ahgross, art, pchelko, mschoene
--- 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