ok, thanks for the explanation. I'll apply the patch.

WILL

----- Original Message ----- From: "Alexey Panchenko" <[EMAIL PROTECTED]>
To: "Velocity Developers List" <[email protected]>
Sent: Tuesday, October 25, 2005 10:26 PM
Subject: Re[2]: MathUtils patch


Will Glass-Husain wrote:

Did you actually have a compilation error? This compiled fine with JDK 1.4
in the past.  There's a constructor that takes a double.

When using java 1.4 to build 1.4 jar it works fine.

I want to use java 1.5 to build 1.4 jar, but get an error when class
is loaded by java 1.4, because 1.5 compiler (even with target=1.4)
calls "public BigDecimal(int val)", which is not available in 1.4.

----- Original Message -----
From: "Alexey Panchenko" <[EMAIL PROTECTED]>
To: "Velocity Developers List" <[email protected]>
Sent: Monday, October 24, 2005 10:54 PM
Subject: MathUtils patch


Hello,

This patch allows building on 1.5 with target=1.4

(in the current code it calls constructor "public BigDecimal(int val)"
which is @since 1.5)

Index: src/java/org/apache/velocity/runtime/parser/node/MathUtils.java
===================================================================
--- src/java/org/apache/velocity/runtime/parser/node/MathUtils.java
(revision 328235)
+++ src/java/org/apache/velocity/runtime/parser/node/MathUtils.java
(working copy)
@@ -50,7 +50,7 @@
    /**
     * A BigDecimal representing the number 0
     */
-    protected static final BigDecimal DECIMAL_ZERO    = new BigDecimal
( 0 );
+    protected static final BigDecimal DECIMAL_ZERO    = new BigDecimal
( BigInteger.ZERO );
    protected static final BigInteger INT_ZERO        =
BigInteger.valueOf( 0 );

    /**

--
Best regards,
Alexey                          mailto:[EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Best regards,
Alexey                            mailto:[EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to