|
Author: adrianc
Date: Tue Jul 10 11:03:56 2012 New Revision: 1359599 URL: http://svn.apache.org/viewvc?rev=1359599&view=rev Log: Small change to Mini-language <set-calendar> element - removed the set-if-empty attribute, which is unnecessary because a Timestamp will never be empty. Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/SetCalendar.java Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/SetCalendar.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/SetCalendar.java?rev=1359599&r1=1359598&r2=1359599&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/SetCalendar.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/SetCalendar.java Tue Jul 10 11:03:56 2012 @@ -91,7 +91,6 @@ public final class SetCalendar extends M private final FlexibleStringExpander periodAlignEnd; private final FlexibleStringExpander periodAlignStart; private final FlexibleStringExpander secondsFse; - private final boolean setIfEmpty; private final boolean setIfNull; private final Scriptlet scriptlet; private final FlexibleStringExpander timeZoneFse; @@ -103,12 +102,12 @@ public final class SetCalendar extends M if (MiniLangValidate.validationOn()) { MiniLangValidate.deprecatedAttribute(simpleMethod, element, "from-field", "replace with \"from\""); MiniLangValidate.deprecatedAttribute(simpleMethod, element, "default-value", "replace with \"default\""); - MiniLangValidate.attributeNames(simpleMethod, element, "field", "from-field", "from", "value", "default-value", "default", "set-if-null", "set-if-empty", + MiniLangValidate.attributeNames(simpleMethod, element, "field", "from-field", "from", "value", "default-value", "default", "set-if-null", "years", "months", "days", "hours", "minutes", "seconds", "millis", "period-align-start", "period-align-end", "locale", "time-zone"); MiniLangValidate.requiredAttributes(simpleMethod, element, "field"); MiniLangValidate.requireAnyAttribute(simpleMethod, element, "from", "value"); MiniLangValidate.constantPlusExpressionAttributes(simpleMethod, element, "value"); - MiniLangValidate.constantAttributes(simpleMethod, element, "set-if-null", "set-if-empty"); + MiniLangValidate.constantAttributes(simpleMethod, element, "set-if-null"); MiniLangValidate.expressionAttributes(simpleMethod, element, "field", "from", "from-field"); MiniLangValidate.noChildElements(simpleMethod, element); } @@ -131,7 +130,6 @@ public final class SetCalendar extends M } this.defaultFse = FlexibleStringExpander.getInstance(element.getAttribute("default")); this.setIfNull = "true".equals(element.getAttribute("set-if-null")); - this.setIfEmpty = !"false".equals(element.getAttribute("set-if-empty")); this.yearsFse = FlexibleStringExpander.getInstance(element.getAttribute("years")); this.monthsFse = FlexibleStringExpander.getInstance(element.getAttribute("months")); this.daysFse = FlexibleStringExpander.getInstance(element.getAttribute("days")); @@ -165,9 +163,6 @@ public final class SetCalendar extends M if (!setIfNull && newValue == null) { return true; } - if (!setIfEmpty && ObjectType.isEmpty(newValue)) { - return true; - } Locale locale = null; TimeZone timeZone = null; Timestamp fromStamp = null; @@ -314,9 +309,6 @@ public final class SetCalendar extends M if (this.setIfNull) { sb.append("set-if-null=\"true\" "); } - if (!this.setIfEmpty) { - sb.append("set-if-empty=\"false\" "); - } sb.append("/>"); return sb.toString(); } |
| Free forum by Nabble | Edit this page |
