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.
Build: NetBeans IDE 7.4 Beta (Build 201307092200) VM: OpenJDK 64-Bit Server VM, 24.0-b50, OpenJDK Runtime Environment, 1.7.0_40-b31 OS: Linux User Comments: GUEST: Tab was closed, that's all cyhelsky: Editing java file GUEST: <Please provide a description of the problem or the steps to reproduce jkovalsky: Closed MainWindow.java leaving only Settings.java opened in Editor. tomoke: Changed "Enumeration<ZipEntry> entries = zipfile.getEntries();" to "Ennumeration entries = zipfile.getEntries()'" yardus: hit a breakpoint Stacktrace: java.lang.IllegalStateException: Annotation not added: org-netbeans-spi-editor-hints-parser_annotation_verifier_fixableIf-Else Statements Must Use Braces ---- (Alt-Enter shows hints) at org.netbeans.modules.editor.NbEditorDocument.removeAnnotation(NbEditorDocument.java:257) at org.openide.text.NbDocument.removeAnnotation(NbDocument.java:533) at org.netbeans.modules.editor.hints.ParseErrorAnnotation.detachAnnotation(ParseErrorAnnotation.java:161) at org.netbeans.modules.editor.hints.AnnotationHolder.attachDetach(AnnotationHolder.java:339) at org.netbeans.modules.editor.hints.AnnotationHolder.access$400(AnnotationHolder.java:123) at org.netbeans.modules.editor.hints.AnnotationHolder$3.run(AnnotationHolder.java:358)
Created attachment 139408 [details] stacktrace
Created attachment 139726 [details] stacktrace Please provide a description of the problem or the steps to reproduce
Created attachment 140239 [details] stacktrace Close a tab of open PHP file (without HTML)
This bug already has 10 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=200175
Created attachment 141144 [details] stacktrace closing a file
Created attachment 143004 [details] stacktrace Closed a lot of tabs by using the Close Other... action
Created attachment 143863 [details] stacktrace writting into the code
Created attachment 145377 [details] stacktrace Running Ant target from context menu in Files.
Created attachment 145569 [details] stacktrace close editors
39 reports => P2
Created attachment 145579 [details] stacktrace Not sure; noticed error icon after doing some Java editing.
There was already a few attempts to fix this issue. #207563, #195733. This is risky to fix to NB 8.0.
Created attachment 146162 [details] stacktrace Closing a project
Created attachment 146325 [details] stacktrace Closing a project.
Created attachment 146356 [details] stacktrace Saved and closed a tab.
Created attachment 146534 [details] stacktrace close other editors
55 reports => P1
P2 is high enough priority for this.
Folks, I was really not able to find an error, since a/ the document from which the ParseErrorAnnotation is being detached is the very same instance on which it has been attached b/ no other write access to 'attachedTo' field - so the document instance must remain as it was set by attach c/ the code path through NbDocument.addAnnotation() MUST proceed through annoMap.put() for ParseErrorAnnotation (returns always a non-null type) d/ the ParseErrorAnnotation.attachedTo is cleared as soon as the NbDocument is asked for annotation removal => the removeAnnotation is called once and only once, on the exactly the same doc instance and the same annoMap. BUT - I've noticed that NbDocument.addAnnotation() and .removeAnnotation() - is synchronized 'just' by the readLock(). Access to getAnnotations() and the Annotations object itself has its own synchronization, but WRITE access to annoMap is only guarded by readLock -- which permits multiple listeners. It is possible that the annoMap gets corrupted if addAnnotation() is called from unrelated threads simultaneously. The visibility of data should be OK as after all the same sync primitive is used by all the threads. Synchronization added in jet-main#9269bff7cdc1
(In reply to Svata Dedic from comment #19) > annoMap is only guarded by readLock -- which permits multiple listeners. should be 'multiple concurrent readers' :)
Integrated into 'main-silver', will be available in build *201405250001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/9269bff7cdc1 User: Svata Dedic <sdedic@netbeans.org> Log: #235211: modifications of annoMap synchronized
I got the feeling Bug 244726 might have something in common with this one.