Use replace instead of replaceAll in toCleanString This is from SonarLint (rule.java:S4348) Regex patterns should not be created needlessly: When String::replaceAll is used, the first argument should be a real regular expression. If it’s not the case, String::replace does exactly the same thing as String::replaceAll without the performance drawback of the regex. Change-Id: I00ba967ff4a27eeeb6fccf9373f6df2c94ecd823
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java index 81a70af..4fec5da 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java
@@ -115,7 +115,7 @@ private static String toCleanString(List<String> list) { for (String v : list) { if (s.length() > 0) s.append(','); - s.append(v.replaceAll("\n", "").trim()); //$NON-NLS-1$ //$NON-NLS-2$ + s.append(v.replace("\n", "").trim()); //$NON-NLS-1$ //$NON-NLS-2$ } return s.toString(); }