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 228139 - java.util.regex.PatternSyntaxException on code completion when String contains reserved regex tokens
Summary: java.util.regex.PatternSyntaxException on code completion when String contain...
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-01 21:54 UTC by markiewb
Modified: 2013-08-12 21:11 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 markiewb 2013-04-01 21:54:35 UTC
The current implementation of subword completion [1] leads to PatternSyntaxException in the java editor, when you try to codecomplete in a string with contains a reserved regex token.

For example: Code complete within the following literals
<code>
            String a="{}";
            String b="()";
            String c="?";
            String d="+";
</code>

ACTUAL: 
PatternSyntaxException 

Example for the first code line 
java.util.regex.PatternSyntaxException: Illegal repetition near index 6
.*?".*?{.*?
      ^

EXPECTED:
No exception, subword code completion works


[1] https://netbeans.org/bugzilla/show_bug.cgi?id=212412

FYI: Set to P2, because it is unusable.
Comment 1 Dusan Balek 2013-04-02 08:13:27 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/877d3bb84740
Comment 2 markiewb 2013-04-02 18:54:58 UTC
Thank you!
Comment 3 markiewb 2013-08-12 21:11:52 UTC
Verified in 201308092300