#3484 Previously open files restored as empty

severe bug
closed-fixed
9
2010-12-16
2010-12-10
mahewa
No

I'm using jEdit 4.4 on Java 1.6.0_20 on Ubuntu.

If jEdit is closed with some open files and even if the "Restore previously open files on startup" option is un-checked, the files are restored on the next startup. Moreover, they're restored as new, empty files (with the original paths and file names).

I'm marking this bug as severe because there's a possible risk that a user e. g. mistakenly re-saves such an empty file or re-writes its contents thus destroys the original file.

Discussion

  • Alan Ezust

    Alan Ezust - 2010-12-10

    What plugins are you using? Please attach an activity log.

     
  • Alan Ezust

    Alan Ezust - 2010-12-10

    if you can reproduce this with jedit -noplugins, it's a bug in the core. I suspect it is a bug in either sessions or projectviewer or one of your other plugins that is restoring previously open files.

     
  • Alan Ezust

    Alan Ezust - 2010-12-10

    oo, I can reproduce this with jedit -noplugins. !
    It is confirmed a bug in core.

     
  • Alan Ezust

    Alan Ezust - 2010-12-10
    • priority: 5 --> 7
    • assigned_to: kpouer --> shlomy
     
  • Alan Ezust

    Alan Ezust - 2010-12-13

    Elevating this to high priority.

     
  • Alan Ezust

    Alan Ezust - 2010-12-13
    • priority: 7 --> 9
     
  • Kazutoshi Satoda

    I couldn't reproduce this on Windows XP, JDK 6u23, with --settings=temporary-settings.

     
  • Alan Ezust

    Alan Ezust - 2010-12-13

    I can reproduce this on windows XP also. the important part is that "previously open files" must be
    UN-checked, and when I try, I only get one empty but named buffer when I start, corresponding to the last opened buffer I had when I quit.

     
  • Alan Ezust

    Alan Ezust - 2010-12-13
    • assigned_to: shlomy --> nobody
    • summary: Previously open files restored as empty --> Previously open files restored as empty (linux)
     
  • Alan Ezust

    Alan Ezust - 2010-12-13
    • summary: Previously open files restored as empty (linux) --> Previously open files restored as empty
    • assigned_to: nobody --> shlomy
     
  • Alan Ezust

    Alan Ezust - 2010-12-14

    Line 345 in PerspectiveManager.java is where we grab the splitconfig without checking restoreFiles, but it is not obvious how to remove the filenames from a splitconfig string.

     
  • Dale Anson

    Dale Anson - 2010-12-14

    Alan, I've been though the split config code (JDiff uses it). Want me to take a look at this one?

     
  • Alan Ezust

    Alan Ezust - 2010-12-14

    That would be great, dale!

     
  • Dale Anson

    Dale Anson - 2010-12-14
    • assigned_to: shlomy --> daleanson
     
  • Dale Anson

    Dale Anson - 2010-12-14
    • status: open --> closed-fixed
     
  • Dale Anson

    Dale Anson - 2010-12-14

    Fixed in revision 19138. The problem really wasn't with the split config itself, but whether the split config should be restored when the user has elected to not restore previously opened files. I adjusted the save and load perspective code to take that setting into account.

     
  • Björn Kautler

    Björn Kautler - 2010-12-14
    • status: closed-fixed --> open
     
  • Björn Kautler

    Björn Kautler - 2010-12-14

    Hi guys,

    this doesn't work fully.

    [subjectivity]
    I would prefer to have the files in the perspective.xml, as the way it is solved now, the split-config is not restored, but that would be ok.
    But if someone shuts down jEdit with this restore on and then changes his properties manually, or takes them from a backup e. g. then you have the very same problem you just tried to fix.
    [/subjectivity]

    If you have the restore on, but for remote files via VFS off (like our default settings are) then you still have the same problem described in that bug. I guess this points maybe towards a more fine-grained fix that maybe also "fixes" the subjective issues mentioned above which is why I mentioned them. :-)

    Regards
    Vampire

     
  • Dale Anson

    Dale Anson - 2010-12-16

    Following some discussion about this bug on the jedit-devel mailing list, I added a new option setting to allow the user to choose whether to restore the split config. Now the PerspectiveManager uses this new setting plus the previously existing settings for restoring local and remote files and edits the split configuration appropriately.

     
  • Dale Anson

    Dale Anson - 2010-12-16
    • status: open --> closed-fixed
     
  • Alan Ezust

    Alan Ezust - 2010-12-17

    Testing this now on my jEdit 4.4.x branch. So far so good.
    I'd like to merge it there.

    I was hasty before and didn't wait for a merge request to be posted, but lets do it right and
    Dale: please post a merge request in the tracker when you think it is ready to go into 4.4.x.
    I will merge it then.

    Thanks also for addressing the other issues in 4.5 re: splitconfig.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks