JDK-4382063 : EOU: JFileChooser should not try to connect to all drives when instantiated.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.3.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt
  • CPU: x86
  • Submitted: 2000-10-24
  • Updated: 2000-12-06
  • Resolved: 2000-12-06
Related Reports
Duplicate :  
Description

Name: yyT116575			Date: 10/23/2000


java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)


The JFileChooser tries to connect to all the drives from 'C:' to 'Z:' when
instantiated to look for the root directory of each drive. This is done so that
the JComboBox of drives can be populated. If any of the drives was a network
drive and for some reason disconnected the check for the root directory
has to timeout before it returns the disconnected status. In that case the
drive is not included in the JComboBox of JFileChooser. This may take a few
seconds for each drive. Thus it takes a while for JFileChooser to come up.
The user may think that the application has crashed.

Some drives may indeed be found connected. Then the JFileChooser comes up.
However between that time and when the user selects a drive it might have been
disconnected. In that case user gets the error dialog anyways. Thus the failure
mode in case of first having checked for network drive vs not is the same. The
complete set of drives on MS windows platform is not unknowable (considering
UNC names are not supported by the JFileCHooser anyways).

This has other disadvantage. If a drive that is not in the JComboBox gets
connected after the creation of JFileChooser the user may not be able to
access it (if the application kept on reusing the JFileChooser instance
and did not allow the mechanism to refresh it).

So why not populate all the drive letters in the JComboBox in the first
place. In absense of which at least a refresh JComboBox button should
be provided on the JFileChooser.
(Review ID: 110549) 
======================================================================

Comments
WORK AROUND Name: yyT116575 Date: 10/23/2000 Install a custom subclass of - javax.swing.filechooser.WindowsFileSystemView override the public File[] getRoots(); to return all drive letters. ======================================================================
11-06-2004

EVALUATION Fixed in merlin-beta by fix to 4290709. leif.samuelsson@Eng 2000-12-05
05-12-2000