fineract-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From abdulazizali77 <...@git.apache.org>
Subject [GitHub] incubator-fineract pull request #256: FINERACT-7: Sort loanInstallmentCharge...
Date Thu, 15 Dec 2016 11:33:01 GMT
Github user abdulazizali77 commented on a diff in the pull request:

    https://github.com/apache/incubator-fineract/pull/256#discussion_r92592186
  
    --- Diff: fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanCharge.java
---
    @@ -494,17 +494,29 @@ private void updateInstallmentCharges() {
                 this.loanInstallmentCharge.addAll(chargePerInstallments);
             } else {
                 int index = 0;
    -            final LoanInstallmentCharge[] loanChargePerInstallments = new LoanInstallmentCharge[chargePerInstallments.size()];
    -            final LoanInstallmentCharge[] loanChargePerInstallmentArray = chargePerInstallments.toArray(loanChargePerInstallments);
    -            for (final LoanInstallmentCharge chargePerInstallment : this.loanInstallmentCharge)
{
    +            //FINERACT-7: NB: this is really overkill and slow, without changing the
Sets and or Entities this is the most
    +            //locally safe way to fix this issue
    +            ArrayList<LoanInstallmentCharge> oldChargeInstallments = new ArrayList<LoanInstallmentCharge>();
    +            ArrayList<LoanInstallmentCharge> newChargeInstallments = new ArrayList<LoanInstallmentCharge>();
    +
    +            oldChargeInstallments.addAll(this.loanInstallmentCharge);
    +            newChargeInstallments.addAll(chargePerInstallments);
    +            Collections.sort(oldChargeInstallments);
    +            Collections.sort(newChargeInstallments);
    +            final LoanInstallmentCharge[] loanChargePerInstallmentArray = chargePerInstallments.toArray(new
LoanInstallmentCharge[chargePerInstallments.size()]);
    --- End diff --
    
    Youre right, have modified the interface accordingly


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message