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 212861 - ant.ProjectLibraryProvider.replaceProperty is trying to access locked document
Summary: ant.ProjectLibraryProvider.replaceProperty is trying to access locked document
Status: RESOLVED WORKSFORME
Alias: None
Product: projects
Classification: Unclassified
Component: Ant Project (show other bugs)
Version: 7.2
Hardware: All All
: P4 normal (vote)
Assignee: Tomas Stupka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-22 18:33 UTC by javydreamercsw
Modified: 2015-02-04 03:34 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 188229


Attachments
stacktrace (10.74 KB, text/plain)
2012-05-22 18:33 UTC, javydreamercsw
Details

Note You need to log in before you can comment on or make changes to this bug.
Description javydreamercsw 2012-05-22 18:33:44 UTC
Build: NetBeans IDE Dev (Build 201205200400)
VM: Java HotSpot(TM) Client VM, 23.0-b21, Java(TM) SE Runtime Environment, 1.7.0_04-b20
OS: Windows 7

User Comments:
javydreamercsw: Creating a library




Stacktrace: 
java.lang.Throwable: Locked by:
   at org.openide.filesystems.FileLock.<init>(FileLock.java:85)
   at org.netbeans.modules.masterfs.filebasedfs.fileobjects.LockForFile.<init>(LockForFile.java:91)
   at org.netbeans.modules.masterfs.filebasedfs.fileobjects.LockForFile.tryLock(LockForFile.java:102)
   at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObj.lock(FileObj.java:359)
   at org.openide.loaders.MultiDataObject$Entry.takeLock(MultiDataObject.java:1356)
   at org.netbeans.modules.properties.PropertiesEditorSupport$Environment.markModified(PropertiesEditorSupport.java:878)
Comment 1 javydreamercsw 2012-05-22 18:33:53 UTC
Created attachment 119746 [details]
stacktrace
Comment 2 Jesse Glick 2012-05-24 00:26:08 UTC
Seems that lib/nblibraries.properties was open in the editor and modified; the IDE went to save changes to it, but could not since it was locked by the editor. Avoidable on the user side by not trying to make customizations via the Properties dialog (or the like) while metadata files are being edited. Possible robustness fixes:

1. The code which opens the Properties dialog warns you if project metadata files are not currently modified. Currently this does not include sharable library metadata; perhaps it could. (TBD, since one thing you can do with the Properties dialog open is create _new_ sharable library areas.)

2. Project system code dealing with *.properties files (for example) could read and write the javax.swing.text.Document corresponding to a possibly open and even modified file, presumably saving any changes it made if the document was previously unmodified. Tricky since that would also imply listening to changes in an open and modified document, which could be undesirable - it is normal to make edits which are temporarily syntactically invalid but which are corrected before saving. Also might be tricky due to file encoding and newline issues (though *.properties are defined to be in ISO-8859-1 at least).
Comment 3 Quality Engineering 2015-02-04 03:34:36 UTC
Reported for 7.3.x or earlier, no new info since then -> closing as worksforme, please reopen in case you see it.