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 200280 - NullPointerException at org.netbeans.lib.lexer.LexerUtilsConstants.innerLanguage
Summary: NullPointerException at org.netbeans.lib.lexer.LexerUtilsConstants.innerLanguage
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Lexer (show other bugs)
Version: 7.1
Hardware: All All
: P1 normal (vote)
Assignee: Miloslav Metelka
URL:
Keywords:
: 200763 202214 (view as bug list)
Depends on:
Blocks: 202214
  Show dependency tree
 
Reported: 2011-07-21 10:05 UTC by Jan Lahoda
Modified: 2011-11-24 13:44 UTC (History)
15 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 179471


Attachments
stacktrace (5.96 KB, text/plain)
2011-07-21 10:05 UTC, Jan Lahoda
Details
stacktrace (5.83 KB, text/plain)
2011-07-25 22:08 UTC, Michel Graciano
Details
stacktrace (5.85 KB, text/plain)
2011-07-27 20:05 UTC, gilbertoca
Details
stacktrace (5.73 KB, text/plain)
2011-08-11 22:49 UTC, Jesse Glick
Details
stacktrace (5.73 KB, text/plain)
2011-08-17 10:34 UTC, Jiri Skrivanek
Details
stacktrace (5.73 KB, text/plain)
2011-08-22 11:54 UTC, Jiri Skrivanek
Details
stacktrace (5.83 KB, text/plain)
2011-08-25 08:14 UTC, Jiri Skrivanek
Details
stacktrace (5.75 KB, text/plain)
2011-09-01 03:38 UTC, David Konecny
Details
stacktrace (5.73 KB, text/plain)
2011-09-01 17:29 UTC, javydreamercsw
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Lahoda 2011-07-21 10:05:46 UTC
Build: NetBeans IDE Dev (Build 20110719-8ca1f1e028ab)
VM: OpenJDK 64-Bit Server VM, 19.0-b09, OpenJDK Runtime Environment, 1.6.0_20-b20
OS: Linux

User Comments:
jlahoda: Undoing a pretty big edit (the original edit was commenting-out ~200 lines of code, containg strings). I also have another part of the code seleced (also contains strings).




Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.lib.lexer.LexerUtilsConstants.innerLanguage(LexerUtilsConstants.java:178)
   at org.netbeans.api.lexer.TokenSequence.language(TokenSequence.java:161)
   at org.netbeans.modules.javadoc.highlighting.Highlighting.tokenHierarchyChanged(Highlighting.java:117)
   at sun.reflect.GeneratedMethodAccessor86.invoke(GeneratedMethodAccessor86.java:0)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:616)
Comment 1 Jan Lahoda 2011-07-21 10:05:51 UTC
Created attachment 109552 [details]
stacktrace
Comment 2 Exceptions Reporter 2011-07-22 20:35:08 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=179471
Comment 3 Michel Graciano 2011-07-25 22:08:10 UTC
Created attachment 109614 [details]
stacktrace

Undoing changes after formatting code. I have just pasted code from http://download.oracle.com/javase/tutorial/java/nutsandbolts/switch.html page to simulate the Java 7 for formatted the code. After that, I tried to undo the format action and the exception showed up.
Comment 4 gilbertoca 2011-07-27 20:05:16 UTC
Created attachment 109649 [details]
stacktrace

editing java code
Comment 5 Exceptions Reporter 2011-08-08 16:51:34 UTC
This bug already has 10 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=179471
Comment 6 Jesse Glick 2011-08-11 22:49:29 UTC
Created attachment 109939 [details]
stacktrace

revert modifications
Comment 7 Jiri Skrivanek 2011-08-17 10:34:31 UTC
Created attachment 110036 [details]
stacktrace

It is possibly minor use case. To reproduce:

- create a new java class
- copy the following to class definition
        addTest(.class,.tests).
            addTest(.class,.tests).
                    addTest(.class,.tests).
                            addTest(.class,.tests).
                                    addTest(.class,.tests).
                                                addTest(.class,.tests).
                                                            addTest(.class,.tests).
- format the code (Alt+Shift+F)
- undo changes (Ctrl+Z) and exception is thrown
Comment 8 Jiri Skrivanek 2011-08-22 11:54:31 UTC
Created attachment 110131 [details]
stacktrace

