xurror commented on a change in pull request #1024:
URL: https://github.com/apache/fineract/pull/1024#discussion_r439216301



##########
File path: 
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanArrearsAgingServiceImpl.java
##########
@@ -423,18 +423,14 @@ public OriginalScheduleExtractor(final String 
loanIdsAsString) {
 
             while (rs.next()) {
                 Long loanId = rs.getLong("loanId");
-                List<LoanSchedulePeriodData> periodDatas = new ArrayList<>();
-                LoanSchedulePeriodData loanSchedulePeriodData = 
fetchLoanSchedulePeriodData(rs);
-                periodDatas.add(loanSchedulePeriodData);
-                while (rs.next()) {
-                    Long tempLoanId = rs.getLong("loanId");
-                    if (loanId.equals(tempLoanId)) {

Review comment:
       Totally makes sense now. Thanks for helping me understand this better.
   I actually read a comment that suggested doing this or using caching or 
hashmap or any other collection to hold all the resultset and instead iterate 
through it as you did but it just wasn't clear to me.
   
   Unfortunately we don't have a way testing this but I agree with your 
approach. Since it passes all IT tests, we can just blindly merge this 2 or 3 
days if there are no objections and hope for the best 😁.




----------------------------------------------------------------
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]


Reply via email to