Removed the NullExpr class that was created to fix the problem with checking FlexibleStringExpander.getOriginal() for null.
This commit might affect user modifications. Any code that checks FlexibleStringExpander.getOriginal() for null should be changed to use FlexibleStringExpander.isEmpty() instead. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@905864 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -56,7 +56,7 @@ public abstract class FlexibleStringExpander implements Serializable {
|
||||
public static final String openBracket = "${";
|
||||
public static final String closeBracket = "}";
|
||||
protected static final UtilCache<String, FlexibleStringExpander> exprCache = UtilCache.createUtilCache("flexibleStringExpander.ExpressionCache");
|
||||
protected static final FlexibleStringExpander nullExpr = new NullElem();
|
||||
protected static final FlexibleStringExpander nullExpr = new ConstElem("");
|
||||
|
||||
/** Does on-the-fly parsing and expansion of the original String using
|
||||
* variable values from the passed context. A null context argument will
|
||||
@@ -400,24 +400,6 @@ public abstract class FlexibleStringExpander implements Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
protected static class NullElem extends FlexibleStringExpander {
|
||||
protected NullElem() {
|
||||
super("");
|
||||
}
|
||||
@Override
|
||||
public void append(StringBuilder buffer, Map<String, ? extends Object> context, TimeZone timeZone, Locale locale) {}
|
||||
/** Returns null to maintain backward compatibility.
|
||||
*/
|
||||
@Override
|
||||
public String getOriginal() {
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
protected static class VarElem extends FlexibleStringExpander {
|
||||
protected final char[] bracketedOriginal;
|
||||
protected VarElem(String original) {
|
||||
|
||||
Reference in New Issue
Block a user