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
This commit is contained in:
parent
3a49749308
commit
bd2aced4a3
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue