mirror of
https://github.com/apache/commons-lang.git
synced 2025-02-15 14:35:20 +00:00
LANG-541 - Switched StringBuffer to StringBuilder when only used internally
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@828909 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e226ac7de9
commit
749c4c66c5
@ -149,7 +149,7 @@ public final void applyPattern(String pattern) {
|
||||
}
|
||||
ArrayList<Format> foundFormats = new ArrayList<Format>();
|
||||
ArrayList<String> foundDescriptions = new ArrayList<String>();
|
||||
StringBuffer stripCustom = new StringBuffer(pattern.length());
|
||||
StringBuilder stripCustom = new StringBuilder(pattern.length());
|
||||
|
||||
ParsePosition pos = new ParsePosition(0);
|
||||
char[] c = pattern.toCharArray();
|
||||
@ -184,7 +184,7 @@ public final void applyPattern(String pattern) {
|
||||
throw new IllegalArgumentException(
|
||||
"Unreadable format element at position " + start);
|
||||
}
|
||||
// fall through
|
||||
//$FALL-THROUGH$
|
||||
default:
|
||||
stripCustom.append(c[pos.getIndex()]);
|
||||
next(pos);
|
||||
@ -351,7 +351,7 @@ private String insertFormats(String pattern, ArrayList<String> customPatterns) {
|
||||
if (!containsElements(customPatterns)) {
|
||||
return pattern;
|
||||
}
|
||||
StringBuffer sb = new StringBuffer(pattern.length() * 2);
|
||||
StringBuilder sb = new StringBuilder(pattern.length() * 2);
|
||||
ParsePosition pos = new ParsePosition(0);
|
||||
int fe = -1;
|
||||
int depth = 0;
|
||||
@ -375,7 +375,7 @@ private String insertFormats(String pattern, ArrayList<String> customPatterns) {
|
||||
break;
|
||||
case END_FE:
|
||||
depth--;
|
||||
//fall through:
|
||||
//$FALL-THROUGH$
|
||||
default:
|
||||
sb.append(c);
|
||||
next(pos);
|
||||
@ -420,8 +420,8 @@ private ParsePosition next(ParsePosition pos) {
|
||||
* @param escapingOn whether to process escaped quotes
|
||||
* @return <code>appendTo</code>
|
||||
*/
|
||||
private StringBuffer appendQuotedString(String pattern, ParsePosition pos,
|
||||
StringBuffer appendTo, boolean escapingOn) {
|
||||
private StringBuilder appendQuotedString(String pattern, ParsePosition pos,
|
||||
StringBuilder appendTo, boolean escapingOn) {
|
||||
int start = pos.getIndex();
|
||||
char[] c = pattern.toCharArray();
|
||||
if (escapingOn && c[start] == QUOTE) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user