mbien commented on code in PR #5311:
URL: https://github.com/apache/netbeans/pull/5311#discussion_r1081212416


##########
ide/bugtracking.bridge/src/org/netbeans/modules/bugtracking/vcs/HookUtils.java:
##########
@@ -43,16 +43,11 @@ public class HookUtils {
      * @return
      */
     public static String prepareFormatString(String formatString, String... 
keys) {
-        formatString = formatString.replaceAll("\\{", "'\\{'");                
 // NOI18N
-        formatString = formatString.replaceAll("\\}", "'\\}'");                
 // NOI18N
+        formatString = formatString.replace("{", "'{'");                 // 
NOI18N
+        formatString = formatString.replace("}", "'}'");                 // 
NOI18N
         for (int i = 0; i < keys.length; i++) {
             String key = keys[i];
-            formatString =
-                formatString.replaceAll(
-                    "'\\{'" + key + "'\\}'",                                   
 // NOI18N
-                    "\\{" + i + "\\}"                                          
 // NOI18N
-                );
-
+            formatString = formatString.replace("'{'" + key + "'}'", "{" + i + 
"}");

Review Comment:
   how do you know that key is not a regexp?



##########
ide/docker.api/src/org/netbeans/modules/docker/IgnorePattern.java:
##########
@@ -108,7 +108,7 @@ static String preprocess(String pattern, char separator) {
         }
 
         ret = ret.replaceAll("^(" + Pattern.quote(sep) + "\\.\\.)+(" + 
Pattern.quote(sep) +")?", Matcher.quoteReplacement(sep))
-                .replaceAll("/", Matcher.quoteReplacement(sep));
+                .replace("/", Matcher.quoteReplacement(sep));

Review Comment:
   this might be wrong since `quoteReplacement` will have a different effect 
when passed to `replace` instead of `replaceAll`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to