FULL PRODUCT VERSION : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64) Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing) ADDITIONAL OS VERSION INFORMATION : Windows XP Service Pack 2 (also happens /w service pack 1) EXTRA RELEVANT SYSTEM CONFIGURATION : Not hardware specific A DESCRIPTION OF THE PROBLEM : Java hangs completely when JFileChooser() is called when a shortcut to the desktop is present on the desktop of Windows XP. STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : In windows XP right-click on the desktop, select "new" from the popup menu then select "shortcut:". In the popup-dialog select "browse", then select the topmost item in the tree "desktop". Select ok. This will create a shortcut to the desktop on the desktop. I have used a shortcut like this for quick access to my desktop icons from a popup window (works well when assigned a hotkey). Next, create a simple java program that simply calls the default constructor of JFileChooser - ie: public class Test { public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { JFileChooser fileChooser = new JFileChooser(); }; }); } } When run with JDK 5.0 this program will hang. However, if you delete the desktop link the program runs to completion. If you run this program with JDK 1.4 it works fine - even with the desktop link. As a final note, the bug is not present if you set the "useShellFolder" property to false, ie: JFileChooser fileChooser = new JFileChooser() { public void updateUI() { putClientProperty("FileChooser.useShellFolder", Boolean.FALSE); super.updateUI(); } }; EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - I did not expect java to hang. ACTUAL - Java hung and the program had to be terminated by task manager. REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- public class Test { public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { // java will hang here if a particular shortcut is present on the desktop JFileChooser fileChooser = new JFileChooser(); }; }); } } See steps above for creating the shortcut on the desktop. ---------- END SOURCE ---------- CUSTOMER SUBMITTED WORKAROUND : Delete the desktop link (see steps for recreating) or add putClientProperty("FileChooser.useShellFolder", Boolean.FALSE); to all JFileChooserClasses. Release Regression From : 1.4.2 The above release value was the last known release where this bug was known to work. Since then there has been a regression. Release Regression From : 1.4.2 The above release value was the last known release where this bug was known to work. Since then there has been a regression.
|