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 157158 - xml lexer treats multiline block comments as different tokens
Summary: xml lexer treats multiline block comments as different tokens
Status: RESOLVED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Lexer (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Samaresh Panda
URL:
Keywords:
Depends on:
Blocks: 154788
  Show dependency tree
 
Reported: 2009-01-20 19:16 UTC by Samaresh Panda
Modified: 2009-02-19 23:31 UTC (History)
0 users

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 Samaresh Panda 2009-01-20 19:16:29 UTC
If text in block comments are in multiple lines because of line breaks, xml lexer treats them as different tokens, one
for each line. As per code comments, this was done as a result of a very old issue 39446.

An example:
    <!--
    This is a block comment
    -->

It creates three block-comment tokens 1)for "<!--" 2) for "/nThis is a block comment" 3) for "/n-->"

Here is the developer's comment in XMLLexer.java.
------------------------------------------------
//create an XML comment token for each line of the comment - a workaround fix for performance bug #39446
//this also causes a SyntaxtElement to be created for each line of the comment - see XMLSyntaxSupport.createElement:277
//PENDING - this code can be removed after editor solve it somehow in their code
------------------------------------------------
Comment 1 Samaresh Panda 2009-01-20 19:36:31 UTC
I removed the hack and verified by adding comments to huge schemas like OTA and another xml document. I could no longer
produce issue 39446. Perhaps with the introduction of lexer and other editor changes, issue 39446 seems to be fixed.

So I'm going to revert this change in lexer.
Comment 2 Samaresh Panda 2009-01-20 21:08:14 UTC
Fix integrated: http://hg.netbeans.org/main/rev/76756e31ccfd.
Comment 3 Quality Engineering 2009-01-23 07:30:58 UTC
Integrated into 'main-golden', will be available in build *200901230201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/76756e31ccfd
User: samaresh@netbeans.org
Log: #157158 : xml lexer creates multiple block comment tokens if separated by line breaks.