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.
Build: NetBeans IDE Dev (Build 100329-6c9dc7e53361) VM: Java HotSpot(TM) Client VM, 16.0-b13, Java(TM) SE Runtime Environment, 1.6.0_18-b07 OS: Windows Server 2008 User Comments: GUEST: I put a: '*' in the "Matching Rows: box in the data browser under services sql command GUEST: Execute a query. Then type in a '?' in the "Matching Rows" field. Exception is thrown. GUEST: I put a ? in the Matching Rows text box in the mysql sunbiz: 1.) Write select query on database and get results 2.) In mathing characters type ? and exception is thrown Stacktrace: java.util.regex.PatternSyntaxException: Dangling meta character '?' near index 0 ? ^ at java.util.regex.Pattern.error(Pattern.java:1713) at java.util.regex.Pattern.sequence(Pattern.java:1878) at java.util.regex.Pattern.expr(Pattern.java:1752) at java.util.regex.Pattern.compile(Pattern.java:1460) at java.util.regex.Pattern.<init>(Pattern.java:1133) at java.util.regex.Pattern.compile(Pattern.java:847)
Created attachment 96262 [details] stacktrace
Should be NetFIXable [1]. Can do similar to #182595. Is that fine, then I attach a patch?? [1] http://wiki.netbeans.org/NetFIX
Created attachment 96294 [details] Added regex checking... also fixes #182595
Saptarshi, could you describe in detail how to reproduce the problem? I need to know how it happens to make a unit test that part of code. Thanks for the patch, I will review it then. Thanks
*** Bug 182595 has been marked as a duplicate of this bug. ***
Steps to reproduce: 1.) Open Execute command on a SQL connection 2.) select * from <column-name> ... this will return rows 3.) You will see the matching rows field 4.) Type one of the pattern characters i.e * or \ in this field The exception is thrown...
Saptarshi, thanks for the steps. Now I see why I didn't reproduce this, on GTK (my default L&F) Matching Rows are not visible at all, I have to run IDE with other L&F - I filed issue 183264. I review your patch and it didn't work for me, some characters still throwing the exception. I fixed it in another way, using http://java.sun.com/javase/6/docs/api/java/util/regex/Pattern.html#quote%28java.lang.String%29 Fixed in core-main/rev/8e5ea5fb080e
Integrated into 'main-golden', will be available in build *201004020200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/8e5ea5fb080e User: Jiri Rechtacek <jrechtacek@netbeans.org> Log: #183115: java.util.regex.PatternSyntaxException: Dangling meta character '?' near index 0 ? ^
OK, I have removed the issue from the NetFIX Pool. Thanks for your attempt Saptarshi anyway!
yea... silly me. But thanks Jiri for reviewing
A better fix applied in core-main/rev/294c1c857218