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.
[dev aug 22] When closing some Output Window tab that had linked to a document with error annotations, got an NPE.
Created attachment 2301 [details] Stack trace
Is the problem always reproducible? I simulated some errors and executed ant task. I was able to see your new "Ant Build Errors" annotations, but closing Output Window with a few linked annotations did not raise any exception. (I would like to find the cause of the problem. In worst case I can always add into code from stack trace some "if"s. But this situation should not happen, so the problem must be somewhere else!)
No, I don't think it is reproducible, sorry.
*** Issue 15442 has been marked as a duplicate of this issue. ***
*** Issue 15393 has been marked as a duplicate of this issue. ***
I thought I had also reported an NPE in saveAnnotationType, but now I cannot find this in IssueZilla. Anyway this happened to me in [dev sep 17].
Created attachment 2618 [details] NPE from AnnotationTypesFolder.saveAnnotationType right after reloading Ant layer
Thanx for report Jesse. At first glance it seems to me as some other problem, but I'm going to double check it and if necessary I will create separate issue. I was able to reproduce the NPE in removeAnnotation and will commit fix today.
The problem (NPE from Annotations.removeAnnotation) was fixed in these files: Checking in src/org/openide/text/Annotation.java; new revision: 1.6; previous revision: 1.5 Checking in src/org/openide/text/CloneableEditorSupport.java; new revision: 1.42; previous revision: 1.41 Checking in src/org/openide/text/DocumentLine.java; new revision: 1.34; previous revision: 1.33 Checking in src/org/openide/text/EnhancedChangeEvent.java; initial revision: 1.1 Checking in src/org/openide/text/PositionRef.java; new revision: 1.37; previous revision: 1.36 I'm leaving the issue opened, because of additional exception attached which I must investigate first.
I have created Issue #15692 for latter exception. Close it as duplicate if the cause is the same. Now, I am closing this bug as fixed. Reopen if you disagree.
Honza! you was just a bit faster than me! I appologize for the chaos, here is the eplanation: I'm silly - I did not read Jesse's comment carefully. It is definitely the issue 14804 - the folder with annotation types still doesn't listen on changes. I would like to fix the 14804 problem ASAP!
*** Issue 15693 has been marked as a duplicate of this issue. ***
build 200109260100 I received attached exception. I'm not able to reproduce it again. I followed steps : compile java with errors, click on error in output window (issue 15693). Please recheck your fix.
Created attachment 2715 [details] NPE
I have some idea where the remaining problem might be and going to check it.
I also saw an NPE from NbEditorDocument.removeAnnotation in [dev sep 26]. Not reproducible, but occurred while clearing Output Window that had some Ant hyperlinks in it. Usually this just removes all the annotations. This time it threw an exception. Note that the Ant annotation first checks for getAnnotatable() and only if non-null does it call detach().
Created attachment 2757 [details] NullPointerException
I know the cause and testing the fix right now.
Another attempt to fix this bug and I hope the final and successfull. If it happens again please reopen and attach stack trace. The whole problem was that add/remove were not synchronized correctly. Checking in src/org/openide/text/Annotation.java; new revision: 1.7; previous revision: 1.6 Checking in src/org/openide/text/DocumentLine.java; new revision: 1.37; previous revision: 1.36 Checking in src/org/openide/text/NbDocument.java; new revision: 1.45; previous revision: 1.44
*** Issue 16385 has been marked as a duplicate of this issue. ***
*** Issue 28556 has been marked as a duplicate of this issue. ***
The issue has been reproduced again. The problem seems to be in no synchronization of adding and removing annotations from cache elements. Namely the Map lineAnnotationsByMark and the List lineAnnotationsArray.
Martin plan to work on this issue.
I have fixed the NPE reported by Jesse in maintrunk: Checking in src/org/netbeans/modules/editor/NbEditorDocument.java; /cvs/editor/src/org/netbeans/modules/editor/NbEditorDocument.java,v <-- NbEditorDocument.java new revision: 1.31; previous revision: 1.30 done
*** Issue 31483 has been marked as a duplicate of this issue. ***
Unfortunatelly I have to reopen the issue again. It seems the synchronization is inevitable ...
*** Issue 33333 has been marked as a duplicate of this issue. ***
It seems this issue is also connected with wrong positions handling after external modification of the document and succeeding reloading. See issue #25595 Repro: 1. add breakpoint somewhere at the end of document 2. make external modification (delete several lines from the end, including the line where the breakpoint was)-> document will be reloaded (during reloading of document all breakpoints are removed from document and after reloading they are setted back.) Our added breakpoint is removed and then it should be added to a new offset (document is different after ext. modification). But the position is obsolete. ( and anno offset is higher as doc.length) That's why a BadLocationException occurs in addAnnotation method in Annotations class. The exception is caught and return statement finishes further adding annotation operations. It causes that the added annotation is not inserted into lineAnnotationsByMark Map. After next call of removeAnnotation a LineAnnotations is going to be retrieved from the Map. But null value is returned.
*** Issue 35400 has been marked as a duplicate of this issue. ***
Attaching potential fix. The fix requires fix of issue 35914 that was already commited into trunk. The fix also relies on fix of issue 33165 and issue 35930. I'll commit them at once.
Created attachment 11529 [details] Editor part of the fix of this issue
*** Issue 36211 has been marked as a duplicate of this issue. ***
I opened a source file with two editors. One was Netbeans source editor, another was an external editor. I edited and saved the source file in the external editor and activate the Netbeans source editor. These steps often make the source editor fail to reload the source file. I tried to compile the source file when the source editor failed to reload it, then that NPE was thrown. I will attach the last part of my ide.log later. Thanks.
I'm sorry that the problem in my previous comments is already pointed out and this problem have been fixed. I stop to attach the log.
*** Issue 37062 has been marked as a duplicate of this issue. ***
This problem should be fixed by the fix of issue 33165. Please reopen if the symptoms would reappear.
*** Issue 39324 has been marked as a duplicate of this issue. ***
*** Issue 43044 has been marked as a duplicate of this issue. ***
*** Issue 44041 has been marked as a duplicate of this issue. ***
v