-
Bug
-
Resolution: Fixed
-
P2
-
7u4
-
b16
-
generic
-
os_x
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2224181 | 8 | Dmitry Cherepanov | P2 | Closed | Cannot Reproduce |
Here's the test to reproduce the issue with the latest build:
import java.awt.*;
import java.io.File;
public class OpenFile {
public static final void main(String args[]) throws Exception{
FileDialog openDialog = new FileDialog((Frame)null);
openDialog.setVisible(true);
if (openDialog.getFile() == null) {
throw new RuntimeException("dialog cancelled");
}
String filename = openDialog.getFile();
String folder = openDialog.getDirectory();
File file = new File(folder + File.separator + filename);
boolean exists = file.exists();
System.err.println(" exists="+exists);
}
}
The app simply asks user to choose any file and then create an instance of the io.File class and just prints whether the file exists or not. The test passes (that is file.exists returns true) on Apple's JDK and on Oracle's JDK before the changes for multipe-files support in FileDialog:
http://hg.openjdk.java.net/jdk7u/jdk7u-dev/jdk/rev/0e2f3e494814
import java.awt.*;
import java.io.File;
public class OpenFile {
public static final void main(String args[]) throws Exception{
FileDialog openDialog = new FileDialog((Frame)null);
openDialog.setVisible(true);
if (openDialog.getFile() == null) {
throw new RuntimeException("dialog cancelled");
}
String filename = openDialog.getFile();
String folder = openDialog.getDirectory();
File file = new File(folder + File.separator + filename);
boolean exists = file.exists();
System.err.println(" exists="+exists);
}
}
The app simply asks user to choose any file and then create an instance of the io.File class and just prints whether the file exists or not. The test passes (that is file.exists returns true) on Apple's JDK and on Oracle's JDK before the changes for multipe-files support in FileDialog:
http://hg.openjdk.java.net/jdk7u/jdk7u-dev/jdk/rev/0e2f3e494814
- backported by
-
JDK-2224181 [macosx] FileDialog.getDirectory() returns incorrect directory
- Closed
- relates to
-
JDK-7124337 [macosx] FileDialog fails to select multiple files
- Closed