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 177497 - it's not possible to type in CSS code embedded in JSP
Summary: it's not possible to type in CSS code embedded in JSP
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP (show other bugs)
Version: 6.x
Hardware: PC Linux
: P1 normal (vote)
Assignee: Marek Fukala
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-24 04:37 UTC by Jindrich Sedek
Modified: 2009-11-25 16:55 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jindrich Sedek 2009-11-24 04:37:17 UTC
Create new Web application
replace index.jsp file with this code:
----------------------------
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>JSP Page</title>
        <style type="text/css">
            <%= "h2" %>{
color:red;|
            }
        </style>
    </head>
    <body>
        <h2>Hello World!</h2>
    </body>
</html>
----------------------------------
set cursor at position of "|"
type something ... -> nothing is writen
Comment 1 Marek Fukala 2009-11-24 05:18:58 UTC
SEVERE [global]
java.lang.NullPointerException
	at org.netbeans.modules.css.gsf.CssCompletion.getAutoQuery(CssCompletion.java:601)
	at org.netbeans.modules.csl.editor.completion.GsfCompletionProvider.getAutoQueryTypes(GsfCompletionProvider.java:159)
	at org.netbeans.modules.editor.completion.CompletionImpl.insertUpdate(CompletionImpl.java:305)
	at org.netbeans.lib.editor.util.swing.PriorityDocumentListenerList.insertUpdate(PriorityDocumentListenerList.java:79)
	at javax.swing.text.AbstractDocument.fireInsertUpdate(AbstractDocument.java:185)
	at org.netbeans.editor.BaseDocument.fireInsertUpdate(BaseDocument.java:1623)
	at org.netbeans.editor.BaseDocument.insertString(BaseDocument.java:778)
	at org.netbeans.editor.BaseKit$DefaultKeyTypedAction.insertString(BaseKit.java:1138)
	at org.netbeans.modules.web.core.syntax.JspKit$JspDefaultKeyTypedAction.insertString(JspKit.java:488)

is thrown after each keystroke
Comment 2 Marek Fukala 2009-11-24 05:34:16 UTC
It is a bug in lexer and also in css completion. I do not handle the case when returned tokensequence is null, but for the particular case the tokensequence should not be null.

I've fixed the css editor part in web-main#3f51dd9f9384, so no exception is thrown and you can type, but the css completion autoopening doesn't work properly due to the lexer issue.

I've filed a new P2 issue #177501 (Cannot get embedded tokensequence from embedded tokensequence, at least under some circumstances) against lexer for the problem.
Comment 3 Marek Fukala 2009-11-24 05:36:45 UTC
Jindro, please verify. Milo, can you please do a code review of the change? Thanks.
Comment 4 Jindrich Sedek 2009-11-24 08:28:07 UTC
verified 
NetBeans IDE Dev (Build web-main-2162-on-091124)

please merge into 6.8 branch
Comment 5 Miloslav Metelka 2009-11-24 09:32:01 UTC
I approve the fix.
Comment 6 Marek Fukala 2009-11-24 09:54:16 UTC
fixed in release68#2bd61fe9a591
Comment 7 Martin Schovanek 2009-11-25 02:30:55 UTC
Verified by QE at the release68 branch.
Comment 8 Quality Engineering 2009-11-25 16:55:42 UTC
Integrated into 'main-golden', will be available in build *200911251400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/3f51dd9f9384
User: Marek Fukala <mfukala@netbeans.org>
Log: #177497 -  it's not possible to type in CSS code embedded in JSP