# HG changeset patch # User azvegint # Date 1403591795 -14400 # Node ID e9902dc8b9a00ecf92f38eff09dff8271c942c8f # Parent f7fd8690671399bb1f1c1ac96dd0ecb53775178d 8042094: Test javax/swing/JFileChooser/7036025/bug7036025.java fails with java.lang.NullPointerException on Windows x86 Reviewed-by: ahgross, art, pchelko, mschoene diff -r f7fd86906713 -r e9902dc8b9a0 jdk/src/share/classes/sun/awt/shell/ShellFolder.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) { diff -r f7fd86906713 -r e9902dc8b9a0 jdk/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java --- 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