FULL PRODUCT VERSION :
java version "9-ea"
Java(TM) SE Runtime Environment (build 9-ea+168)
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+168, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 10.0.15063]
A DESCRIPTION OF THE PROBLEM :
Given a symbolic link A which points to a directory B. When I select A by means of a DirectoryChooser, the returned File is B instead of A.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
create a symbolic link to a directory, from the command prompt:
mklink /D foo bar
run the JavaFX application below, which simply opens a DirectoryChooser
select "foo"
an alert is shown with the result that was returned by the DirectoryChooser, which points to "bar" instead of "foo"
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
the DirectoryChooser must return the symbolic link instead of the directory it points to
ACTUAL -
the DirectoryChooser returns the actual directory that the symbolic link points to
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.io.File;
import javafx.application.Application;
import javafx.scene.control.Alert;
import javafx.stage.DirectoryChooser;
import javafx.stage.Stage;
public class JavaFXApplication1 extends Application {
@Override
public void start(Stage primaryStage) {
primaryStage.show();
DirectoryChooser chooser = new DirectoryChooser();
File f = chooser.showDialog(primaryStage);
if(f != null) {
new Alert(Alert.AlertType.INFORMATION, f.toString()).showAndWait();
}
}
public static void main(String[] args) {
launch(args);
}
}
---------- END SOURCE ----------
java version "9-ea"
Java(TM) SE Runtime Environment (build 9-ea+168)
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+168, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 10.0.15063]
A DESCRIPTION OF THE PROBLEM :
Given a symbolic link A which points to a directory B. When I select A by means of a DirectoryChooser, the returned File is B instead of A.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
create a symbolic link to a directory, from the command prompt:
mklink /D foo bar
run the JavaFX application below, which simply opens a DirectoryChooser
select "foo"
an alert is shown with the result that was returned by the DirectoryChooser, which points to "bar" instead of "foo"
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
the DirectoryChooser must return the symbolic link instead of the directory it points to
ACTUAL -
the DirectoryChooser returns the actual directory that the symbolic link points to
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.io.File;
import javafx.application.Application;
import javafx.scene.control.Alert;
import javafx.stage.DirectoryChooser;
import javafx.stage.Stage;
public class JavaFXApplication1 extends Application {
@Override
public void start(Stage primaryStage) {
primaryStage.show();
DirectoryChooser chooser = new DirectoryChooser();
File f = chooser.showDialog(primaryStage);
if(f != null) {
new Alert(Alert.AlertType.INFORMATION, f.toString()).showAndWait();
}
}
public static void main(String[] args) {
launch(args);
}
}
---------- END SOURCE ----------
- duplicates
-
JDK-8179936 FileChooser returns the File after following links
-
- Open
-