-
Bug
-
Resolution: Not an Issue
-
P3
-
8u241, 11, 14, 15
-
x86
-
os_x
ADDITIONAL SYSTEM INFORMATION :
Mac OS Version 10.15.5
Have tested on versions of java from OpenJDK 11 to 14, and IBM J9 java running on mac and all have similar issue.
A DESCRIPTION OF THE PROBLEM :
It seems the latest OS Catalina version Version 10.15.5 (latest as of date June28 2020) return incorrect absolute path by JFileChooser.
I didn't recall this happening until the latest upgrade to Version 10.15.5
What happen is the directory select by JFileChooser will return a extra period directory.
eg Expected: /storage/hello/abc
Return /storage/hello/./abc instead. There is always a extra /./ reference. It should return absolute path without the irrelevant period. I think this is critical as some application may parse and consider extra period directory as error.
REGRESSION : Last worked in version 14.0.1
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the test code that return directory select by JFileChooser
For example selecting a directory
/storage/hello/abc
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
/storage/hello/abc
ACTUAL -
/storage/hello/./abc
---------- BEGIN SOURCE ----------
import javax.swing.*;
import java.io.File;
public class TestFileChooser {
public static void main(String[] args) {
final JFileChooser dirChooser = new JFileChooser();
dirChooser.setCurrentDirectory(new java.io.File(".")); // Set initial directory
dirChooser.setDialogTitle("Please select folder...");
dirChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); // Select directories only not file !!!
int returnVal = dirChooser.showOpenDialog(new JFrame());
if (returnVal == JFileChooser.APPROVE_OPTION) {
File file = dirChooser.getSelectedFile();
System.out.println("selected: " + file.getAbsolutePath());
}
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Search and replace string "/./" with "/".
However this is not practical as apparently the api is not returning "correct" path.
FREQUENCY : always
Mac OS Version 10.15.5
Have tested on versions of java from OpenJDK 11 to 14, and IBM J9 java running on mac and all have similar issue.
A DESCRIPTION OF THE PROBLEM :
It seems the latest OS Catalina version Version 10.15.5 (latest as of date June28 2020) return incorrect absolute path by JFileChooser.
I didn't recall this happening until the latest upgrade to Version 10.15.5
What happen is the directory select by JFileChooser will return a extra period directory.
eg Expected: /storage/hello/abc
Return /storage/hello/./abc instead. There is always a extra /./ reference. It should return absolute path without the irrelevant period. I think this is critical as some application may parse and consider extra period directory as error.
REGRESSION : Last worked in version 14.0.1
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the test code that return directory select by JFileChooser
For example selecting a directory
/storage/hello/abc
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
/storage/hello/abc
ACTUAL -
/storage/hello/./abc
---------- BEGIN SOURCE ----------
import javax.swing.*;
import java.io.File;
public class TestFileChooser {
public static void main(String[] args) {
final JFileChooser dirChooser = new JFileChooser();
dirChooser.setCurrentDirectory(new java.io.File(".")); // Set initial directory
dirChooser.setDialogTitle("Please select folder...");
dirChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); // Select directories only not file !!!
int returnVal = dirChooser.showOpenDialog(new JFrame());
if (returnVal == JFileChooser.APPROVE_OPTION) {
File file = dirChooser.getSelectedFile();
System.out.println("selected: " + file.getAbsolutePath());
}
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Search and replace string "/./" with "/".
However this is not practical as apparently the api is not returning "correct" path.
FREQUENCY : always