FULL PRODUCT VERSION :
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b25)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.3.9600]
EXTRA RELEVANT SYSTEM CONFIGURATION :
Tested on 2 Windows 8.1 64-bit VMs and a native install.
A DESCRIPTION OF THE PROBLEM :
When you bring up the awt FileDialog if you try to delete an existing file the program will hang until force closed. If you create a new file from the dialog you can delete files without any problems.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the attached source code and it'll bring up a FileDialog. Select an existing file and hit delete. The program will now hang until you force close it.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Prints the filepath specified.
ACTUAL -
Program hangs and must be force closed. It will also eat up a lot of CPU usage while hanging.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
No log file as program hangs instead of crashing.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.Frame;
import java.awt.FileDialog;
public class test {
public static void main(String[] args) {
final FileDialog fd = new FileDialog((Frame)null, "Save As");
fd.setMode(FileDialog.SAVE);
fd.setVisible(true);
if (fd.getFile() == null) {
return;
}
String rv = fd.getDirectory() + fd.getFile();
System.out.println(rv);
}
}
---------- END SOURCE ----------