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 134448 - parentheses within text quotes should not be highlighted
Summary: parentheses within text quotes should not be highlighted
Alias: None
Product: editor
Classification: Unclassified
Component: Painting & Printing (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Miloslav Metelka
Depends on:
Reported: 2008-05-03 02:11 UTC by fendis_khan
Modified: 2016-07-07 07:32 UTC (History)
2 users (show)

See Also:
Exception Reporter:

Proposed patch (2.03 KB, patch)
2011-10-19 04:59 UTC, maxymshg
Details | Diff
Revised patch which contains changes needed to resolve this issue plus a unit test to prove the solution (4.66 KB, patch)
2011-11-12 18:57 UTC, tomwheeler
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description fendis_khan 2008-05-03 02:11:57 UTC
In the example

b = str.indexOf(")");

the editor highlights the closing parentheses within the text quotes.  The editor similarly highlights braces and brackets.

Perhaps it would be appropriate to ignore all such opening/closing elements located within quotes?
Comment 1 Vitezslav Stejskal 2008-05-04 18:18:51 UTC
You are right. I'll fix that.
Comment 2 tomwheeler 2011-10-18 23:32:55 UTC
Just checking in for the First Patch program...  I didn't see an implementation plan posted, though I realize sometimes this is done through e-mail between the mentor and developer.  I'd appreciate it if you could let me know which milestone you're at according to this page:

and if you're stuck, just let Anuradha (and/or me) know and we'll do our best to help.
Comment 3 maxymshg 2011-10-19 04:59:14 UTC
Created attachment 112203 [details]
Proposed patch
Comment 4 tomwheeler 2011-11-12 17:57:15 UTC
I have tested the proposed patch (sent by e-mail; I will attach a final version later today which leaves out unnecessary changes).  

My testing has demonstrated to me that it solves the problem described in this issue and I have not noticed any negative consequences.  This change also adds a unit test to the existing MasterMatcherTest and I have found that this test passes 100% of the time on both Linux and Windows XP.  

However, I do want to point out that unit tests in the editor.bracesmatching module were already broken before this change.  I have filed issue #205033 (Test error/failure in editor.bracesmatching module) about those problems, but since they existed long before this patch, there is no reason to make this issue depend on that one.
Comment 5 tomwheeler 2011-11-12 18:57:04 UTC
Created attachment 113153 [details]
Revised patch which contains changes needed to resolve this issue plus a unit test to prove the solution

I revised Maxim's patch to remove unintentional modifications.
Comment 6 tomwheeler 2011-11-12 19:28:03 UTC
I have tested that the latest patch (attached to this issue) can be applied to the Mercurial repository cleanly, doesn't contain any unnecessary changes and solves the problem identified by this issue.  

In my opinion, this patch is ready to be included in NetBeans.  I have e-mailed David Strupl from Oracle's NetBeans team to ask which engineer should push this change, and offered to push the change myself if they are not available to do so.
Comment 7 tomwheeler 2011-11-15 16:23:08 UTC
I have never heard from David Strupl, but Svata Dedic (who fixed related issue #205033) told me that this should probably be assigned to Editor/Painting & Printing and that Miloslav Metelka would be the likely person to integrate it.  I will change this now.
Comment 8 Martin Balin 2016-07-07 07:32:07 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss