Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6698013
Votes 19
Synopsis JFileChooser can no longer navigate non-local file systems.
Category java:classes_swing
Reported Against
Release Fixed 6u14(b02), 7(b46) (Bug ID:2169960)
State 11-Closed, Unverified, bug
Priority: 3-Medium
Related Bugs 6560349 , 6691325
Submit Date 06-MAY-2008
Description
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 :
 customer  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  customer  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 :
EXPECTED -
chooser should allows the user to navigate into a selected subfolder
ACTUAL -
chooser does not change directories

ERROR MESSAGES/STACK TRACES THAT OCCUR :
no error message occurs

REPRODUCIBILITY :
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.
Posted Date : 2008-05-06 07:58:08.0
Work Around
N/A
Evaluation
The cause is brilliantly discovered by the CR initiator, see Description.
Posted Date : 2008-05-29 15:45:46.0
Comments
  
  Include a link with my name & email   

Submitted On 08-MAY-2008
mattelkins
The following bugs appear to be duplicates of this one:
6668272
6691325


Submitted On 23-SEP-2008
I think the problem is in BasicFileChooserUI.changeDirectory(). In java version "1.6.0_06", ther the if case looks like
if (dir != null)
in previous versions is was
if (dir != null && File.separatorChar == '\\' && dir.getPath().endsWith(".lnk"))
I hope this bug get fixed soon


Submitted On 24-SEP-2008
Solving this bug is really urgent to me as my a major applet will not work anymore that is crucial for our work.


Submitted On 12-NOV-2008
The work around we use is to use the old BasicFileChooserUI.java (you also need the old BasicTransferable.java I think).  You can get this from the JDK source files - use 6u3 or 5u13.  Call setUI on your JFileChooser object to specify the UI. 


Submitted On 17-APR-2009
TheDet
Another duplicate seems to be:
6724190



PLEASE NOTE: JDK6 is formerly known as Project Mustang