Torque
  1. Torque
  2. TORQUE-97

Exception NoSuchMethodError when using IDBroker with Java 1.4

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.3-RC2
    • Fix Version/s: 3.3-RC3
    • Component/s: Runtime
    • Labels:
      None
    • Environment:
      Java 1.4

      Description

      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

        Activity

        Markus Müller created issue -
        Thomas Vandahl made changes -
        Field Original Value New Value
        Assignee Thomas Vandahl [ tv ]
        Thomas Vandahl made changes -
        Resolution Fixed [ 1 ]
        Fix Version/s 3.3-RC3 [ 12312398 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Thomas Fox made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Thomas Vandahl
            Reporter:
            Markus Müller
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development