Did undo in java source file.
Comment 9 Jiri Skrivanek 2011-08-25 08:14:27 UTC
Created attachment 110195 [details]
stacktrace

I pressed Ctrl+Z for undo.
Comment 10 David Konecny 2011-09-01 03:38:13 UTC
Created attachment 110307 [details]
stacktrace
Comment 11 David Konecny 2011-09-01 03:53:19 UTC
I noticed this while filling issue 201503 and it is always reproducible for me and results into damaging my source file. Hence P1. Here are the steps to reproduce:

* create new Java Classes library project
* using New File->Web-Servlet wizard create abc.NewServlet class. on lines 35 to 40 there is

        try {
            /*
             * TODO output your page here out.println("<html>");
             * out.println("<head>"); out.println("<title>Servlet
             * NewServlet</title>"); out.println("</head>");
             * out.println("<body>"); out.println("<h1>Servlet NewServlet at " +
             * request.getContextPath () + "</h1>"); out.println("</body>");
             * out.println("</html>");
             */
        } finally {            


* remove all comments on lines 35 to 40 so that source code looks like (yes, I accidentally left some comment text in code):

        try {
            
              TODO output your page here out.println("<html>");
              out.println("<head>"); out.println("<title>Servlet
              NewServlet</title>"); out.println("</head>");
              out.println("<body>"); out.println("<h1>Servlet NewServlet at " +
              request.getContextPath () + "</h1>"); out.println("</body>");
              out.println("</html>");
             
        } finally {            

* press ALT-Shift-F
* press CTRL-Z - this NPE exception is thrown
* keep pressing CTRL-Z to revert all the changes you did. In my case the result is always:

        try {

         /*   TODO output* your page here out
            .println("<html>");
            *out.println("<head>");
            out.println(
            "<tit*le>Servlet
              NewServlet<
            /title > ")*; out.println(" <  / head >
            ");
              out.println("<body>");*
            out.println("<h1>Servlet NewServlet at "
                    + *request.getContextPath() + "</h1>");
 */           out.println("</body>");
            out.println("</html>");

        } finally {
Comment 12 javydreamercsw 2011-09-01 17:29:15 UTC
Created attachment 110319 [details]
stacktrace

Tried undo (Ctrl-Z) after formatting a file.
Comment 13 Miloslav Metelka 2011-09-07 14:57:05 UTC
http://hg.netbeans.org/jet-main/rev/b6c25aa74205
Comment 14 Quality Engineering 2011-09-08 14:29:34 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/b6c25aa74205
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #200280 - NullPointerException at org.netbeans.lib.lexer.LexerUtilsConstants.innerLanguage.
Comment 15 Peter Nabbefeld 2011-09-16 11:10:06 UTC
Getting this though updating daily - probably sth. has been reverted, or spec version hasn't been upgraded.
Comment 16 Miloslav Metelka 2011-09-16 13:55:20 UTC
I have increased spec version for you to get AU propagation. Next time please just write a note and do not reopen the issue when it was already fixed.
http://hg.netbeans.org/jet-main/rev/036cc0deb669
Comment 17 Peter Nabbefeld 2011-09-16 14:05:31 UTC
(In reply to comment #16)
> I have increased spec version for you to get AU propagation. Next time please
> just write a note and do not reopen the issue when it was already fixed.
> http://hg.netbeans.org/jet-main/rev/036cc0deb669

No problem. I've just been confused, if sth. has changed, or if it was spec version.
Comment 18 Quality Engineering 2011-09-17 14:13:22 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/036cc0deb669
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #200280 - NullPointerException at org.netbeans.lib.lexer.LexerUtilsConstants.innerLanguage - increased lexer module spec version for AU propagation.
Comment 19 Dusan Balek 2011-10-11 15:31:08 UTC
*** Bug 200763 has been marked as a duplicate of this bug. ***
Comment 20 Miloslav Metelka 2011-10-18 10:11:32 UTC
*** Bug 202214 has been marked as a duplicate of this bug. ***
Comment 21 Jesse Glick 2011-11-01 21:06:45 UTC
(In reply to comment #15)
> Getting this though updating daily

Download fresh dev builds.