JDK-6868611 : FileSystemView throws NullPointerException
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6u10,7
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic,windows_xp
  • CPU: generic,x86
  • Submitted: 2009-08-05
  • Updated: 2011-01-19
  • Resolved: 2009-11-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b77Fixed
Related Reports
Duplicate :  
Relates :  
Description
Sometimes the next exception occurs:
java.io.FileNotFoundException: Execution was interrupted
        at sun.awt.shell.Win32ShellFolderManager2.createShellFolder(Win32ShellFolderManager2.java:64)
        at sun.awt.shell.ShellFolder.getShellFolder(ShellFolder.java:241)
        at javax.swing.filechooser.FileSystemView.getShellFolder(FileSystemView.java:531)
        at javax.swing.filechooser.FileSystemView.getFiles(FileSystemView.java:455)
        at javax.swing.plaf.basic.BasicDirectoryModel$LoadFilesThread.run0(BasicDirectoryModel.java:239)
        at javax.swing.plaf.basic.BasicDirectoryModel$LoadFilesThread.run(BasicDirectoryModel.java:228)
Exception in thread "Basic L&F File Loading Thread" java.lang.NullPointerException
        at javax.swing.filechooser.FileSystemView.getFiles(FileSystemView.java:458)
        at javax.swing.plaf.basic.BasicDirectoryModel$LoadFilesThread.run0(BasicDirectoryModel.java:239)
        at javax.swing.plaf.basic.BasicDirectoryModel$LoadFilesThread.run(BasicDirectoryModel.java:228)

It happens when JFileChooser changes current directory while the previous directory hasn't been read yet.

Comments
EVALUATION We should change a couple of things: 1. Don't write in log FileNotFoundException 2. In the javax.swing.filechooser.FileSystemView#getFiles method we should analyze the getShellFolder() invocation result
10-11-2009