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 122663 - [60cat] remaining red underlining after syntax correction
Summary: [60cat] remaining red underlining after syntax correction
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Painting & Printing (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 blocker with 1 vote (vote)
Assignee: issues@editor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-23 20:35 UTC by ulfzibis
Modified: 2009-11-10 02:57 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
missing red underline (6.66 KB, image/jpeg)
2007-11-23 20:36 UTC, ulfzibis
Details
red underline remains (6.79 KB, image/jpeg)
2007-11-23 20:36 UTC, ulfzibis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ulfzibis 2007-11-23 20:35:03 UTC
[ BUILD # : 200711201000 ]
[ JDK VERSION : 1.6.0_03 ]

- example :
        for (int i:=10; i>0; i++)
            System.out.println("Hello World "+i);
(notice that only 2nd line is underlined red, but both lines have
errors)

- delete colon after i
- notice the remaining red underlining of 2nd line
Comment 1 ulfzibis 2007-11-23 20:36:17 UTC
Created attachment 53424 [details]
missing red underline
Comment 2 ulfzibis 2007-11-23 20:36:57 UTC
Created attachment 53425 [details]
red underline remains
Comment 3 Jiri Prox 2007-11-26 08:52:40 UTC
I've have it seen as well in current daily build. It's seems as painting problem, when I move the caret over the wrongly
marked line the red underline went away.
Comment 4 ulfzibis 2007-11-26 16:22:22 UTC
Don't forget, that I had errors in 2 lines, but erroneously only 1 line was underlined.
Comment 5 Vitezslav Stejskal 2007-11-30 11:46:17 UTC
Ok, two problems reported:
#1 - not both lines were underlined to mark the errors
#2 - when the error was corrected the second line stayed underlined

I can reproduce #1 in a dev build, but not #2. With #2 I can actually see the underlining flick in there for a moment
and then disappear. I'm not sure why that is, maybe a conflict between error and hint annotations?

Re #2 - I can't reproduce it. Did you change font size or tweaked fonts&colors settings in any way? Or maybe this is
Windows specific. Jirko, could you please double check this on linux/Mac? Thanks
Comment 6 Jan Lahoda 2007-11-30 14:58:45 UTC
Re 1: I did some debugging, and the problem is possibly in OffestsBag - I have created a test case, which shows what
happens - I would assume that the HighlightSequence should be non-empty on the last line. Is that right? Thanks.

    public void test122663() throws BadLocationException {
        Document doc = new PlainDocument();
        doc.insertString(0, "     567890123456789", SimpleAttributeSet.EMPTY);
        
        OffsetsBag bag = new OffsetsBag(doc);
        
        SimpleAttributeSet attribsA = new SimpleAttributeSet();
        SimpleAttributeSet attribsB = new SimpleAttributeSet();

        attribsA.addAttribute("set-name", "attribsA");
        attribsB.addAttribute("set-name", "attribsB");
        
        bag.addHighlight(5, 10, attribsA);
        bag.addHighlight(5, 15, attribsB);
        
        assertTrue(bag.getHighlights(5, 15).moveNext());
    }
Comment 7 ulfzibis 2007-12-02 23:12:15 UTC
> Re #2 - I can't reproduce it. Did you change font size or tweaked fonts&colors settings in any way?
No, I used fresh installed RC2 without imported settings.

> Or maybe this is Windows specific.
Could be. Painting problem makes sence, because only each 2nd pixel of the red underline remains after error correction.
Comment 8 Jiri Prox 2007-12-03 09:41:57 UTC
#2: I've testes it once more time and I can see this only on Win, others platforms (Linux, Mac) are ok
Comment 9 Vitezslav Stejskal 2007-12-03 10:56:57 UTC
#1 - Thanks for the test case. Yes, the sequence should not be empty? I assume you are saying that it *is* empty and the
test fails, which is obviously a bug.

#2 - Thanks for the extra testing. I'll switch to Windows and try to hunt it down.
Comment 10 Jan Lahoda 2008-01-25 10:02:50 UTC
#1: yes, the sequence should be non-empty, IMO, but it is empty with the current implementation, so the test fails.
Comment 11 Jiri Prox 2008-04-11 00:42:26 UTC
moving opened issues from TM <= 6.1 to TM=Dev
Comment 12 Sergey Petrov 2009-04-13 15:49:54 UTC
can't reproduce #1 with 6.7m3,
there is gray highlighting for i in first row and red highlighting in second row.
after correction rd remained in second row and after click in editor all gone, it seems #2 is still reproducible, also
not sure if highlighting on first row should be gray.
Comment 13 ulfzibis 2009-04-15 12:04:42 UTC
I don't understand.
If in 6.7m3 only 2nd line is underlined, it is reproducible as shown in 1st attachment. _Both_ lines (or at least 1st
line) should be underlined red.
Note that also in build 200711201000 variable i seems underlined grey (difficult to see in attached compressed JPEG).
Comment 14 Vitezslav Stejskal 2009-11-05 13:41:37 UTC
http://hg.netbeans.org/jet-main/rev/3c33ed7e852b
Comment 15 Quality Engineering 2009-11-06 10:03:50 UTC
Integrated into 'main-golden', will be available in build *200911060201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/3c33ed7e852b
User: Vita Stejskal <vstejskal@netbeans.org>
Log: #122663: fixing addHighlights (see the issue for the testcase; many thanks to jlahoda for such an excellent testcase)
Comment 16 ulfzibis 2009-11-09 13:14:38 UTC
Is #2 (corrupted repaint on Windows) also covered by this fix ?
Comment 17 Vitezslav Stejskal 2009-11-10 02:57:38 UTC
No, it's not. There is an other bug for it, see issue #114595. Usually changing the font or its size helps. I'm sorry.