Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8116616

FileChooser may return a File that has a path with spurious characters after the extension

    Details

      Description

      Please see DTL-3215 for all the details.
      Basically there's only one computer where we can see the issue so it's likely there's something specific in the user environment that triggers it. But until we dig out root cause there's the risk it may affect other users.

      In Scene Builder the first thing we do when opening an existing fxml file is:

              FileChooser fileChooser = FileChooserBuilder.create()
                      .extensionFilters(new FileChooser.ExtensionFilter("FXML File", "*.fxml"))
                      .title("Open FXML")
                      .build();
              Stage stage = (frame == null) ? null : frame.getStage();
              File fxmlFile = fileChooser.showOpenDialog(stage); // fxmlFile is faked at this point !!

      Fact is that it returns faked fxmlFile value once Cindy hits Open button, with spurious characters after the ".fxml" extension: see attached DTL3215-error.gif
      As of now Cindy's computer is the sole known system where the issue occurs.
      Strangely enough when I asked Cindy to run on her computer the following tiny code it didn't exhibit the issue:

      public class DTL3215 extends Application {

          public static void main(String[] args) {
              Application.launch(args);
          }

          @Override
          public void start(Stage primaryStage) {
              FileChooser fileChooser = FileChooserBuilder.create().extensionFilters(new FileChooser.ExtensionFilter("FXML File", "*.fxml")).title("Open FXML").build();
              File fxmlFile = fileChooser.showOpenDialog(primaryStage);
              primaryStage.show();
              primaryStage.hide();
              System.out.println("GLOP fxmlFile = " + fxmlFile);
          }
      }

      Any idea ?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                anthony Anthony Petrov (Inactive)
                Reporter:
                yjoan Yves Joan (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported: