Author: doogie
Date: Mon Aug 2 17:42:55 2010
New Revision: 981626
URL:
http://svn.apache.org/viewvc?rev=981626&view=revLog:
BUG FIX: Fix correct formatting around the operator.
Modified:
ofbiz/trunk/framework/sql/src/org/ofbiz/sql/MathValue.java
ofbiz/trunk/framework/sql/src/org/ofbiz/sql/test/ValuesTest.java
Modified: ofbiz/trunk/framework/sql/src/org/ofbiz/sql/MathValue.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/sql/src/org/ofbiz/sql/MathValue.java?rev=981626&r1=981625&r2=981626&view=diff==============================================================================
--- ofbiz/trunk/framework/sql/src/org/ofbiz/sql/MathValue.java (original)
+++ ofbiz/trunk/framework/sql/src/org/ofbiz/sql/MathValue.java Mon Aug 2 17:42:55 2010
@@ -61,7 +61,7 @@ public final class MathValue extends Sta
public StringBuilder appendTo(StringBuilder sb) {
sb.append('(');
- StringUtil.appendTo(sb, values, " ", null, op);
+ StringUtil.appendTo(sb, values, null, null, " ", op, " ");
sb.append(')');
return sb;
}
Modified: ofbiz/trunk/framework/sql/src/org/ofbiz/sql/test/ValuesTest.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/sql/src/org/ofbiz/sql/test/ValuesTest.java?rev=981626&r1=981625&r2=981626&view=diff==============================================================================
--- ofbiz/trunk/framework/sql/src/org/ofbiz/sql/test/ValuesTest.java (original)
+++ ofbiz/trunk/framework/sql/src/org/ofbiz/sql/test/ValuesTest.java Mon Aug 2 17:42:55 2010
@@ -135,13 +135,13 @@ public class ValuesTest extends GenericT
public void testMathValue() {
MathValue v1 = new MathValue("+", GenericTestCaseBase.<ConstantValue>list(nv1, nv2));
- mathValueTest("v1", v1, "+", list(nv1, nv2), "( 1+ 2.0)", null, false);
+ mathValueTest("v1", v1, "+", list(nv1, nv2), "(1 + 2.0)", null, false);
MathValue v2 = new MathValue("+", GenericTestCaseBase.<ConstantValue>list(nv1, nv3));
- mathValueTest("v2", v2, "+", list(nv1, nv3), "( 1+ 3)", v1, false);
+ mathValueTest("v2", v2, "+", list(nv1, nv3), "(1 + 3)", v1, false);
MathValue v3 = new MathValue("+", GenericTestCaseBase.<ConstantValue>list(nv1, nv2));
- mathValueTest("v3", v3, "+", list(nv1, nv2), "( 1+ 2.0)", v1, true);
+ mathValueTest("v3", v3, "+", list(nv1, nv2), "(1 + 2.0)", v1, true);
MathValue v4 = new MathValue("-", GenericTestCaseBase.<ConstantValue>list(nv1, nv3));
- mathValueTest("v4", v4, "-", list(nv1, nv3), "( 1- 3)", v1, false);
+ mathValueTest("v4", v4, "-", list(nv1, nv3), "(1 - 3)", v1, false);
}
public void testNull() {