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

BigDecimal casting in Groovy

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Trunk
    • 18.12.01
    • bi, order, product
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: