Browse Source

Using StringBuilder in StringUtils#capitalize method

StringBuffer is synchronized which is slower and should be replaced with
StringBuilder according to its Javadoc.

Change-Id: If4d4a5a49da289ded34bbec97132ab7636b937cc
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
stable-5.7
Lars Vogel 5 years ago committed by Matthias Sohn
parent
commit
ccd68dc1dc
  1. 2
      org.eclipse.jgit/src/org/eclipse/jgit/util/StringUtils.java

2
org.eclipse.jgit/src/org/eclipse/jgit/util/StringUtils.java

@ -121,7 +121,7 @@ public final class StringUtils {
if (str == null || (strLen = str.length()) == 0) {
return str;
}
return new StringBuffer(strLen)
return new StringBuilder(strLen)
.append(Character.toTitleCase(str.charAt(0)))
.append(str.substring(1)).toString();
}

Loading…
Cancel
Save