adamsaghy commented on code in PR #4800:
URL: https://github.com/apache/fineract/pull/4800#discussion_r2189965686
##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanChargeService.java:
##########
@@ -575,49 +608,67 @@ private BigDecimal
calculatePerInstallmentChargeAmount(final Loan loan, final Lo
}
private void updateInstallmentCharges(final LoanCharge loanCharge) {
- final Collection<LoanInstallmentCharge> remove = new HashSet<>();
+ for (LoanInstallmentCharge oldCharge :
loanCharge.getLoanInstallmentCharge()) {
+
oldCharge.getInstallment().getInstallmentCharges().remove(oldCharge);
+ }
+ loanCharge.getLoanInstallmentCharge().clear();
Review Comment:
Well, it is suboptimal, as we are recreating charges which are unchanged :/
I wonder whether we should have some logic which can compare them properly...
--
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]