Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-11862

BigDecimal casting in Groovy

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Trunk
    • Fix Version/s: 18.12.01
    • Component/s: bi, order, product
    • Labels:
      None

      Description

      Pritam Kute noticed in OFBIZ-11843 that we sometimes use wrong type castings for BigDecimal:

      I have observed that for typecasting in groovy, we have used the wrong coding pattern like

      (BigDecimal) -0.01
      

      It should be like

      -0.01 as BigDecimal
      

      Actually in this case we don't need to cast, because in case of decimal, the default type is always BigDecimal.

      But there are Integers in trunk (mostly 0) and 2 cases where it's useless to cast in R18, nothing in R17

        Attachments

          Activity

            People

            • Assignee:
              pawan Pawan Verma
              Reporter:
              jleroux Jacques Le Roux
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: