From: Manuel Carrasco MoƱino Date: Tue, 26 Nov 2013 20:03:24 +0000 (+0100) Subject: use replace instead of replaceAll because they are fixed conditions X-Git-Tag: release-1.4.0~28^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=fea6e2e6d0e9b221616207ae875fa74fb5e4492b;p=gwtquery.git use replace instead of replaceAll because they are fixed conditions --- diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsniBundleGenerator.java b/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsniBundleGenerator.java index 7c9ab708..95a13e12 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsniBundleGenerator.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsniBundleGenerator.java @@ -216,7 +216,7 @@ public class JsniBundleGenerator extends Generator { if (!isCPPComment && !isCComment && !isRegex && !isOper) { isCPPComment = c == '/'; isCComment = c == '*'; - isOper = !isCPPComment && !isCComment && !"=()&|\n;,\\}".contains(""+prev); + isOper = !isCPPComment && !isCComment && !"=(&|?:\n},".contains(""+prev); isRegex = !isCPPComment && !isCComment && !isOper; } if (isOper) { @@ -258,12 +258,12 @@ public class JsniBundleGenerator extends Generator { } private String escapeQuotedString(String s, Character quote) { - return quote + s.replaceAll("\\*/", "*" + quote + " + " + quote + "/") + quote; + return quote + s.replace("*/", "*" + quote + " + " + quote + "/") + quote; } private String escapeInlineRegex(String s, String mod) { if (s.endsWith("*")) { - return "new RegExp('" + s.replaceAll("\\", "\\\\") + "','" + mod + "')"; + return "new RegExp('" + s.replace("\\", "\\\\") + "','" + mod + "')"; } else { return '/' + s + '/' + mod; }