awasum commented on a change in pull request #670: FINERACT-702: Integrate 
SpotBugs and fix over 300 high priority issues
URL: https://github.com/apache/fineract/pull/670#discussion_r358184092
 
 

 ##########
 File path: 
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java
 ##########
 @@ -2787,7 +2732,8 @@ public LoanTransaction 
handlePayDisbursementTransaction(final Long chargeId, fin
             final boolean isScheduleRegenerateRequired = 
isRepaymentScheduleRegenerationRequiredForDisbursement(actualDisbursementDate);
             this.actualDisbursementDate = null;
             this.disbursedBy = null;
-            boolean isDisbursedAmountChanged = 
!this.approvedPrincipal.equals(this.loanRepaymentScheduleDetail.getPrincipal());
+            boolean isDisbursedAmountChanged =
+                    
!this.approvedPrincipal.equals(this.loanRepaymentScheduleDetail.getPrincipal().getAmount());
 
 Review comment:
   This came as a result of Incompatible Caparison rule violation Exception 
thrown by SpotBugs.
   approvedPrincipal is of Type BigDecimal (Java Type) while 
loanRepaymentScheduleDetail.getPrincipal() returns type Money (Fineract type 
which does not extend BigDecimal, this is an object with various other 
properties). Will the JVM be able to compare BigDecimal and Money? I reasoned 
this wont work so I logically used the amount (of Type BigDecimal) to compare 
with approvedPrincipal. I might be missing something here. Advice. @vishwasbabu 
, @nazeer1100126 , @Nayan .
   
   I could just also suppress this if its a false positive and my reasoning is 
wrong.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to