Upgrade ErrorProne from 2.4.0 to 2.5.1 (FINERACT-1297)

This commit is contained in:
Michael Vorburger
2021-01-23 15:11:40 +01:00
committed by Michael Vorburger ⛑️
parent 6be352fc74
commit 8bff783c5d
5 changed files with 22 additions and 23 deletions
+4 -3
View File
@@ -495,15 +495,15 @@ configure(project.fineractJavaProjects) {
// Configuration for the errorprone plugin // Configuration for the errorprone plugin
// https://github.com/tbroyer/gradle-errorprone-plugin // https://github.com/tbroyer/gradle-errorprone-plugin
dependencies { dependencies {
errorprone "com.google.errorprone:error_prone_core:2.4.0" errorprone "com.google.errorprone:error_prone_core:2.5.1"
} }
tasks.withType(JavaCompile) { tasks.withType(JavaCompile) {
options.errorprone { options.errorprone {
disableWarningsInGeneratedCode = true disableWarningsInGeneratedCode = true
excludedPaths = ".*/build/.*" excludedPaths = ".*/build/.*"
//Todo Remove necessary checks from this list
disable( disable(
// TODO Remove disabled checks from this list, by fixing remaining usages
"UnusedVariable", "UnusedVariable",
"TypeParameterUnusedInFormals", "TypeParameterUnusedInFormals",
"JdkObsolete", "JdkObsolete",
@@ -513,8 +513,8 @@ configure(project.fineractJavaProjects) {
"ReturnFromVoid", "ReturnFromVoid",
"AlmostJavadoc", "AlmostJavadoc",
"InvalidBlockTag", "InvalidBlockTag",
"JavaUtilDate", // TODO FINERACT-1298
) )
//TODO gradually enable these checks
error( error(
"DefaultCharset", "DefaultCharset",
"RemoveUnusedImports", "RemoveUnusedImports",
@@ -586,6 +586,7 @@ configure(project.fineractJavaProjects) {
"ModifiedButNotUsed", "ModifiedButNotUsed",
"InconsistentCapitalization", "InconsistentCapitalization",
"MissingOverride", "MissingOverride",
// TODO enable these remaining checks (one by one)
// "InvalidBlockTag", // "InvalidBlockTag",
// "InconsistentOverloads", // "InconsistentOverloads",
// "MethodCanBeStatic", // "MethodCanBeStatic",
@@ -99,7 +99,7 @@ public class CurrencyData implements Serializable {
return false; return false;
} }
CurrencyData that = (CurrencyData) o; CurrencyData that = (CurrencyData) o;
return Objects.equals(decimalPlaces, that.decimalPlaces) && Objects.equals(code, that.code) && Objects.equals(name, that.name) return (decimalPlaces == that.decimalPlaces) && Objects.equals(code, that.code) && Objects.equals(name, that.name)
&& Objects.equals(inMultiplesOf, that.inMultiplesOf) && Objects.equals(displaySymbol, that.displaySymbol) && Objects.equals(inMultiplesOf, that.inMultiplesOf) && Objects.equals(displaySymbol, that.displaySymbol)
&& Objects.equals(nameCode, that.nameCode) && Objects.equals(displayLabel, that.displayLabel); && Objects.equals(nameCode, that.nameCode) && Objects.equals(displayLabel, that.displayLabel);
} }
@@ -264,17 +264,17 @@ public final class CalendarData implements Serializable {
final String location = null; final String location = null;
final LocalDate startDate = null; final LocalDate startDate = null;
final LocalDate endDate = null; final LocalDate endDate = null;
final Integer duration = Integer.valueOf(0); final Integer duration = 0;
final EnumOptionData type = CalendarEnumerations.calendarType(CalendarType.COLLECTION); final EnumOptionData type = CalendarEnumerations.calendarType(CalendarType.COLLECTION);
final boolean repeating = false; final boolean repeating = false;
final String recurrence = null; final String recurrence = null;
final EnumOptionData frequency = CalendarEnumerations.calendarFrequencyType(CalendarFrequencyType.DAILY); final EnumOptionData frequency = CalendarEnumerations.calendarFrequencyType(CalendarFrequencyType.DAILY);
final Integer interval = Integer.valueOf(1); final Integer interval = 1;
final EnumOptionData repeatsOnDay = CalendarEnumerations.calendarWeekDaysType(CalendarWeekDaysType.MO); final EnumOptionData repeatsOnDay = CalendarEnumerations.calendarWeekDaysType(CalendarWeekDaysType.MO);
final EnumOptionData repeatsOnNthDayOfMonth = CalendarEnumerations.calendarFrequencyNthDayType(NthDayType.ONE); final EnumOptionData repeatsOnNthDayOfMonth = CalendarEnumerations.calendarFrequencyNthDayType(NthDayType.ONE);
final EnumOptionData remindBy = CalendarEnumerations.calendarRemindBy(CalendarRemindBy.EMAIL); final EnumOptionData remindBy = CalendarEnumerations.calendarRemindBy(CalendarRemindBy.EMAIL);
final Integer firstReminder = Integer.valueOf(0); final Integer firstReminder = 0;
final Integer secondReminder = Integer.valueOf(0); final Integer secondReminder = 0;
final String humanReadable = null; final String humanReadable = null;
final Collection<LocalDate> recurringDates = null; final Collection<LocalDate> recurringDates = null;
final Collection<LocalDate> nextTenRecurringDates = null; final Collection<LocalDate> nextTenRecurringDates = null;
@@ -516,13 +516,12 @@ public final class CalendarData implements Serializable {
return false; return false;
} }
CalendarData that = (CalendarData) o; CalendarData that = (CalendarData) o;
return Objects.equals(repeating, that.repeating) && Objects.equals(id, that.id) return (repeating == that.repeating) && Objects.equals(id, that.id) && Objects.equals(calendarInstanceId, that.calendarInstanceId)
&& Objects.equals(calendarInstanceId, that.calendarInstanceId) && Objects.equals(entityId, that.entityId) && Objects.equals(entityId, that.entityId) && Objects.equals(entityType, that.entityType)
&& Objects.equals(entityType, that.entityType) && Objects.equals(title, that.title) && Objects.equals(title, that.title) && Objects.equals(description, that.description)
&& Objects.equals(description, that.description) && Objects.equals(location, that.location) && Objects.equals(location, that.location) && Objects.equals(startDate, that.startDate)
&& Objects.equals(startDate, that.startDate) && Objects.equals(endDate, that.endDate) && Objects.equals(endDate, that.endDate) && Objects.equals(meetingTime, that.meetingTime)
&& Objects.equals(meetingTime, that.meetingTime) && Objects.equals(duration, that.duration) && Objects.equals(duration, that.duration) && Objects.equals(type, that.type) && Objects.equals(recurrence, that.recurrence)
&& Objects.equals(type, that.type) && Objects.equals(recurrence, that.recurrence)
&& Objects.equals(frequency, that.frequency) && Objects.equals(interval, that.interval) && Objects.equals(frequency, that.frequency) && Objects.equals(interval, that.interval)
&& Objects.equals(repeatsOnDay, that.repeatsOnDay) && Objects.equals(repeatsOnNthDayOfMonth, that.repeatsOnNthDayOfMonth) && Objects.equals(repeatsOnDay, that.repeatsOnDay) && Objects.equals(repeatsOnNthDayOfMonth, that.repeatsOnNthDayOfMonth)
&& Objects.equals(remindBy, that.remindBy) && Objects.equals(firstReminder, that.firstReminder) && Objects.equals(remindBy, that.remindBy) && Objects.equals(firstReminder, that.firstReminder)
@@ -38,7 +38,7 @@ import org.apache.fineract.portfolio.calendar.data.CalendarData;
public final class CenterData implements Serializable { public final class CenterData implements Serializable {
private final Long id; private final Long id;
private String accountNo; private final String accountNo;
private final String name; private final String name;
private final String externalId; private final String externalId;
private final Long officeId; private final Long officeId;
@@ -276,7 +276,7 @@ public final class CenterData implements Serializable {
return false; return false;
} }
CenterData that = (CenterData) o; CenterData that = (CenterData) o;
return Objects.equals(active, that.active) && Objects.equals(id, that.id) && Objects.equals(accountNo, that.accountNo) return (active == that.active) && Objects.equals(id, that.id) && Objects.equals(accountNo, that.accountNo)
&& Objects.equals(name, that.name) && Objects.equals(externalId, that.externalId) && Objects.equals(officeId, that.officeId) && Objects.equals(name, that.name) && Objects.equals(externalId, that.externalId) && Objects.equals(officeId, that.officeId)
&& Objects.equals(officeName, that.officeName) && Objects.equals(staffId, that.staffId) && Objects.equals(officeName, that.officeName) && Objects.equals(staffId, that.staffId)
&& Objects.equals(staffName, that.staffName) && Objects.equals(hierarchy, that.hierarchy) && Objects.equals(staffName, that.staffName) && Objects.equals(hierarchy, that.hierarchy)
@@ -721,10 +721,9 @@ public class SavingsAccountCharge extends AbstractPersistableCustom {
return false; return false;
} }
SavingsAccountCharge that = (SavingsAccountCharge) o; SavingsAccountCharge that = (SavingsAccountCharge) o;
return Objects.equals(penaltyCharge, that.penaltyCharge) && Objects.equals(paid, that.paid) && Objects.equals(waived, that.waived) return (penaltyCharge == that.penaltyCharge) && (paid == that.paid) && (waived == that.waived) && (status == that.status)
&& Objects.equals(status, that.status) && Objects.equals(savingsAccount, that.savingsAccount) && Objects.equals(savingsAccount, that.savingsAccount) && Objects.equals(charge, that.charge)
&& Objects.equals(charge, that.charge) && Objects.equals(chargeTime, that.chargeTime) && Objects.equals(chargeTime, that.chargeTime) && dueDate.compareTo(that.dueDate) == 0
&& dueDate.compareTo(that.dueDate) == 0
? Boolean.TRUE ? Boolean.TRUE
: Boolean.FALSE && Objects.equals(feeOnMonth, that.feeOnMonth) && Objects.equals(feeOnDay, that.feeOnDay) : Boolean.FALSE && Objects.equals(feeOnMonth, that.feeOnMonth) && Objects.equals(feeOnDay, that.feeOnDay)
&& Objects.equals(feeInterval, that.feeInterval) && Objects.equals(feeInterval, that.feeInterval)
@@ -800,7 +799,7 @@ public class SavingsAccountCharge extends AbstractPersistableCustom {
private LocalDate setDayOfMonth(LocalDate nextDueLocalDate) { private LocalDate setDayOfMonth(LocalDate nextDueLocalDate) {
int maxDayOfMonth = nextDueLocalDate.lengthOfMonth(); int maxDayOfMonth = nextDueLocalDate.lengthOfMonth();
int newDayOfMonth = (this.feeOnDay.intValue() < maxDayOfMonth) ? this.feeOnDay.intValue() : maxDayOfMonth; int newDayOfMonth = (this.feeOnDay.intValue() < maxDayOfMonth) ? this.feeOnDay : maxDayOfMonth;
nextDueLocalDate = nextDueLocalDate.withDayOfMonth(newDayOfMonth); nextDueLocalDate = nextDueLocalDate.withDayOfMonth(newDayOfMonth);
return nextDueLocalDate; return nextDueLocalDate;
} }
@@ -885,6 +884,6 @@ public class SavingsAccountCharge extends AbstractPersistableCustom {
* *
*/ */
public boolean canOverriteSavingAccountRules() { public boolean canOverriteSavingAccountRules() {
return !(this.isSavingsActivation() || this.isWithdrawalFee()); return (!this.isSavingsActivation() && !this.isWithdrawalFee());
} }
} }