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 137579 - NPE at .lexer.EmbeddedTokenList.joinTokenCount(EmbeddedTokenList.java:239)
Summary: NPE at .lexer.EmbeddedTokenList.joinTokenCount(EmbeddedTokenList.java:239)
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Lexer (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Miloslav Metelka
URL:
Keywords:
: 137701 (view as bug list)
Depends on:
Blocks: 137801
  Show dependency tree
 
Reported: 2008-06-18 15:14 UTC by Martin Schovanek
Modified: 2008-06-23 16:24 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
NullPointerException (2.39 KB, text/plain)
2008-06-18 15:16 UTC, Martin Schovanek
Details
A similar NPE from closing the .jsp (3.30 KB, text/plain)
2008-06-18 15:19 UTC, Martin Schovanek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Schovanek 2008-06-18 15:14:57 UTC
[#200806180005, jdk1.5.0]

to reproduce:
-------------
1) have a .jsp like:
<%
java.util.Map<String,String> map = new java.util.HashMap<String,String>();|
map.put("1", "one");
map.put("2", "two");
%>
<% for(String cn : map.keySet()) { %>
    <p style="<%= (map.get(cn)!=null && !map.get(cn).equals("two") ? "color: red" : "") %>">
    <%=  map.get(cn) %></p>
<% } %>

NOTE: | char represents cursor

2) move the cursor left (by [<-] key)

IDE throws:
Comment 1 Martin Schovanek 2008-06-18 15:16:43 UTC
Created attachment 63001 [details]
NullPointerException
Comment 2 Martin Schovanek 2008-06-18 15:19:54 UTC
Created attachment 63002 [details]
A similar NPE from closing the .jsp
Comment 3 Miloslav Metelka 2008-06-19 15:03:35 UTC
I have identified the problem and I'm working on a fix. In the meantime I have disabled custom embedding creation so
that the problematic jsp can be opened.

http://hg.netbeans.org/main/rev/2f5fdf113b00
Comment 4 Quality Engineering 2008-06-20 15:50:49 UTC
Integrated into 'main-golden', available in NB_Trunk_Production #271 build
Changeset: http://hg.netbeans.org/main/rev/2f5fdf113b00
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #137579 - NPE at .lexer.EmbeddedTokenList.joinTokenCount(EmbeddedTokenList.java:239).
Comment 5 Miloslav Metelka 2008-06-23 09:50:24 UTC
I have removed the original workaround and fixed the problem.

http://hg.netbeans.org/main/rev/349aa983e762
Comment 6 Quality Engineering 2008-06-23 16:13:02 UTC
Integrated into 'main-golden', available in NB_Trunk_Production #277 build
Changeset: http://hg.netbeans.org/main/rev/349aa983e762
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #137579 - NPE at .lexer.EmbeddedTokenList.joinTokenCount(EmbeddedTokenList.java:239) - final fix.
Comment 7 Miloslav Metelka 2008-06-23 16:24:10 UTC
*** Issue 137701 has been marked as a duplicate of this issue. ***