FINERACT-2346: Refractor, Minor Sonar fixes and remove some deprecated code

This commit is contained in:
Aman-Mittal
2025-12-01 19:11:59 +01:00
committed by Adam Saghy
parent 73d8659390
commit 00e9ac8320
17 changed files with 83 additions and 123 deletions
@@ -46,22 +46,18 @@ public class LoanProductPaymentAllocationRuleMerger {
Set<PaymentAllocationTransactionType> existing = new HashSet<>(originalItems.keySet());
Set<PaymentAllocationTransactionType> newSet = new HashSet<>(newItems.keySet());
existing.removeAll(newSet);
if (existing.size() > 0) {
if (!existing.isEmpty()) {
updated = true;
existing.forEach(type -> {
loanProduct.getPaymentAllocationRules().remove(originalItems.get(type));
});
existing.forEach(type -> loanProduct.getPaymentAllocationRules().remove(originalItems.get(type)));
}
// elements to be added
existing = new HashSet<>(originalItems.keySet());
newSet = new HashSet<>(newItems.keySet());
newSet.removeAll(existing);
if (newSet.size() > 0) {
if (!newSet.isEmpty()) {
updated = true;
newSet.forEach(type -> {
loanProduct.getPaymentAllocationRules().add(newItems.get(type));
});
newSet.forEach(type -> loanProduct.getPaymentAllocationRules().add(newItems.get(type)));
}
// elements to be merged