Skip to content

Commit

Permalink
Added and Enforced RedundantModifier Checkstyle(2)(Fineract-821)
Browse files Browse the repository at this point in the history
  • Loading branch information
thesmallstar authored and ptuomola committed Aug 27, 2020
1 parent 946bff4 commit a52526b
Show file tree
Hide file tree
Showing 178 changed files with 357 additions and 361 deletions.
3 changes: 2 additions & 1 deletion fineract-provider/config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@
<message key="name.invalidPattern"
value="Member name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="RedundantModifier"/>
<module name="ParenPad" />
<module name="ModifierOrder"/>
<module name="LocalVariableName">
Expand Down Expand Up @@ -234,7 +235,7 @@
<module name="RedundantModifier"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private ProvisioningHelper() {

}

public static final Map createProvisioingCriteriaJson(ArrayList<Integer> loanProducts, ArrayList categories, Account liability,
public static Map createProvisioingCriteriaJson(ArrayList<Integer> loanProducts, ArrayList categories, Account liability,
Account expense) {
final HashMap<String, Object> map = new HashMap<>();
map.put("loanProducts", addLoanProducts(loanProducts));
Expand All @@ -48,7 +48,7 @@ public static final Map createProvisioingCriteriaJson(ArrayList<Integer> loanPro
return map;
}

public static final String createProvisioningEntryJson() {
public static String createProvisioningEntryJson() {
final HashMap<String, Object> map = new HashMap<>();
map.put("createjournalentries", Boolean.FALSE);
map.put("locale", "en");
Expand All @@ -59,7 +59,7 @@ public static final String createProvisioningEntryJson() {
return provisioningEntryCreateJson;
}

public static final String createProvisioningEntryJsonWithJournalsEnabled() {
public static String createProvisioningEntryJsonWithJournalsEnabled() {
final HashMap<String, Object> map = new HashMap<>();
map.put("createjournalentries", Boolean.TRUE);
map.put("locale", "en");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public enum GLClosureJsonInputParams {

private final String value;

private GLClosureJsonInputParams(final String value) {
GLClosureJsonInputParams(final String value) {
this.value = value;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
public class GLClosureInvalidException extends AbstractPlatformDomainRuleException {

/*** enum of reasons for invalid Accounting Closure **/
public static enum GlClosureInvalidReason {
public enum GlClosureInvalidReason {

FUTURE_DATE, ACCOUNTING_CLOSED;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ private AccountingConstants() {
/***
* Accounting placeholders for cash based accounting for loan products
***/
public static enum CashAccountsForLoan {
public enum CashAccountsForLoan {

FUND_SOURCE(1), LOAN_PORTFOLIO(2), INTEREST_ON_LOANS(3), INCOME_FROM_FEES(4), INCOME_FROM_PENALTIES(5), LOSSES_WRITTEN_OFF(
6), TRANSFERS_SUSPENSE(10), OVERPAYMENT(11), INCOME_FROM_RECOVERY(12);

private final Integer value;

private CashAccountsForLoan(final Integer value) {
CashAccountsForLoan(final Integer value) {
this.value = value;
}

Expand Down Expand Up @@ -70,15 +70,15 @@ public static CashAccountsForLoan fromInt(final int i) {
/***
* Accounting placeholders for accrual based accounting for loan products
***/
public static enum AccrualAccountsForLoan {
public enum AccrualAccountsForLoan {

FUND_SOURCE(1), LOAN_PORTFOLIO(2), INTEREST_ON_LOANS(3), INCOME_FROM_FEES(4), INCOME_FROM_PENALTIES(5), LOSSES_WRITTEN_OFF(
6), INTEREST_RECEIVABLE(
7), FEES_RECEIVABLE(8), PENALTIES_RECEIVABLE(9), TRANSFERS_SUSPENSE(10), OVERPAYMENT(11), INCOME_FROM_RECOVERY(12);

private final Integer value;

private AccrualAccountsForLoan(final Integer value) {
AccrualAccountsForLoan(final Integer value) {
this.value = value;
}

Expand Down Expand Up @@ -108,7 +108,7 @@ public static AccrualAccountsForLoan fromInt(final int i) {
/***
* Enum of all accounting related input parameter names used while creating/updating a loan product
***/
public static enum LoanProductAccountingParams {
public enum LoanProductAccountingParams {

FUND_SOURCE("fundSourceAccountId"), LOAN_PORTFOLIO("loanPortfolioAccountId"), INTEREST_ON_LOANS(
"interestOnLoanAccountId"), INCOME_FROM_FEES("incomeFromFeeAccountId"), INCOME_FROM_PENALTIES(
Expand All @@ -126,7 +126,7 @@ public static enum LoanProductAccountingParams {

private final String value;

private LoanProductAccountingParams(final String value) {
LoanProductAccountingParams(final String value) {
this.value = value;
}

Expand All @@ -140,7 +140,7 @@ public String getValue() {
}
}

public static enum LoanProductAccountingDataParams {
public enum LoanProductAccountingDataParams {

FUND_SOURCE("fundSourceAccount"), LOAN_PORTFOLIO("loanPortfolioAccount"), INTEREST_ON_LOANS(
"interestOnLoanAccount"), INCOME_FROM_FEES("incomeFromFeeAccount"), INCOME_FROM_PENALTIES(
Expand All @@ -153,7 +153,7 @@ public static enum LoanProductAccountingDataParams {

private final String value;

private LoanProductAccountingDataParams(final String value) {
LoanProductAccountingDataParams(final String value) {
this.value = value;
}

Expand All @@ -170,14 +170,14 @@ public String getValue() {
/***
* Accounting placeholders for cash based accounting for savings products
***/
public static enum CashAccountsForSavings {
public enum CashAccountsForSavings {

SAVINGS_REFERENCE(1), SAVINGS_CONTROL(2), INTEREST_ON_SAVINGS(3), INCOME_FROM_FEES(4), INCOME_FROM_PENALTIES(5), TRANSFERS_SUSPENSE(
10), OVERDRAFT_PORTFOLIO_CONTROL(11), INCOME_FROM_INTEREST(12), LOSSES_WRITTEN_OFF(13), ESCHEAT_LIABILITY(14);

private final Integer value;

private CashAccountsForSavings(final Integer value) {
CashAccountsForSavings(final Integer value) {
this.value = value;
}

Expand Down Expand Up @@ -206,7 +206,7 @@ public static CashAccountsForSavings fromInt(final int i) {
/***
* Enum of all accounting related input parameter names used while creating/updating a savings product
***/
public static enum SavingProductAccountingParams {
public enum SavingProductAccountingParams {

SAVINGS_REFERENCE("savingsReferenceAccountId"), SAVINGS_CONTROL("savingsControlAccountId"), INCOME_FROM_FEES(
"incomeFromFeeAccountId"), INCOME_FROM_PENALTIES("incomeFromPenaltyAccountId"), INTEREST_ON_SAVINGS(
Expand All @@ -224,7 +224,7 @@ public static enum SavingProductAccountingParams {

private final String value;

private SavingProductAccountingParams(final String value) {
SavingProductAccountingParams(final String value) {
this.value = value;
}

Expand All @@ -238,7 +238,7 @@ public String getValue() {
}
}

public static enum SavingProductAccountingDataParams {
public enum SavingProductAccountingDataParams {

SAVINGS_REFERENCE("savingsReferenceAccount"), SAVINGS_CONTROL("savingsControlAccount"), INCOME_FROM_FEES(
"incomeFromFeeAccount"), INCOME_FROM_PENALTIES("incomeFromPenaltyAccount"), INTEREST_ON_SAVINGS(
Expand All @@ -251,7 +251,7 @@ public static enum SavingProductAccountingDataParams {

private final String value;

private SavingProductAccountingDataParams(final String value) {
SavingProductAccountingDataParams(final String value) {
this.value = value;
}

Expand All @@ -265,7 +265,7 @@ public String getValue() {
}
}

public static enum FinancialActivity {
public enum FinancialActivity {

ASSET_TRANSFER(100, "assetTransfer", GLAccountType.ASSET), LIABILITY_TRANSFER(200, "liabilityTransfer",
GLAccountType.LIABILITY), CASH_AT_MAINVAULT(101, "cashAtMainVault", GLAccountType.ASSET), CASH_AT_TELLER(102,
Expand All @@ -286,7 +286,7 @@ public static enum FinancialActivity {
}
}

private FinancialActivity(final Integer value, final String code, final GLAccountType mappedGLAccountType) {
FinancialActivity(final Integer value, final String code, final GLAccountType mappedGLAccountType) {
this.value = value;
this.code = code;
this.mappedGLAccountType = mappedGLAccountType;
Expand Down Expand Up @@ -343,13 +343,13 @@ private static FinancialActivityData convertToFinancialActivityData(final Financ
/***
* Accounting placeholders for cash based accounting for Share products
***/
public static enum CashAccountsForShares {
public enum CashAccountsForShares {

SHARES_REFERENCE(1), SHARES_SUSPENSE(2), INCOME_FROM_FEES(3), SHARES_EQUITY(4);

private final Integer value;

private CashAccountsForShares(final Integer value) {
CashAccountsForShares(final Integer value) {
this.value = value;
}

Expand Down Expand Up @@ -378,14 +378,14 @@ public static CashAccountsForShares fromInt(final int i) {
/***
* Enum of all accounting related input parameter names used while creating/updating a savings product
***/
public static enum SharesProductAccountingParams {
public enum SharesProductAccountingParams {

SHARES_REFERENCE("shareReferenceId"), SHARES_SUSPENSE("shareSuspenseId"), INCOME_FROM_FEES("incomeFromFeeAccountId"), SHARES_EQUITY(
"shareEquityId");

private final String value;

private SharesProductAccountingParams(final String value) {
SharesProductAccountingParams(final String value) {
this.value = value;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@

public interface AccountingDropdownReadPlatformService {

public List<EnumOptionData> retrieveGLAccountTypeOptions();
List<EnumOptionData> retrieveGLAccountTypeOptions();

public List<EnumOptionData> retrieveGLAccountUsageOptions();
List<EnumOptionData> retrieveGLAccountUsageOptions();

public List<EnumOptionData> retrieveJournalEntryTypeOptions();
List<EnumOptionData> retrieveJournalEntryTypeOptions();

public List<EnumOptionData> retrieveAccountingRuleTypeOptions();
List<EnumOptionData> retrieveAccountingRuleTypeOptions();

public Map<String, List<GLAccountData>> retrieveAccountMappingOptionsForLoanProducts();
Map<String, List<GLAccountData>> retrieveAccountMappingOptionsForLoanProducts();

public Map<String, List<GLAccountData>> retrieveAccountMappingOptionsForSavingsProducts();
Map<String, List<GLAccountData>> retrieveAccountMappingOptionsForSavingsProducts();

public Map<String, List<GLAccountData>> retrieveAccountMappingOptionsForCharges();
Map<String, List<GLAccountData>> retrieveAccountMappingOptionsForCharges();

public Map<String, List<GLAccountData>> retrieveAccountMappingOptions();
Map<String, List<GLAccountData>> retrieveAccountMappingOptions();

public Map<String, List<GLAccountData>> retrieveAccountMappingOptionsForShareProducts();
Map<String, List<GLAccountData>> retrieveAccountMappingOptionsForShareProducts();

}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static AccountingRuleType fromInt(final Integer ruleTypeValue) {
return type;
}

private AccountingRuleType(final Integer value, final String code) {
AccountingRuleType(final Integer value, final String code) {
this.value = value;
this.code = code;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public enum FinancialActivityAccountsJsonInputParams {

private final String value;

private FinancialActivityAccountsJsonInputParams(final String value) {
FinancialActivityAccountsJsonInputParams(final String value) {
this.value = value;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ private static final class FinancialActivityAccountMapper implements RowMapper<F

private final String sql;

public FinancialActivityAccountMapper() {
FinancialActivityAccountMapper() {
StringBuilder sb = new StringBuilder(300);
sb.append(
" faa.id as id, faa.financial_activity_type as financialActivityId, glaccount.id as glAccountId,glaccount.name as glAccountName,glaccount.gl_code as glCode ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public enum GLAccountJsonInputParams {

private final String value;

private GLAccountJsonInputParams(final String value) {
GLAccountJsonInputParams(final String value) {
this.value = value;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public enum GLAccountType {
private final Integer value;
private final String code;

private GLAccountType(final Integer value, final String code) {
GLAccountType(final Integer value, final String code) {
this.value = value;
this.code = code;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public enum GLAccountUsage {
private final Integer value;
private final String code;

private GLAccountUsage(final Integer value, final String code) {
GLAccountUsage(final Integer value, final String code) {
this.value = value;
this.code = code;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
public interface TrialBalanceRepository extends JpaRepository<TrialBalance, Long>, JpaSpecificationExecutor<TrialBalance> {

@Query(value = "select * from m_trial_balance where office_id=:officeId and account_id=:accountId and closing_balance is null order by created_date, entry_date", nativeQuery = true)
List<TrialBalance> findNewByOfficeAndAccount(@Param("officeId") final Long officeId, @Param("accountId") final Long accountId);
List<TrialBalance> findNewByOfficeAndAccount(@Param("officeId") Long officeId, @Param("accountId") Long accountId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
public class GLAccountInvalidDeleteException extends AbstractPlatformDomainRuleException {

/*** Enum of reasons for invalid delete **/
public static enum GlAccountInvalidDeleteReason {
public enum GlAccountInvalidDeleteReason {

TRANSANCTIONS_LOGGED, HAS_CHILDREN;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
public class GLAccountInvalidUpdateException extends AbstractPlatformDomainRuleException {

/*** Enum of reasons for invalid delete **/
public static enum GlAccountInvalidUpdateReason {
public enum GlAccountInvalidUpdateReason {

TRANSANCTIONS_LOGGED;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ List<GLAccountData> retrieveAllGLAccounts(Integer accountClassification, String

List<GLAccountData> retrieveAllEnabledHeaderGLAccounts(GLAccountType accountType);

GLAccountData retrieveNewGLAccountDetails(final Integer type);
GLAccountData retrieveNewGLAccountDetails(Integer type);

List<GLAccountDataForLookup> retrieveAccountsByTagId(final Long ruleId, final Integer transactionType);
List<GLAccountDataForLookup> retrieveAccountsByTagId(Long ruleId, Integer transactionType);
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private static final class GLAccountMapper implements RowMapper<GLAccountData> {

private final JournalEntryAssociationParametersData associationParametersData;

public GLAccountMapper(final JournalEntryAssociationParametersData associationParametersData) {
GLAccountMapper(final JournalEntryAssociationParametersData associationParametersData) {
if (associationParametersData == null) {
this.associationParametersData = new JournalEntryAssociationParametersData();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public enum JournalEntryJsonInputParams {

private final String value;

private JournalEntryJsonInputParams(final String value) {
JournalEntryJsonInputParams(final String value) {
this.value = value;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public enum JournalEntryType {
private final Integer value;
private final String code;

private JournalEntryType(final Integer value, final String code) {
JournalEntryType(final Integer value, final String code) {
this.value = value;
this.code = code;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
public class JournalEntryInvalidException extends AbstractPlatformDomainRuleException {

/*** enum of reasons for invalid Journal Entry **/
public static enum GlJournalEntryInvalidReason {
public enum GlJournalEntryInvalidReason {

FUTURE_DATE, ACCOUNTING_CLOSED, NO_DEBITS_OR_CREDITS, DEBIT_CREDIT_SUM_MISMATCH_WITH_AMOUNT, DEBIT_CREDIT_SUM_MISMATCH, DEBIT_CREDIT_ACCOUNT_OR_AMOUNT_EMPTY, GL_ACCOUNT_DISABLED, GL_ACCOUNT_MANUAL_ENTRIES_NOT_PERMITTED, INVALID_DEBIT_OR_CREDIT_ACCOUNTS;

Expand Down
Loading

0 comments on commit a52526b

Please sign in to comment.