FINERACT-971 Added and enforced AvoidNoArgumentSuperConstructorCall Checkstyle

This commit is contained in:
Manthan Surkar
2020-08-01 15:08:46 +02:00
committed by Michael Vorburger ⛑️
parent 1f462613fb
commit bcd42b9cb9
68 changed files with 78 additions and 77 deletions
@@ -192,6 +192,7 @@
<message key="name.invalidPattern"
value="Local variable name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="AvoidNoArgumentSuperConstructorCall"/>
<!-- TODO Enable many more checks (go about this one by one, step by step, raise separate PRs fixing and then enforcing):
<module name="HiddenField">
@@ -52,7 +52,7 @@ public class BatchRequestsIntegrationTest {
private RequestSpecification requestSpec;
public BatchRequestsIntegrationTest() {
super();
}
/**
@@ -46,7 +46,7 @@ public final class BatchHelper {
private static final String BATCH_API_URL_EXT = BATCH_API_URL + "&enclosingTransaction=true";
private BatchHelper() {
super();
}
/**
@@ -54,12 +54,12 @@ public class CurrencyDomain implements Comparable<CurrencyDomain> {
private String displayLabel;
CurrencyDomain() {
super();
}
private CurrencyDomain(final String code, final String name, final int decimalPlaces, final String displaySymbol, final String nameCode,
final String displayLabel) {
super();
this.code = code;
this.name = name;
this.decimalPlaces = decimalPlaces;
@@ -55,12 +55,12 @@ public class OfficeDomain {
private String hierarchy;
OfficeDomain() {
super();
}
private OfficeDomain(final int id, final String name, final String nameDecorated, final String externalId, final String[] openingDate,
final String hierarchy) {
super();
this.id = id;
this.name = name;
this.nameDecorated = nameDecorated;
@@ -47,11 +47,11 @@ public class FundsHelper {
private Long resourceId;
FundsHelper() {
super();
}
private FundsHelper(final String name, final String externalId) {
super();
this.name = name;
this.externalId = externalId;
}
@@ -39,7 +39,7 @@ public class FinancialActivityData {
}
public FinancialActivityData(Integer id, String name, GLAccountType mappedGLAccountType) {
super();
this.id = id;
this.name = name;
this.mappedGLAccountType = mappedGLAccountType;
@@ -29,7 +29,7 @@ public class ClientChargePaymentDTO {
private final Long incomeAccountId;
public ClientChargePaymentDTO(Long chargeId, BigDecimal amount, Long clientChargeId, boolean isPenalty, Long incomeAccountId) {
super();
this.chargeId = chargeId;
this.amount = amount;
this.clientChargeId = clientChargeId;
@@ -55,7 +55,7 @@ public class ErrorHandler extends RuntimeException {
* Sole Constructor
*/
ErrorHandler() {
super();
}
/**
@@ -39,7 +39,7 @@ public final class ErrorInfo {
* @param message
*/
public ErrorInfo(final Integer statusCode, final Integer errorCode, final String message) {
super();
this.statusCode = statusCode;
this.errorCode = errorCode;
this.message = message;
@@ -49,7 +49,7 @@ public final class ErrorInfo {
* Constructor so JSON serialization will work with out special Serialiazer
*/
ErrorInfo() {
super();
}
/**
@@ -55,7 +55,7 @@ public class ResolutionHelper {
private final List<BatchRequestNode> childRequests = new ArrayList<>();
public BatchRequestNode() {
super();
}
public BatchRequest getRequest() {
@@ -55,7 +55,7 @@ public class CommandHandlerProvider implements ApplicationContextAware {
private HashMap<String, String> registeredHandlers;
CommandHandlerProvider() {
super();
}
/**
@@ -27,7 +27,7 @@ import org.apache.openjpa.jdbc.sql.MySQLDictionary;
public class MySQLDictionaryCustom extends MySQLDictionary {
public MySQLDictionaryCustom() {
super();
this.supportsSubselect = true;
this.booleanRepresentation = BooleanRepresentationFactory.BOOLEAN;
this.supportsGetGeneratedKeys = false;
@@ -27,7 +27,7 @@ public class HookEventSource implements Serializable {
private final String actionName;
public HookEventSource(final String entityName, final String actionName) {
super();
this.entityName = entityName;
this.actionName = actionName;
}
@@ -43,7 +43,7 @@ public class ReportingProcessServiceProvider implements ApplicationContextAware
Map<String, String> reportingProcessServices = null;
ReportingProcessServiceProvider() {
super();
}
public ReportingProcessService findReportingProcessService(final String reportType) {
@@ -77,7 +77,7 @@ public class TellerApiResource {
public TellerApiResource(PlatformSecurityContext securityContext, DefaultToApiJsonSerializer<TellerData> jsonSerializer,
TellerManagementReadPlatformService readPlatformService,
PortfolioCommandSourceWritePlatformService commandWritePlatformService) {
super();
this.securityContext = securityContext;
this.jsonSerializer = jsonSerializer;
this.readPlatformService = readPlatformService;
@@ -50,7 +50,7 @@ public class TellerJournalApiResource {
@Autowired
public TellerJournalApiResource(final PlatformSecurityContext securityContext,
final DefaultToApiJsonSerializer<TellerData> jsonSerializer, final TellerManagementReadPlatformService readPlatformService) {
super();
this.securityContext = securityContext;
this.jsonSerializer = jsonSerializer;
this.readPlatformService = readPlatformService;
@@ -60,7 +60,7 @@ public final class TellerData implements Serializable {
private TellerData(final Long id, final Long officeId, final Long debitAccountId, final Long creditAccountId, final String name,
final String description, final LocalDate startDate, final LocalDate endDate, final TellerStatus status,
final Boolean hasTransactions, final Boolean hasMappedCashiers) {
super();
this.id = id;
this.officeId = officeId;
this.debitAccountId = debitAccountId;
@@ -88,7 +88,7 @@ public class Cashier extends AbstractPersistableCustom {
* Creates a new cashier.
*/
public Cashier() {
super();
}
public static Cashier fromJson(final Office cashierOffice, final Teller teller, final Staff staff, final String startTime,
@@ -80,7 +80,7 @@ public class CashierTransaction extends AbstractPersistableCustom {
* Creates a new cashier.
*/
public CashierTransaction() {
super();
}
public static CashierTransaction fromJson(final Cashier cashier, final JsonCommand command) {
@@ -76,7 +76,7 @@ public class Teller extends AbstractPersistableCustom {
private Set<Cashier> cashiers;
public Teller() {
super();
}
private Teller(final Office staffOffice, final String name, final String description, final LocalDate startDate,
@@ -62,7 +62,7 @@ public class TellerTransaction extends AbstractPersistableCustom {
private Date postingDate;
public TellerTransaction() {
super();
}
public Office getOffice() {
@@ -40,7 +40,7 @@ public class AllocateCashToCashierCommandHandler implements NewCommandSourceHand
*/
@Autowired
public AllocateCashToCashierCommandHandler(final TellerWritePlatformService writePlatformService) {
super();
this.writePlatformService = writePlatformService;
}
@@ -40,7 +40,7 @@ public class AllocateCashierToTellerCommandHandler implements NewCommandSourceHa
*/
@Autowired
public AllocateCashierToTellerCommandHandler(final TellerWritePlatformService writePlatformService) {
super();
this.writePlatformService = writePlatformService;
}
@@ -30,7 +30,7 @@ public class CreateTellerTransactionCommandHandler implements NewCommandSourceHa
@Autowired
public CreateTellerTransactionCommandHandler(final TellerTransactionWritePlatformService writePlatformService) {
super();
this.writePlatformService = writePlatformService;
}
@@ -47,7 +47,7 @@ public class DeleteCashierAllocationCommandHandler implements NewCommandSourceHa
*/
@Autowired
public DeleteCashierAllocationCommandHandler(final TellerWritePlatformService writePlatformService) {
super();
this.writePlatformService = writePlatformService;
}
@@ -47,7 +47,7 @@ public class DeleteTellerCommandHandler implements NewCommandSourceHandler {
*/
@Autowired
public DeleteTellerCommandHandler(final TellerWritePlatformService writePlatformService) {
super();
this.writePlatformService = writePlatformService;
}
@@ -43,7 +43,7 @@ public class ModifyCashierCommandHandler implements NewCommandSourceHandler {
*/
@Autowired
public ModifyCashierCommandHandler(final CashierWritePlatformService writePlatformService) {
super();
this.writePlatformService = writePlatformService;
}
@@ -40,7 +40,7 @@ public class SettleCashFromCashierCommandHandler implements NewCommandSourceHand
*/
@Autowired
public SettleCashFromCashierCommandHandler(final TellerWritePlatformService writePlatformService) {
super();
this.writePlatformService = writePlatformService;
}
@@ -47,7 +47,7 @@ public class UpdateCashierAllocationCommandHandler implements NewCommandSourceHa
*/
@Autowired
public UpdateCashierAllocationCommandHandler(final TellerWritePlatformService writePlatformService) {
super();
this.writePlatformService = writePlatformService;
}
@@ -47,7 +47,7 @@ public class UpdateTellerCommandHandler implements NewCommandSourceHandler {
*/
@Autowired
public UpdateTellerCommandHandler(final TellerWritePlatformService writePlatformService) {
super();
this.writePlatformService = writePlatformService;
}
@@ -36,7 +36,7 @@ public class DateRange {
private Date endDate;
public DateRange() {
super();
}
public Date getStartDate() {
@@ -118,7 +118,7 @@ public final class ClientChargeData {
EnumOptionData chargeCalculationType, CurrencyData currency, BigDecimal amount, BigDecimal amountPaid, BigDecimal amountWaived,
BigDecimal amountWrittenOff, BigDecimal amountOutstanding, boolean penalty, Boolean isPaid, Boolean isWaived, Boolean isActive,
LocalDate inactivationDate, Collection<ChargeData> chargeOptions, Collection<ClientTransactionData> clientTransactionDatas) {
super();
this.id = id;
this.clientId = clientId;
this.chargeId = chargeId;
@@ -62,7 +62,7 @@ public class ClientNonPersonData implements Serializable {
public ClientNonPersonData(CodeValueData constitution, String incorpNo, LocalDate incorpValidityTillDate,
CodeValueData mainBusinessLine, String remarks) {
super();
this.constitution = constitution;
this.incorpNumber = incorpNo;
this.incorpValidityTillDate = incorpValidityTillDate;
@@ -55,7 +55,7 @@ public final class ClientTransactionData {
private ClientTransactionData(Long id, Long officeId, String officeName, EnumOptionData type, LocalDate date, CurrencyData currency,
PaymentDetailData paymentDetailData, BigDecimal amount, String externalId, LocalDate submittedOnDate, boolean reversed,
Collection<PaymentTypeData> paymentTypeOptions) {
super();
this.id = id;
this.officeId = officeId;
this.officeName = officeName;
@@ -120,7 +120,7 @@ public class ClientTransaction extends AbstractPersistableCustom {
public ClientTransaction(Client client, Office office, PaymentDetail paymentDetail, Integer typeOf, LocalDate transactionLocalDate,
Money amount, boolean reversed, String externalId, Date createdDate, String currencyCode, AppUser appUser) {
super();
this.client = client;
this.office = office;
this.paymentDetail = paymentDetail;
@@ -36,7 +36,7 @@ public class GroupLevelData {
public GroupLevelData(final Long levelId, final String levelName, final Long parentLevelId, final String parentLevelName,
final Long childLevelId, final String childLevelName, final boolean superParent, final boolean recursable,
final boolean canHaveClients) {
super();
this.levelId = levelId;
this.levelName = levelName;
this.parentLevelId = parentLevelId;
@@ -302,7 +302,7 @@ public class LoanTransaction extends AbstractPersistableCustom {
final BigDecimal principalPortion, final BigDecimal interestPortion, final BigDecimal feeChargesPortion,
final BigDecimal penaltyChargesPortion, final BigDecimal overPaymentPortion, final boolean reversed,
final PaymentDetail paymentDetail, final String externalId, final LocalDateTime createdDate, final AppUser appUser) {
super();
this.loan = loan;
this.typeOf = typeOf;
this.dateOf = dateOf;
@@ -74,7 +74,7 @@ public class PaymentTypeApiResource {
public PaymentTypeApiResource(PlatformSecurityContext securityContext, DefaultToApiJsonSerializer<PaymentTypeData> jsonSerializer,
PaymentTypeReadPlatformService readPlatformService, PaymentTypeRepositoryWrapper paymentTypeRepositoryWrapper,
ApiRequestParameterHelper apiRequestParameterHelper, PortfolioCommandSourceWritePlatformService commandWritePlatformService) {
super();
this.securityContext = securityContext;
this.jsonSerializer = jsonSerializer;
this.readPlatformService = readPlatformService;
@@ -96,7 +96,7 @@ public class DepositAccountTermAndPreClosure extends AbstractPersistableCustom {
private Long transferToSavingsAccountId;
protected DepositAccountTermAndPreClosure() {
super();
}
public static DepositAccountTermAndPreClosure createNew(DepositPreClosureDetail preClosureDetail, DepositTermDetail depositTermDetail,
@@ -40,7 +40,7 @@ public class DepositProductRecurringDetail extends AbstractPersistableCustom {
private RecurringDepositProduct product;
protected DepositProductRecurringDetail() {
super();
}
public static DepositProductRecurringDetail createNew(DepositRecurringDetail recurringDetail, SavingsProduct product) {
@@ -47,7 +47,7 @@ public class DepositProductTermAndPreClosure extends AbstractPersistableCustom {
private DepositProductAmountDetails depositProductAmountDetails;
protected DepositProductTermAndPreClosure() {
super();
}
public static DepositProductTermAndPreClosure createNew(DepositPreClosureDetail preClosureDetail, DepositTermDetail depositTermDetail,
@@ -77,7 +77,7 @@ public class FixedDepositProduct extends SavingsProduct {
protected InterestRateChartAssembler chartAssembler;
protected FixedDepositProduct() {
super();
}
public static FixedDepositProduct createNew(final String name, final String shortName, final String description,
@@ -55,7 +55,7 @@ public class RecurringDepositProduct extends FixedDepositProduct {
private DepositProductRecurringDetail recurringDetail;
protected RecurringDepositProduct() {
super();
}
public static RecurringDepositProduct createNew(final String name, final String shortName, final String description,
@@ -62,7 +62,7 @@ public class LookupTableApiResource {
@Autowired
public LookupTableApiResource(final PlatformSecurityContext securityContext, final SpmService spmService,
final LookupTableService lookupTableService) {
super();
this.securityContext = securityContext;
this.spmService = spmService;
this.lookupTableService = lookupTableService;
@@ -27,11 +27,11 @@ public class ComponentData {
private Integer sequenceNo;
public ComponentData() {
super();
}
public ComponentData(final Long id, final String key, final String text, final String description, final Integer sequenceNo) {
super();
this.id = id;
this.key = key;
this.text = text;
@@ -27,11 +27,11 @@ public class LookupTableData {
private List<LookupTableEntry> entries;
public LookupTableData() {
super();
}
public LookupTableData(final String key, final String description, final List<LookupTableEntry> entries) {
super();
this.key = key;
this.description = description;
this.entries = entries;
@@ -25,11 +25,11 @@ public class LookupTableEntry {
private Double score;
public LookupTableEntry() {
super();
}
public LookupTableEntry(final Integer valueFrom, final Integer valueTo, final Double score) {
super();
this.valueFrom = valueFrom;
this.valueTo = valueTo;
this.score = score;
@@ -31,12 +31,12 @@ public class QuestionData {
private Integer sequenceNo;
public QuestionData() {
super();
}
public QuestionData(final Long id, final List<ResponseData> responseDatas, final String componentKey, final String key,
final String text, final String description, final Integer sequenceNo) {
super();
this.id = id;
this.responseDatas = responseDatas;
this.componentKey = componentKey;
@@ -26,11 +26,11 @@ public class ResponseData {
private Integer sequenceNo;
public ResponseData() {
super();
}
public ResponseData(final Long id, final String text, final Integer value, final Integer sequenceNo) {
super();
this.id = id;
this.text = text;
this.value = value;
@@ -32,7 +32,7 @@ public class ScorecardData {
private List<ScorecardValue> scorecardValues;
public ScorecardData() {
super();
}
private ScorecardData(final Long id, final Long userId, final String username, final Long surveyId, final String surveyName,
@@ -28,7 +28,7 @@ public class ScorecardValue {
private Date createdOn;
public ScorecardValue() {
super();
}
private ScorecardValue(final Long questionId, final Long responseId, final Integer value, final Date createdOn) {
@@ -34,12 +34,12 @@ public class SurveyData {
private Date validTo;
public SurveyData() {
super();
}
public SurveyData(final Long id, final List<ComponentData> componentDatas, final List<QuestionData> questionDatas, final String key,
final String name, final String description, final String countryCode, final Date validFrom, final Date validTo) {
super();
this.id = id;
this.componentDatas = componentDatas;
this.questionDatas = questionDatas;
@@ -47,7 +47,7 @@ public class Component extends AbstractPersistableCustom {
private Integer sequenceNo;
public Component() {
super();
}
public Survey getSurvey() {
@@ -50,7 +50,7 @@ public class LookupTable extends AbstractPersistableCustom {
private Double score;
public LookupTable() {
super();
}
public Survey getSurvey() {
@@ -58,7 +58,7 @@ public class Question extends AbstractPersistableCustom {
private Integer sequenceNo;
public Question() {
super();
}
public Survey getSurvey() {
@@ -44,7 +44,7 @@ public class Response extends AbstractPersistableCustom {
private Integer sequenceNo;
public Response() {
super();
}
public Question getQuestion() {
@@ -65,7 +65,7 @@ public class Scorecard extends AbstractPersistableCustom {
private Integer value;
public Scorecard() {
super();
}
public Survey getSurvey() {
@@ -65,7 +65,7 @@ public class Survey extends AbstractPersistableCustom {
private Date validTo;
public Survey() {
super();
}
public List<Component> getComponents() {
@@ -34,7 +34,7 @@ public class LookupTableService {
@Autowired
public LookupTableService(final PlatformSecurityContext securityContext, final LookupTableRepository lookupTableRepository) {
super();
this.securityContext = securityContext;
this.lookupTableRepository = lookupTableRepository;
}
@@ -35,7 +35,7 @@ public class ScorecardService {
@Autowired
public ScorecardService(final PlatformSecurityContext securityContext, final ScorecardRepository scorecardRepository) {
super();
this.securityContext = securityContext;
this.scorecardRepository = scorecardRepository;
}
@@ -47,7 +47,7 @@ public class SpmService {
@Autowired
public SpmService(final PlatformSecurityContext securityContext, final SurveyRepository surveyRepository,
final SurveyValidator surveyValidator) {
super();
this.securityContext = securityContext;
this.surveyRepository = surveyRepository;
this.surveyValidator = surveyValidator;
@@ -30,7 +30,7 @@ import org.apache.fineract.spm.domain.Survey;
public final class LookupTableMapper {
private LookupTableMapper() {
super();
}
public static List<LookupTableData> map(final List<LookupTable> lookupTables) {
@@ -34,7 +34,7 @@ import org.apache.fineract.useradministration.domain.AppUser;
public final class ScorecardMapper {
private ScorecardMapper() {
super();
}
public static List<Scorecard> map(final ScorecardData scorecardData, final Survey survey, final AppUser appUser, final Client client) {
@@ -32,7 +32,7 @@ import org.apache.fineract.spm.domain.Survey;
public final class SurveyMapper {
private SurveyMapper() {
super();
}
public static SurveyData map(final Survey survey) {
@@ -44,7 +44,7 @@ public class CommandHandlerProviderTest {
private CommandHandlerProvider commandHandlerProvider;
public CommandHandlerProviderTest() {
super();
}
@Test
@@ -29,7 +29,7 @@ import org.springframework.stereotype.Component;
public class ValidCommandHandler implements NewCommandSourceHandler {
public ValidCommandHandler() {
super();
}
@Override
@@ -38,7 +38,7 @@ public class RestAssuredFixture {
private RequestSpecification requestSpec;
public RestAssuredFixture(int http) {
super();
this.httpPort = http;
Utils.initializeRESTAssured();
Utils.initializeRESTAssuredPort(http);