Issue Details (XML | Word | Printable)

Key: TORQUE-97
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Thomas Vandahl
Reporter: Markus Müller
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Torque

Exception NoSuchMethodError when using IDBroker with Java 1.4

Created: 18/Jun/07 07:16 PM   Updated: 01/Jul/07 04:22 PM
Return to search
Component/s: Runtime
Affects Version/s: 3.3-RC2
Fix Version/s: 3.3-RC3

Time Tracking:
Not Specified

Environment: Java 1.4

Resolution Date: 01/Jul/07 04:22 PM


 Description  « Hide
I got the exception
    java.lang.NoSuchMethodError: java.math.BigDecimal.<init>(I)V
        at org.apache.torque.oid.IDBroker.getQuantity(IDBroker.java:747)
when using Torque Runtime 3.3-RC2 with JDK 1.4.

Java 1.5 defines additional BigDecimal constructors, one of them takes an int parameter.
Java 1.4 has only a BigDecimal constructor with a double parameter.

I presume that the Torque library was compiled with Java 1.5 causing the problem above.

Probably the problem of line 747 may be solved with a cast as the following:
            quantity = new BigDecimal((double) 1);

Line 775 of IDBroker.java may be fixed the same way:
                quantity = new BigDecimal((double) 10);

Thanks,
Markus


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Thomas Vandahl made changes - 01/Jul/07 04:18 PM
Field Original Value New Value
Assignee Thomas Vandahl [ tv ]
Thomas Vandahl made changes - 01/Jul/07 04:22 PM
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 3.3-RC3 [ 12312398 ]
Resolution Fixed [ 1 ]