FINERACT-823 Gradle modernizer fixing violations

This commit is contained in:
percyashu
2020-03-23 00:54:00 +01:00
committed by Michael Vorburger ⛑️
parent ef5bba4d52
commit 2e620b4de8
50 changed files with 179 additions and 155 deletions
@@ -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() {
@@ -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);
}
}
}
@@ -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;
}
}
}
}
@@ -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;
}
@@ -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);
}
}
}
@@ -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();
}
}
}
@@ -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;
}
}
}
@@ -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());
@@ -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, ");
@@ -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);
@@ -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();
@@ -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;
}
}
}
@@ -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(")");
@@ -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();
}
}
}
@@ -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
}
}
}
}
@@ -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);
@@ -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;
}
@@ -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
}
}
}
@@ -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;
@@ -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;
@@ -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
}
}
}
@@ -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, ");
@@ -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();
@@ -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) {
@@ -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;
@@ -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);
}
}
}
}
@@ -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
}
}
}
@@ -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, ")
@@ -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() {
@@ -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();
@@ -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")
@@ -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, ")
@@ -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 ");
@@ -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);
@@ -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 ;
}
@@ -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();
}
}
}
}
@@ -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) {