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.
This bug was originally marked as duplicate of bug 199170, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related. Build: NetBeans IDE Dev (Build 201210140002) VM: Java HotSpot(TM) 64-Bit Server VM, 23.3-b01, Java(TM) SE Runtime Environment, 1.7.0_07-b10 OS: Windows 8 Stacktrace: java.lang.NullPointerException at org.netbeans.modules.cnd.navigation.overrides.BaseAnnotation.attach(BaseAnnotation.java:214) at org.netbeans.modules.cnd.navigation.overrides.AnnotationsHolder.run(AnnotationsHolder.java:183) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1454) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2036)
Created attachment 125954 [details] stacktrace
Easy to reproduce in debugger. Breakpoints: (a) org.netbeans.modules.cnd.navigation.overrides.BaseAnnotation:214 (attach()) (b) org.netbeans.modules.editor.lib2.document.CharContent:89 (length()) Activate (a), once it is hit (just open a c++ file with annotations), activate (b). Step Out; in NB remove all the text from a file; Save it; Release debugger => NPE document.getEndPosition() could return null. Proposed patch is attached.
Created attachment 128532 [details] Proposed fix
Andrew, please, go ahead and commit
done. http://hg.netbeans.org/cnd-main/rev/ce39a3c088d8
Integrated into 'main-golden', will be available in build *201211300001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/ce39a3c088d8 User: Andrew Krasny <akrasny@netbeans.org> Log: Bug #220092 - [73cat] NullPointerException at org.netbeans.modules.cnd.navigation.overrides.BaseAnnotation.attach