Author: adrianc
Date: Tue Dec 9 09:31:28 2008
New Revision: 724792
URL:
http://svn.apache.org/viewvc?rev=724792&view=revLog:
Fixed a bug I introduced in FlexibleStringExpander - the special ${env...} syntax wasn't being expanded properly.
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=724792&r1=724791&r2=724792&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 Tue Dec 9 09:31:28 2008
@@ -368,19 +368,22 @@
this.bracketedOriginal = openBracket + original + closeBracket;
}
public void append(StringBuilder buffer, Map<String, ? extends Object> context, TimeZone timeZone, Locale locale) {
+ Object obj = null;
try {
- Object obj = UelUtil.evaluate(context, this.bracketedOriginal);
- if (obj == null) {
- if (this.original.startsWith("env.")) {
- obj = System.getProperty(this.original.substring(4));
- }
- }
- if (obj != null) {
- buffer.append((String) ObjectType.simpleTypeConvert(obj, "String", null, timeZone, locale, false));
- }
+ obj = UelUtil.evaluate(context, this.bracketedOriginal);
} catch (Exception e) {
Debug.logVerbose("Error evaluating expression: " + e, module);
}
+ if (obj == null) {
+ if (this.original.startsWith("env.")) {
+ obj = System.getProperty(this.original.substring(4));
+ }
+ }
+ if (obj != null) {
+ try {
+ buffer.append((String) ObjectType.simpleTypeConvert(obj, "String", null, timeZone, locale, false));
+ } catch (Exception e) {}
+ }
}
}