mirror of
https://github.com/apache/commons-lang.git
synced 2025-02-19 00:20:58 +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<Format> foundFormats = new ArrayList<Format>();
|
||||||
ArrayList<String> foundDescriptions = new ArrayList<String>();
|
ArrayList<String> foundDescriptions = new ArrayList<String>();
|
||||||
StringBuffer stripCustom = new StringBuffer(pattern.length());
|
StringBuilder stripCustom = new StringBuilder(pattern.length());
|
||||||
|
|
||||||
ParsePosition pos = new ParsePosition(0);
|
ParsePosition pos = new ParsePosition(0);
|
||||||
char[] c = pattern.toCharArray();
|
char[] c = pattern.toCharArray();
|
||||||
@ -184,7 +184,7 @@ public final void applyPattern(String pattern) {
|
|||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
"Unreadable format element at position " + start);
|
"Unreadable format element at position " + start);
|
||||||
}
|
}
|
||||||
// fall through
|
//$FALL-THROUGH$
|
||||||
default:
|
default:
|
||||||
stripCustom.append(c[pos.getIndex()]);
|
stripCustom.append(c[pos.getIndex()]);
|
||||||
next(pos);
|
next(pos);
|
||||||
@ -351,7 +351,7 @@ private String insertFormats(String pattern, ArrayList<String> customPatterns) {
|
|||||||
if (!containsElements(customPatterns)) {
|
if (!containsElements(customPatterns)) {
|
||||||
return pattern;
|
return pattern;
|
||||||
}
|
}
|
||||||
StringBuffer sb = new StringBuffer(pattern.length() * 2);
|
StringBuilder sb = new StringBuilder(pattern.length() * 2);
|
||||||
ParsePosition pos = new ParsePosition(0);
|
ParsePosition pos = new ParsePosition(0);
|
||||||
int fe = -1;
|
int fe = -1;
|
||||||
int depth = 0;
|
int depth = 0;
|
||||||
@ -375,7 +375,7 @@ private String insertFormats(String pattern, ArrayList<String> customPatterns) {
|
|||||||
break;
|
break;
|
||||||
case END_FE:
|
case END_FE:
|
||||||
depth--;
|
depth--;
|
||||||
//fall through:
|
//$FALL-THROUGH$
|
||||||
default:
|
default:
|
||||||
sb.append(c);
|
sb.append(c);
|
||||||
next(pos);
|
next(pos);
|
||||||
@ -420,8 +420,8 @@ private ParsePosition next(ParsePosition pos) {
|
|||||||
* @param escapingOn whether to process escaped quotes
|
* @param escapingOn whether to process escaped quotes
|
||||||
* @return <code>appendTo</code>
|
* @return <code>appendTo</code>
|
||||||
*/
|
*/
|
||||||
private StringBuffer appendQuotedString(String pattern, ParsePosition pos,
|
private StringBuilder appendQuotedString(String pattern, ParsePosition pos,
|
||||||
StringBuffer appendTo, boolean escapingOn) {
|
StringBuilder appendTo, boolean escapingOn) {
|
||||||
int start = pos.getIndex();
|
int start = pos.getIndex();
|
||||||
char[] c = pattern.toCharArray();
|
char[] c = pattern.toCharArray();
|
||||||
if (escapingOn && c[start] == QUOTE) {
|
if (escapingOn && c[start] == QUOTE) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user