FINERACT-822 Enforce UnusedMethod check
This commit is contained in:
committed by
Michael Vorburger ⛑️
parent
f05239c35b
commit
a7fdafd407
@@ -384,7 +384,6 @@ tasks.withType(JavaCompile) {
|
|||||||
disable(
|
disable(
|
||||||
"UnusedVariable",
|
"UnusedVariable",
|
||||||
"SameNameButDifferent",
|
"SameNameButDifferent",
|
||||||
"UnusedMethod",
|
|
||||||
"ModifiedButNotUsed",
|
"ModifiedButNotUsed",
|
||||||
"TypeParameterUnusedInFormals",
|
"TypeParameterUnusedInFormals",
|
||||||
"UndefinedEquals",
|
"UndefinedEquals",
|
||||||
@@ -461,6 +460,7 @@ tasks.withType(JavaCompile) {
|
|||||||
"DoubleBraceInitialization",
|
"DoubleBraceInitialization",
|
||||||
"UnnecessaryDefaultInEnumSwitch",
|
"UnnecessaryDefaultInEnumSwitch",
|
||||||
"UnusedNestedClass",
|
"UnusedNestedClass",
|
||||||
|
"UnusedMethod",
|
||||||
"InconsistentCapitalization",
|
"InconsistentCapitalization",
|
||||||
"MissingOverride",
|
"MissingOverride",
|
||||||
// "InvalidBlockTag",
|
// "InvalidBlockTag",
|
||||||
|
|||||||
-9
@@ -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) {
|
private void checkJournalEntry(final Integer officeId, final Account account, final String date, final JournalEntry... accountEntries) {
|
||||||
final String url = createURLForGettingAccountEntries(account, date, officeId);
|
final String url = createURLForGettingAccountEntries(account, date, officeId);
|
||||||
final ArrayList<HashMap> response = Utils.performServerGet(this.requestSpec, this.responseSpec, url, "pageItems");
|
final ArrayList<HashMap> response = Utils.performServerGet(this.requestSpec, this.responseSpec, url, "pageItems");
|
||||||
|
|||||||
-5
@@ -37,7 +37,6 @@ import javax.ws.rs.Produces;
|
|||||||
import javax.ws.rs.core.Context;
|
import javax.ws.rs.core.Context;
|
||||||
import javax.ws.rs.core.MediaType;
|
import javax.ws.rs.core.MediaType;
|
||||||
import javax.ws.rs.core.UriInfo;
|
import javax.ws.rs.core.UriInfo;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.apache.fineract.adhocquery.data.AdHocData;
|
import org.apache.fineract.adhocquery.data.AdHocData;
|
||||||
import org.apache.fineract.adhocquery.service.AdHocReadPlatformService;
|
import org.apache.fineract.adhocquery.service.AdHocReadPlatformService;
|
||||||
import org.apache.fineract.commands.domain.CommandWrapper;
|
import org.apache.fineract.commands.domain.CommandWrapper;
|
||||||
@@ -173,8 +172,4 @@ public class AdHocApiResource {
|
|||||||
return this.toApiJsonSerializer.serialize(result);
|
return this.toApiJsonSerializer.serialize(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean is(final String commandParam, final String commandValue) {
|
|
||||||
return StringUtils.isNotBlank(commandParam) && commandParam.trim().equalsIgnoreCase(commandValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
-18
@@ -248,24 +248,6 @@ public class EntityDatatableChecksWritePlatformServiceImpl implements EntityData
|
|||||||
return isMakerCheckerEnabled;
|
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
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public CommandProcessingResult deleteCheck(final Long entityDatatableCheckId) {
|
public CommandProcessingResult deleteCheck(final Long entityDatatableCheckId) {
|
||||||
|
|||||||
-16
@@ -88,18 +88,10 @@ public class InteropIdentifier extends AbstractPersistableCustom {
|
|||||||
return account;
|
return account;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setAccount(SavingsAccount account) {
|
|
||||||
this.account = account;
|
|
||||||
}
|
|
||||||
|
|
||||||
public InteropIdentifierType getType() {
|
public InteropIdentifierType getType() {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setType(InteropIdentifierType type) {
|
|
||||||
this.type = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getValue() {
|
public String getValue() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
@@ -120,18 +112,10 @@ public class InteropIdentifier extends AbstractPersistableCustom {
|
|||||||
return createdBy;
|
return createdBy;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setCreatedBy(String createdBy) {
|
|
||||||
this.createdBy = createdBy;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getCreatedOn() {
|
public Date getCreatedOn() {
|
||||||
return createdOn;
|
return createdOn;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setCreatedOn(Date createdOn) {
|
|
||||||
this.createdOn = createdOn;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String geModifiedBy() {
|
public String geModifiedBy() {
|
||||||
return modifiedBy;
|
return modifiedBy;
|
||||||
}
|
}
|
||||||
|
|||||||
-9
@@ -20,7 +20,6 @@ package org.apache.fineract.portfolio.address.domain;
|
|||||||
|
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
import org.apache.fineract.infrastructure.core.api.JsonCommand;
|
|
||||||
import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
|
import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
|
||||||
|
|
||||||
@Entity
|
@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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
-15
@@ -924,21 +924,6 @@ public class Loan extends AbstractPersistableCustom {
|
|||||||
return amount;
|
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
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|||||||
-15
@@ -233,21 +233,6 @@ public class DefaultScheduledDateGenerator implements ScheduledDateGenerator {
|
|||||||
return dueRepaymentPeriodDate;
|
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
|
@Override
|
||||||
public Boolean isDateFallsInSchedule(final PeriodFrequencyType frequency, final int repaidEvery, final LocalDate startDate,
|
public Boolean isDateFallsInSchedule(final PeriodFrequencyType frequency, final int repaidEvery, final LocalDate startDate,
|
||||||
final LocalDate date) {
|
final LocalDate date) {
|
||||||
|
|||||||
Reference in New Issue
Block a user