Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 176777 - [68cat] NullPointerException at org.netbeans.lib.editor.util.swing.DocumentUtilities.addPriorityDocumentListener
[68cat] NullPointerException at org.netbeans.lib.editor.util.swing.DocumentUt...
Product: contrib
Classification: Unclassified
Component: Code
All All
: P3 (vote)
Assigned To: Michel Graciano
Depends on:
  Show dependency treegraph
Reported: 2009-11-13 05:18 UTC by misterm
Modified: 2010-04-14 12:52 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT

stacktrace (1.43 KB, text/plain)
2009-11-13 05:18 UTC, misterm
NBM package with fix (23.93 KB, application/octet-stream)
2010-04-08 13:13 UTC, ehartmann
Small patch (624 bytes, text/plain)
2010-04-08 13:57 UTC, ehartmann

Note You need to log in before you can comment on or make changes to this bug.
Description misterm 2009-11-13 05:18:24 UTC
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

        at org.netbeans.lib.editor.util.swing.DocumentUtilities.addPriorityDocumentListener(
        at org.netbeans.lib.editor.util.swing.DocumentUtilities.addDocumentListener(
        at org.netbeans.modules.showtodos.TodoAnnotationProvider$ScanningListener.attachTo(
        at org.netbeans.modules.showtodos.TodoAnnotationProvider$ScanningListener.attachTo(
        at org.netbeans.modules.showtodos.TodoAnnotationProvider$ScanningListener.access$000(
        at org.netbeans.modules.showtodos.TodoAnnotationProvider.annotate(
Comment 1 misterm 2009-11-13 05:18:28 UTC
Created attachment 90984 [details]
Comment 2 Vitezslav Stejskal 2009-11-13 05:59:32 UTC
Comment 3 Jiri Kovalsky 2010-04-08 11:06:39 UTC
Issue added to NetFIX Pool [1]. Module owner please speak up if you disagree.


For NetFIX developers, the class is located in this package:
Comment 4 ehartmann 2010-04-08 12:51:03 UTC
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 ?

Comment 5 misterm 2010-04-08 13:08:43 UTC
It was random, sorry.
Comment 6 ehartmann 2010-04-08 13:13:30 UTC
Created attachment 96890 [details]
NBM package with fix
Comment 7 ehartmann 2010-04-08 13:14:47 UTC

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

Comment 8 ehartmann 2010-04-08 13:57:30 UTC
Created attachment 96894 [details]
Small patch
Comment 9 Jiri Kovalsky 2010-04-08 14:03:28 UTC
Michel, could you please review the patch and integrate it if you don't have objections? Thanks!
Comment 10 Michel Graciano 2010-04-08 14:14:01 UTC
I will review it soon. I am glad to see patch coming for this module :)
Comment 11 Michel Graciano 2010-04-08 14:48:01 UTC
@Michael, do you remember which kind of file was you editing in that time? :)
Comment 12 Michel Graciano 2010-04-08 14:52:19 UTC
Changeset: 870582a9a83c
Author:    Michel Graciano <>
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
Comment 13 Michel Graciano 2010-04-08 14:55:23 UTC
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

Comment 14 Jiri Kovalsky 2010-04-08 14:57:11 UTC
Thanks Michel for your review & integration and special thanks to Eric for the patch!
Comment 15 misterm 2010-04-14 12:52:23 UTC
Could not reproduce anymore, seems fixed.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo