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.
Thrown when I had a class structure open. Surely setColorings should not be using NbDocument.runAtomic, which takes out a write lock?! INFO [org.openide.text.CloneableEditorSupport]: Could not lock document msg Caused: org.netbeans.modules.masterfs.filebasedfs.utils.FSException: Cannot lock read-only file <cachedir>/index/s580/java/14/gensrc/<p/C>.java. at org.netbeans.modules.masterfs.filebasedfs.utils.FSException.io(FSException.java:118) at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObj.lock(FileObj.java:350) at org.openide.loaders.MultiDataObject$Entry.takeLock(MultiDataObject.java:1352) at org.netbeans.modules.openide.loaders.SimpleES$Environment.takeLock(SimpleES.java:188) at org.openide.text.DataEditorSupport$Env.markModified(DataEditorSupport.java:950) [catch] at org.openide.text.CloneableEditorSupport.notifyModified(CloneableEditorSupport.java:1991) at org.netbeans.modules.openide.loaders.SimpleES.notifyModified(SimpleES.java:123) at org.openide.text.CloneableEditorSupport.callNotifyModified(CloneableEditorSupport.java:1964) at org.openide.text.CloneableEditorSupport$Listener.vetoableChange(CloneableEditorSupport.java:2828) at org.netbeans.editor.BaseDocument.atomicLockImpl(BaseDocument.java:1610) at org.netbeans.editor.GuardedDocument.runAtomic(GuardedDocument.java:310) at org.openide.text.NbDocument.runAtomic(NbDocument.java:422) at org.netbeans.modules.java.editor.semantic.LexerBasedHighlightLayer.setColorings(LexerBasedHighlightLayer.java:76) at org.netbeans.modules.java.editor.semantic.SemanticHighlighter$3$2.run(SemanticHighlighter.java:1520) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
I do not remember exactly why runAtomic was used (maybe to ensure that noone is reading the highlights?). I do not see a reason for it in the current code, so I will probably try to change the lock to a read lock. But, this worked fine for years (see #87642) - possibly related to redo after save? Mila, adding you on CC just in case you would be interested.
Honzo, regarding runAtomic()/render() I wanted to ask the same question :) I've came to the same fix since Vladimir was complaining regarding beeping during Ctrl-TAB focus change between readonly files and I've found that this runAtomic() was the culprit. I've run java.editor unit tests and they seem to pass fine. http://hg.netbeans.org/jet-main/rev/48ecb1618e52
Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/48ecb1618e52 User: Miloslav Metelka <mmetelka@netbeans.org> Log: #205002 - "Could not lock document" from LexerBasedHighlightLayer.setColorings
according to Mila, the provided patch solves also problems reported in #206858 which is a P1 regression. Please provide a patch for 7.1.
*** Bug 206858 has been marked as a duplicate of this bug. ***
We will address this issue in Patch 1 for 7.1 (aka 7.1.1)
*** Bug 205415 has been marked as a duplicate of this bug. ***
verified in trunk
release71_fixes: http://hg.netbeans.org/releases/rev/570517912912
Integrated into 'releases', will be available in build *201202082200* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/570517912912 User: Miloslav Metelka <mmetelka@netbeans.org> Log: #205002 - "Could not lock document" from LexerBasedHighlightLayer.setColorings