[jira] [Created] (OFBIZ-11832) Replace Map.get() with Map.getOrDefault()

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (OFBIZ-11832) Replace Map.get() with Map.getOrDefault()

Nicolas Malin (Jira)
Pawan Verma created OFBIZ-11832:
-----------------------------------

             Summary: Replace Map.get() with Map.getOrDefault()
                 Key: OFBIZ-11832
                 URL: https://issues.apache.org/jira/browse/OFBIZ-11832
             Project: OFBiz
          Issue Type: Improvement
          Components: ALL COMPONENTS
    Affects Versions: Trunk
            Reporter: Pawan Verma
            Assignee: Pawan Verma


Map.getOrDefault method could be used to replace the code like this:
{code:java}
BigDecimal currentTotalPrice = productWeight.containsKey(product) ? productWeight.get(product) : BigDecimal.ZERO;{code}
Replace with:
{code:java}
BigDecimal currentTotalPrice = productWeight.getOrDefault(product, BigDecimal.ZERO);
{code}
 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)