Author: adrianc
Date: Sun May 6 08:59:24 2012
New Revision: 1334575
URL:
http://svn.apache.org/viewvc?rev=1334575&view=revLog:
FlexibleStringExpander performance improvement - eliminate costly call to UtilValidate.isEmpty(Object).
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=1334575&r1=1334574&r2=1334575&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 Sun May 6 08:59:24 2012
@@ -30,7 +30,14 @@ import javax.el.PropertyNotFoundExceptio
import org.ofbiz.base.lang.IsEmpty;
import org.ofbiz.base.lang.SourceMonitored;
-import org.ofbiz.base.util.*;
+import org.ofbiz.base.util.Debug;
+import org.ofbiz.base.util.ObjectType;
+import org.ofbiz.base.util.ScriptUtil;
+import org.ofbiz.base.util.UtilDateTime;
+import org.ofbiz.base.util.UtilFormatOut;
+import org.ofbiz.base.util.UtilGenerics;
+import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.base.util.UtilValidate;
import org.ofbiz.base.util.cache.UtilCache;
/** Expands String values that contain Unified Expression Language (JSR 245)
@@ -430,9 +437,12 @@ public abstract class FlexibleStringExpa
Object obj = get(context, timeZone, locale);
StringBuilder buffer = new StringBuilder(this.hint);
try {
- if (obj instanceof String && UtilValidate.isEmpty(obj)) {
- } else if (obj != null) {
- buffer.append(ObjectType.simpleTypeConvert(obj, "String", null, timeZone, locale, true));
+ if (obj != null) {
+ if (obj instanceof String) {
+ buffer.append(obj);
+ } else {
+ buffer.append(ObjectType.simpleTypeConvert(obj, "String", null, timeZone, locale, true));
+ }
}
} catch (Exception e) {
buffer.append(obj);