GMaven (OLD... DO NOT USE)
  1. GMaven (OLD... DO NOT USE)
  2. MGROOVY-165

When using BigDecimals in Groovy, compilation fails

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0-rc-3
    • Fix Version/s: 1.0-rc-4
    • Component/s: stub generation
    • Labels:
      None
    • Environment:
      Windows XP
      Maven 2.0.8
    • Number of attachments :
      0

      Description

      Compilation fails when using BigDecimals in a Groovy class with the following output:

      C:\...\Foo.java:[49,18] cannot find symbol
      symbol : class BigDecimal
      location: class org.foo.Foo

      When the stubs are generated, the stubbed Java files do not contain an import for java.math.BigDecimal. I assume this is why compilation fails.

        Activity

        Hide
        Josh Brown added a comment - - edited

        A workaround is to add the BigDecimal import statement to Foo.java:

        import java.math.BigDecimal

        However, since Groovy natively supports BigDecimals, this shouldn't need to be done.

        Show
        Josh Brown added a comment - - edited A workaround is to add the BigDecimal import statement to Foo.java: import java.math.BigDecimal However, since Groovy natively supports BigDecimals, this shouldn't need to be done.
        Hide
        Jason Dillon added a comment -

        Its a bug, I'll update the model factories to include imports for BigDecimal and BigInteger.

        Show
        Jason Dillon added a comment - Its a bug, I'll update the model factories to include imports for BigDecimal and BigInteger.
        Hide
        Jason Dillon added a comment -

        Fixed, thanks for pointing this out!

        Show
        Jason Dillon added a comment - Fixed, thanks for pointing this out!

          People

          • Assignee:
            Jason Dillon
            Reporter:
            Josh Brown
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: