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 154429 - NullPointerException at org.netbeans.modules.languages.features.SyntaxErrorHighlighter$1.run
Summary: NullPointerException at org.netbeans.modules.languages.features.SyntaxErrorHi...
Status: RESOLVED WONTFIX
Alias: None
Product: obsolete
Classification: Unclassified
Component: languages (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: Geertjan Wielenga
URL: http://statistics.netbeans.org/except...
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-03 09:38 UTC by Peter Nabbefeld
Modified: 2010-10-18 09:53 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 143645


Attachments
stacktrace (887 bytes, text/plain)
2008-12-03 09:38 UTC, Peter Nabbefeld
Details
stacktrace (888 bytes, text/plain)
2008-12-10 16:47 UTC, Jiri Prox
Details
Proposed patch (1.05 KB, patch)
2009-01-16 15:48 UTC, J Bachorik
Details | Diff
stacktrace (888 bytes, text/plain)
2009-02-09 21:55 UTC, giorgio42
Details
stacktrace (888 bytes, text/plain)
2009-02-09 22:01 UTC, giorgio42
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Nabbefeld 2008-12-03 09:38:07 UTC
Build: NetBeans IDE Dev (Build 200812020201)
VM: Java HotSpot(TM) Client VM, 10.0-b19, Java(TM) SE Runtime Environment, 1.6.0_05-b13
OS: Windows XP, 5.1, x86

User Comments:
epdv: Trying out the FreeMarker plugin (and changing the freemarker.nbs for better highlighting)



Stacktrace: 
java.lang.NullPointerException
        at org.netbeans.modules.languages.features.SyntaxErrorHighlighter$.run(SyntaxErrorHighlighter.java:129)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
Comment 1 Peter Nabbefeld 2008-12-03 09:38:14 UTC
Created attachment 74458 [details]
stacktrace
Comment 2 Jiri Prox 2008-12-10 16:47:11 UTC
Build: NetBeans IDE Dev (Build 20081210053008)
VM: Java HotSpot(TM) Client VM, 11.0-b13, Java(TM) SE Runtime Environment, 1.6.0_10-rc-b26
OS: Linux, 2.6.22-16-generic, i386

User Comments: 
NPE when opening .diff file

Stacktrace: 
java.lang.NullPointerException
        at org.netbeans.modules.languages.features.SyntaxErrorHighlighter$1.run(SyntaxErrorHighlighter.java:129)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
Comment 3 Jiri Prox 2008-12-10 16:47:18 UTC
Created attachment 74817 [details]
stacktrace
Comment 4 J Bachorik 2009-01-16 15:48:05 UTC
Created attachment 75908 [details]
Proposed patch
Comment 5 Exceptions Reporter 2009-02-09 21:53:43 UTC
This issue has already 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=143645
Comment 6 giorgio42 2009-02-09 21:55:46 UTC
Build: NetBeans IDE Dev (Build 090207)
VM: Java HotSpot(TM) Server VM, 11.0-b16, Java(TM) SE Runtime Environment, 1.6.0_11-b03
OS: Windows XP, 5.1, x86

User Comments: 
Same as before, exceptions appears basically after every editing action, making editing almost impossible.

Stacktrace: 
java.lang.NullPointerException
        at org.netbeans.modules.languages.features.SyntaxErrorHighlighter$1.run(SyntaxErrorHighlighter.java:129)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
Comment 7 giorgio42 2009-02-09 21:55:52 UTC
Created attachment 76758 [details]
stacktrace
Comment 8 giorgio42 2009-02-09 21:59:11 UTC
This bug makes impossible to reasonably edit a .nbs file, throwing exception after exception -> at least P2, if not P1.

Comment 9 giorgio42 2009-02-09 22:01:49 UTC
Build: NetBeans IDE Dev (Build 090207)
VM: Java HotSpot(TM) Server VM, 11.0-b16, Java(TM) SE Runtime Environment, 1.6.0_11-b03
OS: Windows XP, 5.1, x86

User Comments: 
Actually happens at every keypress...

Stacktrace: 
java.lang.NullPointerException
        at org.netbeans.modules.languages.features.SyntaxErrorHighlighter$1.run(SyntaxErrorHighlighter.java:129)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
Comment 10 giorgio42 2009-02-09 22:01:58 UTC
Created attachment 76760 [details]
stacktrace
Comment 11 Jan Jancura 2009-02-14 09:57:19 UTC
freemarker plugin is experimental, diff has been rewritten to Lexer API > P3
Comment 12 giorgio42 2009-02-16 20:54:39 UTC
I get this exception continuously editing a simple .nbs file. It has neither to do with freemarker nor with diff.

(Or is NBS support also experimental? What kind of excuse is this anyway? How can freemarker support be experimental
when it is the technology behind NB file templates?)

Comment 13 udoweigelt 2009-03-15 23:33:58 UTC
Hi have the same problem on my plugin (also nbs). 
I found the following:

1. Error because document==null
SyntaxErrorHighlighter
  public void afterEvaluation (ParserResult parserResult) {
	Position position = document.createPosition (item.getOffset ());

2. the constructor is called twice on opening an editor-window, on the second call doc is null
   
public SyntaxErrorHighlighter (Document doc) {
        this.document = (NbEditorDocument) doc;
    }

3. document==null
AASTEvaluatorFactory implements ASTEvaluatorFactory {
        public ASTEvaluator  create (Document document) {

4. document==null
ParserListenerFactoryImpl
	public Collection<SchedulerTask> create (Snapshot snapshot) {
Document document = snapshot.getSource ().getDocument (false);

JavaDoc of org.​netbeans.​modules.​parsing.​api.​Source
	public Document getDocument(boolean forceOpen)

"Please note that this method can return null in case that this Source was created for a file and there has not been yet
a document loaded from this file.
Returns:
The Document represented by this Source or null if no document has been loaded yet."
Comment 14 Jaroslav Tulach 2010-10-18 09:53:07 UTC
In release 6.7.x Geertjan agreed to take care about Schliemann bugs - assigning to him.

However these bugs are also not influencing the NetBeans IDE (as no module providing editor support is using schliemann anymore). As such there is nobody to work on these bugs right now - marking won'tfix.

In case you can provide fix for one of these bugs, feel free to reopen and tell Geertjan to help you integrate the fix.