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

Replace Map.get() with Map.getOrDefault()

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Implemented
    • Trunk
    • None
    • ALL COMPONENTS
    • None

    Description

      Map.getOrDefault method could be used to replace the code like this:

      BigDecimal currentTotalPrice = productWeight.containsKey(product) ? productWeight.get(product) : BigDecimal.ZERO;

      Replace with:

      BigDecimal currentTotalPrice = productWeight.getOrDefault(product, BigDecimal.ZERO);
      

       

      Attachments

        1. OFBIZ-11832.patch
          4 kB
          Pawan Verma

        Activity

          People

            pawan Pawan Verma
            pawan Pawan Verma
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: