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: | FileAlreadyLockedException when trying to save project properties but metadata files are modified | ||
---|---|---|---|
Product: | projects | Reporter: | pzgyuanf <pzgyuanf> |
Component: | Ant Project | Assignee: | Jesse Glick <jglick> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | anebuzelsky, jrojcek, lhasik, mkrauskopf, mmirilovic, pzajac, tor |
Priority: | P3 | ||
Version: | 4.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | 92011 | ||
Bug Blocks: | 41535, 57480 | ||
Attachments: | the exceptions |
Description
pzgyuanf
2004-10-30 06:17:47 UTC
Created attachment 18618 [details]
the exceptions
Don't do that then - the project properties dialog wants to modify files such as project.properties, private.properties, and project.xml, and it can't do that correctly if you are editing them at the same time. You have to pick one or the other at a time. Of course the IDE should behave more gracefully, but do not plan to change that for 4.0. *** Issue 55927 has been marked as a duplicate of this issue. *** *** Issue 59365 has been marked as a duplicate of this issue. *** Cf. also issue #66295. It is quite disturbing. Why not to save opened document for project.properties before is opened for writing by project customizer? I wouldn't do that. Since e.g. for apisupport/project it also applies also to project.xml, manifest.mf, private.properties, Bunde, Layer, platform.properties... maybe more, which all could be in inconsistent state. Maybe tell the user that she is currently editing those files and e.g. force the save or whatever - would have to be probably solved on the side of particular customizers. *** Issue 74989 has been marked as a duplicate of this issue. *** *** Issue 64627 has been marked as a duplicate of this issue. *** *** Issue 83099 has been marked as a duplicate of this issue. *** Will simply prevent the Properties dialog from being opened when there are unsaved files. (The exact list of files which might be modified by a project properties dialog depends on the project type and in some cases may be difficult to compute in advance.) Will not prevent you from editing files while a (nonmodal) properties dialog is open, but that is just asking for trouble anyway. Checking in Bundle.properties; /shared/data/ccvs/repository/projects/projectui/src/org/netbeans/modules/project/ui/actions/Bundle.properties,v <-- Bundle.properties new revision: 1.33; previous revision: 1.32 done Checking in CustomizeProject.java; /shared/data/ccvs/repository/projects/projectui/src/org/netbeans/modules/project/ui/actions/CustomizeProject.java,v <-- CustomizeProject.java new revision: 1.10; previous revision: 1.9 done Good idea. Verified. Reopening as the fix is not good from UI perspective. Asking the user to save all files before opening the properties dialog is wrong. I think the fix should be rollbacked. Can we do the following: When the user clicks the OK button in the properties dialog, we prompt the user to save all files the properties dialog will modify? If you want a different UI, please open a separate issue with suggestions and make it block this issue. The original problem was indeed fixed and needs to be tracked as such. While the fix could be rolled back, IMHO the data loss potential of the original problem overrides any annoyance caused by the fix. Re. prompting only when OK is clicked in the properties dialog - this would be way more work and would require separate effort from each project type development team. If that were feasible with a modest development effort I would have done it that way to begin with. The problems are that (1) you would need to track precisely which files are about to be written, which requires nontrivial logic for each project type; (2) that would already be too late, as you would need to actually merge the unsaved text edits with the pending customizer edits, meaning every project properties dialog would need to be rewritten to load all of its information from unsaved editor documents, which would also require new APIs. Not worth it, I think. A possibility I considered was requiring save of just those files likely to be read and possibly written by the properties dialog - metadata, basically, rather than regular sources. Possible but would still be more complex and may require cooperation from each project type separately. Not clear whether DataFilesProviderImplementation (?) can provide a generic solution. Tor suggested changing the buttons in the existing dialog to be "Save All" and "Cancel" to be friendlier. |