adamsaghy commented on code in PR #5940:
URL: https://github.com/apache/fineract/pull/5940#discussion_r3374338615


##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanCharge.java:
##########
@@ -320,32 +320,24 @@ public static BigDecimal percentageOf(final BigDecimal 
value, final BigDecimal p
     }
 
     /**
-     * @param percentageOf
-     * @returns a minimum cap or maximum cap set on charges if the criteria 
fits else it returns the percentageOf if the
-     *          amount is within min and max cap
+     * @param value
+     * @returns a minimum cap or maximum cap set on charges if the criteria 
fits else it returns the value if the amount
+     *          is within min and max cap
      */
-    public BigDecimal minimumAndMaximumCap(final BigDecimal percentageOf) {
-        BigDecimal minMaxCap;
-        if (this.minCap != null) {
-            final int minimumCap = percentageOf.compareTo(this.minCap);
-            if (minimumCap == -1) {
-                minMaxCap = this.minCap;
-                return minMaxCap;
-            }
+    public BigDecimal minimumAndMaximumCap(final BigDecimal value) {

Review Comment:
   I see no operations which warrants to use Money here... this method just 
simply comparing values, no calculations which might led to situations where 
rounding is needed...



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to