Author: adrianc
Date: Wed Aug 20 16:12:39 2008
New Revision: 687500
URL:
http://svn.apache.org/viewvc?rev=687500&view=revLog:
A small tweak of the FlexibleStringExpander.
Modified:
ofbiz/trunk/framework/base/src/org/ofbiz/base/util/string/FlexibleStringExpander.java
Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/string/FlexibleStringExpander.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/string/FlexibleStringExpander.java?rev=687500&r1=687499&r2=687500&view=diff==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/string/FlexibleStringExpander.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/string/FlexibleStringExpander.java Wed Aug 20 16:12:39 2008
@@ -19,7 +19,7 @@
package org.ofbiz.base.util.string;
import java.io.Serializable;
-import java.util.LinkedList;
+import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -245,10 +245,11 @@
if (original == null || origLen == 0) {
return null;
}
- List<StrElem> strElems = new LinkedList<StrElem>();
+ ArrayList<StrElem> strElems = new ArrayList<StrElem>();
int start = original.indexOf("${");
if (start == -1) {
strElems.add(new ConstElem(original));
+ strElems.trimToSize();
return strElems;
}
int currentInd = 0;
@@ -296,6 +297,7 @@
if (currentInd < origLen) {
strElems.add(new ConstElem(original.substring(currentInd)));
}
+ strElems.trimToSize();
return strElems;
}