FINERACT-822 enable MissingCasesInEnumSwitch error (#989)

This commit is contained in:
Percy Ayuk Ashu
2020-06-06 22:05:43 +01:00
committed by GitHub
parent cd3621cb60
commit 910eb1f7a8
17 changed files with 27 additions and 5 deletions
+1 -1
View File
@@ -307,7 +307,6 @@ tasks.withType(JavaCompile) {
"UnusedVariable", "UnusedVariable",
"InconsistentCapitalization", "InconsistentCapitalization",
"ClassCanBeStatic", "ClassCanBeStatic",
"MissingCasesInEnumSwitch",
"OperatorPrecedence", "OperatorPrecedence",
"MixedMutabilityReturnType", "MixedMutabilityReturnType",
"SameNameButDifferent", "SameNameButDifferent",
@@ -368,6 +367,7 @@ tasks.withType(JavaCompile) {
"ArgumentSelectionDefectChecker", "ArgumentSelectionDefectChecker",
"CompareToZero", "CompareToZero",
"NarrowingCompoundAssignment", "NarrowingCompoundAssignment",
"MissingCasesInEnumSwitch",
// "ReturnMissingNullable", // "ReturnMissingNullable",
// "InconsistentOverloads", // "InconsistentOverloads",
// "MethodCanBeStatic", // "MethodCanBeStatic",
@@ -127,6 +127,7 @@ public class AccountNumberFormatDataValidator {
case GROUP: case GROUP:
validAccountNumberPrefixes = AccountNumberFormatEnumerations.accountNumberPrefixesForGroups; validAccountNumberPrefixes = AccountNumberFormatEnumerations.accountNumberPrefixesForGroups;
break; break;
default:
} }
Set<Integer> validAccountNumberPrefixValues = new HashSet<>(); Set<Integer> validAccountNumberPrefixValues = new HashSet<>();
@@ -145,6 +145,7 @@ public class AccountNumberFormatReadPlatformServiceImpl implements AccountNumber
case GROUP : case GROUP :
accountNumberPrefixTypesSet = AccountNumberFormatEnumerations.accountNumberPrefixesForGroups; accountNumberPrefixTypesSet = AccountNumberFormatEnumerations.accountNumberPrefixesForGroups;
break; break;
default:
} }
Object[] array = accountNumberPrefixTypesSet.toArray(); Object[] array = accountNumberPrefixTypesSet.toArray();
@@ -53,6 +53,7 @@ public class WorkingDaysEnumerations {
optionData = new EnumOptionData(RepaymentRescheduleType.MOVE_TO_PREVIOUS_WORKING_DAY.getValue().longValue(),RepaymentRescheduleType.MOVE_TO_PREVIOUS_WORKING_DAY.getCode(), optionData = new EnumOptionData(RepaymentRescheduleType.MOVE_TO_PREVIOUS_WORKING_DAY.getValue().longValue(),RepaymentRescheduleType.MOVE_TO_PREVIOUS_WORKING_DAY.getCode(),
"move to previous working day"); "move to previous working day");
break; break;
default:
} }
return optionData; return optionData;
@@ -50,6 +50,7 @@ public class AccountEnumerations {
case GLIM: case GLIM:
optionData = new EnumOptionData(AccountType.GLIM.getValue().longValue(), AccountType.GLIM.getCode(), "GLIM"); optionData = new EnumOptionData(AccountType.GLIM.getValue().longValue(), AccountType.GLIM.getCode(), "GLIM");
break; break;
default:
} }
return optionData; return optionData;
@@ -52,6 +52,7 @@ public class InterestRateChartEnumerations {
optionData = new EnumOptionData(PeriodFrequencyType.YEARS.getValue().longValue(), optionData = new EnumOptionData(PeriodFrequencyType.YEARS.getValue().longValue(),
PeriodFrequencyType.YEARS.getCode(), "Years"); PeriodFrequencyType.YEARS.getCode(), "Years");
break; break;
default:
} }
return optionData; return optionData;
@@ -66,4 +67,4 @@ public class InterestRateChartEnumerations {
} }
return optionDatas; return optionDatas;
} }
} }
@@ -4501,6 +4501,7 @@ public class Loan extends AbstractPersistableCustom {
break; break;
case INVALID: case INVALID:
break; break;
default:
} }
return dueRepaymentPeriodDate.minusDays(1);// get 2n-1 range date from return dueRepaymentPeriodDate.minusDays(1);// get 2n-1 range date from
// startDate // startDate
@@ -57,6 +57,7 @@ public class AprCalculator {
case YEARS: case YEARS:
defaultAnnualNominalInterestRate = ratePerPeriod.multiply(BigDecimal.valueOf(1)); defaultAnnualNominalInterestRate = ratePerPeriod.multiply(BigDecimal.valueOf(1));
break; break;
default:
} }
break; break;
case INVALID: case INVALID:
@@ -45,6 +45,7 @@ public class DefaultPaymentPeriodsInOneYearCalculator implements PaymentPeriodsI
case INVALID: case INVALID:
paymentPeriodsInOneYear = Integer.valueOf(0); paymentPeriodsInOneYear = Integer.valueOf(0);
break; break;
default:
} }
return paymentPeriodsInOneYear; return paymentPeriodsInOneYear;
} }
@@ -91,7 +92,8 @@ public class DefaultPaymentPeriodsInOneYearCalculator implements PaymentPeriodsI
case INVALID: case INVALID:
fraction = Double.valueOf("0"); fraction = Double.valueOf("0");
break; break;
default:
} }
return fraction; return fraction;
} }
} }
@@ -227,6 +227,7 @@ public class DefaultScheduledDateGenerator implements ScheduledDateGenerator {
break; break;
case INVALID: case INVALID:
break; break;
default:
} }
return dueRepaymentPeriodDate; return dueRepaymentPeriodDate;
} }
@@ -281,6 +282,7 @@ public class DefaultScheduledDateGenerator implements ScheduledDateGenerator {
break; break;
case INVALID: case INVALID:
break; break;
default:
} }
return isScheduledDate; return isScheduledDate;
} }
@@ -315,6 +317,7 @@ public class DefaultScheduledDateGenerator implements ScheduledDateGenerator {
break; break;
case INVALID: case INVALID:
break; break;
default:
} }
return idealDisbursementDate; return idealDisbursementDate;
@@ -333,4 +336,4 @@ public class DefaultScheduledDateGenerator implements ScheduledDateGenerator {
generatedDate = adjustRepaymentDate(generatedDate, loanApplicationTerms, holidayDetailDTO).getChangedScheduleDate(); generatedDate = adjustRepaymentDate(generatedDate, loanApplicationTerms, holidayDetailDTO).getChangedScheduleDate();
return generatedDate; return generatedDate;
} }
} }
@@ -658,6 +658,7 @@ public final class LoanApplicationTerms {
break; break;
case INVALID: case INVALID:
break; break;
default:
} }
return dueRepaymentPeriodDate; return dueRepaymentPeriodDate;
} }
@@ -1050,6 +1051,7 @@ public final class LoanApplicationTerms {
} }
periodicInterestRate = oneDayOfYearInterestRate.multiply(numberOfDaysInPeriod, mc); periodicInterestRate = oneDayOfYearInterestRate.multiply(numberOfDaysInPeriod, mc);
break; break;
default:
} }
break; break;
case SAME_AS_REPAYMENT_PERIOD: case SAME_AS_REPAYMENT_PERIOD:
@@ -228,10 +228,11 @@ public class NotesApiResource {
resourceNameForPermissions = "GROUPNOTE"; resourceNameForPermissions = "GROUPNOTE";
resourceDetails.withGroupId(resourceId); resourceDetails.withGroupId(resourceId);
break; break;
default:
} }
return resourceDetails.withEntityName(resourceNameForPermissions).build(); return resourceDetails.withEntityName(resourceNameForPermissions).build();
} }
} }
@@ -437,6 +437,7 @@ public class NoteWritePlatformServiceJpaRepositoryImpl implements NoteWritePlatf
// break; // break;
case SAVING_ACCOUNT: case SAVING_ACCOUNT:
break; break;
default:
} }
if (noteForUpdate == null) { throw new NoteNotFoundException(noteId, resourceId, type.name().toLowerCase()); } if (noteForUpdate == null) { throw new NoteNotFoundException(noteId, resourceId, type.name().toLowerCase()); }
return noteForUpdate; return noteForUpdate;
@@ -46,6 +46,7 @@ public class DepositAccountUtils {
break; break;
case INVALID: case INVALID:
break; break;
default:
} }
return nextDepositDate; return nextDepositDate;
} }
@@ -2337,6 +2337,7 @@ public class SavingsAccount extends AbstractPersistableCustom {
case YEARS: case YEARS:
lockedInUntilLocalDate = activationLocalDate.plusYears(this.lockinPeriodFrequency).toDate(); lockedInUntilLocalDate = activationLocalDate.plusYears(this.lockinPeriodFrequency).toDate();
break; break;
default:
} }
return lockedInUntilLocalDate; return lockedInUntilLocalDate;
@@ -292,6 +292,7 @@ public class SavingsAccountCharge extends AbstractPersistableCustom {
this.amountWaived = null; this.amountWaived = null;
this.amountWrittenOff = null; this.amountWrittenOff = null;
break; break;
default:
} }
} }
@@ -420,6 +421,7 @@ public class SavingsAccountCharge extends AbstractPersistableCustom {
this.amountPercentageAppliedTo = null; this.amountPercentageAppliedTo = null;
this.amountOutstanding = null; this.amountOutstanding = null;
break; break;
default:
} }
} }
} }
@@ -494,6 +496,7 @@ public class SavingsAccountCharge extends AbstractPersistableCustom {
this.amountPercentageAppliedTo = null; this.amountPercentageAppliedTo = null;
this.amountOutstanding = null; this.amountOutstanding = null;
break; break;
default:
} }
} }
@@ -927,6 +927,7 @@ public class ShareAccountDataSerializer {
case YEARS: case YEARS:
lockinDate = purchaseDate.plusYears(lockinPeriod) ; lockinDate = purchaseDate.plusYears(lockinPeriod) ;
break ; break ;
default:
} }
} }
return lockinDate ; return lockinDate ;