FINERACT-821 Added and Enforced ArrayTypeStyle checkstyle

This commit is contained in:
Manthan Surkar
2020-05-27 11:27:32 +02:00
committed by Michael Vorburger ⛑️
parent 3e95c32e18
commit ef538e5c75
8 changed files with 24 additions and 22 deletions
@@ -88,6 +88,8 @@
</module>
<module name="UpperEll"/>
<module name="NeedBraces"/>
<module name="ArrayTypeStyle"/>
<!-- TODO Enable many more checks (go about this one by one, step by step, raise separate PRs fixing and then enforcing):
<module name="HiddenField">
@@ -146,7 +148,7 @@
<module name="ParenPad" />
<module name="MultipleVariableDeclarations"/>
<module name="ArrayTypeStyle"/>
<module name="MissingSwitchDefault"/>
<module name="FallThrough"/>
@@ -95,8 +95,8 @@ public class AccountingScenarioIntegrationTest {
Float SP_WITHDRAWAL_AMOUNT = Float.valueOf(WITHDRAWAL_AMOUNT);
Float SP_WITHDRAWAL_AMOUNT_ADJUSTED = Float.valueOf(WITHDRAWAL_AMOUNT_ADJUSTED);
private final String REPAYMENT_DATE[] = { "", "04 May 2011", "04 July 2011", "04 September 2011", "04 November 2011", "04 January 2012" };
private final Float REPAYMENT_AMOUNT[] = { .0f, 2200.0f, 3000.0f, 900.0f, 2000.0f, 2500.0f };
private final String[] REPAYMENT_DATE = { "", "04 May 2011", "04 July 2011", "04 September 2011", "04 November 2011", "04 January 2012" };
private final Float[] REPAYMENT_AMOUNT = { .0f, 2200.0f, 3000.0f, 900.0f, 2000.0f, 2500.0f };
private final Float AMOUNT_TO_BE_WAIVE = 400.0f;
private LoanTransactionHelper loanTransactionHelper;
@@ -99,7 +99,7 @@ public class ClientEntityImportHandler implements ImportHandler {
String clientType=ImportHandlerUtils.readAsString(ClientEntityConstants.CLIENT_TYPE_COL, row);
Long clientTypeId = null;
if (clientType!=null) {
String clientTypeAr[] =clientType .split("-");
String[] clientTypeAr =clientType .split("-");
if (clientTypeAr[1] != null) {
clientTypeId = Long.parseLong(clientTypeAr[1]);
}
@@ -107,7 +107,7 @@ public class ClientEntityImportHandler implements ImportHandler {
String clientClassification= ImportHandlerUtils.readAsString(ClientEntityConstants.CLIENT_CLASSIFICATION_COL, row);
Long clientClassicationId = null;
if (clientClassification!=null) {
String clientClassificationAr[] =clientClassification.split("-");
String[] clientClassificationAr =clientClassification.split("-");
if (clientClassificationAr[1] != null) {
clientClassicationId = Long.parseLong(clientClassificationAr[1]);
}
@@ -117,7 +117,7 @@ public class ClientEntityImportHandler implements ImportHandler {
String mainBusinessLine=ImportHandlerUtils.readAsString(ClientEntityConstants.MAIN_BUSINESS_LINE,row);
Long mainBusinessId = null;
if (mainBusinessLine!=null) {
String mainBusinessLineAr[] = ImportHandlerUtils.readAsString(ClientEntityConstants.MAIN_BUSINESS_LINE, row).split("-");
String[] mainBusinessLineAr = ImportHandlerUtils.readAsString(ClientEntityConstants.MAIN_BUSINESS_LINE, row).split("-");
if (mainBusinessLineAr[1] != null) {
mainBusinessId = Long.parseLong(mainBusinessLineAr[1]);
}
@@ -125,7 +125,7 @@ public class ClientEntityImportHandler implements ImportHandler {
String constitution= ImportHandlerUtils.readAsString(ClientEntityConstants.CONSTITUTION_COL,row);
Long constitutionId = null;
if (constitution!=null) {
String constitutionAr[] = constitution.split("-");
String[] constitutionAr = constitution.split("-");
if (constitutionAr[1] != null) {
constitutionId = Long.parseLong(constitutionAr[1]);
}
@@ -151,7 +151,7 @@ public class ClientEntityImportHandler implements ImportHandler {
String addressType = ImportHandlerUtils.readAsString(ClientEntityConstants.ADDRESS_TYPE_COL, row);
Long addressTypeId = null;
if (addressType!=null) {
String addressTypeAr[] = addressType.split("-");
String[] addressTypeAr = addressType.split("-");
if (addressTypeAr[1] != null) {
addressTypeId = Long.parseLong(addressTypeAr[1]);
}
@@ -168,7 +168,7 @@ public class ClientEntityImportHandler implements ImportHandler {
String stateProvince=ImportHandlerUtils.readAsString(ClientEntityConstants.STATE_PROVINCE_COL, row);
Long stateProvinceId = null;
if (stateProvince!=null) {
String stateProvinceAr[] = stateProvince.split("-");
String[] stateProvinceAr = stateProvince.split("-");
if (stateProvinceAr[1] != null) {
stateProvinceId = Long.parseLong(stateProvinceAr[1]);
}
@@ -176,7 +176,7 @@ public class ClientEntityImportHandler implements ImportHandler {
String country= ImportHandlerUtils.readAsString(ClientEntityConstants.COUNTRY_COL, row);
Long countryId = null;
if (country!=null) {
String countryAr[] = country.split("-");
String[] countryAr = country.split("-");
if (countryAr[1] != null) {
countryId = Long.parseLong(countryAr[1]);
}
@@ -104,7 +104,7 @@ public class ClientPersonImportHandler implements ImportHandler {
String clientType=ImportHandlerUtils.readAsString(ClientPersonConstants.CLIENT_TYPE_COL, row);
Long clientTypeId = null;
if (clientType!=null) {
String clientTypeAr[] = clientType.split("-");
String[] clientTypeAr = clientType.split("-");
if (clientTypeAr[1] != null) {
clientTypeId = Long.parseLong(clientTypeAr[1]);
}
@@ -112,7 +112,7 @@ public class ClientPersonImportHandler implements ImportHandler {
String gender=ImportHandlerUtils.readAsString(ClientPersonConstants.GENDER_COL, row);
Long genderId = null;
if (gender!=null) {
String genderAr[] = gender.split("-");
String[] genderAr = gender.split("-");
if (genderAr[1] != null) {
genderId = Long.parseLong(genderAr[1]);
}
@@ -120,7 +120,7 @@ public class ClientPersonImportHandler implements ImportHandler {
String clientClassification= ImportHandlerUtils.readAsString(ClientPersonConstants.CLIENT_CLASSIFICATION_COL, row);
Long clientClassicationId = null;
if (clientClassification!=null) {
String clientClassificationAr[] = clientClassification.split("-");
String[] clientClassificationAr = clientClassification.split("-");
if (clientClassificationAr[1] != null) {
clientClassicationId = Long.parseLong(clientClassificationAr[1]);
}
@@ -133,7 +133,7 @@ public class ClientPersonImportHandler implements ImportHandler {
String addressType=ImportHandlerUtils.readAsString(ClientPersonConstants.ADDRESS_TYPE_COL, row);
Long addressTypeId = null;
if (addressType!=null) {
String addressTypeAr[] = addressType.split("-");
String[] addressTypeAr = addressType.split("-");
if (addressTypeAr[1] != null) {
addressTypeId = Long.parseLong(addressTypeAr[1]);
@@ -151,7 +151,7 @@ public class ClientPersonImportHandler implements ImportHandler {
String stateProvince=ImportHandlerUtils.readAsString(ClientPersonConstants.STATE_PROVINCE_COL, row);
Long stateProvinceId = null;
if (stateProvince!=null) {
String stateProvinceAr[] = stateProvince.split("-");
String[] stateProvinceAr = stateProvince.split("-");
if (stateProvinceAr[1] != null) {
stateProvinceId = Long.parseLong(stateProvinceAr[1]);
}
@@ -159,7 +159,7 @@ public class ClientPersonImportHandler implements ImportHandler {
String country=ImportHandlerUtils.readAsString(ClientPersonConstants.COUNTRY_COL, row);
Long countryId=null;
if (country!=null) {
String countryAr[] = country.split("-");
String[] countryAr = country.split("-");
if (countryAr[1] != null) {
countryId = Long.parseLong(countryAr[1]);
}
@@ -84,7 +84,7 @@ public class GuarantorImportHandler implements ImportHandler {
private GuarantorData ReadGuarantor(Row row,String locale,String dateFormat) {
String loanaccountInfo=ImportHandlerUtils.readAsString(GuarantorConstants.LOAN_ACCOUNT_NO_COL, row);
if (loanaccountInfo!=null){
String loanAccountAr[]=loanaccountInfo.split("-");
String[] loanAccountAr=loanaccountInfo.split("-");
loanAccountId=Long.parseLong(loanAccountAr[0]);
}
String guarantorType = ImportHandlerUtils.readAsString(GuarantorConstants.GUARANTO_TYPE_COL, row);
@@ -102,7 +102,7 @@ public class GuarantorImportHandler implements ImportHandler {
String clientRelationshipTypeInfo=ImportHandlerUtils.readAsString(GuarantorConstants.CLIENT_RELATIONSHIP_TYPE_COL, row);
Integer clientRelationshipTypeId=null;
if (clientRelationshipTypeInfo!=null){
String clientRelationshipTypeAr[]=clientRelationshipTypeInfo.split("-");
String[] clientRelationshipTypeAr=clientRelationshipTypeInfo.split("-");
clientRelationshipTypeId=Integer.parseInt(clientRelationshipTypeAr[1]);
}
String firstname = ImportHandlerUtils.readAsString(GuarantorConstants.FIRST_NAME_COL, row);
@@ -83,7 +83,7 @@ public class LoanRepaymentImportHandler implements ImportHandler {
private LoanTransactionData readLoanRepayment(Row row,String locale, String dateFormat) {
String loanaccountInfo=ImportHandlerUtils.readAsString(LoanRepaymentConstants.LOAN_ACCOUNT_NO_COL, row);
if (loanaccountInfo!=null){
String loanAccountAr[]=loanaccountInfo.split("-");
String[] loanAccountAr=loanaccountInfo.split("-");
loanAccountId = this.loanReadPlatformService.retrieveLoanIdByAccountNumber(loanAccountAr[0]);
}
BigDecimal repaymentAmount=null;
@@ -184,7 +184,7 @@ public class ChartOfAccountsWorkbook extends AbstractWorkbookPopulator {
if (!accountNamesandTags.isEmpty()){
for (String accountNameandTag:accountNamesandTags) {
if (chartOfAccountsSheet.getRow(rowIndex)!=null){
String accountNameAndTagAr[]=accountNameandTag.split("-");
String[] accountNameAndTagAr=accountNameandTag.split("-");
writeString(ChartOfAcountsConstants.LOOKUP_ACCOUNT_NAME_COL,row,accountNameAndTagAr[0]);
writeString(ChartOfAcountsConstants.LOOKUP_ACCOUNT_ID_COL,row,accountNameAndTagAr[1]);
writeString(ChartOfAcountsConstants.LOOKUP_TAG_COL,row,accountNameAndTagAr[2]);
@@ -192,7 +192,7 @@ public class ChartOfAccountsWorkbook extends AbstractWorkbookPopulator {
rowIndex++;
}else{
row =chartOfAccountsSheet.createRow(rowIndex);
String accountNameAndTagAr[]=accountNameandTag.split("-");
String[] accountNameAndTagAr=accountNameandTag.split("-");
writeString(ChartOfAcountsConstants.LOOKUP_ACCOUNT_NAME_COL,row,accountNameAndTagAr[0]);
writeString(ChartOfAcountsConstants.LOOKUP_ACCOUNT_ID_COL,row,accountNameAndTagAr[1]);
writeString(ChartOfAcountsConstants.LOOKUP_TAG_COL,row,accountNameAndTagAr[2]);
@@ -25,7 +25,7 @@ import org.springframework.jdbc.core.RowMapper;
public class PaginationHelper<E> {
public Page<E> fetchPage(final JdbcTemplate jt, final String sqlCountRows, final String sqlFetchRows, final Object args[],
public Page<E> fetchPage(final JdbcTemplate jt, final String sqlCountRows, final String sqlFetchRows, final Object[] args,
final RowMapper<E> rowMapper) {
final List<E> items = jt.query(sqlFetchRows, args, rowMapper);