If there is no ${, then don't create a list just to add a single item to

it.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@912284 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Adam Heath
2010-02-21 01:33:44 +00:00
parent e2712b8a9e
commit fb997ed8e9
@@ -199,15 +199,13 @@ public abstract class FlexibleStringExpander implements Serializable {
if (length == 0) {
return null;
}
int origLen = length;
ArrayList<FlexibleStringExpander> strElems = new ArrayList<FlexibleStringExpander>();
String expression = new String(chars, 0, length + offset);
int start = expression.indexOf(openBracket, offset);
if (start == -1) {
strElems.add(new ConstElem(chars, offset, length));
strElems.trimToSize();
return strElems.toArray(new FlexibleStringExpander[strElems.size()]);
return new FlexibleStringExpander[] { new ConstElem(chars, offset, length) };
}
int origLen = length;
ArrayList<FlexibleStringExpander> strElems = new ArrayList<FlexibleStringExpander>();
int currentInd = offset;
int end = -1;
while (start != -1) {