Author: adrianc
Date: Mon Apr 23 12:57:06 2012 New Revision: 1329221 URL: http://svn.apache.org/viewvc?rev=1329221&view=rev Log: MiniLangValidate.java bug fix - validation was failing for constant attributes that contained only spaces. Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/MiniLangValidate.java Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/MiniLangValidate.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/MiniLangValidate.java?rev=1329221&r1=1329220&r2=1329221&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/MiniLangValidate.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/MiniLangValidate.java Mon Apr 23 12:57:06 2012 @@ -92,7 +92,7 @@ public final class MiniLangValidate { */ public static void constantAttributes(SimpleMethod method, Element element, String... attributeNames) throws ValidationException { for (String name : attributeNames) { - String attributeValue = element.getAttribute(name).trim(); + String attributeValue = element.getAttribute(name); if (!MiniLangUtil.isConstantAttribute(attributeValue)) { handleError("Constant attribute \"" + name + "\" cannot contain an expression.", method, element); } @@ -109,7 +109,7 @@ public final class MiniLangValidate { */ public static void constantPlusExpressionAttributes(SimpleMethod method, Element element, String... attributeNames) throws ValidationException { for (String name : attributeNames) { - String attributeValue = element.getAttribute(name).trim(); + String attributeValue = element.getAttribute(name); if (!MiniLangUtil.isConstantPlusExpressionAttribute(attributeValue)) { handleError("Constant+expr attribute \"" + name + "\" is missing a constant value (expression-only constants are not allowed).", method, element); } @@ -145,7 +145,7 @@ public final class MiniLangValidate { */ public static void expressionAttributes(SimpleMethod method, Element element, String... attributeNames) throws ValidationException { for (String name : attributeNames) { - String attributeValue = element.getAttribute(name).trim(); + String attributeValue = element.getAttribute(name); if (attributeValue.length() > 0) { if (attributeValue.startsWith("${") && attributeValue.endsWith("}")) { handleError("Expression attribute \"" + name + "\" enclosed in \"${}\" (remove enclosing ${}).", method, element); @@ -212,7 +212,7 @@ public final class MiniLangValidate { public static void requireAnyAttribute(SimpleMethod method, Element element, String... attributeNames) throws ValidationException { StringBuilder sb = new StringBuilder(); for (String name : attributeNames) { - String attributeValue = element.getAttribute(name).trim(); + String attributeValue = element.getAttribute(name); if (attributeValue.length() > 0) { return; } @@ -265,7 +265,7 @@ public final class MiniLangValidate { */ public static void requiredAttributes(SimpleMethod method, Element element, String... attributeNames) throws ValidationException { for (String name : attributeNames) { - String attributeValue = element.getAttribute(name).trim(); + String attributeValue = element.getAttribute(name); if (attributeValue.length() == 0) { handleError("Required attribute \"" + name + "\" is missing.", method, element); } |
Free forum by Nabble | Edit this page |