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 220092 - [73cat] NullPointerException at org.netbeans.modules.cnd.navigation.overrides.BaseAnnotation.attach
Summary: [73cat] NullPointerException at org.netbeans.modules.cnd.navigation.overrides...
Status: CLOSED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal (vote)
Assignee: Andrew Krasny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-15 07:53 UTC by kosmonaffft
Modified: 2013-01-28 15:27 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 193544


Attachments
stacktrace (1.13 KB, text/plain)
2012-10-15 07:53 UTC, kosmonaffft
Details
Proposed fix (1.01 KB, patch)
2012-11-28 20:24 UTC, Andrew Krasny
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description kosmonaffft 2012-10-15 07:53:49 UTC
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)
Comment 1 kosmonaffft 2012-10-15 07:53:51 UTC
Created attachment 125954 [details]
stacktrace
Comment 2 Andrew Krasny 2012-11-28 20:23:47 UTC
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.
Comment 3 Andrew Krasny 2012-11-28 20:24:25 UTC
Created attachment 128532 [details]
Proposed fix
Comment 4 Vladimir Voskresensky 2012-11-28 20:30:55 UTC
Andrew, please, go ahead and commit
Comment 5 Andrew Krasny 2012-11-28 20:49:22 UTC
done. http://hg.netbeans.org/cnd-main/rev/ce39a3c088d8
Comment 6 Quality Engineering 2012-11-30 02:51:05 UTC
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