FINERACT-822 Enabling UnnecessaryParentheses check

This commit is contained in:
percyashu
2020-06-04 02:14:25 +01:00
committed by Yemdjih Kaze Nasser
parent cc6bf4b4b0
commit 960e81af1c
57 changed files with 305 additions and 305 deletions
+1 -1
View File
@@ -306,7 +306,6 @@ tasks.withType(JavaCompile) {
disable(
"UnusedVariable",
"InconsistentCapitalization",
"UnnecessaryParentheses",
"ClassCanBeStatic",
"MissingCasesInEnumSwitch",
"OperatorPrecedence",
@@ -339,6 +338,7 @@ tasks.withType(JavaCompile) {
"WaitNotInLoop",
"ThreeLetterTimeZoneID",
"VariableNameSameAsType",
"UnnecessaryParentheses",
// "ReturnMissingNullable",
// "InconsistentOverloads",
// "MethodCanBeStatic",
@@ -775,8 +775,8 @@ public class ClientSavingsIntegrationTest {
final Float nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
final HashMap interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
final Integer daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
double interestRateInFraction = (nominalAnnualInterest / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = nominalAnnualInterest / 100;
double perDay = (double) 1 / daysInYear;
double interestPerDay = interestRateInFraction * perDay;
Float interestPosted = (float) (interestPerDay * balance * 1);
@@ -922,8 +922,8 @@ public class ClientSavingsIntegrationTest {
.get("interestCalculationDaysInYearType");
Integer daysInYear = Integer.valueOf(interestCalculationDaysInYearType
.get("id").toString());
double interestRateInFraction = (nominalAnnualInterest / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = nominalAnnualInterest / 100;
double perDay = (double) 1 / daysInYear;
double interestPerDay = interestRateInFraction * perDay;
Float interestPosted = (float) (interestPerDay * balance * 1);
@@ -954,8 +954,8 @@ public class ClientSavingsIntegrationTest {
.get("interestCalculationDaysInYearType");
daysInYear = Integer.valueOf(interestCalculationDaysInYearType
.get("id").toString());
interestRateInFraction = (nominalAnnualInterest / 100);
perDay = (double) 1 / (daysInYear);
interestRateInFraction = nominalAnnualInterest / 100;
perDay = (double) 1 / daysInYear;
interestPerDay = interestRateInFraction * perDay;
interestPosted = (float) (interestPerDay * balance * 1);
@@ -990,8 +990,8 @@ public class ClientSavingsIntegrationTest {
.get("interestCalculationDaysInYearType");
daysInYear = Integer.valueOf(interestCalculationDaysInYearType
.get("id").toString());
interestRateInFraction = (nominalAnnualInterest / 100);
perDay = (double) 1 / (daysInYear);
interestRateInFraction = nominalAnnualInterest / 100;
perDay = (double) 1 / daysInYear;
interestPerDay = interestRateInFraction * perDay;
interestPosted = (float) (interestPerDay * balance * 1);
@@ -1029,8 +1029,8 @@ public class ClientSavingsIntegrationTest {
.get("interestCalculationDaysInYearType");
daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get(
"id").toString());
interestRateInFraction = (nominalAnnualInterest / 100);
perDay = (double) 1 / (daysInYear);
interestRateInFraction = nominalAnnualInterest / 100;
perDay = (double) 1 / daysInYear;
interestPerDay = interestRateInFraction * perDay;
interestPosted = (float) (interestPerDay * balance * 19);
@@ -1072,8 +1072,8 @@ public class ClientSavingsIntegrationTest {
.get("interestCalculationDaysInYearType");
daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get(
"id").toString());
interestRateInFraction = (nominalAnnualInterest / 100);
perDay = (double) 1 / (daysInYear);
interestRateInFraction = nominalAnnualInterest / 100;
perDay = (double) 1 / daysInYear;
interestPerDay = interestRateInFraction * perDay;
interestPosted = (float) (interestPerDay * balance * 8);
@@ -1108,8 +1108,8 @@ public class ClientSavingsIntegrationTest {
.get("interestCalculationDaysInYearType");
daysInYear = Integer.valueOf(interestCalculationDaysInYearType
.get("id").toString());
interestRateInFraction = (nominalAnnualInterest / 100);
perDay = (double) 1 / (daysInYear);
interestRateInFraction = nominalAnnualInterest / 100;
perDay = (double) 1 / daysInYear;
interestPerDay = interestRateInFraction * perDay;
interestPosted = (float) (interestPerDay * balance * 1);
@@ -1260,8 +1260,8 @@ public class ClientSavingsIntegrationTest {
.get("interestCalculationDaysInYearType");
Integer daysInYear = Integer.valueOf(interestCalculationDaysInYearType
.get("id").toString());
double interestRateInFraction = (nominalAnnualInterest / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = nominalAnnualInterest / 100;
double perDay = (double) 1 / daysInYear;
double interestPerDay = interestRateInFraction * perDay;
Float interestPosted = (float) (interestPerDay * balance * 1);
@@ -1292,8 +1292,8 @@ public class ClientSavingsIntegrationTest {
.get("interestCalculationDaysInYearType");
daysInYear = Integer.valueOf(interestCalculationDaysInYearType
.get("id").toString());
interestRateInFraction = (nominalAnnualInterest / 100);
perDay = (double) 1 / (daysInYear);
interestRateInFraction = nominalAnnualInterest / 100;
perDay = (double) 1 / daysInYear;
interestPerDay = interestRateInFraction * perDay;
interestPosted = (float) (interestPerDay * balance * 1);
@@ -1328,8 +1328,8 @@ public class ClientSavingsIntegrationTest {
.get("interestCalculationDaysInYearType");
daysInYear = Integer.valueOf(interestCalculationDaysInYearType
.get("id").toString());
interestRateInFraction = (nominalAnnualInterest / 100);
perDay = (double) 1 / (daysInYear);
interestRateInFraction = nominalAnnualInterest / 100;
perDay = (double) 1 / daysInYear;
interestPerDay = interestRateInFraction * perDay;
interestPosted = (float) (interestPerDay * balance * 1);
@@ -1367,8 +1367,8 @@ public class ClientSavingsIntegrationTest {
.get("interestCalculationDaysInYearType");
daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get(
"id").toString());
interestRateInFraction = (nominalAnnualInterest / 100);
perDay = (double) 1 / (daysInYear);
interestRateInFraction = nominalAnnualInterest / 100;
perDay = (double) 1 / daysInYear;
interestPerDay = interestRateInFraction * perDay;
interestPosted = (float) (interestPerDay * balance * 19);
@@ -1410,8 +1410,8 @@ public class ClientSavingsIntegrationTest {
.get("interestCalculationDaysInYearType");
daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get(
"id").toString());
interestRateInFraction = (nominalAnnualInterest / 100);
perDay = (double) 1 / (daysInYear);
interestRateInFraction = nominalAnnualInterest / 100;
perDay = (double) 1 / daysInYear;
interestPerDay = interestRateInFraction * perDay;
interestPosted = (float) (interestPerDay * balance * 8);
@@ -1446,8 +1446,8 @@ public class ClientSavingsIntegrationTest {
.get("interestCalculationDaysInYearType");
daysInYear = Integer.valueOf(interestCalculationDaysInYearType
.get("id").toString());
interestRateInFraction = (nominalAnnualInterest / 100);
perDay = (double) 1 / (daysInYear);
interestRateInFraction = nominalAnnualInterest / 100;
perDay = (double) 1 / daysInYear;
interestPerDay = interestRateInFraction * perDay;
interestPosted = (float) (interestPerDay * balance * 1);
@@ -1596,8 +1596,8 @@ public class ClientSavingsIntegrationTest {
final Float nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
final HashMap interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
final Integer daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
double interestRateInFraction = (nominalAnnualInterest / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = nominalAnnualInterest / 100;
double perDay = (double) 1 / daysInYear;
double interestPerDay = interestRateInFraction * perDay;
Float interestPosted = (float) (interestPerDay * balance * 1);
@@ -1763,8 +1763,8 @@ public class ClientSavingsIntegrationTest {
final Float nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
final HashMap interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
final Integer daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
double interestRateInFraction = (nominalAnnualInterest / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = nominalAnnualInterest / 100;
double perDay = (double) 1 / daysInYear;
double interestPerDay = interestRateInFraction * perDay;
Float interestPosted = (float) (interestPerDay * balance * 1);
@@ -1787,8 +1787,8 @@ public class ClientSavingsIntegrationTest {
final Float nominalLastAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
final HashMap interestLastCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
final Integer daysLastInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
double interestLastRateInFraction = (nominalAnnualInterest / 100);
double perLastDay = (double) 1 / (daysInYear);
double interestLastRateInFraction = nominalAnnualInterest / 100;
double perLastDay = (double) 1 / daysInYear;
double interestLastPerDay = interestLastRateInFraction * perLastDay;
Float interestLastPosted = (float) (interestLastPerDay * balance * 1);
@@ -60,7 +60,7 @@ public class ExternalServicesConfigurationTest {
ArrayList<HashMap> externalServicesConfig = this.externalServicesConfigurationHelper
.getExternalServicesConfigurationByServiceName(requestSpec, responseSpec, "S3");
Assert.assertNotNull(externalServicesConfig);
for (Integer configIndex = 0; configIndex < (externalServicesConfig.size()); configIndex++) {
for (Integer configIndex = 0; configIndex < externalServicesConfig.size(); configIndex++) {
String name = (String) externalServicesConfig.get(configIndex).get("name");
String value = null;
if (name.equals(configName)) {
@@ -88,7 +88,7 @@ public class ExternalServicesConfigurationTest {
externalServicesConfig = this.externalServicesConfigurationHelper.getExternalServicesConfigurationByServiceName(requestSpec,
responseSpec, "SMTP");
Assert.assertNotNull(externalServicesConfig);
for (Integer configIndex = 0; configIndex < (externalServicesConfig.size()); configIndex++) {
for (Integer configIndex = 0; configIndex < externalServicesConfig.size(); configIndex++) {
String name = (String) externalServicesConfig.get(configIndex).get("name");
String value = null;
if (name.equals(configName)) {
@@ -154,7 +154,7 @@ public class FixedDepositTest {
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
Integer numberOfDaysLeft = daysInMonth - currentDate + 1;
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
final String INTEREST_POSTED_DATE = dateFormat.format(todaysDate.getTime());
final String CLOSED_ON_DATE = dateFormat.format(Calendar.getInstance().getTime());
@@ -290,7 +290,7 @@ public class FixedDepositTest {
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
Integer numberOfDaysLeft = daysInMonth - currentDate + 1;
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
final String INTEREST_POSTED_DATE = dateFormat.format(todaysDate.getTime());
final String CLOSED_ON_DATE = dateFormat.format(Calendar.getInstance().getTime());
@@ -434,7 +434,7 @@ public class FixedDepositTest {
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
Integer numberOfDaysLeft = daysInMonth - currentDate + 1;
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
Calendar closedOn = Calendar.getInstance();
closedOn.add(Calendar.MONTH, -6);
@@ -726,7 +726,7 @@ public class FixedDepositTest {
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
Integer numberOfDaysLeft = daysInMonth - currentDate + 1;
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
final String INTEREST_POSTED_DATE = dateFormat.format(todaysDate.getTime());
final String CLOSED_ON_DATE = dateFormat.format(Calendar.getInstance().getTime());
@@ -897,7 +897,7 @@ public class FixedDepositTest {
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
Integer numberOfDaysLeft = daysInMonth - currentDate + 1;
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
final String INTEREST_POSTED_DATE = dateFormat.format(todaysDate.getTime());
final String CLOSED_ON_DATE = dateFormat.format(Calendar.getInstance().getTime());
@@ -1225,8 +1225,8 @@ public class FixedDepositTest {
ArrayList<ArrayList<HashMap>> interestRateChartData = this.fixedDepositProductHelper.getInterestRateChartSlabsByProductId(
this.requestSpec, this.responseSpec, fixedDepositProductId);
Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
double interestRateInFraction = (interestRate / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
LOG.info("per day = {}" , perDay);
double interestPerDay = interestRateInFraction * perDay;
@@ -1297,8 +1297,8 @@ public class FixedDepositTest {
ArrayList<ArrayList<HashMap>> interestRateChartData = this.fixedDepositProductHelper.getInterestRateChartSlabsByProductId(
this.requestSpec, this.responseSpec, fixedDepositProductId);
Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
double interestRateInFraction = (interestRate / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
LOG.info("per day = {}" , perDay);
double interestPerDay = interestRateInFraction * perDay;
@@ -1374,8 +1374,8 @@ public class FixedDepositTest {
Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
interestRate -= preClosurePenalInterestRate;
double interestRateInFraction = (interestRate / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
LOG.info("per day = {}" , perDay);
double interestPerDay = interestRateInFraction * perDay;
@@ -1383,7 +1383,7 @@ public class FixedDepositTest {
todaysDate.add(Calendar.DAY_OF_MONTH, -1);
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
daysInMonth = (daysInMonth - currentDate) + 1;
daysInMonth = daysInMonth - currentDate + 1;
Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth);
principal += interestPerMonth;
todaysDate.add(Calendar.DATE, daysInMonth);
@@ -1480,8 +1480,8 @@ public class FixedDepositTest {
Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
interestRate -= preClosurePenalInterestRate;
double interestRateInFraction = (interestRate / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
LOG.info("per day = {}", perDay);
double interestPerDay = interestRateInFraction * perDay;
@@ -1489,7 +1489,7 @@ public class FixedDepositTest {
todaysDate.add(Calendar.DAY_OF_MONTH, -1);
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
daysInMonth = (daysInMonth - currentDate) + 1;
daysInMonth = daysInMonth - currentDate + 1;
Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth);
principal += interestPerMonth;
todaysDate.add(Calendar.DATE, daysInMonth);
@@ -1591,8 +1591,8 @@ public class FixedDepositTest {
Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositedPeriod);
interestRate -= preClosurePenalInterestRate;
double interestRateInFraction = (interestRate / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
LOG.info("per day = {}" , perDay);
double interestPerDay = interestRateInFraction * perDay;
@@ -1600,7 +1600,7 @@ public class FixedDepositTest {
todaysDate.add(Calendar.DAY_OF_MONTH, -1);
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
daysInMonth = (daysInMonth - currentDate) + 1;
daysInMonth = daysInMonth - currentDate + 1;
Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth);
principal += interestPerMonth;
todaysDate.add(Calendar.DATE, daysInMonth);
@@ -1706,8 +1706,8 @@ public class FixedDepositTest {
Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositedPeriod);
interestRate -= preClosurePenalInterestRate;
double interestRateInFraction = (interestRate / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
LOG.info("per day = {}" , perDay);
double interestPerDay = interestRateInFraction * perDay;
@@ -1715,7 +1715,7 @@ public class FixedDepositTest {
todaysDate.add(Calendar.DAY_OF_MONTH, -1);
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
daysInMonth = (daysInMonth - currentDate) + 1;
daysInMonth = daysInMonth - currentDate + 1;
Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth);
principal += interestPerMonth;
todaysDate.add(Calendar.DATE, daysInMonth);
@@ -1804,8 +1804,8 @@ public class FixedDepositTest {
this.requestSpec, this.responseSpec, fixedDepositProductId);
Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
double interestRateInFraction = (interestRate / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
LOG.info("per day = {}" , perDay);
double interestPerDay = interestRateInFraction * perDay;
@@ -1879,8 +1879,8 @@ public class FixedDepositTest {
this.requestSpec, this.responseSpec, fixedDepositProductId);
Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
double interestRateInFraction = (interestRate / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
LOG.info("per day = {}" , perDay);
double interestPerDay = interestRateInFraction * perDay;
@@ -1915,7 +1915,7 @@ public class FixedDepositTest {
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
Integer daysLeft = daysInMonth - currentDate;
todaysDate.add(Calendar.DATE, (daysLeft + 1));
todaysDate.add(Calendar.DATE, daysLeft + 1);
daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
LOG.info("{}",dateFormat.format(todaysDate.getTime()));
final String VALID_FROM = dateFormat.format(todaysDate.getTime());
@@ -1961,8 +1961,8 @@ public class FixedDepositTest {
this.requestSpec, this.responseSpec, fixedDepositProductId);
Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
double interestRateInFraction = (interestRate / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
LOG.info("per day = {}" , perDay);
double interestPerDay = interestRateInFraction * perDay;
@@ -1998,7 +1998,7 @@ public class FixedDepositTest {
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
Integer daysLeft = daysInMonth - currentDate;
todaysDate.add(Calendar.DATE, (daysLeft + 1));
todaysDate.add(Calendar.DATE, daysLeft + 1);
daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
LOG.info("{}",dateFormat.format(todaysDate.getTime()));
final String VALID_FROM = dateFormat.format(todaysDate.getTime());
@@ -2044,8 +2044,8 @@ public class FixedDepositTest {
this.requestSpec, this.responseSpec, fixedDepositProductId);
Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
double interestRateInFraction = (interestRate / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
LOG.info("per day = {}" , perDay);
double interestPerDay = interestRateInFraction * perDay;
@@ -2082,7 +2082,7 @@ public class FixedDepositTest {
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
Integer daysLeft = daysInMonth - currentDate;
todaysDate.add(Calendar.DATE, (daysLeft + 1));
todaysDate.add(Calendar.DATE, daysLeft + 1);
daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
LOG.info("{}",dateFormat.format(todaysDate.getTime()));
final String VALID_FROM = dateFormat.format(todaysDate.getTime());
@@ -2125,8 +2125,8 @@ public class FixedDepositTest {
this.requestSpec, this.responseSpec, fixedDepositProductId);
Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
double interestRateInFraction = (interestRate / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
LOG.info("per day = {}" , perDay);
double interestPerDay = interestRateInFraction * perDay;
@@ -2163,7 +2163,7 @@ public class FixedDepositTest {
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
Integer daysLeft = daysInMonth - currentDate;
todaysDate.add(Calendar.DATE, (daysLeft + 1));
todaysDate.add(Calendar.DATE, daysLeft + 1);
daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
LOG.info("{}",dateFormat.format(todaysDate.getTime()));
final String VALID_FROM = dateFormat.format(todaysDate.getTime());
@@ -2206,8 +2206,8 @@ public class FixedDepositTest {
this.requestSpec, this.responseSpec, fixedDepositProductId);
Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
double interestRateInFraction = (interestRate / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
LOG.info("per day = {}" ,perDay);
double interestPerDay = interestRateInFraction * perDay;
@@ -2244,7 +2244,7 @@ public class FixedDepositTest {
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
Integer daysLeft = daysInMonth - currentDate;
todaysDate.add(Calendar.DATE, (daysLeft + 1));
todaysDate.add(Calendar.DATE, daysLeft + 1);
daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
LOG.info("{}",dateFormat.format(todaysDate.getTime()));
final String VALID_FROM = dateFormat.format(todaysDate.getTime());
@@ -2287,8 +2287,8 @@ public class FixedDepositTest {
this.requestSpec, this.responseSpec, fixedDepositProductId);
Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
double interestRateInFraction = (interestRate / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
LOG.info("per day = {}" , perDay);
double interestPerDay = interestRateInFraction * perDay;
@@ -2324,7 +2324,7 @@ public class FixedDepositTest {
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
Integer daysLeft = daysInMonth - currentDate;
todaysDate.add(Calendar.DATE, (daysLeft + 1));
todaysDate.add(Calendar.DATE, daysLeft + 1);
daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
LOG.info("{}",dateFormat.format(todaysDate.getTime()));
final String VALID_FROM = dateFormat.format(todaysDate.getTime());
@@ -2367,8 +2367,8 @@ public class FixedDepositTest {
this.requestSpec, this.responseSpec, fixedDepositProductId);
Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
double interestRateInFraction = (interestRate / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
LOG.info("per day = {}" , perDay);
double interestPerDay = interestRateInFraction * perDay;
@@ -2421,7 +2421,7 @@ public class FixedDepositTest {
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
Integer numberOfDaysLeft = daysInMonth - currentDate + 1;
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
@@ -2503,7 +2503,7 @@ public class FixedDepositTest {
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
Integer numberOfDaysLeft = daysInMonth - currentDate + 1;
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
@@ -66,10 +66,10 @@ public class GlobalConfigInterestChargedFromDateSameAsDisbursalDateTest {
String configName = "interest-charged-from-date-same-as-disbursal-date";
boolean newBooleanValue = true;
for (Integer configIndex = 0; configIndex < (globalConfig.size()); configIndex++) {
for (Integer configIndex = 0; configIndex < globalConfig.size(); configIndex++) {
if (globalConfig.get(configIndex).get("name")
.equals(configName)) {
String configId = (globalConfig.get(configIndex).get("id"))
String configId = globalConfig.get(configIndex).get("id")
.toString();
Integer updateConfigId = this.globalConfigurationHelper
.updateEnabledFlagForGlobalConfiguration(this.requestSpec, this.responseSpec,
@@ -66,7 +66,7 @@ public class GlobalConfigurationTest {
Assert.assertNotNull(globalConfig);
String configName = "penalty-wait-period";
for (Integer configIndex = 0; configIndex < (globalConfig.size() - 1); configIndex++) {
for (Integer configIndex = 0; configIndex < globalConfig.size() - 1; configIndex++) {
if (globalConfig.get(configIndex).get("name").equals(configName)) {
Integer configId = (Integer) globalConfig.get(configIndex).get("id");
Assert.assertNotNull(configId);
@@ -120,7 +120,7 @@ public class GlobalConfigurationTest {
this.responseSpec);
Assert.assertNotNull(isCacheGlobalConfig);
for (Integer cacheType = 0; cacheType <= ((isCacheGlobalConfig.size()) - 1); cacheType++) {
for (Integer cacheType = 0; cacheType <= isCacheGlobalConfig.size() - 1; cacheType++) {
// Retrieving Is Cache Enabled Global Configuration details
isCacheGlobalConfig = this.globalConfigurationHelper.getGlobalConfigurationIsCacheEnabled(this.requestSpec, this.responseSpec);
@@ -155,7 +155,7 @@ public class GlobalConfigurationTest {
String newValue = "0";
String newBooleanValue = "true";
for (Integer configIndex = 0; configIndex < (globalConfig.size() - 1); configIndex++) {
for (Integer configIndex = 0; configIndex < globalConfig.size() - 1; configIndex++) {
if (globalConfig.get(configIndex).get("name").equals(configName)) {
Integer configId = (Integer) globalConfig.get(configIndex).get(
"id");
@@ -210,10 +210,10 @@ public class GlobalConfigurationTest {
}
/* Update other global configuration property */
String otherConfigName = "maker-checker";
for (Integer configIndex = 0; configIndex < (globalConfig.size() - 1); configIndex++) {
for (Integer configIndex = 0; configIndex < globalConfig.size() - 1; configIndex++) {
if (globalConfig.get(configIndex).get("name")
.equals(otherConfigName)) {
String configId = (globalConfig.get(configIndex).get("id"))
String configId = globalConfig.get(configIndex).get("id")
.toString();
Integer updateConfigId = this.globalConfigurationHelper
.updateValueForGlobalConfiguration(this.requestSpec,
@@ -223,4 +223,4 @@ public class GlobalConfigurationTest {
}
}
}
}
}
@@ -155,7 +155,7 @@ public class RecurringDepositTest {
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
Integer numberOfDaysLeft = daysInMonth - currentDate + 1;
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
final String INTEREST_POSTED_DATE = dateFormat.format(todaysDate.getTime());
final String CLOSED_ON_DATE = dateFormat.format(Calendar.getInstance().getTime());
@@ -307,7 +307,7 @@ public class RecurringDepositTest {
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
Integer numberOfDaysLeft = daysInMonth - currentDate + 1;
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
final String INTEREST_POSTED_DATE = dateFormat.format(todaysDate.getTime());
final String CLOSED_ON_DATE = dateFormat.format(Calendar.getInstance().getTime());
@@ -510,7 +510,7 @@ public class RecurringDepositTest {
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
Integer numberOfDaysLeft = daysInMonth - currentDate + 1;
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
final String INTEREST_POSTED_DATE = dateFormat.format(todaysDate.getTime());
final String CLOSED_ON_DATE = dateFormat.format(Calendar.getInstance().getTime());
@@ -724,7 +724,7 @@ public class RecurringDepositTest {
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
Integer numberOfDaysLeft = daysInMonth - currentDate + 1;
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
final String INTEREST_POSTED_DATE = dateFormat.format(todaysDate.getTime());
Calendar closedOn = Calendar.getInstance();
@@ -891,7 +891,7 @@ public class RecurringDepositTest {
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
Integer numberOfDaysLeft = daysInMonth - currentDate + 1;
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
final String INTEREST_POSTED_DATE = dateFormat.format(todaysDate.getTime());
final String CLOSED_ON_DATE = dateFormat.format(Calendar.getInstance().getTime());
@@ -1416,8 +1416,8 @@ public class RecurringDepositTest {
Float principal = (Float) recurringDepositSummary.get("accountBalance");
Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
double interestRateInFraction = (interestRate / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
LOG.info("per day = {}" , perDay);
double interestPerDay = interestRateInFraction * perDay;
@@ -1499,8 +1499,8 @@ public class RecurringDepositTest {
Float principal = (Float) recurringDepositSummary.get("accountBalance");
Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
double interestRateInFraction = (interestRate / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
LOG.info("per day = {}" , perDay);
double interestPerDay = interestRateInFraction * perDay;
@@ -1580,14 +1580,14 @@ public class RecurringDepositTest {
Float principal = (Float) recurringDepositSummary.get("totalDeposits");
Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
double interestRateInFraction = (interestRate / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
LOG.info("per day = {}" , perDay);
double interestPerDay = interestRateInFraction * perDay;
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
daysInMonth = (daysInMonth - currentDate) + 1;
daysInMonth = daysInMonth - currentDate + 1;
Float interestToBePosted = (float) (interestPerDay * principal * daysInMonth);
principal += interestToBePosted;
@@ -1686,8 +1686,8 @@ public class RecurringDepositTest {
Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
interestRate -= preClosurePenalInterestRate;
double interestRateInFraction = (interestRate / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
LOG.info("per day = {}" , perDay);
double interestPerDay = interestRateInFraction * perDay;
@@ -1695,7 +1695,7 @@ public class RecurringDepositTest {
calendar.add(Calendar.MONTH, -1);
Integer currentDate = Integer.valueOf(currentDateFormat.format(calendar.getTime()));
Integer daysInMonth = calendar.getActualMaximum(Calendar.DATE);
daysInMonth = (daysInMonth - currentDate) + 1;
daysInMonth = daysInMonth - currentDate + 1;
Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth);
principal += interestPerMonth + depositAmount;
calendar.add(Calendar.DATE, daysInMonth);
@@ -1816,8 +1816,8 @@ public class RecurringDepositTest {
Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
interestRate -= preClosurePenalInterestRate;
double interestRateInFraction = (interestRate / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
LOG.info("per day = {}" , perDay);
double interestPerDay = interestRateInFraction * perDay;
@@ -1825,7 +1825,7 @@ public class RecurringDepositTest {
calendar.add(Calendar.MONTH, -1);
Integer currentDate = Integer.valueOf(currentDateFormat.format(calendar.getTime()));
Integer daysInMonth = calendar.getActualMaximum(Calendar.DATE);
daysInMonth = (daysInMonth - currentDate) + 1;
daysInMonth = daysInMonth - currentDate + 1;
Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth);
principal += interestPerMonth + depositAmount;
calendar.add(Calendar.DATE, daysInMonth);
@@ -1953,8 +1953,8 @@ public class RecurringDepositTest {
Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositedPeriod);
interestRate -= preClosurePenalInterestRate;
double interestRateInFraction = (interestRate / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
LOG.info("per day = {}" , perDay);
double interestPerDay = interestRateInFraction * perDay;
@@ -1963,7 +1963,7 @@ public class RecurringDepositTest {
calendar.add(Calendar.DAY_OF_MONTH, -1);
Integer currentDate = Integer.valueOf(currentDateFormat.format(calendar.getTime()));
Integer daysInMonth = calendar.getActualMaximum(Calendar.DATE);
daysInMonth = (daysInMonth - currentDate) + 1;
daysInMonth = daysInMonth - currentDate + 1;
Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth);
principal += interestPerMonth + depositAmount;
calendar.add(Calendar.DATE, daysInMonth);
@@ -2096,8 +2096,8 @@ public class RecurringDepositTest {
Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositedPeriod);
interestRate -= preClosurePenalInterestRate;
double interestRateInFraction = (interestRate / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
LOG.info("per day = {}" , perDay);
double interestPerDay = interestRateInFraction * perDay;
@@ -2106,7 +2106,7 @@ public class RecurringDepositTest {
calendar.add(Calendar.DAY_OF_MONTH, -1);
Integer currentDate = Integer.valueOf(currentDateFormat.format(calendar.getTime()));
Integer daysInMonth = calendar.getActualMaximum(Calendar.DATE);
daysInMonth = (daysInMonth - currentDate) + 1;
daysInMonth = daysInMonth - currentDate + 1;
Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth);
principal += interestPerMonth + depositAmount;
calendar.add(Calendar.DATE, daysInMonth);
@@ -2209,8 +2209,8 @@ public class RecurringDepositTest {
this.requestSpec, this.responseSpec, recurringDepositProductId);
Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
double interestRateInFraction = (interestRate / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
LOG.info("per day = {}" , perDay);
double interestPerDay = interestRateInFraction * perDay;
@@ -2292,8 +2292,8 @@ public class RecurringDepositTest {
this.requestSpec, this.responseSpec, recurringDepositProductId);
Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
double interestRateInFraction = (interestRate / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
LOG.info("per day = {}" , perDay);
double interestPerDay = interestRateInFraction * perDay;
@@ -2333,7 +2333,7 @@ public class RecurringDepositTest {
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
Integer daysLeft = daysInMonth - currentDate;
todaysDate.add(Calendar.DATE, (daysLeft + 1));
todaysDate.add(Calendar.DATE, daysLeft + 1);
daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
LOG.info("{}",dateFormat.format(todaysDate.getTime()));
final String VALID_FROM = dateFormat.format(todaysDate.getTime());
@@ -2381,8 +2381,8 @@ public class RecurringDepositTest {
this.requestSpec, this.responseSpec, recurringDepositProductId);
Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
double interestRateInFraction = (interestRate / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
LOG.info("per day = {}" , perDay);
double interestPerDay = interestRateInFraction * perDay;
@@ -2423,7 +2423,7 @@ public class RecurringDepositTest {
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
Integer daysLeft = daysInMonth - currentDate;
todaysDate.add(Calendar.DATE, (daysLeft + 1));
todaysDate.add(Calendar.DATE, daysLeft + 1);
daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
LOG.info("{}",dateFormat.format(todaysDate.getTime()));
final String VALID_FROM = dateFormat.format(todaysDate.getTime());
@@ -2471,8 +2471,8 @@ public class RecurringDepositTest {
this.requestSpec, this.responseSpec, recurringDepositProductId);
Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
double interestRateInFraction = (interestRate / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
LOG.info("per day = {} " , perDay);
double interestPerDay = interestRateInFraction * perDay;
@@ -2512,7 +2512,7 @@ public class RecurringDepositTest {
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
Integer daysLeft = daysInMonth - currentDate;
todaysDate.add(Calendar.DATE, (daysLeft + 1));
todaysDate.add(Calendar.DATE, daysLeft + 1);
daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
LOG.info("{}",dateFormat.format(todaysDate.getTime()));
final String VALID_FROM = dateFormat.format(todaysDate.getTime());
@@ -2561,8 +2561,8 @@ public class RecurringDepositTest {
this.requestSpec, this.responseSpec, recurringDepositProductId);
Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
double interestRateInFraction = (interestRate / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
LOG.info("per day = {} " , perDay);
double interestPerDay = interestRateInFraction * perDay;
@@ -2602,7 +2602,7 @@ public class RecurringDepositTest {
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
Integer daysLeft = daysInMonth - currentDate;
todaysDate.add(Calendar.DATE, (daysLeft + 1));
todaysDate.add(Calendar.DATE, daysLeft + 1);
daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
LOG.info("{}",dateFormat.format(todaysDate.getTime()));
final String VALID_FROM = dateFormat.format(todaysDate.getTime());
@@ -2651,8 +2651,8 @@ public class RecurringDepositTest {
this.requestSpec, this.responseSpec, recurringDepositProductId);
Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
double interestRateInFraction = (interestRate / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
LOG.info("per day = {} " , perDay);
double interestPerDay = interestRateInFraction * perDay;
@@ -2693,7 +2693,7 @@ public class RecurringDepositTest {
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
Integer daysLeft = daysInMonth - currentDate;
todaysDate.add(Calendar.DATE, (daysLeft + 1));
todaysDate.add(Calendar.DATE, daysLeft + 1);
daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
LOG.info("{}",dateFormat.format(todaysDate.getTime()));
final String VALID_FROM = dateFormat.format(todaysDate.getTime());
@@ -2741,8 +2741,8 @@ public class RecurringDepositTest {
this.requestSpec, this.responseSpec, recurringDepositProductId);
Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
double interestRateInFraction = (interestRate / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
LOG.info("per day = {} " , perDay);
double interestPerDay = interestRateInFraction * perDay;
@@ -2783,7 +2783,7 @@ public class RecurringDepositTest {
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
Integer daysLeft = daysInMonth - currentDate;
todaysDate.add(Calendar.DATE, (daysLeft + 1));
todaysDate.add(Calendar.DATE, daysLeft + 1);
daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
LOG.info("{}",dateFormat.format(todaysDate.getTime()));
final String VALID_FROM = dateFormat.format(todaysDate.getTime());
@@ -2831,8 +2831,8 @@ public class RecurringDepositTest {
this.requestSpec, this.responseSpec, recurringDepositProductId);
Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
double interestRateInFraction = (interestRate / 100);
double perDay = (double) 1 / (daysInYear);
double interestRateInFraction = interestRate / 100;
double perDay = (double) 1 / daysInYear;
LOG.info("per day = {} " , perDay);
double interestPerDay = interestRateInFraction * perDay;
@@ -79,9 +79,9 @@ public class SkipRepaymentOnMonthFirstTest {
String configName = "skip-repayment-on-first-day-of-month";
boolean newBooleanValue = true;
for (Integer configIndex = 0; configIndex < (globalConfig.size()); configIndex++) {
for (Integer configIndex = 0; configIndex < globalConfig.size(); configIndex++) {
if (globalConfig.get(configIndex).get("name").equals(configName)) {
String configId = (globalConfig.get(configIndex).get("id")).toString();
String configId = globalConfig.get(configIndex).get("id").toString();
Integer updateConfigId = this.globalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(
this.requestSpec, this.responseSpec, configId.toString(), newBooleanValue);
Assert.assertNotNull(updateConfigId);
@@ -270,6 +270,6 @@ public class CenterDomain implements Comparable<CenterDomain> {
@Override
public int compareTo(CenterDomain cd) {
return ( this.id).compareTo(cd.getId());
return this.id.compareTo(cd.getId());
}
}
@@ -207,9 +207,9 @@ public class Utils {
final Random rnd = new Random();
final StringBuilder sb = new StringBuilder(len);
for (int i = 0; i < len; i++) {
sb.append((sourceSetString).charAt(rnd.nextInt(lengthOfSource)));
sb.append(sourceSetString.charAt(rnd.nextInt(lengthOfSource)));
}
return (prefix + (sb.toString()));
return prefix + sb.toString();
}
public static String randomStringGenerator(final String prefix, final int len) {
@@ -162,7 +162,7 @@ public class CampaignsHelper {
public String getJSONForCampaignAction(String command, String actionDate) {
final HashMap<String, Object> map = new HashMap<>();
String dateString = ("close".equalsIgnoreCase(command)) ? "closureDate" : "activationDate";
String dateString = "close".equalsIgnoreCase(command) ? "closureDate" : "activationDate";
map.put(dateString, actionDate);
map.put("locale", "en");
map.put("dateFormat", DATE_FORMAT);
@@ -177,7 +177,7 @@ public class ProductToGLAccountMappingReadPlatformServiceImpl implements Product
accountMappingDetails.put(LoanProductAccountingDataParams.FEES_RECEIVABLE.getValue(), gLAccountData);
} else if (glAccountForLoan.equals(AccrualAccountsForLoan.PENALTIES_RECEIVABLE)) {
accountMappingDetails.put(LoanProductAccountingDataParams.PENALTIES_RECEIVABLE.getValue(), gLAccountData);
} else if ((glAccountForLoan.equals(AccrualAccountsForLoan.INCOME_FROM_RECOVERY))) {
} else if (glAccountForLoan.equals(AccrualAccountsForLoan.INCOME_FROM_RECOVERY)) {
accountMappingDetails.put(LoanProductAccountingDataParams.INCOME_FROM_RECOVERY.getValue(), gLAccountData);
}
}
@@ -375,4 +375,4 @@ public class ProductToGLAccountMappingReadPlatformServiceImpl implements Product
return fetchChargeToIncomeAccountMappings(PortfolioProductType.SHARES, productId, false);
}
}
}
@@ -140,7 +140,7 @@ public class AuditReadPlatformServiceImpl implements AuditReadPlatformService {
// data scoping: head office (hierarchy = ".") can see all audit
// entries
if (!(hierarchy.equals("."))) {
if (!hierarchy.equals(".")) {
partSql += " join m_office o2 on o2.id = aud.office_id and o2.hierarchy like '" + hierarchy + "%' ";
}
@@ -166,7 +166,7 @@ public class PortfolioCommandSourceWritePlatformServiceImpl implements Portfolio
final CommandSource commandSourceInput = this.commandSourceRepository.findById(makerCheckerId)
.orElseThrow(() -> new CommandNotFoundException(makerCheckerId));
if (!(commandSourceInput.isMarkedAsAwaitingApproval())) { throw new CommandNotAwaitingApprovalException(makerCheckerId); }
if (!commandSourceInput.isMarkedAsAwaitingApproval()) { throw new CommandNotAwaitingApprovalException(makerCheckerId); }
this.context.authenticatedUser().validateHasCheckerPermissionTo(commandSourceInput.getPermissionCode());
@@ -49,14 +49,14 @@ public class SmsConfigUtils {
headers.add(SmsCampaignConstants.FINERACT_PLATFORM_TENANT_ID, tenant.getTenantIdentifier());
headers.add(SmsCampaignConstants.FINERACT_TENANT_APP_KEY, messageGatewayConfigurationData.getTenantAppKey());
StringBuilder pathBuilder = new StringBuilder();
String endPoint = (messageGatewayConfigurationData.getEndPoint() == null || messageGatewayConfigurationData.getEndPoint().equals(
"/")) ? "" : messageGatewayConfigurationData.getEndPoint();
pathBuilder = (messageGatewayConfigurationData.getEndPoint() == null || messageGatewayConfigurationData.getEndPoint().equals("/")) ? pathBuilder
String endPoint = messageGatewayConfigurationData.getEndPoint() == null || messageGatewayConfigurationData.getEndPoint().equals(
"/") ? "" : messageGatewayConfigurationData.getEndPoint();
pathBuilder = messageGatewayConfigurationData.getEndPoint() == null || messageGatewayConfigurationData.getEndPoint().equals("/") ? pathBuilder
.append("{apiEndPoint}") : pathBuilder.append("{endPoint}/{apiEndPoint}");
// pathBuilder.append("{endPoint}/{apiEndPoint}") ;
UriBuilder builder = UriBuilder.fromPath(pathBuilder.toString()).host(messageGatewayConfigurationData.getHostName()).scheme("http")
.port(messageGatewayConfigurationData.getPortNumber());
URI uri = (messageGatewayConfigurationData.getEndPoint() == null || messageGatewayConfigurationData.getEndPoint().equals("/")) ? builder
URI uri = messageGatewayConfigurationData.getEndPoint() == null || messageGatewayConfigurationData.getEndPoint().equals("/") ? builder
.build(apiEndPoint) : builder.build(endPoint, apiEndPoint);
HttpEntity<?> entity = null;
if (apiQueueResourceDatas != null) {
@@ -230,7 +230,7 @@ public class SmsCampaign extends AbstractPersistableCustom {
}
if (command.isChangeInLongParameterNamed(SmsCampaignValidator.runReportId,
(this.businessRuleId != null) ? this.businessRuleId.getId() : null)) {
this.businessRuleId != null ? this.businessRuleId.getId() : null)) {
final String newValue = command.stringValueOfParameterNamed(SmsCampaignValidator.runReportId);
actualChanges.put(SmsCampaignValidator.runReportId, newValue);
}
@@ -324,11 +324,11 @@ public class SmsCampaignValidator {
if (client != null) {
DeviceRegistration deviceRegistration = this.deviceRegistrationRepository
.findDeviceRegistrationByClientId(client.getId());
return (deviceRegistration != null);
return deviceRegistration != null;
}
return false;
}
return (mobileNo != null);
return mobileNo != null;
}
}
@@ -176,7 +176,7 @@ public class DataValidatorBuilder {
if(trueOfFalseField!=null)
{
if((!trueOfFalseField.toString().equalsIgnoreCase("true")) && (!trueOfFalseField.toString().equalsIgnoreCase("false")) )
if(!trueOfFalseField.toString().equalsIgnoreCase("true") && !trueOfFalseField.toString().equalsIgnoreCase("false"))
{
final StringBuilder validationErrorCode = new StringBuilder("validation.msg.").append(this.resource).append(".")
.append(this.parameter).append(".must.be.true.or.false");
@@ -188,7 +188,7 @@ public final class Report extends AbstractPersistableCustom {
if (!actualChanges.isEmpty()) {
if (isCoreReport()) {
for (final String key : actualChanges.keySet()) {
if (!(key.equals("useReport"))) { throw new PlatformDataIntegrityException(
if (!key.equals("useReport")) { throw new PlatformDataIntegrityException(
"error.msg.only.use.report.can.be.updated.for.core.report",
"Only the Use Report field can be updated for Core Reports", key); }
}
@@ -238,7 +238,7 @@ public final class Report extends AbstractPersistableCustom {
baseDataValidator.reset().parameter("reportCategory").value(this.reportCategory).notExceedingLengthOf(45);
if (StringUtils.isNotBlank(this.reportType)) {
if ((this.reportType.equals("Table")) || (this.reportType.equals("Chart"))) {
if (this.reportType.equals("Table") || this.reportType.equals("Chart")) {
baseDataValidator.reset().parameter("reportSql").value(this.reportSql)
.cantBeBlankWhenParameterProvidedIs("reportType", this.reportType);
} else {
@@ -272,7 +272,7 @@ public final class Report extends AbstractPersistableCustom {
private boolean changeInReportParameters(final Set<ReportParameterUsage> newReportParameterUsages) {
if (!(this.reportParameterUsages.equals(newReportParameterUsages))) { return true; }
if (!this.reportParameterUsages.equals(newReportParameterUsages)) { return true; }
return false;
}
@@ -281,4 +281,4 @@ public final class Report extends AbstractPersistableCustom {
return this.reportParameterUsages;
}
}
}
@@ -499,7 +499,7 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
private String datatableColumnNameToCodeValueName(final String columnName, final String code) {
return (code + "_cd_" + columnName);
return code + "_cd_" + columnName;
}
private void throwExceptionIfValidationWarningsExist(final List<ApiParameterError> dataValidationErrors) {
@@ -511,11 +511,11 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
final StringBuilder constrainBuilder, final String dataTableNameAlias, final Map<String, Long> codeMappings,
final boolean isConstraintApproach) {
String name = (column.has("name")) ? column.get("name").getAsString() : null;
final String type = (column.has("type")) ? column.get("type").getAsString().toLowerCase() : null;
final Integer length = (column.has("length")) ? column.get("length").getAsInt() : null;
final Boolean mandatory = (column.has("mandatory")) ? column.get("mandatory").getAsBoolean() : false;
final String code = (column.has("code")) ? column.get("code").getAsString() : null;
String name = column.has("name") ? column.get("name").getAsString() : null;
final String type = column.has("type") ? column.get("type").getAsString().toLowerCase() : null;
final Integer length = column.has("length") ? column.get("length").getAsInt() : null;
final Boolean mandatory = column.has("mandatory") ? column.get("mandatory").getAsBoolean() : false;
final String code = column.has("code") ? column.get("code").getAsString() : null;
if (StringUtils.isNotBlank(code)) {
if (isConstraintApproach) {
@@ -662,14 +662,14 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
final StringBuilder constrainBuilder, final Map<String, Long> codeMappings, final List<String> removeMappings,
final boolean isConstraintApproach) {
String name = (column.has("name")) ? column.get("name").getAsString() : null;
final String lengthStr = (column.has("length")) ? column.get("length").getAsString() : null;
Integer length = (StringUtils.isNotBlank(lengthStr)) ? Integer.parseInt(lengthStr) : null;
String newName = (column.has("newName")) ? column.get("newName").getAsString() : name;
final Boolean mandatory = (column.has("mandatory")) ? column.get("mandatory").getAsBoolean() : false;
final String after = (column.has("after")) ? column.get("after").getAsString() : null;
final String code = (column.has("code")) ? column.get("code").getAsString() : null;
final String newCode = (column.has("newCode")) ? column.get("newCode").getAsString() : null;
String name = column.has("name") ? column.get("name").getAsString() : null;
final String lengthStr = column.has("length") ? column.get("length").getAsString() : null;
Integer length = StringUtils.isNotBlank(lengthStr) ? Integer.parseInt(lengthStr) : null;
String newName = column.has("newName") ? column.get("newName").getAsString() : name;
final Boolean mandatory = column.has("mandatory") ? column.get("mandatory").getAsBoolean() : false;
final String after = column.has("after") ? column.get("after").getAsString() : null;
final String code = column.has("code") ? column.get("code").getAsString() : null;
final String newCode = column.has("newCode") ? column.get("newCode").getAsString() : null;
final String dataTableNameAlias = datatableName.toLowerCase().replaceAll("\\s", "_");
if (isConstraintApproach) {
if (StringUtils.isBlank(newName)) {
@@ -759,12 +759,12 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
private void parseDatatableColumnForAdd(final JsonObject column, StringBuilder sqlBuilder, final String dataTableNameAlias,
final StringBuilder constrainBuilder, final Map<String, Long> codeMappings, final boolean isConstraintApproach) {
String name = (column.has("name")) ? column.get("name").getAsString() : null;
final String type = (column.has("type")) ? column.get("type").getAsString().toLowerCase() : null;
final Integer length = (column.has("length")) ? column.get("length").getAsInt() : null;
final Boolean mandatory = (column.has("mandatory")) ? column.get("mandatory").getAsBoolean() : false;
final String after = (column.has("after")) ? column.get("after").getAsString() : null;
final String code = (column.has("code")) ? column.get("code").getAsString() : null;
String name = column.has("name") ? column.get("name").getAsString() : null;
final String type = column.has("type") ? column.get("type").getAsString().toLowerCase() : null;
final Integer length = column.has("length") ? column.get("length").getAsInt() : null;
final Boolean mandatory = column.has("mandatory") ? column.get("mandatory").getAsBoolean() : false;
final String after = column.has("after") ? column.get("after").getAsString() : null;
final String code = column.has("code") ? column.get("code").getAsString() : null;
if (StringUtils.isNotBlank(code)) {
if (isConstraintApproach) {
@@ -803,7 +803,7 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
private void parseDatatableColumnForDrop(final JsonObject column, StringBuilder sqlBuilder, final String datatableName,
final StringBuilder constrainBuilder, final List<String> codeMappings) {
final String datatableAlias = datatableName.toLowerCase().replaceAll("\\s", "_");
final String name = (column.has("name")) ? column.get("name").getAsString() : null;
final String name = column.has("name") ? column.get("name").getAsString() : null;
//sqlBuilder = sqlBuilder.append(", DROP COLUMN `" + name + "`");
final StringBuilder findFKSql = new StringBuilder();
findFKSql.append("SELECT count(*)").append("FROM information_schema.TABLE_CONSTRAINTS i")
@@ -855,9 +855,9 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
**/
private void removeNullValuesFromStringColumn(final String datatableName, final JsonObject column,
final Map<String, ResultsetColumnHeaderData> mapColumnNameDefinition) {
final Boolean mandatory = (column.has("mandatory")) ? column.get("mandatory").getAsBoolean() : false;
final String name = (column.has("name")) ? column.get("name").getAsString() : "";
final String type = (mapColumnNameDefinition.containsKey(name)) ? mapColumnNameDefinition.get(name).getColumnType() : "";
final Boolean mandatory = column.has("mandatory") ? column.get("mandatory").getAsBoolean() : false;
final String name = column.has("name") ? column.get("name").getAsString() : "";
final String type = mapColumnNameDefinition.containsKey(name) ? mapColumnNameDefinition.get(name).getColumnType() : "";
if (StringUtils.isNotEmpty(type)) {
if (mandatory && stringDataTypes.contains(type.toLowerCase())) {
@@ -1578,7 +1578,7 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
final String dateFormat = queryParams.get("dateFormat");
Locale clientApplicationLocale = null;
final String localeQueryParam = queryParams.get("locale");
if (!(StringUtils.isBlank(localeQueryParam))) {
if (!StringUtils.isBlank(localeQueryParam)) {
clientApplicationLocale = new Locale(queryParams.get("locale"));
}
@@ -1595,8 +1595,8 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
// ignores id and foreign key fields
// also ignores locale and dateformat fields that are used for
// validating numeric and date data
if (!((key.equalsIgnoreCase("id")) || (key.equalsIgnoreCase(keyFieldName)) || (key.equals("locale"))
|| (key.equals("dateFormat")))) {
if (!(key.equalsIgnoreCase("id") || key.equalsIgnoreCase(keyFieldName) || key.equals("locale")
|| key.equals("dateFormat"))) {
notFound = true;
// matches incoming fields with and without underscores (spaces
// and underscores considered the same)
@@ -1782,7 +1782,7 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
builder.append(" JOIN m_entity_datatable_check edc ON edc.`x_registered_table_name` = xrt.`registered_table_name`");
builder.append(" WHERE edc.`x_registered_table_name` = '" + datatableName + "'");
final Long count = this.jdbcTemplate.queryForObject(builder.toString(), Long.class);
return (count > 0) ? true : false;
return count > 0 ? true : false;
}
}
@@ -127,7 +127,7 @@ public class FineractEntityAccessReadServiceImpl implements FineractEntityAccess
Collection<FineractEntityToEntityMappingData> entityAccessData = null;
GetOneEntityMapper mapper = new GetOneEntityMapper();
if (includeAllSubOffices && (firstEntityType.getTable().equals("m_office"))) {
if (includeAllSubOffices && firstEntityType.getTable().equals("m_office")) {
sql += " where firstentity.hierarchy like ? order by firstEntity.hierarchy";
entityAccessData = this.jdbcTemplate.query(sql, mapper, new Object[] { fromEntityId, fromEntityId, hierarchySearchString });
} else {
@@ -135,7 +135,7 @@ public class SchedularWritePlatformServiceJpaRepositoryImpl implements Schedular
boolean isStopExecution = false;
final ScheduledJobDetail scheduledJobDetail = this.scheduledJobDetailsRepository.findByJobKeyWithLock(jobKey);
if (scheduledJobDetail.isCurrentlyRunning()
|| (triggerType.equals(SchedulerServiceConstants.TRIGGER_TYPE_CRON) && (scheduledJobDetail.getNextRunTime().after(new Date())))) {
|| triggerType.equals(SchedulerServiceConstants.TRIGGER_TYPE_CRON) && scheduledJobDetail.getNextRunTime().after(new Date())) {
isStopExecution = true;
}
final SchedulerDetail schedulerDetail = retriveSchedulerDetail();
@@ -170,10 +170,10 @@ public class TenantAwareBasicAuthenticationFilter extends BasicAuthenticationFil
}
String pathURL = request.getRequestURI();
boolean isSelfServiceRequest = (pathURL != null && pathURL.contains("/self/"));
boolean isSelfServiceRequest = pathURL != null && pathURL.contains("/self/");
boolean notAllowed = ((isSelfServiceRequest && !user.isSelfServiceUser())
||(!isSelfServiceRequest && user.isSelfServiceUser()));
boolean notAllowed = isSelfServiceRequest && !user.isSelfServiceUser()
|| !isSelfServiceRequest && user.isSelfServiceUser();
if(notAllowed){
throw new BadCredentialsException("User not authorised to use the requested resource.");
@@ -30,7 +30,7 @@ public class RandomOTPGenerator {
public String generate() {
StringBuilder builder = new StringBuilder();
for(int i = 0; i < tokenLength; i++) {
builder.append(allowedCharacters.charAt((int) (Math.random() * (allowedCharacters.length()))));
builder.append(allowedCharacters.charAt((int) (Math.random() * allowedCharacters.length())));
}
return builder.toString();
@@ -281,7 +281,7 @@ public class SmsMessageScheduledJobServiceImpl implements SmsMessageScheduledJob
Integer deliveryStatus = smsMessageDeliveryReportData.getDeliveryStatus();
if (!smsMessageDeliveryReportData.getHasError()
&& (deliveryStatus != 100)) {
&& deliveryStatus != 100) {
SmsMessage smsMessage = this.smsMessageRepository.findById(smsMessageDeliveryReportData.getId()).orElse(null);
Integer statusType = smsMessage.getStatusType();
@@ -131,7 +131,7 @@ public class SmsReadPlatformServiceImpl implements SmsReadPlatformService {
@Override
public Collection<SmsData> retrieveAllPending(final Long campaignId, final Integer limit) {
final String sqlPlusLimit = (limit > 0) ? " limit 0, " + limit : "";
final String sqlPlusLimit = limit > 0 ? " limit 0, " + limit : "";
String sql = "select " + this.smsRowMapper.schema() + " where smo.status_enum = " + SmsMessageStatusType.PENDING.getValue();
if (campaignId != null) {
sql += " and smo.campaign_id = " + campaignId;
@@ -144,7 +144,7 @@ public class SmsReadPlatformServiceImpl implements SmsReadPlatformService {
@Override
public Collection<SmsData> retrieveAllSent(final Integer limit) {
final String sqlPlusLimit = (limit > 0) ? " limit 0, " + limit : "";
final String sqlPlusLimit = limit > 0 ? " limit 0, " + limit : "";
final String sql = "select " + this.smsRowMapper.schema() + " where smo.status_enum IN (" + SmsMessageStatusType.WAITING_FOR_DELIVERY_REPORT.getValue()
+ "," + SmsMessageStatusType.SENT.getValue() + ")" + sqlPlusLimit;
@@ -153,7 +153,7 @@ public class SmsReadPlatformServiceImpl implements SmsReadPlatformService {
@Override
public List<Long> retrieveExternalIdsOfAllSent(final Integer limit) {
final String sqlPlusLimit = (limit > 0) ? " limit 0, " + limit : "";
final String sqlPlusLimit = limit > 0 ? " limit 0, " + limit : "";
final String sql = "select external_id from " + this.smsRowMapper.tableName() + " where status_enum = "
+ SmsMessageStatusType.SENT.getValue() + sqlPlusLimit;
@@ -162,7 +162,7 @@ public class SmsReadPlatformServiceImpl implements SmsReadPlatformService {
@Override
public Page<Long> retrieveAllWaitingForDeliveryReport(final Integer limit) {
final String sqlPlusLimit = (limit > 0) ? " limit 0, " + limit : "";
final String sqlPlusLimit = limit > 0 ? " limit 0, " + limit : "";
final String sql = "select id from " + this.smsRowMapper.tableName() + " where status_enum = "
+ SmsMessageStatusType.WAITING_FOR_DELIVERY_REPORT.getValue() + sqlPlusLimit;
final String sqlCountRows = "SELECT FOUND_ROWS()";
@@ -172,7 +172,7 @@ public class SmsReadPlatformServiceImpl implements SmsReadPlatformService {
@Override
public List<Long> retrieveAllPending(final Integer limit) {
final String sqlPlusLimit = (limit > 0) ? " limit 0, " + limit : "";
final String sqlPlusLimit = limit > 0 ? " limit 0, " + limit : "";
final String sql = "select external_id from " + this.smsRowMapper.tableName() + " where status_enum = "
+ SmsMessageStatusType.PENDING.getValue() + sqlPlusLimit;
@@ -181,7 +181,7 @@ public class SmsReadPlatformServiceImpl implements SmsReadPlatformService {
@Override
public Collection<SmsData> retrieveAllDelivered(final Integer limit) {
final String sqlPlusLimit = (limit > 0) ? " limit 0, " + limit : "";
final String sqlPlusLimit = limit > 0 ? " limit 0, " + limit : "";
final String sql = "select " + this.smsRowMapper.schema() + " where smo.status_enum = " + SmsMessageStatusType.DELIVERED.getValue()
+ sqlPlusLimit;
@@ -190,7 +190,7 @@ public class SmsReadPlatformServiceImpl implements SmsReadPlatformService {
@Override
public Collection<SmsData> retrieveAllFailed(final Integer limit) {
final String sqlPlusLimit = (limit > 0) ? " limit 0, " + limit : "";
final String sqlPlusLimit = limit > 0 ? " limit 0, " + limit : "";
final String sql = "select " + this.smsRowMapper.schema() + " where smo.status_enum = " + SmsMessageStatusType.FAILED.getValue()
+ sqlPlusLimit;
@@ -247,4 +247,4 @@ public class SmsReadPlatformServiceImpl implements SmsReadPlatformService {
return this.paginationHelper.fetchPage(this.jdbcTemplate, sqlCountRows, sqlBuilder.toString(), finalObjectArray, this.smsRowMapper);
}
}
}
@@ -94,7 +94,7 @@ public class XBRLBuilder {
final String prefix = taxonomy.getNamespace();
String qname = taxonomy.getName();
if (prefix != null && (!prefix.isEmpty())) {
if (prefix != null && !prefix.isEmpty()) {
final NamespaceData ns = this.readNamespaceService.retrieveNamespaceByPrefix(prefix);
if (ns != null) {
@@ -131,8 +131,8 @@ public class XBRLBuilder {
final String startDateStr = timeFormat.format(this.startDate);
final String endDateStr = timeFormat.format(this.endDate);
final String contextRefID = (context.getPeriodType() == 0) ? ("As_Of_" + endDateStr + (this.instantScenarioCounter++))
: ("Duration_" + startDateStr + "_To_" + endDateStr + (this.durationScenarioCounter++));
final String contextRefID = context.getPeriodType() == 0 ? "As_Of_" + endDateStr + this.instantScenarioCounter++
: "Duration_" + startDateStr + "_To_" + endDateStr + this.durationScenarioCounter++;
this.contextMap.put(context, contextRefID);
}
@@ -211,7 +211,7 @@ public class Holiday extends AbstractPersistableCustom {
final Set<Office> currentSetOfOffices = new HashSet<>(this.offices);
final Set<Office> newSetOfOffices = new HashSet<>(newOffices);
if (!(currentSetOfOffices.equals(newSetOfOffices))) {
if (!currentSetOfOffices.equals(newSetOfOffices)) {
updated = true;
this.offices = newOffices;
}
@@ -237,7 +237,7 @@ public class Money implements Comparable<Money> {
}
public Money percentageOf(BigDecimal percentage, final RoundingMode roundingMode) {
final BigDecimal newAmount = (this.amount.multiply(percentage)).divide(BigDecimal.valueOf(100), roundingMode);
final BigDecimal newAmount = this.amount.multiply(percentage).divide(BigDecimal.valueOf(100), roundingMode);
return Money.of(monetaryCurrency(), newAmount);
}
@Override
@@ -333,4 +333,4 @@ public class Money implements Comparable<Money> {
public Money zero() {
return Money.zero(getCurrency());
}
}
}
@@ -129,7 +129,7 @@ public class Staff extends AbstractPersistableCustom {
this.externalId = StringUtils.defaultIfEmpty(externalId, null);
this.mobileNo = StringUtils.defaultIfEmpty(mobileNo, null);
this.loanOfficer = isLoanOfficer;
this.active = (isActive == null) ? true : isActive;
this.active = isActive == null ? true : isActive;
deriveDisplayName(firstname);
if (joiningDate != null) {
this.joiningDate = joiningDate.toDateTimeAtStartOfDay().toDate();
@@ -274,4 +274,4 @@ public class Staff extends AbstractPersistableCustom {
public Image getImage() {
return this.image;
}
}
}
@@ -164,8 +164,8 @@ public final class StaffCommandFromApiJsonDeserializer {
//Need to add here check to see if any clients, group, account and loans are assigned to this staff if staff is being set to inactive --LJB
final Boolean forceStatus = this.fromApiJsonHelper.extractBooleanNamed("forceStatus", element);
if ((!activeFlag && forceStatus == null) ||
(!activeFlag && forceStatus)) {
if (!activeFlag && forceStatus == null ||
!activeFlag && forceStatus) {
Object[] result = staffReadPlatformService.hasAssociatedItems(staffId);
if (result != null && result.length > 0) {
@@ -160,8 +160,8 @@ public class TellerApiResource {
@QueryParam("todate") @ApiParam(value = "todate") final String toDateStr) {
final DateTimeFormatter dateFormatter = ISODateTimeFormat.basicDate();
final Date fromDate = (fromDateStr != null ? dateFormatter.parseDateTime(fromDateStr).toDate() : new Date());
final Date toDate = (toDateStr != null ? dateFormatter.parseDateTime(toDateStr).toDate() : new Date());
final Date fromDate = fromDateStr != null ? dateFormatter.parseDateTime(fromDateStr).toDate() : new Date();
final Date toDate = toDateStr != null ? dateFormatter.parseDateTime(toDateStr).toDate() : new Date();
final TellerData teller = this.readPlatformService.findTeller(tellerId);
final Collection<CashierData> cashiers = this.readPlatformService.getCashiersForTeller(tellerId, fromDate, toDate);
@@ -74,7 +74,7 @@ public class StandingInstructionHistoryReadPlatformServiceImpl implements Standi
sqlBuilder.append(this.standingInstructionHistoryMapper.schema());
if (standingInstructionDTO.transferType() != null || standingInstructionDTO.clientId() != null
|| standingInstructionDTO.clientName() != null
|| (standingInstructionDTO.fromAccountType() != null && standingInstructionDTO.fromAccount() != null)
|| standingInstructionDTO.fromAccountType() != null && standingInstructionDTO.fromAccount() != null
|| standingInstructionDTO.startDateRange() != null || standingInstructionDTO.endDateRange() != null) {
sqlBuilder.append(" where ");
}
@@ -279,4 +279,4 @@ public class StandingInstructionHistoryReadPlatformServiceImpl implements Standi
}
}
}
}
@@ -222,7 +222,7 @@ public class StandingInstructionWritePlatformServiceImpl implements StandingInst
}
BigDecimal transactionAmount = data.amount();
if (data.toAccountType().isLoanAccount()
&& (recurrenceType.isDuesRecurrence() || (isDueForTransfer && instructionType.isDuesAmoutTransfer()))) {
&& (recurrenceType.isDuesRecurrence() || isDueForTransfer && instructionType.isDuesAmoutTransfer())) {
StandingInstructionDuesData standingInstructionDuesData = this.standingInstructionReadPlatformService
.retriveLoanDuesData(data.toAccount().accountId());
if (data.instructionType().isDuesAmoutTransfer()) {
@@ -190,14 +190,14 @@ public class AddressWritePlatformServiceImpl implements AddressWritePlatformServ
final Address addobj = this.addressRepository.getOne(addressId);
if (!(command.stringValueOfParameterNamed("street").isEmpty())) {
if (!command.stringValueOfParameterNamed("street").isEmpty()) {
is_address_update = true;
final String street = command.stringValueOfParameterNamed("street");
addobj.setStreet(street);
}
if (!(command.stringValueOfParameterNamed("addressLine1").isEmpty())) {
if (!command.stringValueOfParameterNamed("addressLine1").isEmpty()) {
is_address_update = true;
final String addressLine1 = command.stringValueOfParameterNamed("addressLine1");
@@ -205,7 +205,7 @@ public class AddressWritePlatformServiceImpl implements AddressWritePlatformServ
}
if (!(command.stringValueOfParameterNamed("addressLine2").isEmpty())) {
if (!command.stringValueOfParameterNamed("addressLine2").isEmpty()) {
is_address_update = true;
final String addressLine2 = command.stringValueOfParameterNamed("addressLine2");
@@ -213,34 +213,34 @@ public class AddressWritePlatformServiceImpl implements AddressWritePlatformServ
}
if (!(command.stringValueOfParameterNamed("addressLine3").isEmpty())) {
if (!command.stringValueOfParameterNamed("addressLine3").isEmpty()) {
is_address_update = true;
final String addressLine3 = command.stringValueOfParameterNamed("addressLine3");
addobj.setAddressLine3(addressLine3);
}
if (!(command.stringValueOfParameterNamed("townVillage").isEmpty())) {
if (!command.stringValueOfParameterNamed("townVillage").isEmpty()) {
is_address_update = true;
final String townVillage = command.stringValueOfParameterNamed("townVillage");
addobj.setTownVillage(townVillage);
}
if (!(command.stringValueOfParameterNamed("city").isEmpty())) {
if (!command.stringValueOfParameterNamed("city").isEmpty()) {
is_address_update = true;
final String city = command.stringValueOfParameterNamed("city");
addobj.setCity(city);
}
if (!(command.stringValueOfParameterNamed("countyDistrict").isEmpty())) {
if (!command.stringValueOfParameterNamed("countyDistrict").isEmpty()) {
is_address_update = true;
final String countyDistrict = command.stringValueOfParameterNamed("countyDistrict");
addobj.setCountyDistrict(countyDistrict);
}
if ((command.longValueOfParameterNamed("stateProvinceId") != null)) {
if ((command.longValueOfParameterNamed("stateProvinceId") != 0)) {
if (command.longValueOfParameterNamed("stateProvinceId") != null) {
if (command.longValueOfParameterNamed("stateProvinceId") != 0) {
is_address_update = true;
stateId = command.longValueOfParameterNamed("stateProvinceId");
stateIdobj = this.codeValueRepository.getOne(stateId);
@@ -248,8 +248,8 @@ public class AddressWritePlatformServiceImpl implements AddressWritePlatformServ
}
}
if ((command.longValueOfParameterNamed("countryId") != null)) {
if ((command.longValueOfParameterNamed("countryId") != 0)) {
if (command.longValueOfParameterNamed("countryId") != null) {
if (command.longValueOfParameterNamed("countryId") != 0) {
is_address_update = true;
countryId = command.longValueOfParameterNamed("countryId");
countryIdObj = this.codeValueRepository.getOne(countryId);
@@ -258,7 +258,7 @@ public class AddressWritePlatformServiceImpl implements AddressWritePlatformServ
}
if (!(command.stringValueOfParameterNamed("postalCode").isEmpty())) {
if (!command.stringValueOfParameterNamed("postalCode").isEmpty()) {
is_address_update = true;
final String postalCode = command.stringValueOfParameterNamed("postalCode");
addobj.setPostalCode(postalCode);
@@ -264,7 +264,7 @@ public class ChargeReadPlatformServiceImpl implements ChargeReadPlatformService
// charges mapped to current user's office
String inClause = fineractEntityAccessUtil
.getSQLWhereClauseForProductIDsForUserOffice_ifGlobalConfigEnabled(FineractEntityType.CHARGE);
if ((inClause != null) && (!(inClause.trim().isEmpty()))) {
if ((inClause != null) && !inClause.trim().isEmpty()) {
sql += " and c.id in ( " + inClause + " ) ";
}
@@ -447,4 +447,4 @@ public class ChargeReadPlatformServiceImpl implements ChargeReadPlatformService
return this.jdbcTemplate.query(sql, rm, new Object[] { ChargeAppliesTo.SHARES.getValue() });
}
}
}
@@ -338,7 +338,7 @@ public class CollectionSheetReadPlatformServiceImpl implements CollectionSheetRe
final GroupGeneralData group = this.groupReadPlatformService.retrieveOne(groupId);
// entityType should be center if it's within a center
final CalendarEntityType entityType = (group.isChildGroup()) ? CalendarEntityType.CENTERS : CalendarEntityType.GROUPS;
final CalendarEntityType entityType = group.isChildGroup() ? CalendarEntityType.CENTERS : CalendarEntityType.GROUPS;
Long entityId = null;
if(group.isChildGroup()){
@@ -326,7 +326,7 @@ public final class GroupingTypesDataValidator {
final Boolean active = this.fromApiJsonHelper.extractBooleanNamed(GroupingTypesApiConstants.activeParamName,
element);
if ((active != null && active)
|| (this.fromApiJsonHelper.parameterExists(GroupingTypesApiConstants.activationDateParamName, element))) {
|| this.fromApiJsonHelper.parameterExists(GroupingTypesApiConstants.activationDateParamName, element)) {
final LocalDate joinedDate = this.fromApiJsonHelper
.extractLocalDateNamed(GroupingTypesApiConstants.activationDateParamName, element);
baseDataValidator.reset().parameter(GroupingTypesApiConstants.activationDateParamName).value(joinedDate)
@@ -380,8 +380,8 @@ public final class GroupingTypesDataValidator {
final Boolean active = this.fromApiJsonHelper.extractBooleanNamed(GroupingTypesApiConstants.activeParamName,
element);
if ((active != null && active) || (this.fromApiJsonHelper
.parameterExists(GroupingTypesApiConstants.activationDateParamName, element))) {
if ((active != null && active) || this.fromApiJsonHelper
.parameterExists(GroupingTypesApiConstants.activationDateParamName, element)) {
final LocalDate joinedDate = this.fromApiJsonHelper
.extractLocalDateNamed(GroupingTypesApiConstants.activationDateParamName, element);
baseDataValidator.reset().parameter(GroupingTypesApiConstants.activationDateParamName).value(joinedDate)
@@ -590,4 +590,4 @@ public final class GroupingTypesDataValidator {
throwExceptionIfValidationWarningsExist(dataValidationErrors);
}
}
}
@@ -1266,8 +1266,8 @@ public class Loan extends AbstractPersistableCustom {
if (installment.getFeeChargesCharged(getCurrency()).isLessThan(fee)
|| installment.getInterestCharged(getCurrency()).isLessThan(interest)
|| installment.getPenaltyChargesCharged(getCurrency()).isLessThan(penality)
|| (getAccruedTill().isEqual(loanTransaction.getTransactionDate()) && !installment.getDueDate().isEqual(
getAccruedTill()))) {
|| getAccruedTill().isEqual(loanTransaction.getTransactionDate()) && !installment.getDueDate().isEqual(
getAccruedTill())) {
interest = interest.minus(loanTransaction.getInterestPortion(getCurrency()));
fee = fee.minus(loanTransaction.getFeeChargesPortion(getCurrency()));
penality = penality.minus(loanTransaction.getPenaltyChargesPortion(getCurrency()));
@@ -1751,21 +1751,21 @@ public class Loan extends AbstractPersistableCustom {
}
if (jsonObject.get(LoanApiConstants.disbursementPrincipalParameterName).isJsonPrimitive()
&& StringUtils.isNotBlank((jsonObject.get(LoanApiConstants.disbursementPrincipalParameterName).getAsString()))) {
&& StringUtils.isNotBlank(jsonObject.get(LoanApiConstants.disbursementPrincipalParameterName).getAsString())) {
BigDecimal principal = jsonObject.getAsJsonPrimitive(LoanApiConstants.disbursementPrincipalParameterName).getAsBigDecimal();
returnObject.put(LoanApiConstants.disbursementPrincipalParameterName, principal);
}
if (jsonObject.has(LoanApiConstants.disbursementIdParameterName)
&& jsonObject.get(LoanApiConstants.disbursementIdParameterName).isJsonPrimitive()
&& StringUtils.isNotBlank((jsonObject.get(LoanApiConstants.disbursementIdParameterName).getAsString()))) {
&& StringUtils.isNotBlank(jsonObject.get(LoanApiConstants.disbursementIdParameterName).getAsString())) {
Long id = jsonObject.getAsJsonPrimitive(LoanApiConstants.disbursementIdParameterName).getAsLong();
returnObject.put(LoanApiConstants.disbursementIdParameterName, id);
}
if (jsonObject.has(LoanApiConstants.loanChargeIdParameterName)
&& jsonObject.get(LoanApiConstants.loanChargeIdParameterName).isJsonPrimitive()
&& StringUtils.isNotBlank((jsonObject.get(LoanApiConstants.loanChargeIdParameterName).getAsString()))) {
&& StringUtils.isNotBlank(jsonObject.get(LoanApiConstants.loanChargeIdParameterName).getAsString())) {
returnObject.put(LoanApiConstants.loanChargeIdParameterName,
jsonObject.getAsJsonPrimitive(LoanApiConstants.loanChargeIdParameterName).getAsString());
}
@@ -2384,7 +2384,7 @@ public class Loan extends AbstractPersistableCustom {
**/
if (isNoneOrCashOrUpfrontAccrualAccountingEnabledOnLoanProduct()
&& ((isMultiDisburmentLoan() && getDisbursedLoanDisbursementDetails().size() == 1) || !isMultiDisburmentLoan())) {
&& (isMultiDisburmentLoan() && getDisbursedLoanDisbursementDetails().size() == 1 || !isMultiDisburmentLoan())) {
final LoanTransaction interestAppliedTransaction = LoanTransaction.accrueInterest(getOffice(), this, interestApplied,
actualDisbursementDate, createdDate, currentUser);
addLoanTransaction(interestAppliedTransaction) ;
@@ -2465,7 +2465,7 @@ public class Loan extends AbstractPersistableCustom {
}
isMultiTrancheDisburse = true;
}
return (!statusEnum.hasStateOf(LoanStatus.fromInt(this.loanStatus)) || isMultiTrancheDisburse);
return !statusEnum.hasStateOf(LoanStatus.fromInt(this.loanStatus)) || isMultiTrancheDisburse;
}
public Money adjustDisburseAmount(final JsonCommand command, final LocalDate actualDisbursementDate) {
@@ -2519,7 +2519,7 @@ public class Loan extends AbstractPersistableCustom {
} else {
this.loanRepaymentScheduleDetail.setPrincipal(this.loanRepaymentScheduleDetail.getPrincipal().minus(diff).getAmount());
}
if (!(this.loanProduct().isMultiDisburseLoan()) && diff.compareTo(BigDecimal.ZERO) < 0) {
if (!this.loanProduct().isMultiDisburseLoan() && diff.compareTo(BigDecimal.ZERO) < 0) {
final String errorMsg = "Loan can't be disbursed,disburse amount is exceeding approved amount ";
throw new LoanDisbursalException(errorMsg, "disburse.amount.must.be.less.than.approved.amount", principalDisbursed,
this.loanRepaymentScheduleDetail.getPrincipal().getAmount());
@@ -2733,12 +2733,12 @@ public class Loan extends AbstractPersistableCustom {
final Integer installmentNumber = null;
for (final LoanCharge charge : charges()) {
Date actualDisbursementDate = getActualDisbursementDate(charge);
if ((charge.getCharge().getChargeTimeType().equals(ChargeTimeType.DISBURSEMENT.getValue())
if (charge.getCharge().getChargeTimeType().equals(ChargeTimeType.DISBURSEMENT.getValue())
&& disbursedOn.equals(new LocalDate(actualDisbursementDate)) && actualDisbursementDate != null && !charge.isWaived() && !charge
.isFullyPaid())
|| (charge.getCharge().getChargeTimeType().equals(ChargeTimeType.TRANCHE_DISBURSEMENT.getValue())
.isFullyPaid()
|| charge.getCharge().getChargeTimeType().equals(ChargeTimeType.TRANCHE_DISBURSEMENT.getValue())
&& disbursedOn.equals(new LocalDate(actualDisbursementDate)) && actualDisbursementDate != null
&& !charge.isWaived() && !charge.isFullyPaid())) {
&& !charge.isWaived() && !charge.isFullyPaid()) {
if (totalFeeChargesDueAtDisbursement.isGreaterThanZero() && !charge.getChargePaymentMode().isPaymentModeAccountTransfer()) {
charge.markAsFullyPaid();
// Add "Loan Charge Paid By" details to this transaction
@@ -3992,7 +3992,7 @@ public class Loan extends AbstractPersistableCustom {
boolean isRegenerationRequired = false;
if (this.loanProduct.isMultiDisburseLoan()) {
LoanDisbursementDetails details = fetchLastDisburseDetail();
if (details != null && !(details.expectedDisbursementDate().equals(details.actualDisbursementDate()))) {
if (details != null && !details.expectedDisbursementDate().equals(details.actualDisbursementDate())) {
isRegenerationRequired = true;
}
}
@@ -4855,8 +4855,8 @@ public class Loan extends AbstractPersistableCustom {
}
break;
case LOAN_DISBURSED:
if ((!(isApproved() && isNotDisbursed()) && !this.loanProduct.isMultiDisburseLoan())
|| (this.loanProduct.isMultiDisburseLoan() && !isAllTranchesNotDisbursed())) {
if (!(isApproved() && isNotDisbursed()) && !this.loanProduct.isMultiDisburseLoan()
|| this.loanProduct.isMultiDisburseLoan() && !isAllTranchesNotDisbursed()) {
final String defaultUserMessage = "Loan Disbursal is not allowed. Loan Account is not in approved and not disbursed state.";
final ApiParameterError error = ApiParameterError.generalError(
"error.msg.loan.disbursal.account.is.not.approve.not.disbursed.state", defaultUserMessage);
@@ -5179,7 +5179,7 @@ public class Loan extends AbstractPersistableCustom {
for (final LoanCharge loanCharge : charges) {
if (!loanCharge.isDueAtDisbursement()) {
updateOverdueScheduleInstallment(loanCharge);
if (loanCharge.getDueLocalDate() == null || (!lastRepaymentDate.isBefore(loanCharge.getDueLocalDate()))) {
if (loanCharge.getDueLocalDate() == null || !lastRepaymentDate.isBefore(loanCharge.getDueLocalDate())) {
if ((loanCharge.isInstalmentFee() || !loanCharge.isWaived())
&& (loanCharge.getDueLocalDate() == null || !lastTransactionDate.isAfter(loanCharge.getDueLocalDate()))) {
recalculateLoanCharge(loanCharge, generatorDTO.getPenaltyWaitPeriod());
@@ -5819,7 +5819,7 @@ public class Loan extends AbstractPersistableCustom {
}
public Boolean shouldCreateStandingInstructionAtDisbursement() {
return (this.createStandingInstructionAtDisbursement != null) && this.createStandingInstructionAtDisbursement;
return this.createStandingInstructionAtDisbursement != null && this.createStandingInstructionAtDisbursement;
}
public Collection<LoanCharge> getLoanCharges(LocalDate dueDate) {
@@ -5827,7 +5827,7 @@ public class Loan extends AbstractPersistableCustom {
for (LoanCharge loanCharge : charges) {
if ((loanCharge.getDueLocalDate() != null) && loanCharge.getDueLocalDate().equals(dueDate)) {
if (loanCharge.getDueLocalDate() != null && loanCharge.getDueLocalDate().equals(dueDate)) {
loanCharges.add(loanCharge);
}
}
@@ -6151,7 +6151,7 @@ public class Loan extends AbstractPersistableCustom {
public BigDecimal getDerivedAmountForCharge(final LoanCharge loanCharge) {
BigDecimal amount = BigDecimal.ZERO;
if (isMultiDisburmentLoan() && (loanCharge.getCharge().getChargeTimeType().equals(ChargeTimeType.DISBURSEMENT.getValue()))) {
if (isMultiDisburmentLoan() && loanCharge.getCharge().getChargeTimeType().equals(ChargeTimeType.DISBURSEMENT.getValue())) {
amount = getApprovedPrincipal();
} else {
// If charge type is specified due date and loan is multi disburment
@@ -6186,7 +6186,7 @@ public class Loan extends AbstractPersistableCustom {
public LoanRepaymentScheduleInstallment fetchLoanForeclosureDetail(final LocalDate closureDate) {
Money[] receivables = retriveIncomeOutstandingTillDate(closureDate);
Money totalPrincipal = (Money.of(getCurrency(), this.getSummary().getTotalPrincipalOutstanding()));
Money totalPrincipal = Money.of(getCurrency(), this.getSummary().getTotalPrincipalOutstanding());
totalPrincipal = totalPrincipal.minus(receivables[3]);
final Set<LoanInterestRecalcualtionAdditionalDetails> compoundingDetails = null;
final LocalDate currentDate = DateUtils.getLocalDateOfTenant();
@@ -6312,7 +6312,7 @@ public class Loan extends AbstractPersistableCustom {
}
private double calculateInterestForDays(int daysInPeriod, BigDecimal interest, int days) {
if (interest.doubleValue() == 0) { return 0; }
return ((interest.doubleValue()) / daysInPeriod) * days;
return interest.doubleValue() / daysInPeriod * days;
}
public Money[] getReceivableIncome(final LocalDate tillDate) {
@@ -6383,9 +6383,9 @@ public class Loan extends AbstractPersistableCustom {
double interest = calculateInterestForDays(daysInPeriod, installment.getInterestCharged(getCurrency()).getAmount(),
tillDays);
actualAmountTobeAccrued = actualAmountTobeAccrued.plus(interest);
} else if ((tillDate.isAfter(installment.getFromDate()) && tillDate.isEqual(installment.getDueDate()))
|| (tillDate.isEqual(installment.getFromDate()) && tillDate.isEqual(installment.getDueDate()))
|| (tillDate.isAfter(installment.getFromDate()) && tillDate.isAfter(installment.getDueDate()))) {
} else if (tillDate.isAfter(installment.getFromDate()) && tillDate.isEqual(installment.getDueDate())
|| tillDate.isEqual(installment.getFromDate()) && tillDate.isEqual(installment.getDueDate())
|| tillDate.isAfter(installment.getFromDate()) && tillDate.isAfter(installment.getDueDate())) {
actualAmountTobeAccrued = actualAmountTobeAccrued.plus(installment.getInterestAccrued(getCurrency()));
}
}
@@ -6444,7 +6444,7 @@ public class Loan extends AbstractPersistableCustom {
LocalDate installmentStartDate = getDisbursementDate();
if (newInstallments.size() > 0) {
installmentStartDate = newInstallments.get((newInstallments.size() - 1)).getDueDate();
installmentStartDate = newInstallments.get(newInstallments.size() - 1).getDueDate();
}
int installmentNumber = newInstallments.size();
@@ -6465,7 +6465,7 @@ public class Loan extends AbstractPersistableCustom {
int penaltyWaitPeriod = 0;
for (LoanCharge loanCharge : charges) {
if (loanCharge.getDueLocalDate() != null
&& (loanCharge.getDueLocalDate().isAfter(transactionDate))) {
&& loanCharge.getDueLocalDate().isAfter(transactionDate)) {
loanCharge.setActive(false);
} else if (loanCharge.getDueLocalDate() == null) {
recalculateLoanCharge(loanCharge, penaltyWaitPeriod);
@@ -6477,12 +6477,12 @@ public class Loan extends AbstractPersistableCustom {
if (loanTransaction.isChargesWaiver()) {
for (LoanChargePaidBy chargePaidBy : loanTransaction
.getLoanChargesPaid()) {
if ((chargePaidBy.getLoanCharge().isDueDateCharge() && chargePaidBy
if (chargePaidBy.getLoanCharge().isDueDateCharge() && chargePaidBy
.getLoanCharge().getDueLocalDate()
.isAfter(transactionDate))
|| (chargePaidBy.getLoanCharge().isInstalmentFee() && (chargePaidBy
.getInstallmentNumber() != null && chargePaidBy
.getInstallmentNumber() > installmentNumber))) {
.isAfter(transactionDate)
|| chargePaidBy.getLoanCharge().isInstalmentFee() && chargePaidBy
.getInstallmentNumber() != null && chargePaidBy
.getInstallmentNumber() > installmentNumber) {
loanTransaction.reverse();
}
}
@@ -615,7 +615,7 @@ public abstract class AbstractLoanRepaymentScheduleTransactionProcessor implemen
installemntCharge = loanCharge;
chargePerInstallment = paidLoanChargePerInstallment;
}
} else if (latestPaidCharge == null || (loanCharge.isPaidOrPartiallyPaid(currency))
} else if (latestPaidCharge == null || loanCharge.isPaidOrPartiallyPaid(currency)
&& loanCharge.getDueLocalDate().isAfter(latestPaidCharge.getDueLocalDate())) {
latestPaidCharge = loanCharge;
}
@@ -716,4 +716,4 @@ public abstract class AbstractLoanRepaymentScheduleTransactionProcessor implemen
}
}
}
}
@@ -72,7 +72,7 @@ public class HeavensFamilyLoanRepaymentScheduleTransactionProcessor extends Abst
final LoanRepaymentScheduleInstallment previousInstallment = installments.get(previousInstallmentIndex);
lastInstallmentDueDate = previousInstallment.getDueDate();
isInAdvance = !(transactionDate.isAfter(lastInstallmentDueDate) || (transactionDate.isEqual(lastInstallmentDueDate)));
isInAdvance = !(transactionDate.isAfter(lastInstallmentDueDate) || transactionDate.isEqual(lastInstallmentDueDate));
return isInAdvance;
}
@@ -246,4 +246,4 @@ public class HeavensFamilyLoanRepaymentScheduleTransactionProcessor extends Abst
}
return transactionAmountRemaining;
}
}
}
@@ -195,7 +195,7 @@ public class GuarantorDomainServiceImpl implements GuarantorDomainService {
@Override
public void releaseGuarantor(final GuarantorFundingDetails guarantorFundingDetails, final LocalDate transactionDate) {
BigDecimal amoutForWithdraw = guarantorFundingDetails.getAmountRemaining();
if (amoutForWithdraw.compareTo(BigDecimal.ZERO) > 0 && (guarantorFundingDetails.getStatus().isActive())) {
if (amoutForWithdraw.compareTo(BigDecimal.ZERO) > 0 && guarantorFundingDetails.getStatus().isActive()) {
SavingsAccount savingsAccount = guarantorFundingDetails.getLinkedSavingsAccount();
savingsAccount.releaseFunds(amoutForWithdraw);
DepositAccountOnHoldTransaction onHoldTransaction = DepositAccountOnHoldTransaction.release(savingsAccount, amoutForWithdraw,
@@ -443,7 +443,7 @@ public class GuarantorDomainServiceImpl implements GuarantorDomainService {
final List<GuarantorFundingDetails> fundingDetails = guarantor.getGuarantorFundDetails();
for (GuarantorFundingDetails guarantorFundingDetails : fundingDetails) {
BigDecimal amoutForRelease = guarantorFundingDetails.getAmountRemaining();
if (amoutForRelease.compareTo(BigDecimal.ZERO) > 0 && (guarantorFundingDetails.getStatus().isActive())) {
if (amoutForRelease.compareTo(BigDecimal.ZERO) > 0 && guarantorFundingDetails.getStatus().isActive()) {
SavingsAccount savingsAccount = guarantorFundingDetails.getLinkedSavingsAccount();
savingsAccount.releaseFunds(amoutForRelease);
DepositAccountOnHoldTransaction onHoldTransaction = DepositAccountOnHoldTransaction.release(savingsAccount,
@@ -1101,7 +1101,7 @@ public final class LoanApplicationTerms {
}
switch (this.interestCalculationPeriodMethod) {
case DAILY:
periodsInOneYear = (!this.daysInYearType.getCode().equalsIgnoreCase("DaysInYearType.actual")) ? this.daysInYearType
periodsInOneYear = !this.daysInYearType.getCode().equalsIgnoreCase("DaysInYearType.actual") ? this.daysInYearType
.getValue().longValue() : calculator.calculate(PeriodFrequencyType.DAYS).longValue();
break;
case INVALID:
@@ -1771,4 +1771,4 @@ public final class LoanApplicationTerms {
this.isEqualAmortization = isEqualAmortization;
}
}
}
@@ -518,7 +518,7 @@ public class LoanScheduleAssembler {
}
if (jsonObject.has(LoanApiConstants.disbursementPrincipalParameterName)
&& jsonObject.get(LoanApiConstants.disbursementPrincipalParameterName).isJsonPrimitive()
&& StringUtils.isNotBlank((jsonObject.get(LoanApiConstants.disbursementPrincipalParameterName).getAsString()))) {
&& StringUtils.isNotBlank(jsonObject.get(LoanApiConstants.disbursementPrincipalParameterName).getAsString())) {
principal = jsonObject.getAsJsonPrimitive(LoanApiConstants.disbursementPrincipalParameterName).getAsBigDecimal();
}
BigDecimal waivedChargeAmount = null;
@@ -552,7 +552,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
if(gsimClientMembers.contains(BigDecimal.valueOf(newLoanApplication.getClientId())))
{
savingsAccount = this.savingsAccountAssembler.assembleFrom((clientAccountMappings.get(BigDecimal.valueOf(newLoanApplication.getClientId()))).longValue());
savingsAccount = this.savingsAccountAssembler.assembleFrom(clientAccountMappings.get(BigDecimal.valueOf(newLoanApplication.getClientId())).longValue());
this.fromApiJsonDeserializer.validatelinkedSavingsAccount(savingsAccount, newLoanApplication);
boolean isActive = true;
@@ -310,7 +310,7 @@ public class LoanUtilService {
}
if (jsonObject.has(LoanApiConstants.disbursementPrincipalParameterName)
&& jsonObject.get(LoanApiConstants.disbursementPrincipalParameterName).isJsonPrimitive()
&& StringUtils.isNotBlank((jsonObject.get(LoanApiConstants.disbursementPrincipalParameterName).getAsString()))) {
&& StringUtils.isNotBlank(jsonObject.get(LoanApiConstants.disbursementPrincipalParameterName).getAsString())) {
principal = jsonObject.getAsJsonPrimitive(LoanApiConstants.disbursementPrincipalParameterName).getAsBigDecimal();
}
@@ -434,12 +434,12 @@ public class LoanProduct extends AbstractPersistableCustom {
}
if (jsonObject.has(LoanProductConstants.minValueParameterName)
&& jsonObject.get(LoanProductConstants.minValueParameterName).isJsonPrimitive()
&& StringUtils.isNotBlank((jsonObject.get(LoanProductConstants.minValueParameterName).getAsString()))) {
&& StringUtils.isNotBlank(jsonObject.get(LoanProductConstants.minValueParameterName).getAsString())) {
minValue = jsonObject.getAsJsonPrimitive(LoanProductConstants.minValueParameterName).getAsBigDecimal();
}
if (jsonObject.has(LoanProductConstants.maxValueParameterName)
&& jsonObject.get(LoanProductConstants.maxValueParameterName).isJsonPrimitive()
&& StringUtils.isNotBlank((jsonObject.get(LoanProductConstants.maxValueParameterName).getAsString()))) {
&& StringUtils.isNotBlank(jsonObject.get(LoanProductConstants.maxValueParameterName).getAsString())) {
maxValue = jsonObject.getAsJsonPrimitive(LoanProductConstants.maxValueParameterName).getAsBigDecimal();
}
if (jsonObject.has(LoanProductConstants.borrowerCycleNumberParamName)
@@ -502,12 +502,12 @@ public class LoanProduct extends AbstractPersistableCustom {
}
if (jsonObject.has(LoanProductConstants.minValueParameterName)
&& jsonObject.get(LoanProductConstants.minValueParameterName).isJsonPrimitive()
&& StringUtils.isNotBlank((jsonObject.get(LoanProductConstants.minValueParameterName).getAsString()))) {
&& StringUtils.isNotBlank(jsonObject.get(LoanProductConstants.minValueParameterName).getAsString())) {
minValue = jsonObject.getAsJsonPrimitive(LoanProductConstants.minValueParameterName).getAsBigDecimal();
}
if (jsonObject.has(LoanProductConstants.maxValueParameterName)
&& jsonObject.get(LoanProductConstants.maxValueParameterName).isJsonPrimitive()
&& StringUtils.isNotBlank((jsonObject.get(LoanProductConstants.maxValueParameterName).getAsString()))) {
&& StringUtils.isNotBlank(jsonObject.get(LoanProductConstants.maxValueParameterName).getAsString())) {
maxValue = jsonObject.getAsJsonPrimitive(LoanProductConstants.maxValueParameterName).getAsBigDecimal();
}
if (jsonObject.has(LoanProductConstants.borrowerCycleNumberParamName)
@@ -520,7 +520,7 @@ public class LoanProduct extends AbstractPersistableCustom {
}
if (jsonObject.has(LoanProductConstants.borrowerCycleIdParameterName)
&& jsonObject.get(LoanProductConstants.borrowerCycleIdParameterName).isJsonPrimitive()
&& StringUtils.isNotBlank((jsonObject.get(LoanProductConstants.borrowerCycleIdParameterName).getAsString()))) {
&& StringUtils.isNotBlank(jsonObject.get(LoanProductConstants.borrowerCycleIdParameterName).getAsString())) {
id = jsonObject.getAsJsonPrimitive(LoanProductConstants.borrowerCycleIdParameterName).getAsLong();
}
LoanProductBorrowerCycleVariations borrowerCycleVariations = new LoanProductBorrowerCycleVariations(cycleNumber,
@@ -108,7 +108,7 @@ public class LoanProductReadPlatformServiceImpl implements LoanProductReadPlatfo
// products mapped to current user's office
String inClause = fineractEntityAccessUtil
.getSQLWhereClauseForProductIDsForUserOffice_ifGlobalConfigEnabled(FineractEntityType.LOAN_PRODUCT);
if ((inClause != null) && (!(inClause.trim().isEmpty()))) {
if (inClause != null && !inClause.trim().isEmpty()) {
sql += " where lp.id in ( " + inClause + " ) ";
}
@@ -124,7 +124,7 @@ public class LoanProductReadPlatformServiceImpl implements LoanProductReadPlatfo
String sql = "select " + rm.schema();
if ((inClause != null) && (!(inClause.trim().isEmpty()))) {
if (inClause != null && !inClause.trim().isEmpty()) {
sql += " where lp.id in ("+inClause+") ";
//Here no need to check injection as this is internal where clause
// SQLInjectionValidator.validateSQLInput(inClause);
@@ -155,7 +155,7 @@ public class LoanProductReadPlatformServiceImpl implements LoanProductReadPlatfo
// products mapped to current user's office
String inClause = fineractEntityAccessUtil
.getSQLWhereClauseForProductIDsForUserOffice_ifGlobalConfigEnabled(FineractEntityType.LOAN_PRODUCT);
if ((inClause != null) && (!(inClause.trim().isEmpty()))) {
if (inClause != null && !inClause.trim().isEmpty()) {
if (activeOnly) {
sql += " and id in ( " + inClause + " )";
} else {
@@ -552,7 +552,7 @@ public class LoanProductReadPlatformServiceImpl implements LoanProductReadPlatfo
// products mapped to current user's office
String inClause = fineractEntityAccessUtil
.getSQLWhereClauseForProductIDsForUserOffice_ifGlobalConfigEnabled(FineractEntityType.LOAN_PRODUCT);
if ((inClause != null) && (!(inClause.trim().isEmpty()))) {
if (inClause != null && !inClause.trim().isEmpty()) {
sql += " and id in (" + inClause + ") ";
}
@@ -572,7 +572,7 @@ public class LoanProductReadPlatformServiceImpl implements LoanProductReadPlatfo
// products mapped to current user's office
String inClause = fineractEntityAccessUtil
.getSQLWhereClauseForProductIDsForUserOffice_ifGlobalConfigEnabled(FineractEntityType.LOAN_PRODUCT);
if ((inClause != null) && (!(inClause.trim().isEmpty()))) {
if (inClause != null && !inClause.trim().isEmpty()) {
sql += " and lp.id in ( " + inClause + " ) ";
}
@@ -591,7 +591,7 @@ public class LoanProductReadPlatformServiceImpl implements LoanProductReadPlatfo
// products mapped to current user's office
String inClause1 = fineractEntityAccessUtil
.getSQLWhereClauseForProductIDsForUserOffice_ifGlobalConfigEnabled(FineractEntityType.LOAN_PRODUCT);
if ((inClause1 != null) && (!(inClause1.trim().isEmpty()))) {
if (inClause1 != null && !inClause1.trim().isEmpty()) {
sql += " and rp.id in ( " + inClause1 + " ) ";
}
@@ -601,7 +601,7 @@ public class LoanProductReadPlatformServiceImpl implements LoanProductReadPlatfo
// products mapped to current user's office
String inClause2 = fineractEntityAccessUtil
.getSQLWhereClauseForProductIDsForUserOffice_ifGlobalConfigEnabled(FineractEntityType.LOAN_PRODUCT);
if ((inClause2 != null) && (!(inClause2.trim().isEmpty()))) {
if (inClause2 != null && !inClause2.trim().isEmpty()) {
sql += " and lp.id in ( " + inClause2 + " ) ";
}
@@ -621,7 +621,7 @@ public class LoanProductReadPlatformServiceImpl implements LoanProductReadPlatfo
// products mapped to current user's office
String inClause = fineractEntityAccessUtil
.getSQLWhereClauseForProductIDsForUserOffice_ifGlobalConfigEnabled(FineractEntityType.LOAN_PRODUCT);
if ((inClause != null) && (!(inClause.trim().isEmpty()))) {
if (inClause != null && !inClause.trim().isEmpty()) {
sql += " lp.id in ( " + inClause + " ) and ";
}
@@ -684,4 +684,4 @@ public class LoanProductReadPlatformServiceImpl implements LoanProductReadPlatfo
}
}
}
}
@@ -573,7 +573,7 @@ public class SavingsAccount extends AbstractPersistableCustom {
final List<SavingsAccountTransaction> withholdTransactions = new ArrayList<>();
List<SavingsAccountTransaction> trans = getTransactions() ;
for (final SavingsAccountTransaction transaction : trans) {
if ((transaction.isWithHoldTaxAndNotReversed())) {
if (transaction.isWithHoldTaxAndNotReversed()) {
withholdTransactions.add(transaction);
}
}
@@ -658,7 +658,7 @@ public class SavingsProduct extends AbstractPersistableCustom {
final Set<Charge> currentSetOfCharges = new HashSet<>(this.charges);
final Set<Charge> newSetOfCharges = new HashSet<>(newSavingsProductCharges);
if (!(currentSetOfCharges.equals(newSetOfCharges))) {
if (!currentSetOfCharges.equals(newSetOfCharges)) {
updated = true;
this.charges = newSavingsProductCharges;
}
@@ -752,4 +752,4 @@ public class SavingsProduct extends AbstractPersistableCustom {
return this.daysToEscheat;
}
}
}
@@ -68,7 +68,7 @@ public class SavingsProductReadPlatformServiceImpl implements SavingsProductRead
// products mapped to current user's office
String inClause = fineractEntityAccessUtil
.getSQLWhereClauseForProductIDsForUserOffice_ifGlobalConfigEnabled(FineractEntityType.SAVINGS_PRODUCT);
if ((inClause != null) && (!(inClause.trim().isEmpty()))) {
if (inClause != null && !inClause.trim().isEmpty()) {
sql += " and sp.id in ( " + inClause + " ) ";
}
@@ -84,7 +84,7 @@ public class SavingsProductReadPlatformServiceImpl implements SavingsProductRead
// products mapped to current user's office
String inClause = fineractEntityAccessUtil
.getSQLWhereClauseForProductIDsForUserOffice_ifGlobalConfigEnabled(FineractEntityType.SAVINGS_PRODUCT);
if ((inClause != null) && (!(inClause.trim().isEmpty()))) {
if (inClause != null && !inClause.trim().isEmpty()) {
sql += " and id in ( " + inClause + " ) ";
}
@@ -254,7 +254,7 @@ public class SavingsProductReadPlatformServiceImpl implements SavingsProductRead
// products mapped to current user's office
String inClause = fineractEntityAccessUtil
.getSQLWhereClauseForProductIDsForUserOffice_ifGlobalConfigEnabled(FineractEntityType.SAVINGS_PRODUCT);
if ((inClause != null) && (!(inClause.trim().isEmpty()))) {
if (inClause != null && !inClause.trim().isEmpty()) {
sql += " where id in ( " + inClause + " ) ";
inClauseAdded = true;
}
@@ -288,10 +288,10 @@ public class SavingsProductReadPlatformServiceImpl implements SavingsProductRead
// products mapped to current user's office
String inClause = fineractEntityAccessUtil
.getSQLWhereClauseForProductIDsForUserOffice_ifGlobalConfigEnabled(FineractEntityType.SAVINGS_PRODUCT);
if ((inClause != null) && (!(inClause.trim().isEmpty()))) {
if (inClause != null && !inClause.trim().isEmpty()) {
sql += " and id in ( " + inClause + " ) ";
}
return this.jdbcTemplate.query(sql, this.savingsProductRowMapper, new Object[] {currencyCode});
}
}
}
@@ -192,7 +192,7 @@ public class SelfServiceRegistrationWritePlatformServiceImpl implements SelfServ
Collection<SmsProviderData> smsProviders = this.smsCampaignDropdownReadPlatformService.retrieveSmsProviders();
if (smsProviders.isEmpty()) { throw new PlatformDataIntegrityException("error.msg.mobile.service.provider.not.available",
"Mobile service provider not available."); }
Long providerId = (new ArrayList<>(smsProviders)).get(0).getId();
Long providerId = new ArrayList<>(smsProviders).get(0).getId();
final String message = "Hi " + selfServiceRegistration.getFirstName() + "," + "\n"
+ "To create user, please use following details \n" + "Request Id : " + selfServiceRegistration.getId()
+ "\n Authentication Token : " + selfServiceRegistration.getAuthenticationToken();
@@ -109,6 +109,6 @@ public class ShareAccountChargeData implements Serializable {
private BigDecimal getAmountOrPercentage() {
return (this.chargeCalculationType != null) && (this.chargeCalculationType.getId().intValue() > 1) ? this.percentage : this.amount;
return this.chargeCalculationType != null && this.chargeCalculationType.getId().intValue() > 1 ? this.percentage : this.amount;
}
}
@@ -98,7 +98,7 @@ public class ShareAccountCharge extends AbstractPersistableCustom {
this.shareAccount = shareAccount;
this.charge = chargeDefinition;
this.chargeTime = (chargeTime == null) ? chargeDefinition.getChargeTimeType() : chargeTime.getValue();
this.chargeTime = chargeTime == null ? chargeDefinition.getChargeTimeType() : chargeTime.getValue();
this.chargeCalculation = chargeDefinition.getChargeCalculation();
if (chargeCalculation != null) {
@@ -490,7 +490,7 @@ public class ShareAccountDataSerializer {
if(totalSubsribedShares == null) {
totalSubsribedShares = Long.valueOf(0);
}
if((totalSubsribedShares+requested) > totalSharesIssuable) {
if(totalSubsribedShares+requested > totalSharesIssuable) {
baseDataValidator.reset().parameter(ShareAccountApiConstants.requestedshares_paramname).value(requested)
.failWithCodeNoParameterAddedToErrorCode("shares.requested.can.not.be.approved.exceeding.totalshares.issuable");
}
@@ -115,7 +115,7 @@ public class ShareProductDividendAssembler {
}
if (lastDividendAppliedDate != null) {
numberOfShareDaysPerAccount += (Days.daysBetween(lastDividendAppliedDate, shareStartDate).getDays() * numberOfShares);
numberOfShareDaysPerAccount += Days.daysBetween(lastDividendAppliedDate, shareStartDate).getDays() * numberOfShares;
}
lastDividendAppliedDate = shareStartDate;
if (type.isPurchased()) {
@@ -127,7 +127,7 @@ public class ShareProductDividendAssembler {
}
}
if (lastDividendAppliedDate != null) {
numberOfShareDaysPerAccount += (Days.daysBetween(lastDividendAppliedDate, postingDate).getDays() * numberOfShares);
numberOfShareDaysPerAccount += Days.daysBetween(lastDividendAppliedDate, postingDate).getDays() * numberOfShares;
}
numberOfShareDays += numberOfShareDaysPerAccount;
numberOfSharesdaysPerAccount.put(accountData.getId(), numberOfShareDaysPerAccount);
@@ -134,7 +134,7 @@ public class TransferWritePlatformServiceJpaRepositoryImpl implements TransferWr
TransferNotSupportedReason.SOURCE_AND_DESTINATION_GROUP_CANNOT_BE_SAME, sourceGroupId, destinationGroupId); }
/*** Do not allow bulk client transfers across branches ***/
if (!(sourceOffice.getId().equals(destinationGroup.getOffice().getId()))) { throw new TransferNotSupportedException(
if (!sourceOffice.getId().equals(destinationGroup.getOffice().getId())) { throw new TransferNotSupportedException(
TransferNotSupportedReason.BULK_CLIENT_TRANSFER_ACROSS_BRANCHES, sourceGroupId, destinationGroupId); }
for (final Client client : clients) {
@@ -529,4 +529,4 @@ public class TransferWritePlatformServiceJpaRepositoryImpl implements TransferWr
* ClientNotAwaitingTransferApprovalException(group.getId()); } }
**/
}
}