FULL PRODUCT VERSION :
java version "1.6.0_06"
Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
Java HotSpot(TM) Client VM (build 10.0-b22, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
Our app uses JFileChooser to navigate a variety of non-local file systems (network, FTP, etc) by supplying a FileSystemView object to the chooser.
This worked fine until 1.6.0_04, when a change was made to BasicFileChooserUI.changeDirectory(). The problem occurs when the user opens the chooser and attempts to navigate into one of the displayed folders either by double clicking it, or single-clicking it then clicking the Open button.
The new version of changeDirectory() always calls ShellFolder.getShellFolder(dir) which uses File.getCanonicalFile() to retrieve the canonical path for the file then tests the file to see if it exists. This test is performed using the LOCAL file system and when the test fails it throws an exception and the chooser refuses to navigate into the selected folder. Of course the test fails, because the folder doesn't exist on the LOCAL file system.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
invoke JFileChooser with a FileSystemView that describes a remote file system.
EXPECTED VERSUS ACTUAL BEHAVIOR :
chooser should allows the user to navigate into a selected subfolder
chooser does not change directories
ERROR MESSAGES/STACK TRACES THAT OCCUR :
no error message occurs
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
The only workaround we found was to hard code File.getCanonicalPath() to always return "C:\", this passes the "exists" test and JFileChooser is now permitted to navigate into the folder the user has selected.
Release Regression From : 6u3
The above release value was the last known release where this
bug was not reproducible. Since then there has been a regression.