FINERACT-822 Enforce UnusedMethod check

This commit is contained in:
percyashu
2020-06-23 10:00:49 +02:00
committed by Michael Vorburger ⛑️
parent f05239c35b
commit a7fdafd407
8 changed files with 1 additions and 88 deletions
+1 -1
View File
@@ -384,7 +384,6 @@ tasks.withType(JavaCompile) {
disable(
"UnusedVariable",
"SameNameButDifferent",
"UnusedMethod",
"ModifiedButNotUsed",
"TypeParameterUnusedInFormals",
"UndefinedEquals",
@@ -461,6 +460,7 @@ tasks.withType(JavaCompile) {
"DoubleBraceInitialization",
"UnnecessaryDefaultInEnumSwitch",
"UnusedNestedClass",
"UnusedMethod",
"InconsistentCapitalization",
"MissingOverride",
// "InvalidBlockTag",
@@ -66,15 +66,6 @@ public class JournalEntryHelper {
}
private String getEntryValueFromJournalEntry(final ArrayList<HashMap> entryResponse, final int entryNumber) {
final HashMap map = (HashMap) entryResponse.get(entryNumber).get("entryType");
return (String) map.get("value");
}
private Float getTransactionAmountFromJournalEntry(final ArrayList<HashMap> entryResponse, final int entryNumber) {
return (Float) entryResponse.get(entryNumber).get("amount");
}
private void checkJournalEntry(final Integer officeId, final Account account, final String date, final JournalEntry... accountEntries) {
final String url = createURLForGettingAccountEntries(account, date, officeId);
final ArrayList<HashMap> response = Utils.performServerGet(this.requestSpec, this.responseSpec, url, "pageItems");
@@ -37,7 +37,6 @@ import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.UriInfo;
import org.apache.commons.lang3.StringUtils;
import org.apache.fineract.adhocquery.data.AdHocData;
import org.apache.fineract.adhocquery.service.AdHocReadPlatformService;
import org.apache.fineract.commands.domain.CommandWrapper;
@@ -173,8 +172,4 @@ public class AdHocApiResource {
return this.toApiJsonSerializer.serialize(result);
}
private boolean is(final String commandParam, final String commandValue) {
return StringUtils.isNotBlank(commandParam) && commandParam.trim().equalsIgnoreCase(commandValue);
}
}
@@ -248,24 +248,6 @@ public class EntityDatatableChecksWritePlatformServiceImpl implements EntityData
return isMakerCheckerEnabled;
}
private List<String> getDatatableNames(Long status, String entity, Long productId) {
List<String> ret = new ArrayList<>();
List<EntityDatatableChecks> tableRequiredBeforeAction = null;
if (productId != null) {
tableRequiredBeforeAction = this.entityDatatableChecksRepository.findByEntityStatusAndProduct(entity, status, productId);
}
if (tableRequiredBeforeAction == null || tableRequiredBeforeAction.size() < 1) {
tableRequiredBeforeAction = this.entityDatatableChecksRepository.findByEntityStatusAndNoProduct(entity, status);
}
if (tableRequiredBeforeAction != null && tableRequiredBeforeAction.size() > 0) {
for (EntityDatatableChecks t : tableRequiredBeforeAction) {
ret.add(t.getDatatableName());
}
}
return ret;
}
@Transactional
@Override
public CommandProcessingResult deleteCheck(final Long entityDatatableCheckId) {
@@ -88,18 +88,10 @@ public class InteropIdentifier extends AbstractPersistableCustom {
return account;
}
private void setAccount(SavingsAccount account) {
this.account = account;
}
public InteropIdentifierType getType() {
return type;
}
private void setType(InteropIdentifierType type) {
this.type = type;
}
public String getValue() {
return value;
}
@@ -120,18 +112,10 @@ public class InteropIdentifier extends AbstractPersistableCustom {
return createdBy;
}
private void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public Date getCreatedOn() {
return createdOn;
}
private void setCreatedOn(Date createdOn) {
this.createdOn = createdOn;
}
public String geModifiedBy() {
return modifiedBy;
}
@@ -20,7 +20,6 @@ package org.apache.fineract.portfolio.address.domain;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.apache.fineract.infrastructure.core.api.JsonCommand;
import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
@Entity
@@ -47,12 +46,4 @@ public class FieldConfiguration extends AbstractPersistableCustom {
}
private static FieldConfiguration fromJson(final JsonCommand command) {
final String entity = command.stringValueOfParameterNamed("entity");
final String table = command.stringValueOfParameterNamed("table");
final String field = command.stringValueOfParameterNamed("field");
final boolean is_enabled = command.booleanPrimitiveValueOfParameterNamed("implementationKey");
return new FieldConfiguration(entity, table, field, is_enabled);
}
}
@@ -924,21 +924,6 @@ public class Loan extends AbstractPersistableCustom {
return amount;
}
private boolean isFirstTrancheDisbursement() {
if (isMultiDisburmentLoan()) {
int totalTranchDisbursementCount = 0;
for (final LoanDisbursementDetails loanDisbursementDetail : this.disbursementDetails) {
if (loanDisbursementDetail.actualDisbursementDate() != null) {
totalTranchDisbursementCount++;
}
}
if (totalTranchDisbursementCount < 2) {
return true;
}
}
return false;
}
/**
* @return
*/
@@ -233,21 +233,6 @@ public class DefaultScheduledDateGenerator implements ScheduledDateGenerator {
return dueRepaymentPeriodDate;
}
private LocalDate adjustToNthWeekDay(LocalDate dueRepaymentPeriodDate, int nthDay, int dayOfWeek) {
// adjust date to start of month
dueRepaymentPeriodDate = dueRepaymentPeriodDate.withDayOfMonth(1);
// adjust date to next week if current day is past specified day of
// week.
if (dueRepaymentPeriodDate.getDayOfWeek() > dayOfWeek) {
dueRepaymentPeriodDate = dueRepaymentPeriodDate.plusWeeks(1);
}
// adjust date to specified date of week
dueRepaymentPeriodDate = dueRepaymentPeriodDate.withDayOfWeek(dayOfWeek);
// adjust to specified nth week day
dueRepaymentPeriodDate = dueRepaymentPeriodDate.plusWeeks(nthDay - 1);
return dueRepaymentPeriodDate;
}
@Override
public Boolean isDateFallsInSchedule(final PeriodFrequencyType frequency, final int repaidEvery, final LocalDate startDate,
final LocalDate date) {