From ccd68dc1dc2e90ba88aa1162b99ea40154a2cb93 Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Tue, 17 Dec 2019 23:51:00 +0100 Subject: [PATCH] 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 --- org.eclipse.jgit/src/org/eclipse/jgit/util/StringUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/StringUtils.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/StringUtils.java index 7e8bbc80f..b2e344608 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/StringUtils.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/StringUtils.java @@ -121,7 +121,7 @@ public static String capitalize(String str) { 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(); }