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 200967 - AssertionError: token:> ts=JoinedTokenSequence[ContextDataTokenSequence[ts=TokenSequence for text/x-latte-template/text/html at tokenIndex=0. TokenList contains 1 tokens: *[0]: "<" <0,1> DECLARATION[1
Summary: AssertionError: token:> ts=JoinedTokenSequence[ContextDataTokenSequence[ts=To...
Status: VERIFIED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: HTML Editor (show other bugs)
Version: 7.2
Hardware: PC All
: P3 normal with 1 vote (vote)
Assignee: David Konecny
URL:
Keywords:
: 200211 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-08-15 16:04 UTC by Martin Fousek
Modified: 2012-09-13 07:40 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 180619


Attachments
stacktrace (4.32 KB, text/plain)
2011-08-15 16:04 UTC, Martin Fousek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Fousek 2011-08-15 16:04:51 UTC
Build: NetBeans IDE Dev (Build 20110815-c7e0dc802007)
VM: Java HotSpot(TM) 64-Bit Server VM, 19.0-b09, Java(TM) SE Runtime Environment, 1.6.0_23-b05
OS: Linux

User Comments:
marfous: pressed enter in HEAD section after </script> tag




Stacktrace: 
java.lang.AssertionError: token:> ts=JoinedTokenSequence[ContextDataTokenSequence[ts=TokenSequence for text/x-latte-template/text/html at tokenIndex=0. TokenList contains 1 tokens:
*[0]: "<" <0,1> DECLARATION[14] ParT[1/2], IHC=376489243

,virtual=false],ContextDataTokenSequence[CURRENT,ts=TokenSequence for text/x-latte-template/text/html at tokenIndex=3. TokenList contains 5 tokens:
T[0]: "!DOCTYPE" <1,9> DECLARATION[14] ParT[2/2], la=1, st=State(hash=7683932,s=41,ss=0,es=0,tag=null,attr=null), IHC=835425291
T[1]: " " <9,10> WS[3] DefT, la=1, st=State(hash=6264075,s=24,ss=0,es=0,tag=null,attr=null), IHC=744781751
T[2]: "html" <10,14> DECLARATION[14] DefT, la=1, st=State(hash=6264075,s=24,ss=0,es=0,tag=null,attr=null), IHC=2012194341
*[3]: ">" <14,15> DECLARATION[14] DefT, st=State(hash=4259571,s=0,ss=0,es=0,tag=null,attr=null), IHC=377816231
T[4]: "\n" <15,16> TEXT[0] DefT, la=1, st=State(hash=4259571,s=0,ss=0,es=0,tag=null,attr=null), IHC=1995733885

,virtual=false],ContextDataTokenSequence[ts=TokenSequence
   at org.netbeans.modules.web.indent.api.support.MarkupAbstractIndenter.getLineIndent(MarkupAbstractIndenter.java:473)
   at org.netbeans.modules.web.indent.api.support.AbstractIndenter.processLanguage(AbstractIndenter.java:1190)
   at org.netbeans.modules.web.indent.api.support.AbstractIndenter.calculateIndentation(AbstractIndenter.java:345)
   at org.netbeans.modules.web.indent.api.support.AbstractIndenter.reindent(AbstractIndenter.java:209)
   at org.netbeans.modules.html.editor.indent.HtmlIndentTask.reindent(HtmlIndentTask.java:74)
   at org.netbeans.modules.editor.indent.TaskHandler$MimeItem.runTask(TaskHandler.java:546)
Comment 1 Martin Fousek 2011-08-15 16:04:55 UTC
Created attachment 109987 [details]
stacktrace
Comment 2 David Konecny 2011-11-01 11:01:04 UTC
*** Bug 200211 has been marked as a duplicate of this bug. ***
Comment 3 David Konecny 2012-04-19 04:22:26 UTC
This exception happens only on Latte files. Should be filed for Nette plugin and evaluated there first.
Comment 4 mpalasis 2012-05-24 10:19:33 UTC
NetBeans-PHP 201205200400
This error occurs when editing PHP files.
exception report @ http://statistics.netbeans.org/analytics/exception.do?id=581981

reopened because: nothing to do with Latte..
Comment 5 mpalasis 2012-05-29 08:12:06 UTC
(In reply to comment #4)
> NetBeans-PHP 201205200400
also in nb 201205280002

To Reproduce:
create new php file and paste:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<base href="<?php
    echo $baseref;
   ?>" />


Now try to hit enter at the trailing '/>'.

It's worth noting that if the DOCTYPE was simply <!DOCTYPE html> this bug does not occur, interesting? ;)
Comment 6 David Konecny 2012-05-30 06:24:45 UTC
Thanks for the test case. I have not had a time to try it but will early next week. Thanks.
Comment 7 redhead 2012-05-31 18:12:37 UTC
I just wanted to ask (and bump a bit) if the status of this issue is being considered or even worked on. We have a serious problem with it in the Nette plugin but I am still not sure if it's related only to Latte files or it's a problem with HTML indenter (that's what the stacktrace shows).

My case where the error comes up (with Nette plugin in a .latte file) is when pressing Enter right after this text <!DOCTYPE html>. Even this simple code throws exception.

Regards.
Nette plugin dev
Comment 8 majkl578 2012-06-19 11:09:02 UTC
Bump.

David, did you have a time to look at this issue (as you promised almost a month ago)?

Verified also on Linux. By the way, priority should be P2, not P3 since there is a workaround, but is really impractical and the bug is annoying.

Thanks.

PS: Any possibility to get this fixed in final 7.2?
Comment 9 David Konecny 2012-06-20 03:13:00 UTC
Looking at it right! Too much work and too little time. I'm very sorry!
Comment 10 David Konecny 2012-06-20 04:49:01 UTC
Fixed and unit test added. 75665a9f7caf
Unfortunately it is too late for inclusion of this fix in 7.2 - 7.2 is in high resistance mode and only fixes of P1s or serious P2s are allowed to be integrated. It will be fixed in 7.2 Patch 1.

A workaround for this problem it to structure the code in your test case like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<base 
    href="<?php
    echo $baseref;
   ?>" />

-> notice a one more empty line I added between "href" definition.

If there is enough demand I can build a patched version of  org.netbeans.modules.web.indent.jar and attach it to this issued once NB7.2 is released which could be used as short time patch.

As usual verification of the fix on daily dev build of NB 7.3 would be appreciated. Continual builder will append a build number here once the fix is part of a build.
Comment 11 Quality Engineering 2012-06-22 04:49:07 UTC
Integrated into 'main-golden', will be available in build *201206220002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/75665a9f7caf
User: David Konecny <dkonecny@netbeans.org>
Log: #200967 - AssertionError: token:> ts=JoinedTokenSequence
Comment 12 Marian Mirilovic 2012-06-27 13:33:33 UTC
regression see bug 214777
Comment 13 David Konecny 2012-06-27 20:47:20 UTC
> regression see bug 214777

Must be a different way to trigger the same assertion.
Comment 14 Vladimir Riha 2012-08-08 09:30:57 UTC
unable to reproduce in trunk with given sample code and other snippets in reports => verified


Product Version: NetBeans IDE Dev (Build 201208080001)
Java: 1.7.0_06; Java HotSpot(TM) Client VM 23.2-b09
System: Linux version 3.0.0-23-generic running on i386; UTF-8; en_US (nb)
Comment 15 Petr Jiricka 2012-08-30 20:14:27 UTC
So changeset 75665a9f7caf should be transplanted to release72 branch for the 7.2 patch? If so, could you do that David? Thanks.
Comment 16 Petr Jiricka 2012-08-31 19:22:24 UTC
Transplanted to release72 branch as changeset 77321fe2823a.
Comment 17 Quality Engineering 2012-09-01 11:09:43 UTC
Integrated into 'releases', will be available in build *201209010822* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/77321fe2823a
User: David Konecny <dkonecny@netbeans.org>
Log: #200967 - AssertionError: token:> ts=JoinedTokenSequence
Comment 18 Vladimir Riha 2012-09-13 07:40:16 UTC
Unable to reproduce with given samples => verifying for patch

Product Version: NetBeans IDE 7.2 (Build 201207171143)
Java: 1.7.0_07; Java HotSpot(TM) Client VM 23.3-b01
System: Linux version 3.2.0-30-generic-pae running on i386; UTF-8; en_US (nb)