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

Save As leads to bizarre situation if target file is already open

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Withdrawn
    • Icon: P3 P3
    • 7u6
    • 7u6
    • javafx

      Suppose you are editing old.fxml and you want to do Save As to save it as new.fxml. Suppose that new.fxml already exists. Then a dialogue requires you to confirm that you really want to overwrite new.fxml. So far so good. But suppose also that you had a second window open where you were already editing new.fxml. After the Save As, you will have two windows that both think they are editing new.fxml. The end result is strange behaviour and almost certainly corruption.

      I think in this case we should show an error dialogue after you have selected new.fxml, instead of the "replace existing file" dialogue. All you can do is click OK to confirm that you have seen the error message, and when you do so, the Save As file chooser reappears for you to pick another name. The file chooser API doesn't allow us to prevent the user from selecting new.fxml in the first place so this is probably the best we can do.

            yjoan Yves Joan (Inactive)
            emcmanuswse Eamonn McManus (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: