mbien commented on code in PR #5311:
URL: https://github.com/apache/netbeans/pull/5311#discussion_r1080731688
##########
ide/bugtracking.bridge/src/org/netbeans/modules/bugtracking/vcs/HookUtils.java:
##########
@@ -43,16 +43,10 @@ public class HookUtils {
* @return
*/
public static String prepareFormatString(String formatString, String...
keys) {
- formatString = formatString.replaceAll("\\{", "'\\{'");
// NOI18N
- formatString = formatString.replaceAll("\\}", "'\\}'");
// NOI18N
- for (int i = 0; i < keys.length; i++) {
- String key = keys[i];
- formatString =
- formatString.replaceAll(
- "'\\{'" + key + "'\\}'",
// NOI18N
- "\\{" + i + "\\}"
// NOI18N
- );
-
+ formatString = formatString.replace("{", "'{'"); //
NOI18N
+ formatString = formatString.replace("}", "'}'"); //
NOI18N
+ for (String key : keys) {
+ formatString = formatString.replace("'{'" + key + "'}'", "{" + key
+ "}");
}
Review Comment:
second `key` should be `i` but you removed the index from the loop, so you
have to revert that too.
--
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