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 091110-2ed0c0f492b5) VM: Java HotSpot(TM) Client VM, 10.0-b19, Java(TM) SE Runtime Environment, 1.6.0_04-b12 OS: Windows XP, 5.1, x86 Stacktrace: java.lang.NullPointerException at org.netbeans.lib.editor.util.swing.DocumentUtilities.addPriorityDocumentListener(DocumentUtilities.java:127) at org.netbeans.lib.editor.util.swing.DocumentUtilities.addDocumentListener(DocumentUtilities.java:105) at org.netbeans.modules.showtodos.TodoAnnotationProvider$ScanningListener.attachTo(TodoAnnotationProvider.java:164) at org.netbeans.modules.showtodos.TodoAnnotationProvider$ScanningListener.attachTo(TodoAnnotationProvider.java:173) at org.netbeans.modules.showtodos.TodoAnnotationProvider$ScanningListener.access$000(TodoAnnotationProvider.java:136) at org.netbeans.modules.showtodos.TodoAnnotationProvider.annotate(TodoAnnotationProvider.java:92)
Created attachment 90984 [details] stacktrace
org.netbeans.modules.showtodos.TodoAnnotationProvider$ScanningListener.attachTo(TodoAnnotationProvider.java:164)
Issue added to NetFIX Pool [1]. Module owner please speak up if you disagree. [1] http://wiki.netbeans.org/NetFIXIssues For NetFIX developers, the class is located in this package: http://hg.netbeans.org/main/contrib/file/tip/showtodos/src/org/netbeans/modules/showtodos
I used a lot ShowTodos module, I've never seen this exception. From the exception stack trace, it seems that either there is no EditorCookie from the context, or ck.openDocument() is null. That seems strange. Here is a small patch that should prevent this exception by testing the existence of an EditorCookie from the context. Misterm, can you provide me a scenario for testing my patch ? -éric
It was random, sorry.
Created attachment 96890 [details] NBM package with fix
Misterm, I've attached a nbm package build today with my fix, can you upgrade your version with this one (I've bumped the version, so it should install without trouble), and tell me if the exception is gone ? Thanks for your help -éric
Created attachment 96894 [details] Small patch
Michel, could you please review the patch and integrate it if you don't have objections? Thanks!
I will review it soon. I am glad to see patch coming for this module :)
@Michael, do you remember which kind of file was you editing in that time? :)
Changeset: 870582a9a83c Author: Michel Graciano <hmichel@netbeans.org> Date: 2010-04-08 11:50 Message: Bug #176777 - [68cat] NullPointerException at org.netbeans.lib.editor.util.swing.DocumentUtilities.addPriorityDocumentListener Issue #176777 - [68cat] NullPointerException at org.netbeans.lib.editor.util.swing.DocumentUtilities.addPriorityDocumentListener
Thanks Eric for your patch. I tested it and looks ok for me. The commit was made inside the IDE and the issue update too, so the link is not correct. The correct link is http://hg.netbeans.org/main/contrib/rev/870582a9a83c Regards
Thanks Michel for your review & integration and special thanks to Eric for the patch!
Could not reproduce anymore, seems fixed.