FINERACT-823 Gradle modernizer fixing violations
This commit is contained in:
committed by
Michael Vorburger ⛑️
parent
ef5bba4d52
commit
2e620b4de8
@@ -44,9 +44,10 @@ buildscript {
|
||||
classpath 'com.radcortez.gradle:openjpa-gradle-plugin:3.1.0'
|
||||
classpath 'gradle.plugin.org.nosphere.apache:creadur-rat-gradle:0.2.2'
|
||||
classpath "com.github.spotbugs:spotbugs-gradle-plugin:2.0.1"
|
||||
// Use Guava version 23+ as a workaround to spotbug intergration.
|
||||
// See: https://github.com/spotbugs/spotbugs-gradle-plugin/issues/128#issuecomment-535864882
|
||||
// Use Guava version 23+ as a workaround to spotbug intergration.
|
||||
// See: https://github.com/spotbugs/spotbugs-gradle-plugin/issues/128#issuecomment-535864882
|
||||
classpath 'com.google.guava:guava:28.1-jre'
|
||||
classpath "gradle.plugin.com.github.andygoossens:gradle-modernizer-plugin:1.3.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,6 +65,7 @@ apply plugin: 'java-library'
|
||||
apply plugin: 'openjpa'
|
||||
apply plugin: "com.github.spotbugs"
|
||||
apply plugin: 'checkstyle'
|
||||
apply plugin: 'com.github.andygoossens.gradle-modernizer-plugin'
|
||||
// apply plugin: 'pmd'
|
||||
|
||||
dependencyManagement {
|
||||
@@ -299,6 +301,27 @@ if (project.hasProperty('security') && project.getProperty('security') == 'oauth
|
||||
}
|
||||
}
|
||||
|
||||
modernizer {
|
||||
includeTestClasses = true
|
||||
failOnViolations = true
|
||||
|
||||
violationLogLevel="error"
|
||||
|
||||
javaVersion = project.targetCompatibility
|
||||
|
||||
ignorePackages = []
|
||||
ignoreClassNamePatterns = [
|
||||
'.*AbstractPersistableCustom'
|
||||
]
|
||||
ignoreGeneratedClasses = true
|
||||
|
||||
exclusions = []
|
||||
exclusionPatterns = [
|
||||
// To be removed when https://issues.apache.org/jira/browse/FINERACT-826 is fixed
|
||||
'org/joda/time/.*'
|
||||
]
|
||||
}
|
||||
|
||||
task dist(type:Zip){
|
||||
baseName = 'fineractplatform'
|
||||
version = qualifyVersionIfNecessary(releaseVersion)
|
||||
|
||||
+2
-2
@@ -362,7 +362,7 @@ public class AccountingScenarioIntegrationTest {
|
||||
final String APPROVED_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String ACTIVATION_DATE = dateFormat.format(todaysDate.getTime());
|
||||
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
|
||||
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
|
||||
@@ -445,7 +445,7 @@ public class AccountingScenarioIntegrationTest {
|
||||
final String ACTIVATION_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String EXPECTED_FIRST_DEPOSIT_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
|
||||
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
|
||||
|
||||
+26
-26
@@ -147,7 +147,7 @@ public class FixedDepositTest {
|
||||
final String ACTIVATION_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime());
|
||||
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
|
||||
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
|
||||
@@ -286,7 +286,7 @@ public class FixedDepositTest {
|
||||
final String ACTIVATION_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime());
|
||||
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
|
||||
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
|
||||
@@ -433,7 +433,7 @@ public class FixedDepositTest {
|
||||
final String ACTIVATION_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime());
|
||||
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
|
||||
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
|
||||
@@ -725,7 +725,7 @@ public class FixedDepositTest {
|
||||
final String ACTIVATION_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime());
|
||||
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
|
||||
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
|
||||
@@ -896,7 +896,7 @@ public class FixedDepositTest {
|
||||
final String ACTIVATION_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime());
|
||||
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
|
||||
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
|
||||
@@ -1191,7 +1191,7 @@ public class FixedDepositTest {
|
||||
|
||||
todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.MONTH, -1);
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
todaysDate.add(Calendar.DATE, -(currentDate - 1));
|
||||
final String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String APPROVED_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
@@ -1261,7 +1261,7 @@ public class FixedDepositTest {
|
||||
|
||||
todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.MONTH, -1);
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
todaysDate.add(Calendar.DATE, -(currentDate - 1));
|
||||
final String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String APPROVED_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
@@ -1385,7 +1385,7 @@ public class FixedDepositTest {
|
||||
|
||||
todaysDate.add(Calendar.MONTH, -1);
|
||||
todaysDate.add(Calendar.DAY_OF_MONTH, -1);
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
daysInMonth = (daysInMonth - currentDate) + 1;
|
||||
Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth);
|
||||
@@ -1493,7 +1493,7 @@ public class FixedDepositTest {
|
||||
|
||||
todaysDate.add(Calendar.MONTH, -1);
|
||||
todaysDate.add(Calendar.DAY_OF_MONTH, -1);
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
daysInMonth = (daysInMonth - currentDate) + 1;
|
||||
Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth);
|
||||
@@ -1606,7 +1606,7 @@ public class FixedDepositTest {
|
||||
|
||||
todaysDate.add(Calendar.MONTH, -1);
|
||||
todaysDate.add(Calendar.DAY_OF_MONTH, -1);
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
daysInMonth = (daysInMonth - currentDate) + 1;
|
||||
Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth);
|
||||
@@ -1722,7 +1722,7 @@ public class FixedDepositTest {
|
||||
|
||||
todaysDate.add(Calendar.MONTH, -1);
|
||||
todaysDate.add(Calendar.DAY_OF_MONTH, -1);
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
daysInMonth = (daysInMonth - currentDate) + 1;
|
||||
Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth);
|
||||
@@ -1774,7 +1774,7 @@ public class FixedDepositTest {
|
||||
|
||||
todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.MONTH, -1);
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
todaysDate.add(Calendar.DATE, -(currentDate - 1));
|
||||
final String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String APPROVED_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
@@ -1850,7 +1850,7 @@ public class FixedDepositTest {
|
||||
|
||||
todaysDate = Calendar.getInstance();
|
||||
//todaysDate.add(Calendar.MONTH, -1);
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
todaysDate.add(Calendar.DATE, -(currentDate - 1));
|
||||
final String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String APPROVED_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
@@ -1921,10 +1921,10 @@ public class FixedDepositTest {
|
||||
Calendar todaysDate = Calendar.getInstance();
|
||||
|
||||
todaysDate.add(Calendar.YEAR, -1);
|
||||
Integer currentMonth = new Integer(currentMonthFormat.format(todaysDate.getTime()));
|
||||
Integer currentMonth = Integer.valueOf(currentMonthFormat.format(todaysDate.getTime()));
|
||||
Integer numberOfMonths = 12 - currentMonth;
|
||||
todaysDate.add(Calendar.MONTH, numberOfMonths);
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
Integer daysLeft = daysInMonth - currentDate;
|
||||
todaysDate.add(Calendar.DATE, (daysLeft + 1));
|
||||
@@ -2005,10 +2005,10 @@ public class FixedDepositTest {
|
||||
Calendar todaysDate = Calendar.getInstance();
|
||||
|
||||
todaysDate.add(Calendar.YEAR, -1);
|
||||
Integer currentMonth = new Integer(currentMonthFormat.format(todaysDate.getTime()));
|
||||
Integer currentMonth = Integer.valueOf(currentMonthFormat.format(todaysDate.getTime()));
|
||||
Integer numberOfMonths = 12 - currentMonth;
|
||||
todaysDate.add(Calendar.MONTH, numberOfMonths);
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
Integer daysLeft = daysInMonth - currentDate;
|
||||
todaysDate.add(Calendar.DATE, (daysLeft + 1));
|
||||
@@ -2090,10 +2090,10 @@ public class FixedDepositTest {
|
||||
|
||||
Calendar todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.YEAR, -1);
|
||||
Integer currentMonth = new Integer(currentMonthFormat.format(todaysDate.getTime()));
|
||||
Integer currentMonth = Integer.valueOf(currentMonthFormat.format(todaysDate.getTime()));
|
||||
Integer numberOfMonths = 12 - currentMonth;
|
||||
todaysDate.add(Calendar.MONTH, numberOfMonths);
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
Integer daysLeft = daysInMonth - currentDate;
|
||||
todaysDate.add(Calendar.DATE, (daysLeft + 1));
|
||||
@@ -2172,10 +2172,10 @@ public class FixedDepositTest {
|
||||
|
||||
Calendar todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.YEAR, -1);
|
||||
Integer currentMonth = new Integer(currentMonthFormat.format(todaysDate.getTime()));
|
||||
Integer currentMonth = Integer.valueOf(currentMonthFormat.format(todaysDate.getTime()));
|
||||
Integer numberOfMonths = 12 - currentMonth;
|
||||
todaysDate.add(Calendar.MONTH, numberOfMonths);
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
Integer daysLeft = daysInMonth - currentDate;
|
||||
todaysDate.add(Calendar.DATE, (daysLeft + 1));
|
||||
@@ -2254,10 +2254,10 @@ public class FixedDepositTest {
|
||||
|
||||
Calendar todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.YEAR, -1);
|
||||
Integer currentMonth = new Integer(currentMonthFormat.format(todaysDate.getTime()));
|
||||
Integer currentMonth = Integer.valueOf(currentMonthFormat.format(todaysDate.getTime()));
|
||||
Integer numberOfMonths = 12 - currentMonth;
|
||||
todaysDate.add(Calendar.MONTH, numberOfMonths);
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
Integer daysLeft = daysInMonth - currentDate;
|
||||
todaysDate.add(Calendar.DATE, (daysLeft + 1));
|
||||
@@ -2335,10 +2335,10 @@ public class FixedDepositTest {
|
||||
|
||||
Calendar todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.YEAR, -1);
|
||||
Integer currentMonth = new Integer(currentMonthFormat.format(todaysDate.getTime()));
|
||||
Integer currentMonth = Integer.valueOf(currentMonthFormat.format(todaysDate.getTime()));
|
||||
Integer numberOfMonths = 12 - currentMonth;
|
||||
todaysDate.add(Calendar.MONTH, numberOfMonths);
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
Integer daysLeft = daysInMonth - currentDate;
|
||||
todaysDate.add(Calendar.DATE, (daysLeft + 1));
|
||||
@@ -2576,4 +2576,4 @@ public class FixedDepositTest {
|
||||
Assert.assertEquals(financialActivityAccountId, deletedFinancialActivityAccountId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -340,7 +340,7 @@ public class FundsIntegrationTest {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new Long(fundId);
|
||||
return Long.valueOf(fundId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+27
-27
@@ -148,7 +148,7 @@ public class RecurringDepositTest {
|
||||
final String EXPECTED_FIRST_DEPOSIT_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime());
|
||||
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
|
||||
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
|
||||
@@ -300,7 +300,7 @@ public class RecurringDepositTest {
|
||||
final String EXPECTED_FIRST_DEPOSIT_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime());
|
||||
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
|
||||
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
|
||||
@@ -505,7 +505,7 @@ public class RecurringDepositTest {
|
||||
final String EXPECTED_FIRST_DEPOSIT_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime());
|
||||
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
|
||||
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
|
||||
@@ -721,7 +721,7 @@ public class RecurringDepositTest {
|
||||
final String EXPECTED_FIRST_DEPOSIT_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime());
|
||||
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
|
||||
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
|
||||
@@ -888,7 +888,7 @@ public class RecurringDepositTest {
|
||||
final String EXPECTED_FIRST_DEPOSIT_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String MONTH_DAY = monthDayFormat.format(todaysDate.getTime());
|
||||
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
Integer numberOfDaysLeft = (daysInMonth - currentDate) + 1;
|
||||
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
|
||||
@@ -1374,7 +1374,7 @@ public class RecurringDepositTest {
|
||||
|
||||
todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.MONTH, -1);
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
todaysDate.add(Calendar.DATE, -(currentDate - 1));
|
||||
final String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String APPROVED_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
@@ -1454,7 +1454,7 @@ public class RecurringDepositTest {
|
||||
|
||||
todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.MONTH, -1);
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
todaysDate.add(Calendar.DATE, -(currentDate - 1));
|
||||
final String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String APPROVED_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
@@ -1591,7 +1591,7 @@ public class RecurringDepositTest {
|
||||
DecimalFormat decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
|
||||
decimalFormat.applyPattern(".");
|
||||
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
daysInMonth = (daysInMonth - currentDate) + 1;
|
||||
Float interestToBePosted = new Float(decimalFormat.format(interestPerDay * principal * daysInMonth));
|
||||
@@ -1698,7 +1698,7 @@ public class RecurringDepositTest {
|
||||
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.MONTH, -1);
|
||||
Integer currentDate = new Integer(currentDateFormat.format(calendar.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(calendar.getTime()));
|
||||
Integer daysInMonth = calendar.getActualMaximum(Calendar.DATE);
|
||||
daysInMonth = (daysInMonth - currentDate) + 1;
|
||||
Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth);
|
||||
@@ -1830,7 +1830,7 @@ public class RecurringDepositTest {
|
||||
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.MONTH, -1);
|
||||
Integer currentDate = new Integer(currentDateFormat.format(calendar.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(calendar.getTime()));
|
||||
Integer daysInMonth = calendar.getActualMaximum(Calendar.DATE);
|
||||
daysInMonth = (daysInMonth - currentDate) + 1;
|
||||
Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth);
|
||||
@@ -1970,7 +1970,7 @@ public class RecurringDepositTest {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.MONTH, -1);
|
||||
calendar.add(Calendar.DAY_OF_MONTH, -1);
|
||||
Integer currentDate = new Integer(currentDateFormat.format(calendar.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(calendar.getTime()));
|
||||
Integer daysInMonth = calendar.getActualMaximum(Calendar.DATE);
|
||||
daysInMonth = (daysInMonth - currentDate) + 1;
|
||||
Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth);
|
||||
@@ -2115,7 +2115,7 @@ public class RecurringDepositTest {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.MONTH, -1);
|
||||
calendar.add(Calendar.DAY_OF_MONTH, -1);
|
||||
Integer currentDate = new Integer(currentDateFormat.format(calendar.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(calendar.getTime()));
|
||||
Integer daysInMonth = calendar.getActualMaximum(Calendar.DATE);
|
||||
daysInMonth = (daysInMonth - currentDate) + 1;
|
||||
Float interestPerMonth = (float) (interestPerDay * principal * daysInMonth);
|
||||
@@ -2178,7 +2178,7 @@ public class RecurringDepositTest {
|
||||
|
||||
todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.MONTH, -1);
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
todaysDate.add(Calendar.DATE, -(currentDate - 1));
|
||||
final String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String APPROVED_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
@@ -2262,7 +2262,7 @@ public class RecurringDepositTest {
|
||||
|
||||
todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.MONTH, -1);
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
todaysDate.add(Calendar.DATE, -(currentDate - 1));
|
||||
final String SUBMITTED_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
final String APPROVED_ON_DATE = dateFormat.format(todaysDate.getTime());
|
||||
@@ -2344,10 +2344,10 @@ public class RecurringDepositTest {
|
||||
|
||||
Calendar todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.YEAR, -1);
|
||||
Integer currentMonth = new Integer(currentMonthFormat.format(todaysDate.getTime()));
|
||||
Integer currentMonth = Integer.valueOf(currentMonthFormat.format(todaysDate.getTime()));
|
||||
Integer numberOfMonths = 12 - currentMonth;
|
||||
todaysDate.add(Calendar.MONTH, numberOfMonths);
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
Integer daysLeft = daysInMonth - currentDate;
|
||||
todaysDate.add(Calendar.DATE, (daysLeft + 1));
|
||||
@@ -2435,10 +2435,10 @@ public class RecurringDepositTest {
|
||||
|
||||
Calendar todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.YEAR, -1);
|
||||
Integer currentMonth = new Integer(currentMonthFormat.format(todaysDate.getTime()));
|
||||
Integer currentMonth = Integer.valueOf(currentMonthFormat.format(todaysDate.getTime()));
|
||||
Integer numberOfMonths = 12 - currentMonth;
|
||||
todaysDate.add(Calendar.MONTH, numberOfMonths);
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
Integer daysLeft = daysInMonth - currentDate;
|
||||
todaysDate.add(Calendar.DATE, (daysLeft + 1));
|
||||
@@ -2525,10 +2525,10 @@ public class RecurringDepositTest {
|
||||
Calendar todaysDate = Calendar.getInstance();
|
||||
|
||||
todaysDate.add(Calendar.YEAR, -1);
|
||||
Integer currentMonth = new Integer(currentMonthFormat.format(todaysDate.getTime()));
|
||||
Integer currentMonth = Integer.valueOf(currentMonthFormat.format(todaysDate.getTime()));
|
||||
Integer numberOfMonths = 12 - currentMonth;
|
||||
todaysDate.add(Calendar.MONTH, numberOfMonths);
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
Integer daysLeft = daysInMonth - currentDate;
|
||||
todaysDate.add(Calendar.DATE, (daysLeft + 1));
|
||||
@@ -2616,10 +2616,10 @@ public class RecurringDepositTest {
|
||||
Calendar todaysDate = Calendar.getInstance();
|
||||
|
||||
todaysDate.add(Calendar.YEAR, -1);
|
||||
Integer currentMonth = new Integer(currentMonthFormat.format(todaysDate.getTime()));
|
||||
Integer currentMonth = Integer.valueOf(currentMonthFormat.format(todaysDate.getTime()));
|
||||
Integer numberOfMonths = 12 - currentMonth;
|
||||
todaysDate.add(Calendar.MONTH, numberOfMonths);
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
Integer daysLeft = daysInMonth - currentDate;
|
||||
todaysDate.add(Calendar.DATE, (daysLeft + 1));
|
||||
@@ -2708,10 +2708,10 @@ public class RecurringDepositTest {
|
||||
|
||||
Calendar todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.YEAR, -1);
|
||||
Integer currentMonth = new Integer(currentMonthFormat.format(todaysDate.getTime()));
|
||||
Integer currentMonth = Integer.valueOf(currentMonthFormat.format(todaysDate.getTime()));
|
||||
Integer numberOfMonths = 12 - currentMonth;
|
||||
todaysDate.add(Calendar.MONTH, numberOfMonths);
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
Integer daysLeft = daysInMonth - currentDate;
|
||||
todaysDate.add(Calendar.DATE, (daysLeft + 1));
|
||||
@@ -2799,10 +2799,10 @@ public class RecurringDepositTest {
|
||||
|
||||
Calendar todaysDate = Calendar.getInstance();
|
||||
todaysDate.add(Calendar.YEAR, -1);
|
||||
Integer currentMonth = new Integer(currentMonthFormat.format(todaysDate.getTime()));
|
||||
Integer currentMonth = Integer.valueOf(currentMonthFormat.format(todaysDate.getTime()));
|
||||
Integer numberOfMonths = 12 - currentMonth;
|
||||
todaysDate.add(Calendar.MONTH, numberOfMonths);
|
||||
Integer currentDate = new Integer(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer currentDate = Integer.valueOf(currentDateFormat.format(todaysDate.getTime()));
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
Integer daysLeft = daysInMonth - currentDate;
|
||||
todaysDate.add(Calendar.DATE, (daysLeft + 1));
|
||||
@@ -3206,4 +3206,4 @@ public class RecurringDepositTest {
|
||||
Assert.assertEquals(financialActivityAccountId, deletedFinancialActivityAccountId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -425,7 +425,7 @@ public class SchedulerJobsTestResults {
|
||||
this.schedulerJobHelper.executeJob(JobName);
|
||||
final HashMap runningBalanceAfter = this.accountHelper.getAccountingWithRunningBalanceById(accountID.toString());
|
||||
|
||||
final Integer INT_BALANCE = new Integer(MINIMUM_OPENING_BALANCE);
|
||||
final Integer INT_BALANCE = Integer.valueOf(MINIMUM_OPENING_BALANCE);
|
||||
|
||||
Assert.assertEquals("Verifying Account Running Balance after running Update Accounting Running Balances Scheduler Job",
|
||||
INT_BALANCE, runningBalanceAfter.get("organizationRunningBalance"));
|
||||
|
||||
+2
-2
@@ -63,7 +63,7 @@ public class VariableInstallmentsDecliningBalanceHelper {
|
||||
.withInterestTypeAsDecliningBalance() //
|
||||
.withTranches(multiDisburseLoan) //
|
||||
.withInterestCalculationPeriodTypeAsRepaymentPeriod(true)//
|
||||
.withVariableInstallmentsConfig(Boolean.TRUE, new Integer(5), new Integer(90))//
|
||||
.withVariableInstallmentsConfig(Boolean.TRUE, Integer.valueOf(5), Integer.valueOf(90))//
|
||||
.withAccounting(accountingRule, accounts).build(null);
|
||||
return loanProductJSON ;
|
||||
}
|
||||
@@ -81,7 +81,7 @@ public class VariableInstallmentsDecliningBalanceHelper {
|
||||
.withInterestTypeAsDecliningBalance() //
|
||||
.withTranches(multiDisburseLoan) //
|
||||
.withInterestCalculationPeriodTypeAsRepaymentPeriod(true)//
|
||||
.withVariableInstallmentsConfig(Boolean.TRUE, new Integer(5), new Integer(90))//
|
||||
.withVariableInstallmentsConfig(Boolean.TRUE, Integer.valueOf(5), Integer.valueOf(90))//
|
||||
.withAccounting(accountingRule, accounts).build(null);
|
||||
return loanProductJSON ;
|
||||
}
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ public class VariableInstallmentsFlatHelper {
|
||||
.withInterestTypeAsFlat() //
|
||||
.withTranches(multiDisburseLoan) //
|
||||
.withInterestCalculationPeriodTypeAsRepaymentPeriod(true)//
|
||||
.withVariableInstallmentsConfig(Boolean.TRUE, new Integer(5), new Integer(90))//
|
||||
.withVariableInstallmentsConfig(Boolean.TRUE, Integer.valueOf(5), Integer.valueOf(90))//
|
||||
.withAccounting(accountingRule, accounts).build(null);
|
||||
return loanProductJSON ;
|
||||
}
|
||||
|
||||
+2
-2
@@ -59,8 +59,8 @@ public class VariableInstallmentsIntegrationTest {
|
||||
System.out.println("------------------------------RETRIEVING CREATED LOAN PRODUCT DETAILS ---------------------------------------");
|
||||
Map loanProduct = (Map)loanTransactionHelper.getLoanProductDetail(requestSpec, responseSpec, loanProductID, "") ;
|
||||
Assert.assertTrue((Boolean)loanProduct.get("allowVariableInstallments")) ;
|
||||
Assert.assertEquals(new Integer(5), loanProduct.get("minimumGap")) ;
|
||||
Assert.assertEquals(new Integer(90), loanProduct.get("maximumGap")) ;
|
||||
Assert.assertEquals(Integer.valueOf(5), loanProduct.get("minimumGap")) ;
|
||||
Assert.assertEquals(Integer.valueOf(90), loanProduct.get("maximumGap")) ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -86,7 +86,7 @@ public class ClientTransactionDTO {
|
||||
}
|
||||
|
||||
public boolean isChargePayment() {
|
||||
return ClientTransactionType.PAY_CHARGE.getValue().equals(new Integer(this.transactionType.getId().intValue()));
|
||||
return ClientTransactionType.PAY_CHARGE.getValue().equals(Integer.valueOf(this.transactionType.getId().intValue()));
|
||||
}
|
||||
|
||||
public String getCurrencyCode() {
|
||||
|
||||
+2
-2
@@ -281,7 +281,7 @@ public class ProvisioningEntriesReadPlatformServiceImpl implements ProvisioningE
|
||||
|
||||
private static final class ProvisioningEntryIdDateRowMapper implements RowMapper<ProvisioningEntryData> {
|
||||
|
||||
StringBuffer buff = new StringBuffer().append("select history1.id, history1.created_date from m_provisioning_history history1 ")
|
||||
StringBuilder buff = new StringBuilder().append("select history1.id, history1.created_date from m_provisioning_history history1 ")
|
||||
.append("where history1.created_date = (select max(history2.created_date) from m_provisioning_history history2 ")
|
||||
.append("where history2.journal_entry_created='1')");
|
||||
|
||||
@@ -348,4 +348,4 @@ public class ProvisioningEntriesReadPlatformServiceImpl implements ProvisioningE
|
||||
whereClauseItemsitems, mapper);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -229,14 +229,14 @@ public class ImportHandlerUtils {
|
||||
}
|
||||
|
||||
public static String getDefaultUserMessages(List<ApiParameterError> ApiParameterErrorList){
|
||||
StringBuffer defaultUserMessages=new StringBuffer();
|
||||
StringBuilder defaultUserMessages=new StringBuilder();
|
||||
for (ApiParameterError error:ApiParameterErrorList) {
|
||||
defaultUserMessages=defaultUserMessages.append(error.getDefaultUserMessage()+'\t');
|
||||
}
|
||||
return defaultUserMessages.toString();
|
||||
}
|
||||
public static String getErrorList(List<String> errorList){
|
||||
StringBuffer errors=new StringBuffer();
|
||||
StringBuilder errors=new StringBuilder();
|
||||
for (String error: errorList) {
|
||||
errors=errors.append(error);
|
||||
}
|
||||
@@ -380,4 +380,4 @@ public class ImportHandlerUtils {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ public class SmsCampaignEnumerations {
|
||||
}
|
||||
|
||||
public static EnumOptionData calendarMonthType(final Month entityType) {
|
||||
final EnumOptionData optionData = new EnumOptionData(new Long(entityType.getValue()), entityType.name(), entityType.name());
|
||||
final EnumOptionData optionData = new EnumOptionData(Long.valueOf(entityType.getValue()), entityType.name(), entityType.name());
|
||||
return optionData;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -93,7 +93,7 @@ public class CodeValue extends AbstractPersistableCustom<Long> {
|
||||
isActive = isActiveObj;
|
||||
}
|
||||
if (position == null) {
|
||||
position = new Integer(0);
|
||||
position = Integer.valueOf(0);
|
||||
}
|
||||
|
||||
Boolean mandatory = command.booleanPrimitiveValueOfParameterNamed(
|
||||
@@ -145,4 +145,4 @@ public class CodeValue extends AbstractPersistableCustom<Long> {
|
||||
public CodeValueData toData() {
|
||||
return CodeValueData.instance(getId(), this.label, this.position, this.isActive, this.mandatory);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -104,7 +104,7 @@ public class PaginationParameters {
|
||||
}
|
||||
|
||||
public String orderBySql() {
|
||||
final StringBuffer sql = new StringBuffer();
|
||||
final StringBuilder sql = new StringBuilder();
|
||||
|
||||
if (this.isOrderByRequested()) {
|
||||
sql.append(" order by ").append(this.getOrderBy());
|
||||
@@ -116,7 +116,7 @@ public class PaginationParameters {
|
||||
}
|
||||
|
||||
public String limitSql() {
|
||||
final StringBuffer sql = new StringBuffer();
|
||||
final StringBuilder sql = new StringBuilder();
|
||||
if (this.isLimited()) {
|
||||
sql.append(" limit ").append(this.getLimit());
|
||||
if (this.isOffset()) {
|
||||
@@ -137,4 +137,4 @@ public class PaginationParameters {
|
||||
|
||||
return sqlBuilder.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -97,7 +97,7 @@ public class GenericDataServiceImpl implements GenericDataService {
|
||||
// apache one to be about the same then this can be removed.
|
||||
int s = 0;
|
||||
int e = 0;
|
||||
final StringBuffer result = new StringBuffer();
|
||||
final StringBuilder result = new StringBuilder();
|
||||
|
||||
while ((e = str.indexOf(pattern, s)) >= 0) {
|
||||
result.append(str.substring(s, e));
|
||||
@@ -122,7 +122,7 @@ public class GenericDataServiceImpl implements GenericDataService {
|
||||
@Override
|
||||
public String generateJsonFromGenericResultsetData(final GenericResultsetData grs) {
|
||||
|
||||
final StringBuffer writer = new StringBuffer();
|
||||
final StringBuilder writer = new StringBuilder();
|
||||
|
||||
writer.append("[");
|
||||
|
||||
@@ -316,4 +316,4 @@ public class GenericDataServiceImpl implements GenericDataService {
|
||||
|
||||
return rsValues;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+5
-4
@@ -28,6 +28,7 @@ import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
@@ -100,9 +101,9 @@ public class ReadReportingServiceImpl implements ReadReportingService {
|
||||
try {
|
||||
|
||||
final GenericResultsetData result = retrieveGenericResultset(name, type, queryParams, isSelfServiceUserReport);
|
||||
final StringBuffer sb = generateCsvFileBuffer(result);
|
||||
final StringBuilder sb = generateCsvFileBuffer(result);
|
||||
|
||||
final InputStream in = new ByteArrayInputStream(sb.toString().getBytes("UTF-8"));
|
||||
final InputStream in = new ByteArrayInputStream(sb.toString().getBytes(StandardCharsets.UTF_8));
|
||||
|
||||
final byte[] outputByte = new byte[4096];
|
||||
Integer readLen = in.read(outputByte, 0, 4096);
|
||||
@@ -122,8 +123,8 @@ public class ReadReportingServiceImpl implements ReadReportingService {
|
||||
|
||||
}
|
||||
|
||||
private StringBuffer generateCsvFileBuffer(final GenericResultsetData result) {
|
||||
final StringBuffer writer = new StringBuffer();
|
||||
private StringBuilder generateCsvFileBuffer(final GenericResultsetData result) {
|
||||
final StringBuilder writer = new StringBuilder();
|
||||
|
||||
final List<ResultsetColumnHeaderData> columnHeaders = result.getColumnHeaders();
|
||||
logger.info("NO. of Columns: {}", columnHeaders.size());
|
||||
|
||||
+6
-6
@@ -78,7 +78,7 @@ public class FineractEntityAccessReadServiceImpl implements FineractEntityAccess
|
||||
Collection<FineractEntityToEntityMappingData> accesslist = retrieveEntityAccessFor(firstEntityType, relId, fromEntityId,
|
||||
includeAllOffices);
|
||||
String returnIdListStr = null;
|
||||
StringBuffer accessListCSVStrBuf = null;
|
||||
StringBuilder accessListCSVStrBuf = null;
|
||||
if ((accesslist != null) && (accesslist.size() > 0)) {
|
||||
for(FineractEntityToEntityMappingData accessData: accesslist){
|
||||
if (accessData == null) {
|
||||
@@ -86,7 +86,7 @@ public class FineractEntityAccessReadServiceImpl implements FineractEntityAccess
|
||||
}
|
||||
|
||||
if(accessListCSVStrBuf == null){
|
||||
accessListCSVStrBuf = new StringBuffer() ;
|
||||
accessListCSVStrBuf = new StringBuilder() ;
|
||||
}else{
|
||||
accessListCSVStrBuf.append(",");
|
||||
}
|
||||
@@ -99,7 +99,7 @@ public class FineractEntityAccessReadServiceImpl implements FineractEntityAccess
|
||||
|
||||
} else {
|
||||
|
||||
accessListCSVStrBuf = new StringBuffer();
|
||||
accessListCSVStrBuf = new StringBuilder();
|
||||
accessListCSVStrBuf.append("false"); // Append false so that no rows
|
||||
// will be returned
|
||||
}
|
||||
@@ -138,7 +138,7 @@ public class FineractEntityAccessReadServiceImpl implements FineractEntityAccess
|
||||
}
|
||||
|
||||
private String getSQLForRetriveEntityAccessFor() {
|
||||
StringBuffer str = new StringBuffer("select eem.rel_id as relId,eem.from_id as fromId, ");
|
||||
StringBuilder str = new StringBuilder("select eem.rel_id as relId,eem.from_id as fromId, ");
|
||||
str.append("eem.to_id as toId, eem.start_date as startDate, eem.end_date as endDate ");
|
||||
str.append("from m_entity_to_entity_mapping eem ");
|
||||
str.append("where eem.rel_id = ? ");
|
||||
@@ -268,7 +268,7 @@ public class FineractEntityAccessReadServiceImpl implements FineractEntityAccess
|
||||
|
||||
public GetOneEntityMapper() {
|
||||
|
||||
StringBuffer str = new StringBuffer("select eem.rel_id as relId, ");
|
||||
StringBuilder str = new StringBuilder("select eem.rel_id as relId, ");
|
||||
str.append("eem.from_id as fromId,eem.to_Id as toId,eem.start_date as startDate,eem.end_date as endDate ");
|
||||
str.append("from m_entity_to_entity_mapping eem ");
|
||||
str.append("where eem.id= ? ");
|
||||
@@ -298,7 +298,7 @@ public class FineractEntityAccessReadServiceImpl implements FineractEntityAccess
|
||||
|
||||
public EntityToEntityMapper() {
|
||||
|
||||
StringBuffer str = new StringBuffer("select eem.id as mapId, ");
|
||||
StringBuilder str = new StringBuilder("select eem.id as mapId, ");
|
||||
str.append("eem.rel_id as relId, ");
|
||||
str.append("eem.from_id as from_id, ");
|
||||
str.append("eem.to_id as to_id, ");
|
||||
|
||||
+1
-1
@@ -700,7 +700,7 @@ public class Sender {
|
||||
HttpURLConnection conn = getConnection(url);
|
||||
conn.setDoOutput(true);
|
||||
conn.setUseCaches(false);
|
||||
conn.setFixedLengthStreamingMode(bytes.length);
|
||||
conn.setFixedLengthStreamingMode(Long.valueOf(bytes.length));
|
||||
conn.setRequestMethod("POST");
|
||||
conn.setRequestProperty("Content-Type", contentType);
|
||||
conn.setRequestProperty("Authorization", "key=" + key);
|
||||
|
||||
+1
-1
@@ -123,7 +123,7 @@ public class TwilioHookProcessor implements HookProcessor {
|
||||
payload, HashMap.class);
|
||||
map.put("BASE_URI", System.getProperty("baseUrl"));
|
||||
if (map.containsKey("clientId")) {
|
||||
final Long clientId = new Long(Integer.toString((int) map
|
||||
final Long clientId = Long.valueOf(Integer.toString((int) map
|
||||
.get("clientId")));
|
||||
final Client client = this.clientRepositoryWrapper.findOneWithNotFoundDetection(clientId);
|
||||
final String mobileNo = client.mobileNo();
|
||||
|
||||
+2
-2
@@ -418,7 +418,7 @@ public class JobRegisterServiceImpl implements JobRegisterService, ApplicationLi
|
||||
|
||||
private String getStackTraceAsString(final Throwable throwable) {
|
||||
final StackTraceElement[] stackTraceElements = throwable.getStackTrace();
|
||||
final StringBuffer sb = new StringBuffer(throwable.toString());
|
||||
final StringBuilder sb = new StringBuilder(throwable.toString());
|
||||
for (final StackTraceElement element : stackTraceElements) {
|
||||
sb.append("\n \t at ").append(element.getClassName()).append(".").append(element.getMethodName()).append("(")
|
||||
.append(element.getLineNumber()).append(")");
|
||||
@@ -435,4 +435,4 @@ public class JobRegisterServiceImpl implements JobRegisterService, ApplicationLi
|
||||
final JobKey JobKey = new JobKey(keyParams[0], keyParams[1]);
|
||||
return JobKey;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -98,7 +98,7 @@ public class SchedulerJobListener implements JobListener {
|
||||
StackTraceElement[] stackTraceElements = null;
|
||||
errorMessage = throwable.getMessage();
|
||||
stackTraceElements = throwable.getStackTrace();
|
||||
final StringBuffer sb = new StringBuffer(throwable.toString());
|
||||
final StringBuilder sb = new StringBuilder(throwable.toString());
|
||||
for (final StackTraceElement element : stackTraceElements) {
|
||||
sb.append("\n \t at ").append(element.getClassName()).append(".").append(element.getMethodName()).append("(")
|
||||
.append(element.getLineNumber()).append(")");
|
||||
|
||||
+2
-2
@@ -225,7 +225,7 @@ public class StaffReadPlatformServiceImpl implements StaffReadPlatformService {
|
||||
|
||||
private String getStaffCriteria(final String sqlSearch, final Long officeId, final boolean loanOfficersOnly, final String status) {
|
||||
|
||||
final StringBuffer extraCriteria = new StringBuffer(200);
|
||||
final StringBuilder extraCriteria = new StringBuilder(200);
|
||||
|
||||
if (sqlSearch != null) {
|
||||
extraCriteria.append(" and (").append(sqlSearch).append(")");
|
||||
@@ -310,4 +310,4 @@ public class StaffReadPlatformServiceImpl implements StaffReadPlatformService {
|
||||
return params.toArray();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -245,7 +245,7 @@ public class TellerManagementReadPlatformServiceImpl implements TellerManagement
|
||||
|
||||
private String getTellerCriteria(final String sqlSearch, final Long officeId, final String status) {
|
||||
|
||||
final StringBuffer extraCriteria = new StringBuffer(200);
|
||||
final StringBuilder extraCriteria = new StringBuilder(200);
|
||||
|
||||
if (sqlSearch != null) {
|
||||
extraCriteria.append(" and (").append(sqlSearch).append(")");
|
||||
@@ -291,7 +291,7 @@ public class TellerManagementReadPlatformServiceImpl implements TellerManagement
|
||||
|
||||
private String getTellerCriteria(final String sqlSearch, final Long tellerId) {
|
||||
|
||||
final StringBuffer extraCriteria = new StringBuffer(200);
|
||||
final StringBuilder extraCriteria = new StringBuilder(200);
|
||||
|
||||
if (sqlSearch != null) {
|
||||
extraCriteria.append(" and (").append(sqlSearch).append(")");
|
||||
@@ -918,4 +918,4 @@ public class TellerManagementReadPlatformServiceImpl implements TellerManagement
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -258,8 +258,8 @@ public class StandingInstructionWritePlatformServiceImpl implements StandingInst
|
||||
|
||||
private boolean transferAmount(final StringBuilder sb, final AccountTransferDTO accountTransferDTO, final Long instructionId) {
|
||||
boolean transferCompleted = true;
|
||||
StringBuffer errorLog = new StringBuffer();
|
||||
StringBuffer updateQuery = new StringBuffer(
|
||||
StringBuilder errorLog = new StringBuilder();
|
||||
StringBuilder updateQuery = new StringBuilder(
|
||||
"INSERT INTO `m_account_transfer_standing_instructions_history` (`standing_instruction_id`, `status`, `amount`,`execution_time`, `error_log`) VALUES (");
|
||||
try {
|
||||
this.accountTransfersWritePlatformService.transferFunds(accountTransferDTO);
|
||||
|
||||
+2
-2
@@ -49,12 +49,12 @@ public class ShareAccountSummaryData implements Serializable {
|
||||
this.accountNo = accountNo;
|
||||
this.externalId = externalId;
|
||||
if(approvedShares == null) {
|
||||
this.totalApprovedShares = new Long(0) ;
|
||||
this.totalApprovedShares = Long.valueOf(0) ;
|
||||
}else {
|
||||
this.totalApprovedShares = approvedShares;
|
||||
}
|
||||
if(pendingForApprovalShares == null) {
|
||||
this.totalPendingForApprovalShares = new Long(0) ;
|
||||
this.totalPendingForApprovalShares = Long.valueOf(0) ;
|
||||
}else {
|
||||
this.totalPendingForApprovalShares = pendingForApprovalShares;
|
||||
}
|
||||
|
||||
+2
-2
@@ -168,7 +168,7 @@ public class AccountDetailsReadPlatformServiceJpaRepositoryImpl implements Accou
|
||||
private final String schema ;
|
||||
|
||||
ShareAccountSummaryDataMapper() {
|
||||
final StringBuffer buff = new StringBuffer()
|
||||
final StringBuilder buff = new StringBuilder()
|
||||
.append("sa.id as id, sa.external_id as externalId, sa.status_enum as statusEnum, ")
|
||||
.append("sa.account_no as accountNo, sa.total_approved_shares as approvedShares, sa.total_pending_shares as pendingShares, ")
|
||||
.append("sa.savings_account_id as savingsAccountNo, sa.minimum_active_period_frequency as minimumactivePeriod,")
|
||||
@@ -605,4 +605,4 @@ public class AccountDetailsReadPlatformServiceJpaRepositoryImpl implements Accou
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -259,17 +259,17 @@ public class CalendarData implements Serializable {
|
||||
final String location = null;
|
||||
final LocalDate startDate = null;
|
||||
final LocalDate endDate = null;
|
||||
final Integer duration = new Integer(0);
|
||||
final Integer duration = Integer.valueOf(0);
|
||||
final EnumOptionData type = CalendarEnumerations.calendarType(CalendarType.COLLECTION);
|
||||
final boolean repeating = false;
|
||||
final String recurrence = null;
|
||||
final EnumOptionData frequency = CalendarEnumerations.calendarFrequencyType(CalendarFrequencyType.DAILY);
|
||||
final Integer interval = new Integer(1);
|
||||
final Integer interval = Integer.valueOf(1);
|
||||
final EnumOptionData repeatsOnDay = CalendarEnumerations.calendarWeekDaysType(CalendarWeekDaysType.MO);
|
||||
final EnumOptionData repeatsOnNthDayOfMonth = CalendarEnumerations.calendarFrequencyNthDayType(NthDayType.ONE);
|
||||
final EnumOptionData remindBy = CalendarEnumerations.calendarRemindBy(CalendarRemindBy.EMAIL);
|
||||
final Integer firstReminder = new Integer(0);
|
||||
final Integer secondReminder = new Integer(0);
|
||||
final Integer firstReminder = Integer.valueOf(0);
|
||||
final Integer secondReminder = Integer.valueOf(0);
|
||||
final String humanReadable = null;
|
||||
final Collection<LocalDate> recurringDates = null;
|
||||
final Collection<LocalDate> nextTenRecurringDates = null;
|
||||
|
||||
+1
-1
@@ -640,7 +640,7 @@ public class Calendar extends AbstractAuditableCustom<AppUser, Long> {
|
||||
public void updateStartAndEndDate(final LocalDate startDate, final LocalDate endDate) {
|
||||
|
||||
final CalendarFrequencyType frequencyType = CalendarUtils.getFrequency(this.recurrence);
|
||||
final Integer interval = new Integer(CalendarUtils.getInterval(this.recurrence));
|
||||
final Integer interval = Integer.valueOf(CalendarUtils.getInterval(this.recurrence));
|
||||
final String newRecurrence = Calendar.constructRecurrence(frequencyType, interval, startDate.getDayOfWeek(), null);
|
||||
|
||||
this.recurrence = newRecurrence;
|
||||
|
||||
+3
-3
@@ -86,7 +86,7 @@ public class CalendarReadPlatformServiceImpl implements CalendarReadPlatformServ
|
||||
final boolean repeating = rs.getBoolean("repeating");
|
||||
final String recurrence = rs.getString("recurrence");
|
||||
final EnumOptionData frequency = CalendarEnumerations.calendarFrequencyType(CalendarUtils.getFrequency(recurrence));
|
||||
final Integer interval = new Integer(CalendarUtils.getInterval(recurrence));
|
||||
final Integer interval = Integer.valueOf(CalendarUtils.getInterval(recurrence));
|
||||
final EnumOptionData repeatsOnDay = CalendarEnumerations.calendarWeekDaysType(CalendarUtils.getRepeatsOnDay(recurrence));
|
||||
final EnumOptionData repeatsOnNthDayOfMonth = CalendarEnumerations.calendarFrequencyNthDayType(CalendarUtils.getRepeatsOnNthDayOfMonth(recurrence));
|
||||
final Integer remindById = rs.getInt("remindById");
|
||||
@@ -477,7 +477,7 @@ public class CalendarReadPlatformServiceImpl implements CalendarReadPlatformServ
|
||||
final boolean repeating = rs.getBoolean("repeating");
|
||||
final String recurrence = rs.getString("recurrence");
|
||||
final EnumOptionData frequency = CalendarEnumerations.calendarFrequencyType(CalendarUtils.getFrequency(recurrence));
|
||||
final Integer interval = new Integer(CalendarUtils.getInterval(recurrence));
|
||||
final Integer interval = Integer.valueOf(CalendarUtils.getInterval(recurrence));
|
||||
final EnumOptionData repeatsOnDay = CalendarEnumerations.calendarWeekDaysType(CalendarUtils.getRepeatsOnDay(recurrence));
|
||||
final EnumOptionData repeatsOnNthDayOfMonth = CalendarEnumerations.calendarFrequencyNthDayType(CalendarUtils
|
||||
.getRepeatsOnNthDayOfMonth(recurrence));
|
||||
@@ -510,4 +510,4 @@ public class CalendarReadPlatformServiceImpl implements CalendarReadPlatformServ
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -215,7 +215,7 @@ public class CollectionSheetReadPlatformServiceImpl implements CollectionSheetRe
|
||||
private static final class JLGCollectionSheetFaltDataMapper implements RowMapper<JLGCollectionSheetFlatData> {
|
||||
|
||||
public String collectionSheetSchema(final boolean isCenterCollection) {
|
||||
StringBuffer sql = new StringBuffer(400);
|
||||
StringBuilder sql = new StringBuilder(400);
|
||||
sql.append("SELECT loandata.*, sum(lc.amount_outstanding_derived) as chargesDue from ")
|
||||
.append("(SELECT gp.display_name As groupName, ")
|
||||
.append("gp.id As groupId, ")
|
||||
@@ -498,7 +498,7 @@ public class CollectionSheetReadPlatformServiceImpl implements CollectionSheetRe
|
||||
|
||||
public String collectionSheetSchema(final boolean isCenterCollection) {
|
||||
|
||||
final StringBuffer sql = new StringBuffer(400);
|
||||
final StringBuilder sql = new StringBuilder(400);
|
||||
sql.append("SELECT gp.display_name As groupName, ")
|
||||
.append("gp.id As groupId, ")
|
||||
.append("cl.display_name As clientName, ")
|
||||
@@ -820,7 +820,7 @@ public class CollectionSheetReadPlatformServiceImpl implements CollectionSheetRe
|
||||
|
||||
public IndividualMandatorySavingsCollectionsheetExtractor(final boolean checkForOfficeId, final boolean checkforStaffId) {
|
||||
|
||||
final StringBuffer sb = new StringBuffer(400);
|
||||
final StringBuilder sb = new StringBuilder(400);
|
||||
sb.append("SELECT if(sa.deposit_type_enum=100,'Saving Deposit',if(sa.deposit_type_enum=300,'Recurring Deposit','Current Deposit')) as depositAccountType, cl.display_name As clientName, cl.id As clientId, ");
|
||||
sb.append("sa.id As savingsId, sa.account_no As accountId, sa.status_enum As accountStatusId, ");
|
||||
sb.append("sp.short_name As productShortName, sp.id As productId, ");
|
||||
|
||||
+1
-1
@@ -123,7 +123,7 @@ public class CenterReadPlatformServiceImpl implements CenterReadPlatformService
|
||||
// caused by the same name of columns in m_office and m_group tables
|
||||
private String getCenterExtraCriteria(String schemaSl, List<Object> paramList,final SearchParameters searchCriteria) {
|
||||
|
||||
StringBuffer extraCriteria = new StringBuffer(200);
|
||||
StringBuilder extraCriteria = new StringBuilder(200);
|
||||
extraCriteria.append(" and g.level_id = " + GroupTypes.CENTER.getId());
|
||||
if (searchCriteria!=null) {
|
||||
String sqlQueryCriteria = searchCriteria.getSqlSearch();
|
||||
|
||||
+1
-1
@@ -215,7 +215,7 @@ public class GroupReadPlatformServiceImpl implements GroupReadPlatformService {
|
||||
// caused by the same name of columns in m_office and m_group tables
|
||||
private String getGroupExtraCriteria(String schemaSql, List<Object> paramList, final SearchParameters searchCriteria) {
|
||||
|
||||
StringBuffer extraCriteria = new StringBuffer(200);
|
||||
StringBuilder extraCriteria = new StringBuilder(200);
|
||||
extraCriteria.append(" and g.level_Id = ").append(GroupTypes.GROUP.getId());
|
||||
String sqlSearch = searchCriteria.getSqlSearch();
|
||||
if (sqlSearch != null) {
|
||||
|
||||
+2
-2
@@ -176,7 +176,7 @@ public class LoanEnumerations {
|
||||
optionData = new EnumOptionData(nthDayValue, codePrefix + type.getCode(), "last");
|
||||
break;
|
||||
default:
|
||||
optionData = new EnumOptionData(new Integer(0).longValue(), codePrefix + type.getCode(), "invalid");
|
||||
optionData = new EnumOptionData(Integer.valueOf(0).longValue(), codePrefix + type.getCode(), "invalid");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -633,7 +633,7 @@ public class LoanEnumerations {
|
||||
optionData = new EnumOptionData(nthDayValue, codePrefix + type.getCode(), "last");
|
||||
break;
|
||||
default:
|
||||
optionData = new EnumOptionData(new Integer(0).longValue(), codePrefix + type.getCode(), "invalid");
|
||||
optionData = new EnumOptionData(Integer.valueOf(0).longValue(), codePrefix + type.getCode(), "invalid");
|
||||
break;
|
||||
}
|
||||
return optionData;
|
||||
|
||||
+2
-2
@@ -1211,7 +1211,7 @@ public class SavingsAccountReadPlatformServiceImpl implements SavingsAccountRead
|
||||
public boolean isAccountBelongsToClient(final Long clientId, final Long accountId, final DepositAccountType depositAccountType,
|
||||
final String currencyCode) {
|
||||
try {
|
||||
final StringBuffer buff = new StringBuffer("select count(*) from m_savings_account sa ") ;
|
||||
final StringBuilder buff = new StringBuilder("select count(*) from m_savings_account sa ") ;
|
||||
buff.append(" where sa.id = ? and sa.client_id = ? and sa.deposit_type_enum = ? and sa.currency_code = ? and sa.status_enum = 300");
|
||||
return this.jdbcTemplate.queryForObject(buff.toString(),
|
||||
new Object[] { accountId, clientId, depositAccountType.getValue(), currencyCode }, Integer.class) > 0;
|
||||
@@ -1257,4 +1257,4 @@ public class SavingsAccountReadPlatformServiceImpl implements SavingsAccountRead
|
||||
throw new SavingsAccountNotFoundException(accountId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -113,7 +113,7 @@ public class SearchReadPlatformServiceImpl implements SearchReadPlatformService
|
||||
final String groupMatchSql = " (select IF(g.level_id=1,'CENTER','GROUP') as entityType, g.id as entityId, g.display_name as entityName, g.external_id as entityExternalId, g.account_no as entityAccountNo "
|
||||
+ " , g.office_id as parentId, o.name as parentName, null as entityMobileNo, g.status_enum as entityStatusEnum, null as parentType "
|
||||
+ " from m_group g join m_office o on o.id = g.office_id where o.hierarchy like :hierarchy and (g.account_no like :search or g.display_name like :search or g.external_id like :search or g.id like :search )) ";
|
||||
final StringBuffer sql = new StringBuffer();
|
||||
final StringBuilder sql = new StringBuilder();
|
||||
|
||||
if (searchConditions.isClientSearch()) {
|
||||
sql.append(clientMatchSql).append(union);
|
||||
@@ -211,7 +211,7 @@ public class SearchReadPlatformServiceImpl implements SearchReadPlatformService
|
||||
// TODO- build the query dynamically based on selected entity types, for
|
||||
// now adding query for only loan entity.
|
||||
public String schema(final AdHocQuerySearchConditions searchConditions, final MapSqlParameterSource params) {
|
||||
final StringBuffer sql = new StringBuffer();
|
||||
final StringBuilder sql = new StringBuilder();
|
||||
sql.append(
|
||||
"Select a.name as officeName, a.Product as productName, a.cnt as 'count', a.outstandingAmt as outstanding, a.percentOut as percentOut ")
|
||||
.append("from (select mo.name, mp.name Product, sum(ifnull(ml.total_expected_repayment_derived,0.0)) TotalAmt, count(*) cnt, ")
|
||||
@@ -306,7 +306,7 @@ public class SearchReadPlatformServiceImpl implements SearchReadPlatformService
|
||||
return sql.toString();
|
||||
}
|
||||
|
||||
private void checkAndUpdateWhereClause(final StringBuffer sql) {
|
||||
private void checkAndUpdateWhereClause(final StringBuilder sql) {
|
||||
if (isWhereClauseAdded) {
|
||||
sql.append(" and ");
|
||||
} else {
|
||||
@@ -330,4 +330,4 @@ public class SearchReadPlatformServiceImpl implements SearchReadPlatformService
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ public class SelfAccountTransferReadServiceImpl implements
|
||||
public Collection<SelfAccountTemplateData> retrieveSelfAccountTemplateData(
|
||||
AppUser user) {
|
||||
SelfAccountTemplateMapper mapper = new SelfAccountTemplateMapper();
|
||||
StringBuffer sql = new StringBuffer()
|
||||
StringBuilder sql = new StringBuilder()
|
||||
.append("select s.id as accountId, ")
|
||||
.append("s.account_no as accountNo, ")
|
||||
.append("2 as accountType, ")
|
||||
|
||||
+3
-3
@@ -420,7 +420,7 @@ public class ShareAccount extends AbstractPersistableCustom<Long> {
|
||||
this.closedDate = null;
|
||||
this.closedBy = null;
|
||||
this.totalSharesApproved = null;
|
||||
Long tempTotalShares = new Long(0);
|
||||
Long tempTotalShares = Long.valueOf(0);
|
||||
for (ShareAccountTransaction transaction : this.shareAccountTransactions) {
|
||||
if(transaction.isPurchasTransaction()) {
|
||||
transaction.undoApprove();
|
||||
@@ -540,8 +540,8 @@ public class ShareAccount extends AbstractPersistableCustom<Long> {
|
||||
for(ShareAccountTransaction transaction: this.shareAccountTransactions) {
|
||||
transaction.setActive(false);
|
||||
}
|
||||
this.totalSharesApproved = new Long(0) ;
|
||||
this.totalSharesPending = new Long(0) ;
|
||||
this.totalSharesApproved = Long.valueOf(0) ;
|
||||
this.totalSharesPending = Long.valueOf(0) ;
|
||||
}
|
||||
|
||||
public void removeCharges() {
|
||||
|
||||
+6
-6
@@ -479,13 +479,13 @@ public class ShareAccountDataSerializer {
|
||||
|
||||
private void validateTotalSubsribedShares(final ShareAccount account, final ShareAccountTransaction transaction, final DataValidatorBuilder baseDataValidator) {
|
||||
Long totalSubsribedShares = account.getShareProduct().getSubscribedShares() ;
|
||||
Long requested = new Long(0) ;
|
||||
Long requested = Long.valueOf(0) ;
|
||||
if(transaction.isActive() && transaction.isPendingForApprovalTransaction()) {
|
||||
requested +=transaction.getTotalShares() ;
|
||||
}
|
||||
Long totalSharesIssuable = account.getShareProduct().getSharesIssued() ;
|
||||
if(totalSharesIssuable == null) totalSharesIssuable = account.getShareProduct().getTotalShares() ;
|
||||
if(totalSubsribedShares == null) totalSubsribedShares = new Long(0) ;
|
||||
if(totalSubsribedShares == null) totalSubsribedShares = Long.valueOf(0) ;
|
||||
if((totalSubsribedShares+requested) > totalSharesIssuable) {
|
||||
baseDataValidator.reset().parameter(ShareAccountApiConstants.requestedshares_paramname).value(requested)
|
||||
.failWithCodeNoParameterAddedToErrorCode("shares.requested.can.not.be.approved.exceeding.totalshares.issuable");
|
||||
@@ -737,7 +737,7 @@ public class ShareAccountDataSerializer {
|
||||
purchasedShares.add(purchasedSharesId);
|
||||
}
|
||||
if (totalShares > 0) {
|
||||
account.updateApprovedShares(new Long(totalShares));
|
||||
account.updateApprovedShares(Long.valueOf(totalShares));
|
||||
}
|
||||
}
|
||||
if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException(dataValidationErrors); }
|
||||
@@ -783,7 +783,7 @@ public class ShareAccountDataSerializer {
|
||||
purchasedShares.add(purchasedSharesId);
|
||||
}
|
||||
if (totalShares > 0) {
|
||||
account.removePendingShares(new Long(totalShares));
|
||||
account.removePendingShares(Long.valueOf(totalShares));
|
||||
}
|
||||
}
|
||||
actualChanges.put(ShareAccountApiConstants.requestedshares_paramname, purchasedShares);
|
||||
@@ -862,8 +862,8 @@ public class ShareAccountDataSerializer {
|
||||
final Integer lockinPeriod = account.getLockinPeriodFrequency();
|
||||
final PeriodFrequencyType periodType = account.getLockinPeriodFrequencyType();
|
||||
if (lockinPeriod == null && periodType == null) { return; }
|
||||
Long totalSharesCanBeRedeemed = new Long(0);
|
||||
Long totalSharesPurchasedBeforeRedeem = new Long(0) ;
|
||||
Long totalSharesCanBeRedeemed = Long.valueOf(0);
|
||||
Long totalSharesPurchasedBeforeRedeem = Long.valueOf(0) ;
|
||||
boolean isPurchaseTransactionExist = false ;
|
||||
|
||||
Set<ShareAccountTransaction> transactions = account.getShareAccountTransactions();
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ public class PurchasedSharesReadPlatformServiceImpl implements
|
||||
private final String schema ;
|
||||
|
||||
public PurchasedSharesDataRowMapper() {
|
||||
StringBuffer buff = new StringBuffer()
|
||||
StringBuilder buff = new StringBuilder()
|
||||
.append("saps.id, saps.account_id, saps.transaction_date, saps.total_shares, saps.unit_price, ")
|
||||
.append("saps.status_enum, saps.type_enum, saps.amount, saps.charge_amount as chargeamount, ")
|
||||
.append("saps.amount_paid as amountPaid")
|
||||
|
||||
+1
-1
@@ -70,7 +70,7 @@ public class ShareAccountChargeReadPlatformServiceImpl implements
|
||||
private final String schema;
|
||||
|
||||
public ShareAccountChargeMapper() {
|
||||
StringBuffer buff = new StringBuffer()
|
||||
StringBuilder buff = new StringBuilder()
|
||||
.append("sc.id as id, c.id as chargeId, sc.account_id as accountId, c.name as name, ")
|
||||
.append("sc.amount as amountDue, sc.amount_paid_derived as amountPaid, ")
|
||||
.append("sc.amount_waived_derived as amountWaived, sc.amount_writtenoff_derived as amountWrittenOff, ")
|
||||
|
||||
+3
-3
@@ -253,7 +253,7 @@ public class ShareAccountReadPlatformServiceImpl implements ShareAccountReadPlat
|
||||
public ShareAccountMapper(final Collection<ShareAccountChargeData> charges, final Collection<ShareAccountTransactionData> purchasedShares) {
|
||||
this.charges = charges;
|
||||
this.purchasedShares = purchasedShares;
|
||||
StringBuffer buff = new StringBuffer()
|
||||
StringBuilder buff = new StringBuilder()
|
||||
.append("sa.id as id, sa.external_id as externalId, sa.status_enum as statusEnum, ")
|
||||
.append("sa.savings_account_id, msa.account_no as savingsAccNo, ")
|
||||
.append("c.id as clientId, c.display_name as clientName, ")
|
||||
@@ -443,7 +443,7 @@ public class ShareAccountReadPlatformServiceImpl implements ShareAccountReadPlat
|
||||
private final String schema;
|
||||
|
||||
public PurchasedSharesDataRowMapper() {
|
||||
StringBuffer buff = new StringBuffer()
|
||||
StringBuilder buff = new StringBuilder()
|
||||
.append("saps.id as purchasedId, saps.account_id as accountId, saps.transaction_date as transactionDate, saps.total_shares as purchasedShares, saps.unit_price as unitPrice, ")
|
||||
.append("saps.status_enum as purchaseStatus, saps.type_enum as purchaseType, saps.amount as amount, saps.charge_amount as chargeamount, ")
|
||||
.append("saps.amount_paid as amountPaid ");
|
||||
@@ -479,7 +479,7 @@ public class ShareAccountReadPlatformServiceImpl implements ShareAccountReadPlat
|
||||
private final String schema;
|
||||
|
||||
ShareAccountDividendRowMapper() {
|
||||
StringBuffer buff = new StringBuffer()
|
||||
StringBuilder buff = new StringBuilder()
|
||||
.append("spdp.created_date, sadd.id, sadd.amount, sadd.savings_transaction_id, sadd.status ")
|
||||
.append(" from m_share_account_dividend_details sadd ")
|
||||
.append("JOIN m_share_product_dividend_pay_out spdp ON spdp.id = sadd.dividend_pay_out_id ");
|
||||
|
||||
+3
-3
@@ -270,7 +270,7 @@ public class ShareAccountWritePlatformServiceJpaRepositoryImpl implements ShareA
|
||||
}
|
||||
Set<ShareAccountTransaction> transactions = account.getShareAccountTransactions();
|
||||
Set<ShareAccountTransaction> journalTransactions = new HashSet<>();
|
||||
Long totalSubsribedShares = new Long(0) ;
|
||||
Long totalSubsribedShares = Long.valueOf(0) ;
|
||||
|
||||
for (ShareAccountTransaction transaction : transactions) {
|
||||
if (transaction.isActive() && transaction.isPurchasTransaction()) {
|
||||
@@ -401,7 +401,7 @@ public class ShareAccountWritePlatformServiceJpaRepositoryImpl implements ShareA
|
||||
if (!changes.isEmpty()) {
|
||||
this.shareAccountRepository.save(account);
|
||||
ArrayList<Long> transactionIds = (ArrayList<Long>) changes.get(ShareAccountApiConstants.requestedshares_paramname);
|
||||
Long totalSubscribedShares = new Long(0) ;
|
||||
Long totalSubscribedShares = Long.valueOf(0) ;
|
||||
if (transactionIds != null) {
|
||||
Set<ShareAccountTransaction> transactions = new HashSet<>();
|
||||
for (Long id : transactionIds) {
|
||||
@@ -411,7 +411,7 @@ public class ShareAccountWritePlatformServiceJpaRepositoryImpl implements ShareA
|
||||
}
|
||||
this.journalEntryWritePlatformService.createJournalEntriesForShares(populateJournalEntries(account, transactions));
|
||||
}
|
||||
if(!totalSubscribedShares.equals(new Long(0))) {
|
||||
if(!totalSubscribedShares.equals(Long.valueOf(0))) {
|
||||
ShareProduct shareProduct = account.getShareProduct() ;
|
||||
shareProduct.addSubscribedShares(totalSubscribedShares);
|
||||
this.shareProductRepository.save(shareProduct);
|
||||
|
||||
+1
-1
@@ -416,7 +416,7 @@ public class ShareProduct extends AbstractAuditableCustom<AppUser, Long> {
|
||||
|
||||
public void addSubscribedShares(final Long subscribedShares) {
|
||||
if(this.totalSubscribedShares == null) {
|
||||
this.totalSubscribedShares = new Long(0) ;
|
||||
this.totalSubscribedShares = Long.valueOf(0) ;
|
||||
}
|
||||
this.totalSubscribedShares += subscribedShares ;
|
||||
}
|
||||
|
||||
+2
-2
@@ -204,7 +204,7 @@ public class ShareProductReadPlatformServiceImpl implements ProductReadPlatformS
|
||||
|
||||
Collection<ShareProductMarketPriceData> shareMarketCollection;
|
||||
Collection<ChargeData> charges;
|
||||
private StringBuffer buff = new StringBuffer();
|
||||
private StringBuilder buff = new StringBuilder();
|
||||
|
||||
ShareProductRowMapper(Collection<ShareProductMarketPriceData> shareMarketCollection, Collection<ChargeData> charges) {
|
||||
this.shareMarketCollection = shareMarketCollection;
|
||||
@@ -284,4 +284,4 @@ public class ShareProductReadPlatformServiceImpl implements ProductReadPlatformS
|
||||
return this.buff.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -88,7 +88,7 @@ public class LookupTableApiResource {
|
||||
return LookupTableMapper.map(lookupTables);
|
||||
}
|
||||
|
||||
return Collections.EMPTY_LIST;
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@GET
|
||||
|
||||
@@ -53,7 +53,7 @@ public class LookupTableMapper {
|
||||
return new ArrayList<>(lookupTableDataMap.values());
|
||||
}
|
||||
|
||||
return Collections.EMPTY_LIST;
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
public static List<LookupTable> map(final LookupTableData lookupTableData, final Survey survey) {
|
||||
|
||||
@@ -125,7 +125,7 @@ public class StorageTest {
|
||||
verify(this.notificationGeneratorWritePlatformService, times(1)).create(refEq(notification));
|
||||
verify(this.notificationMapperWritePlatformService, times(1)).create(refEq(notificationMapper));
|
||||
verify(this.notificationGeneratorReadRepositoryWrapper, times(1)).findById(1L);
|
||||
assertEquals(actualGeneratedNotificationId, new Long(1));
|
||||
assertEquals(actualGeneratedNotificationId, Long.valueOf(1));
|
||||
}
|
||||
|
||||
private String getCurrentDateTime() {
|
||||
|
||||
@@ -79,7 +79,7 @@ public class TopicTest {
|
||||
|
||||
verify(this.roleRepository, times(1)).save(role);
|
||||
verify(this.topicWritePltfService, times(1)).create(refEq(topic));
|
||||
assertEquals(topicId, new Long(1));
|
||||
assertEquals(topicId, Long.valueOf(1));
|
||||
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ public class TopicTest {
|
||||
Long subscriberId = this.topicSubscriberWritePltfService.create(topicSubscriber);
|
||||
|
||||
verify(this.topicSubscriberWritePltfService, times(1)).create(refEq(topicSubscriber));
|
||||
assertEquals(subscriberId, new Long(1));
|
||||
assertEquals(subscriberId, Long.valueOf(1));
|
||||
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -20,7 +20,6 @@ package org.apache.fineract.template;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
import com.google.common.io.Resources;
|
||||
import com.google.common.reflect.TypeToken;
|
||||
import com.google.gson.Gson;
|
||||
@@ -32,6 +31,7 @@ import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Type;
|
||||
import java.math.RoundingMode;
|
||||
import java.net.MalformedURLException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -83,8 +83,8 @@ public class TemplateMergeServiceTest {
|
||||
Map<String, Object> scopes = new HashMap<>();
|
||||
scopes.put("installments", installments);
|
||||
|
||||
String templateText = Resources.toString(Resources.getResource("template.mustache"), Charsets.UTF_8);
|
||||
String expectedOutput = Resources.toString(Resources.getResource("template-expected.html"), Charsets.UTF_8);
|
||||
String templateText = Resources.toString(Resources.getResource("template.mustache"), StandardCharsets.UTF_8);
|
||||
String expectedOutput = Resources.toString(Resources.getResource("template-expected.html"), StandardCharsets.UTF_8);
|
||||
|
||||
String output = compileTemplateText(templateText, scopes);
|
||||
assertEquals(expectedOutput, output);
|
||||
|
||||
Reference in New Issue
Block a user