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.
Summary: | Automatically closing editor files when they are deleted outside of IDE makes users loose data | ||
---|---|---|---|
Product: | platform | Reporter: | austvik <austvik> |
Component: | Text | Assignee: | issues@editor <issues> |
Status: | REOPENED --- | ||
Severity: | normal | CC: | mmirilovic |
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | PC | ||
OS: | Mac OS X | ||
Issue Type: | ENHANCEMENT | Exception Reporter: |
Description
austvik
2010-06-27 21:09:34 UTC
From the log: INFO [org.netbeans.modules.editor.hints.AnnotationHolder] org.openide.filesystems.FileStateInvalidException: MasterFileObject[/Users/austvik/opengrok/trunk/opengrok-indexer/pom.xml@5a5d13d4:3889bb23,valid=false] at org.openide.loaders.DataObject.find(DataObject.java:499) Caused: org.openide.loaders.DataObjectNotFoundException: MasterFileObject[/Users/austvik/opengrok/trunk/opengrok-indexer/pom.xml@5a5d13d4:3889bb23,valid=false] at org.openide.loaders.DataObject.find(DataObject.java:519) at org.netbeans.modules.editor.hints.AnnotationHolder.getInstance(AnnotationHolder.java:145) at org.netbeans.modules.editor.hints.HintsControllerImpl.setErrorsImpl(HintsControllerImpl.java:108) at org.netbeans.modules.editor.hints.HintsControllerImpl.setErrors(HintsControllerImpl.java:93) [catch] at org.netbeans.spi.editor.hints.HintsController$1.run(HintsController.java:79) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1957) WARNING [org.netbeans.modules.openide.loaders.DataObjectEncodingQueryImplementation]: Invalid DataObject: /Users/austvik/opengrok/trunk/opengrok-indexer/pom.xml WARNING [org.netbeans.modules.openide.loaders.DataObjectEncodingQueryImplementation]: Invalid DataObject: /Users/austvik/opengrok/trunk/opengrok-web/pom.xml WARNING [org.netbeans.modules.openide.loaders.DataObjectEncodingQueryImplementation]: Invalid DataObject: /Users/austvik/opengrok/trunk/pom.xml This is as designed: IDE refreshes all files while focus is moving to the IDE, the reason is exactly the same as you described : external changes might affect the content you are currently working on in the IDE. This is very different from how other editors behave, and *leads to deleted user data*, which I think should be extremely high priority not to do. I think the design is partly wrong (since it deletes users data and differs from other editors) and should be changed so that when a refresh happens. If the file does not exist on disk: change file status to new and unsaved, but keep buffer open so that user data is available. Please change from bug to feature request if you believe that this is "as designed", but please remove invalid, as it shouldn't be invalid to ask netbeans to not delete user data. well I am +1 for what jaustvik says this default design is not very user friendly I think that IF a file is open in editor NB should ask you that the file was modified externally, if you want to update it (give the poor user an option to resolve the conflict himself) obviously if a file is NOT open in editor NB can automagically update it (since there is no conflict) in its tree view How the other editors I have used behave: ** GNU Emacs 22.1.1 ** (Edit after changed content of file:) test.file changed on disk; really edit the buffer? (y, n, r or C-h) (Save after answering y on the previous question:) test.file has changed since visited or saved. Save anyway? (yes or no) (Edit deleted file:) Behaves as if the file is new. ** VIM - Vi IMproved 7.2 ** Saving changed file: WARNING: The file has been changed since reading it!!! Do you really want to write to it (y/n)? (Writing deleted file:) "test.file" [New] ** Eclipse Galileo Version: 1.2.2.20100216-1730 ** (File edited outside editor:) The file '.../test.file' has been changed on the file system. Do you want to replace the editor contents with these changes? (Yes, No) (File deleted outside editor:) The file '.../test.file' has been deleted or is not accessible. Yo you want to save your changes or close the editor without saving? (Close, Save) ** Visual Studio 2008 ** I don't have the exact text here, but if the file is changed it says something like "File has changed on disk, update buffer? (yes, no, cancel)" I think it is safe to say that "automatically deleting users editor/buffer" is not the expected behavior. |