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 121964 - NullPointerException at org.netbeans.api.lexer.Language$Accessor.languageOperation
Summary: NullPointerException at org.netbeans.api.lexer.Language$Accessor.languageOper...
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Lexer (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: issues@editor
URL: http://statistics.netbeans.org/except...
Keywords: REGRESSION
: 121908 121970 122031 122077 122138 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-11-15 08:27 UTC by avp
Modified: 2007-12-07 16:37 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 11362


Attachments
stacktrace (7.63 KB, text/plain)
2007-11-15 14:00 UTC, Jiri Skrivanek
Details
stacktrace (2.67 KB, text/plain)
2007-11-15 17:30 UTC, Jesse Glick
Details
stacktrace (2.67 KB, text/plain)
2007-11-15 18:18 UTC, leszekg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description avp 2007-11-15 08:27:24 UTC
Build: NetBeans IDE Dev (Build 200711141200)
VM: Java HotSpot(TM) Client VM, 1.6.0_02-b05
OS: Linux, 2.6.22.5-31-default, i386

User Comments:
Comment 1 Jiri Prox 2007-11-15 09:50:37 UTC
I can reproduce it too - just press enter in XML file. 
Comment 2 Jiri Prox 2007-11-15 09:51:53 UTC
It's quite serious, XML file cannot be edited  -> P2
Comment 3 avp 2007-11-15 09:59:58 UTC
I can't edit .cpp files
Comment 4 Jan Becicka 2007-11-15 13:50:02 UTC
*** Issue 121908 has been marked as a duplicate of this issue. ***
Comment 5 Jan Becicka 2007-11-15 13:50:21 UTC
Not in 6.0.
Comment 6 Jiri Skrivanek 2007-11-15 14:00:07 UTC
Build: NetBeans IDE Dev (Build 20071115111332)
VM: Java HotSpot(TM) Client VM, 1.6.0_03-b02
OS: Windows XP, 5.1, x86

User Comments: 
To reproduce:

- create a web application with Struts framework
- open New file wizard
- choose Struts|Struts Action
- type a package name and action path in text fields
- click Finish and the exception is thrown
Comment 7 Jiri Skrivanek 2007-11-15 14:00:11 UTC
Created attachment 53043 [details]
stacktrace
Comment 8 Jiri Skrivanek 2007-11-15 14:03:48 UTC
It is a regression since build 200711131810. Last time it worked in build 200711131522.
Comment 9 Miloslav Metelka 2007-11-15 15:30:39 UTC
I'm working on it.
Comment 10 Jesse Glick 2007-11-15 17:30:42 UTC
Build: NetBeans IDE Dev (Build 071114)
VM: Java HotSpot(TM) Client VM, 1.6.0_03-b05
OS: Linux, 2.6.22-14-generic, i386

User Comments: 
Just typed some text at the end of a plain text file.
Comment 11 Jesse Glick 2007-11-15 17:30:45 UTC
Created attachment 53069 [details]
stacktrace
Comment 12 Jesse Glick 2007-11-15 17:32:19 UTC
Thrown when simply editing a plain text file. Definitely P1.
Comment 13 leszekg 2007-11-15 18:18:01 UTC
Build: NetBeans IDE Dev (Build 200711150000)
VM: Java HotSpot(TM) Client VM, 1.6.0_02-b06
OS: Windows Vista, 6.0, x86

User Comments: 
I opened new-created properties file.
Comment 14 leszekg 2007-11-15 18:18:05 UTC
Created attachment 53074 [details]
stacktrace
Comment 15 Miloslav Metelka 2007-11-15 23:24:25 UTC
I have eliminated the NPE:

Checking in TokenHierarchyOperation.java;
/cvs/lexer/src/org/netbeans/lib/lexer/TokenHierarchyOperation.java,v  <--  TokenHierarchyOperation.java
new revision: 1.32; previous revision: 1.31

but I'm still searching why the XML language is not initialized. The code in XMLKit that does 
doc.putProperty(Language.class, XMLTokenId.language());
does not triggered (J2EE_LEXER_COLORING is false) and the XML Lexer module does seem to have a xml layer. I did not find
any place where the XMLTokenId.language() would get registered yet. I've made a small patch that bypasses the cache of
LanguageManager but it still has no effect due to the missing language.
Comment 16 Torbjorn Norbye 2007-11-16 02:12:04 UTC
*** Issue 122077 has been marked as a duplicate of this issue. ***
Comment 17 Jiri Prox 2007-11-16 08:37:55 UTC
*** Issue 122031 has been marked as a duplicate of this issue. ***
Comment 18 Miloslav Metelka 2007-11-16 10:48:56 UTC
*** Issue 121970 has been marked as a duplicate of this issue. ***
Comment 19 Miloslav Metelka 2007-11-16 12:33:38 UTC
Since the xml uses the old way of syntax highlighting I had to do one more fix in HLFactory to use it since token
hierarchy is now always non-null. I have also improved TH use in SyntaxHighlighting.

Checking in src/org/netbeans/modules/editor/impl/highlighting/HLFactory.java;
/cvs/editor/src/org/netbeans/modules/editor/impl/highlighting/HLFactory.java,v  <--  HLFactory.java
new revision: 1.7; previous revision: 1.6
done
Checking in lib2/src/org/netbeans/modules/editor/lib2/highlighting/SyntaxHighlighting.java;
/cvs/editor/lib2/src/org/netbeans/modules/editor/lib2/highlighting/SyntaxHighlighting.java,v  <--  SyntaxHighlighting.java
new revision: 1.19; previous revision: 1.18

This should not appear in 6.0 since this regression was caused by issue 121829.
Comment 20 Jan Lahoda 2007-11-16 19:32:56 UTC
*** Issue 122138 has been marked as a duplicate of this issue. ***