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

Summary: xml lexer treats multiline block comments as different tokens
Product: xml Reporter: Samaresh Panda <samaresh>
Component: LexerAssignee: Samaresh Panda <samaresh>
Status: RESOLVED FIXED    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 154788    

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.