#2 "Save as" overwrites existing files

closed-accepted
7
2002-02-26
2002-01-18
No

The user opens a new file and then calls "Save as",
inadvertently using the same name as another file
which was already open. No complaints. DrJava saves
it and shows it in the document list with the same
name as the other document!

Discussion

  • Eric E. Allen

    Eric E. Allen - 2002-01-18
    • summary: "Save as" overwrites existing files. --> "Save as" overwrites existing files
     
  • Eric E. Allen

    Eric E. Allen - 2002-01-18
    • summary: "Save as" overwrites existing files --> "Save as" overwrites existing files
     
  • Brian Stoler

    Brian Stoler - 2002-01-18

    Logged In: YES
    user_id=343403

    Here's what I think we should do:

    1) If you try to "save as" to a file that already exists but
    is not open, we give you an "are you sure" dialog to confirm.

    2) If you try to "save as" to a file that already exists and
    is open, I think we should simply refuse. We tell the user
    that you can't overwrite an open document, and that if you'd
    like to overwrite it then you must close the old copy of the
    file first.

     
  • Brian Stoler

    Brian Stoler - 2002-01-18
    • summary: "Save as" overwrites existing files --> "Save as" overwrites existing files
    • status: open --> open-accepted
     
  • Brian Stoler

    Brian Stoler - 2002-02-13
    • summary: "Save as" overwrites existing files --> "Save as" overwrites existing files
    • assigned_to: eallen --> eiburns
     
  • Jim Van Fleet

    Jim Van Fleet - 2002-02-19

    Logged In: YES
    user_id=430778

    After having researched the best way to actually attack this bug, we decided to beef up the FileSaveSelector interface with new methods void warnFileOpen() and boolean verifyOverwrite().

    What remains to do is first write the test cases to make sure that the appropriate methods fire when necessary. Then, we will integrate some stub SWING code which we have prepared to handle the return data. Finally, we will change the logic in DefaultGlobalModel.DefinitionsDocumentHandler to incorporate the changes.

     
  • Jim Van Fleet

    Jim Van Fleet - 2002-02-19
    • summary: "Save as" overwrites existing files --> "Save as" overwrites existing files
     
  • Erik Burns

    Erik Burns - 2002-02-26

    Logged In: YES
    user_id=437715

    OK, so we've finished the code, and fixed the test cases, and everything is happy. (Note: it is not quite
    committed yet.) We went with the changes mentioned previously.

    We also created a new method which overloads tempFile(); this new method, tempFile(int i), is useful
    because it allows for making *MULTIPLE, DIFFERENT* files. Previously, test cases (specifically
    GlobalModelOtherTest.testInteractionsCanSeeChangedClass) called tempFile() multiple times and wrote and
    rewrote over files with the same name, all of them open. This is obviously not allowed in the new saving
    paradigm. Thus, we changed testInteractionsCanSeeChangedClass() to use the new tempFile(int i), as well
    as using the new tempFile(int i) in our own tests. Others should feel free to use this as well, after we
    commit. This will be tomorrow some time (hopefully near 1:00pm).

     
  • Erik Burns

    Erik Burns - 2002-02-26
    • summary: "Save as" overwrites existing files --> "Save as" overwrites existing files
     
  • Jim Van Fleet

    Jim Van Fleet - 2002-02-26

    Logged In: YES
    user_id=430778

    Release candidate 1 in drjava-20020226-1933. We'll change the focus of the default overwrite option to NO, then close the bug.

     
  • Jim Van Fleet

    Jim Van Fleet - 2002-02-26
    • summary: "Save as" overwrites existing files --> "Save as" overwrites existing files
    • status: open-accepted --> pending-accepted
     
  • Jim Van Fleet

    Jim Van Fleet - 2002-02-26

    Logged In: YES
    user_id=430778

    drjava-20020226-2005 contains final focus fix. Bug closed

     
  • Jim Van Fleet

    Jim Van Fleet - 2002-02-26
    • summary: "Save as" overwrites existing files --> "Save as" overwrites existing files
    • status: pending-accepted --> closed-accepted
     

Log in to post a comment.