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 227419

Summary: Highlights sequence for SyntaxHighlighting layer reports invalid offsets
Product: editor Reporter: Miloslav Metelka <mmetelka>
Component: Painting & PrintingAssignee: Miloslav Metelka <mmetelka>
Status: VERIFIED FIXED    
Severity: normal CC: MackSix, mmirilovic, vriha
Priority: P2    
Version: 7.3   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Attachments: Sample jsp where the problem occurs

Description Miloslav Metelka 2013-03-13 13:40:16 UTC
Created attachment 132564 [details]
Sample jsp where the problem occurs

Transferred from issue 225341:

The CSS issue is fixed, thanks. But JSP issue is still valid, the issue is with
SyntaxHighlighting (unlike CSS and Semantic) - please check attached IDE log

To reproduce:
- paste text of attached JSP file to JSP file in IDE couple of times


Product Version: NetBeans IDE Dev (Build jet-main-7697-on-20130313)
Java: 1.7.0_17; Java HotSpot(TM) Client VM 23.7-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_17-b02
System: Linux version 3.2.0-38-generic-pae running on i386; UTF-8; en_US (nb)
Comment 1 Vladimir Riha 2013-03-13 14:08:16 UTC
After offline discussion with Mila, let's make it 73patch2 candidate since it happens randomly (+to recover one has to simply reopen file), it seems to affect only coloring and there is now other feedback from users
Comment 2 Vladimir Riha 2013-04-19 06:13:46 UTC
*** Bug 228739 has been marked as a duplicate of this bug. ***
Comment 3 Vladimir Riha 2013-04-19 06:17:29 UTC
Another use case from issue 228739:

"adding the elements from the palatte, the
color highlighting is broken and most everything turn black in the are to the
end of the file."
Comment 4 Vladimir Riha 2013-05-15 06:12:06 UTC
Milo, do you think it can be fixed for 7.3.1? I'd vote for it since it really doesn't look good
Comment 5 Miloslav Metelka 2013-05-20 15:48:12 UTC
Finally I was able to reproduce on the following JSP:

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <body>
        <jsp:useBean 
    </body>
</html>


When placing cursor here

        <jsp:useBean |

and typing 'i' followed by Ctrl+SPACE which fills in 'id="|"' and typing 'ab' followed by Enter and pressing Ctrl+Z leads to an inconsistent token hierarchy. 
One of embedded token lists of the TH has doubled contained tokens.
It affects syntax highlighting as well since the highlighting layer reports offset boundaries of the same token(s) twice so the layer becomes disabled for the particular coloring.

http://hg.netbeans.org/jet-main/rev/79e1dfc5eef4
Comment 6 Quality Engineering 2013-05-22 02:36:42 UTC
Integrated into 'main-golden', will be available in build *201305212300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/79e1dfc5eef4
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #227419 - Highlights sequence for SyntaxHighlighting layer reports invalid offsets.
Comment 7 Vladimir Riha 2013-05-22 07:58:29 UTC
Thanks a lot. It seems to fix the issue (at least I can't reproduce it anymore). I found issue 230077 but I think it is not related (moreover, I reproduced it on dev build 201305192300, so before this fix). 

Verified in trunk



Product Version: NetBeans IDE Dev (Build 201305212300)
Java: 1.7.0_21; Java HotSpot(TM) Client VM 23.21-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b11
System: Linux version 3.2.0-43-generic-pae running on i386; UTF-8; en_US (nb)
Comment 8 Miloslav Metelka 2013-05-23 09:14:22 UTC
In release73:
79e1dfc5eef4 transplanted as e7e1dc289d75
Comment 9 Quality Engineering 2013-05-24 00:11:59 UTC
Integrated into 'releases', will be available in build *201305232200* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/e7e1dc289d75
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #227419 - Highlights sequence for SyntaxHighlighting layer reports invalid offsets.
(transplanted from 79e1dfc5eef4613777afe645f51f96fd757c91fe)
Comment 10 Vladimir Riha 2013-05-28 10:37:55 UTC
v.

Product Version: NetBeans IDE 7.3.1 (Build 201305272201)
Java: 1.7.0_21; Java HotSpot(TM) Client VM 23.21-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b11
System: Linux version 3.2.0-43-generic-pae running on i386; UTF-8; en_US (nb)