Added Empty Statement Check and enforced checkstyle

This commit is contained in:
thesmallstar
2020-05-15 19:43:16 +02:00
committed by Michael Vorburger ⛑️
parent 297e483742
commit 9eccd61333
14 changed files with 24 additions and 27 deletions
@@ -59,7 +59,7 @@
<property name="customImportOrderRules" value="STATIC###THIRD_PARTY_PACKAGE"/>
</module>
<module name="OneStatementPerLine"/>
<module name="EmptyStatement"/>
<!-- TODO Enable many more checks (go about this one by one, step by step, raise separate PRs fixing and then enforcing):
<module name="HiddenField">
@@ -68,7 +68,6 @@
<property name="ignoreSetter" value="true" />
<property name="setterCanReturnItsClass" value="true" />
</module>
<module name="EmptyStatement"/>
<module name="FinalClass"/>
<module name="HideUtilityClassConstructor"/>
@@ -73,7 +73,7 @@ public class GlobalConfigInterestChargedFromDateSameAsDisbursalDateTest {
.toString();
Integer updateConfigId = this.globalConfigurationHelper
.updateEnabledFlagForGlobalConfiguration(this.requestSpec, this.responseSpec,
configId.toString(), newBooleanValue);;
configId.toString(), newBooleanValue);
Assert.assertNotNull(updateConfigId);
break;
}
@@ -73,17 +73,17 @@ public class ProvisioningTransactionHelper {
}
public Map retrieveProvisioningEntry(final Integer provisioningEntry) {
String url = "/fineract-provider/api/v1/provisioningentries/"+provisioningEntry+"?"+Utils.TENANT_IDENTIFIER; ;
String url = "/fineract-provider/api/v1/provisioningentries/"+provisioningEntry+"?"+Utils.TENANT_IDENTIFIER;
return Utils.performServerGet(requestSpec, responseSpec, url, "") ;
}
public Map retrieveProvisioningEntries(final Integer provisioningEntry) {
String url = "/fineract-provider/api/v1/provisioningentries/entries?entryId="+provisioningEntry+"&"+Utils.TENANT_IDENTIFIER; ;
String url = "/fineract-provider/api/v1/provisioningentries/entries?entryId="+provisioningEntry+"&"+Utils.TENANT_IDENTIFIER;
return Utils.performServerGet(requestSpec, responseSpec, url, "") ;
}
public Map retrieveAllProvisioningEntries() {
String url = "/fineract-provider/api/v1/provisioningentries?dateFormat=dd MMMM yyyy"+"&"+"locale=en"+"&"+Utils.TENANT_IDENTIFIER; ;
String url = "/fineract-provider/api/v1/provisioningentries?dateFormat=dd MMMM yyyy"+"&"+"locale=en"+"&"+Utils.TENANT_IDENTIFIER;
return Utils.performServerGet(requestSpec, responseSpec, url, "") ;
}
@@ -222,7 +222,7 @@ public class CenterImportHandler implements ImportHandler {
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
Type groupCollectionType = new TypeToken<Collection<GroupGeneralData>>() {}.getType();
gsonBuilder.registerTypeAdapter(groupCollectionType,new GroupIdSerializer());
String payload= gsonBuilder.create().toJson(centers.get(rowIndex));;
String payload= gsonBuilder.create().toJson(centers.get(rowIndex));
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
.createCenter() //
.withJson(payload) //
@@ -238,7 +238,7 @@ public class GroupImportHandler implements ImportHandler {
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
Type clientCollectionType = new TypeToken<Collection<ClientData>>() {}.getType();
gsonBuilder.registerTypeAdapter(clientCollectionType,new ClientIdSerializer());
String payload= gsonBuilder.create().toJson(groups.get(rowIndex));;
String payload= gsonBuilder.create().toJson(groups.get(rowIndex));
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
.createGroup() //
.withJson(payload) //
@@ -318,7 +318,7 @@ public class LoanImportHandler implements ImportHandler {
CommandProcessingResult result=null;
loanId="";
try {
String status = statuses.get(i);;
String status = statuses.get(i);
progressLevel = getProgressLevel(status);
if (progressLevel == 0&& loans.get(i)!=null) {
@@ -264,7 +264,7 @@ public class SavingsImportHandler implements ImportHandler {
if (progressLevel == 0) {
CommandProcessingResult result = importSavings(i,dateFormat);
savingsId = result.getSavingsId();;
savingsId = result.getSavingsId();
progressLevel = 1;
} else
savingsId = ImportHandlerUtils.readAsLong(SavingsConstants.SAVINGS_ID_COL, savingsSheet.getRow(savings.get(i).getRowIndex()));
@@ -490,7 +490,7 @@ private WorkbookPopulator populateCenterWorkbook(Long officeId,Long staffId){
if (officeId!=null) {
String activeAccounts="sa.status_enum = 300";
SearchParameters searchParameters = SearchParameters.from(activeAccounts, officeId, null, null, null);
savingsAccounts = savingsAccountReadPlatformService.retrieveAll(searchParameters).getPageItems();;
savingsAccounts = savingsAccountReadPlatformService.retrieveAll(searchParameters).getPageItems();
}else {
savingsAccounts= savingsAccountReadPlatformService.retrieveAll(null).getPageItems();
}
@@ -100,7 +100,7 @@ public class ProvisioningCriteriaWritePlatformServiceJpaRepositoryImpl implement
if(this.provisioningEntriesReadPlatformService.retrieveProvisioningEntryDataByCriteriaId(criteriaId) != null) {
throw new ProvisioningCriteriaCannotBeDeletedException(criteriaId) ;
}
this.provisioningCriteriaRepository.deleteById(criteriaId); ;
this.provisioningCriteriaRepository.deleteById(criteriaId);
return new CommandProcessingResultBuilder().withEntityId(criteriaId).build();
}
@@ -118,18 +118,18 @@ public class Address extends AbstractPersistableCustom {
this.latitude = latitude;
this.longitude = longitude;
this.createdBy = createdBy;
//this.createdOn = createdOn;
// this.createdOn = createdOn;
this.updatedBy = updatedBy;
//this.updatedOn = updatedOn;
// this.updatedOn = updatedOn;
if (createdOn != null) {
this.createdOn = createdOn.toDate();
if (createdOn != null) {
this.createdOn = createdOn.toDate();
}
}
if (updatedOn != null) {
this.updatedOn = updatedOn.toDate();
}
if (updatedOn != null) {
this.updatedOn = updatedOn.toDate();
}
}
@@ -167,8 +167,6 @@ public class Address extends AbstractPersistableCustom {
final LocalDate updatedOn = command.localDateValueOfParameterNamed("updatedOn");
return new Address(street, addressLine1, addressLine2, addressLine3, townVillage, city, countyDistrict,
stateProvince, country, postalCode, latitude, longitude, createdBy, createdOn, updatedBy, updatedOn);
}
@@ -384,7 +382,7 @@ public class Address extends AbstractPersistableCustom {
}
public void setUpdatedOn(LocalDate updatedOn) {
this.updatedOn = updatedOn.toDate();;
this.updatedOn = updatedOn.toDate();
}
}
@@ -268,7 +268,7 @@ public class LoanTransactionData {
final PaymentDetailData paymentDetailData = null;
final CurrencyData currency = null;
final BigDecimal unrecognizedIncomePortion = null;
final BigDecimal principalPortion = null;;
final BigDecimal principalPortion = null;
final BigDecimal interestPortion = null;
final BigDecimal feeChargesPortion = null;
final BigDecimal penaltyChargesPortion = null;
@@ -279,7 +279,7 @@ public class TaxValidator {
.validateDateAfter(existing.startDate());
}
if(mapping.getTaxComponent()!= null && !existing.getTaxComponent().getId().equals(mapping.getTaxComponent().getId())){
baseDataValidator.reset().parameter(TaxApiConstants.taxComponentIdParamName).failWithCode("update.not.supported");;
baseDataValidator.reset().parameter(TaxApiConstants.taxComponentIdParamName).failWithCode("update.not.supported");
}
} else if (mapping.endDate() != null) {
baseDataValidator.reset().parameter(TaxApiConstants.endDateParamName).failWithCode("not.supported.for.new.association");
@@ -140,7 +140,7 @@ public class SpmApiResource {
public void activateOrDeactivateSurvey(@PathParam("id") final Long id, @QueryParam("command") final String command) {
this.securityContext.authenticatedUser();
if(command != null && command.equalsIgnoreCase("activate")){
this.spmService.activateSurvey(id);;
this.spmService.activateSurvey(id);
}else if(command != null && command.equalsIgnoreCase("deactivate")){
this.spmService.deactivateSurvey(id);
}else{
@@ -82,7 +82,7 @@ public class Survey extends AbstractPersistableCustom {
public void setQuestions(List<Question> questions) {
if(this.questions != null){
this.questions.clear();;
this.questions.clear();
}else{
this.questions = new ArrayList<>();
}