This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 245565 - Can't Save a File
Summary: Can't Save a File
Status: NEW
Alias: None
Product: third-party
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 8.0
Hardware: PC Linux
: P2 normal (vote)
Assignee: Michel Graciano
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-10 17:38 UTC by codeslinger_compsalot
Modified: 2014-07-14 12:32 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description codeslinger_compsalot 2014-07-10 17:38:07 UTC
Product Version = NetBeans IDE 8.0 (Build 201403101706)
Operating System = Linux version 3.13.0-30-generic running on amd64
Java; VM; Vendor = 1.7.0_55
Runtime = OpenJDK 64-Bit Server VM 24.51-b03

Sorry, but I don't have repro steps for you.
I suspect this is related to the AutoSave module.

I suspect what happened is that I did a manual save at the same exact time that AutoSave also did a save.
So far, the problem has not reoccurred after I disabled AutoSave.

Experience with other programs (word processors etc) that have an AutoSave feature shows that it is very hard to get this right.
There are so many ways in which things can go wrong, that AutoSave seldom is reliable and can lead to corruption of documents.

In this case, I very nearly lost 3 hours of intense work, I would have been exceedingly unhappy if I had.

Scenario:

I had about a dozen files open.  I was jumping back and forth between about 5 of them, making coordinated programming changes in each one.

fairly frequently I would do a manual save all, via CTRL-SHIFT-s, because this computer is prone to crashing and I didn't want to lose anything.

Every now and then I would also notice that AutoSave had also done a save (Note: IMHO 10 minutes is way too long for the default, try 5 minutes instead)

I do distinctly remember on at least one occasion that the AutoSave and my manual save did occur at basically the same time.

At some point, after about 3 hours of work, 
I compiled the program and got an error that didn't make any sense.  It was complaining about a missing function name, but I knew the function existed.
so, I went to the open file that had that function in it.... I had renamed the function and coordinated the change between the files.  and the open file did 
indeed appear to be correct.   Making sure that everything was saved, I went back to the compiler and tried again, same error.

Back to the file with the function in it and everything looks correct.  So then I tried adding a deliberate error to see what the compiler would do with that.
result, nothing, the compiler was not seeing the change.

So then I looked closely at the open file and noticed that when I modified it, the Unsaved Changes status icon did not become active.

I then tried various methods of invoking the save of that file, including Scan For External Changes, and then examined the file on the disk via shell.  Nothing, no changes were being saved for that file.

So then I did a copy and paste to a newly created file and saved that.  after which I exited netbeans and used shell to replace the bad file with the good one.
I restarted netbeans and everything was fine.

It was only just that one file that refused to be saved.  I believe it was the active file when I noticed that AutoSave and manual save had collided.

needless-to-say,  I have disabled AutoSave and won't use it ever again...   I didn't trust it in the first place which was why I was paying attention to when it did it's saves.

Given the nature of the changes It would have been quite difficult to replace that lost work.  If it isn't going to be reliable and it hasn't been exhaustively tested 
and there is even the slightest chance that it will cause corruption or loss of a file, they for crying out loud don't release the friggin thing!!!!!
Comment 1 Milutin Kristofic 2014-07-14 12:31:51 UTC
This issue is for module creator of autosave.