[jira] [Comment Edited] (OFBIZ-9572) Replace all "BigDecimal ZERO" by BigDecimal.ZERO

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

[jira] [Comment Edited] (OFBIZ-9572) Replace all "BigDecimal ZERO" by BigDecimal.ZERO

Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-9572?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16125805#comment-16125805 ]

Gil Portenseigne edited comment on OFBIZ-9572 at 8/14/17 3:30 PM:
------------------------------------------------------------------

+1 on removing variable declaration and using BigDecimal.ZERO.  On the setScale part, i find it awkward to define it on the class variable (=> FinAccountHelper.java), or on the ZERO value... In any case, the setScale must be used when returning BigDecimal value from a method/service.


was (Author: gil portenseigne):
+1 on removing variable declaration and using BigDecimal.ZERO.  On the setScale part, i find it awkward to define it on the class variable, or on the ZERO value... In any case, the setScale must be used when returning BigDecimal value from a method/service.

> Replace all "BigDecimal ZERO" by BigDecimal.ZERO
> ------------------------------------------------
>
>                 Key: OFBIZ-9572
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-9572
>             Project: OFBiz
>          Issue Type: Improvement
>            Reporter: Jacques Le Roux
>
> Using "BigDecimal ZERO" instead of BigDecimal.ZERO does not add anything but more useless code. They are both constants and the compiler will made them so.
> This should not be done when setScale() is used on the ZERO constant



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)