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 Dev (Build 200903310200) VM: Java HotSpot(TM) Client VM, 11.3-b02, Java(TM) SE Runtime Environment, 1.6.0_13-b03 OS: Windows XP, 5.1, x86 User Comments: stefan79: Added more @Override mit Alt-<Return> Stacktrace: java.lang.NullPointerException at org.netbeans.modules.editor.errorstripe.AnnotationViewDataImpl.computeTotalStatus(AnnotationViewDataImpl.java:441) at org.netbeans.modules.editor.errorstripe.AnnotationView.drawGlobalStatus(AnnotationView.java:262) at org.netbeans.modules.editor.errorstripe.AnnotationView.paintComponent(AnnotationView.java:342) at javax.swing.JComponent.paint(JComponent.java:1027) at javax.swing.JComponent.paintToOffscreen(JComponent.java:5122) at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1472)
Created attachment 79302 [details] stacktrace
Any reliable steps how to reproduce this one? Thanks
-) Make a File, implement a Interface or Override some Methods. -) Delete all the @Override-annoations. -) Save & Compile the File -) Then press Alt-Return on every Override-Methode (as fast as you can)
Tried your scenario on a class file with 5 Override methods(04/20 build). No exceptions out of 4 attempts. Could you please try to reproduce once more on some recent build ?
I´ve tested the latest release. The NPE doesn´t occured. But i think the problem is still alive. Do you habe a big File (> 2000 rows) for a test? I think it´s a problem in this Editor-Thread, because when i make more "@Override" - Tags, the Cursor is still on WAIT-Cursor. Maybe something hangs in this Thread?
looks like between annotations.getNumberOfAnnotations(line) call and annotations.getPasiveAnnotations(line) call, number of annotations on specified line may drop and cause npe. code should either skip nulls (may cause some redraw artifacts, but may not if this change cause next redraw and status recalculation) or lock, synchronize in this place to be sure annotations are the same over these two lines. If I'm right with assumption it shuold be really random issue, and relatively rare.
fixed: remove first call annotations.getNumberOfAnnotations(line) as next call annotations.getPasiveAnnotations(line) also checks for the same number and return null if number of annotation not >1, the only verification now is null verification. there still may be random issue(but new one and may be even more rare) as getPasiveAnnotations(line) may got similar threading issue in internal logic.
http://hg.netbeans.org/jet-main/rev/02d730a10d81
Integrated into 'main-golden', will be available in build *200904250201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/02d730a10d81 User: sergeyp@netbeans.org Log: fix #161790 - remove unnecessary call as getPassiveAnnotation also verify the same number against 1 and return null if <=1