This is an automated email from the ASF dual-hosted git repository.
vorburger pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git
The following commit(s) were added to refs/heads/develop by this push:
new 6438063 FINERACT-995: Rewriting logic to remove call to rs.previous()
6438063 is described below
commit 6438063a7ff0267db3816817c71a3ea73ca9157d
Author: Petri Tuomola <[email protected]>
AuthorDate: Wed Jun 10 07:25:37 2020 +0300
FINERACT-995: Rewriting logic to remove call to rs.previous()
---
.travis.yml | 1 +
.../service/LoanArrearsAgingServiceImpl.java | 19 +++++++------------
2 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 92bd607..244228b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -73,6 +73,7 @@ script:
# using "&&" instead of several "-" means that integrationTest does not run if
test fails,
# and Docker test does not run if integration test fails, which makes PR
failure easier to understand.
# @see
https://docs.travis-ci.com/user/job-lifecycle/#customizing-the-build-phase
+# NOTE: Sleep after docker-compose increased to 60 seconds as often Travis
would fail to get Docker up in 30 seconds
- ./gradlew --console=plain licenseMain licenseTest licenseIntegrationTest
check && ./gradlew --console=plain integrationTest --fail-fast && sudo
service mysql stop && docker-compose build && docker-compose up -d &&
sleep 30s && http --verify=no --timeout 240 --check-status get
https://localhost:8443/fineract-provider/actuator/health && (( $(http
--verify=no --timeout 30 --check-status --body get
https://localhost:8443/fineract-provider/actuator/info | wc --chars) > 100 ))
# We stop the mysql system service when running the Docker test to avoid port
3306 conflicts (unless we run the mysql in docker-compose on another port; req.
FINERACT-773)
# The fany /actuator/info test makes sure that has more than 100 characters of
JSON to test that the git.properties worked (see FINERACT-983)
diff --git
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanArrearsAgingServiceImpl.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanArrearsAgingServiceImpl.java
index 67e01ca..895ac44 100644
---
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanArrearsAgingServiceImpl.java
+++
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanArrearsAgingServiceImpl.java
@@ -438,19 +438,14 @@ public class LoanArrearsAgingServiceImpl implements
LoanArrearsAgingService, Bus
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)) {
- periodDatas.add(fetchLoanSchedulePeriodData(rs));
- } else {
- rs.previous();
- break;
- }
+
+ List<LoanSchedulePeriodData> periodDatas =
scheduleDate.get(loanId);
+ if (periodDatas == null) {
+ periodDatas = new ArrayList<>();
+ scheduleDate.put(loanId, periodDatas);
}
- scheduleDate.put(loanId, periodDatas);
+
+ periodDatas.add(fetchLoanSchedulePeriodData(rs));
}
return scheduleDate;