Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: address highly critical errorprone issues
> Task :compileDebugJavaWithJavac • 1 src/com/github/iusmac/sevensim/scheduler/SubscriptionScheduleEntity.java:104: error: [EqualsHashCode] Classes that override equals should also override hashCode. public boolean equals(final Object o) { ^ (see https://errorprone.info/bugpattern/EqualsHashCode) • 2 src/com/github/iusmac/sevensim/scheduler/DaysOfWeek.java:71: error: [GuardedBy] Invalid @GuardedBy expression: static member guarded by instance private static Locale sDefaultLocaleCache; ^ (see https://errorprone.info/bugpattern/GuardedBy) • 3 src/com/github/iusmac/sevensim/scheduler/DaysOfWeek.java:73: error: [GuardedBy] Invalid @GuardedBy expression: static member guarded by instance private static String[] sDaysOfWeekNarrowStrings; ^ (see https://errorprone.info/bugpattern/GuardedBy) • 4 src/com/github/iusmac/sevensim/scheduler/DaysOfWeek.java:269: error: [GuardedBy] This access should be guarded by 'DaysOfWeek'; instead found: 'this' if (sDaysOfWeekNarrowStrings == null || !loc.equals(sDefaultLocaleCache)) { ^ (see https://errorprone.info/bugpattern/GuardedBy) • 5 src/com/github/iusmac/sevensim/scheduler/DaysOfWeek.java:269: error: [GuardedBy] This access should be guarded by 'DaysOfWeek'; instead found: 'this' if (sDaysOfWeekNarrowStrings == null || !loc.equals(sDefaultLocaleCache)) { ^ (see https://errorprone.info/bugpattern/GuardedBy) • 6 src/com/github/iusmac/sevensim/scheduler/DaysOfWeek.java:270: error: [GuardedBy] This access should be guarded by 'DaysOfWeek'; instead found: 'this' sDaysOfWeekNarrowStrings = DateFormatSymbols.getInstance(loc) ^ (see https://errorprone.info/bugpattern/GuardedBy) • 7 src/com/github/iusmac/sevensim/scheduler/DaysOfWeek.java:272: error: [GuardedBy] This access should be guarded by 'DaysOfWeek'; instead found: 'this' sDefaultLocaleCache = loc; ^ (see https://errorprone.info/bugpattern/GuardedBy) • 8 src/com/github/iusmac/sevensim/scheduler/DaysOfWeek.java:274: error: [GuardedBy] This access should be guarded by 'DaysOfWeek'; instead found: 'this' return sDaysOfWeekNarrowStrings[dayOfWeek]; ^ (see https://errorprone.info/bugpattern/GuardedBy) • 9 src/com/github/iusmac/sevensim/telephony/Subscription.java:143: error: [BoxedPrimitiveEquality] Comparison using reference equality instead of value equality. Reference equality of boxed primitive types is usually not useful, as they are value objects, and it is bug-prone, as instances are cached for some values but not others. && mKeepDisabledAcrossBoots == subToCompare.mKeepDisabledAcrossBoots; ^ (see https://errorprone.info/bugpattern/BoxedPrimitiveEquality) Did you mean '&& Objects.equals(mKeepDisabledAcrossBoots, subToCompare.mKeepDisabledAcrossBoots);' or '&& mKeepDisabledAcrossBoots.equals(subToCompare.mKeepDisabledAcrossBoots);'? • 10 src/com/github/iusmac/sevensim/telephony/TelephonyController.java:369: error: [GuardedBy] This access should be guarded by 'TelephonyController.this', which is not currently held final Subscription sub = BundleCompat.getParcelable(mRequestMetadata, KEY_SUBSCRIPTION, ^ (see https://errorprone.info/bugpattern/GuardedBy) • 11 src/com/github/iusmac/sevensim/telephony/PinStorage.java:55: error: [GuardedBy] Invalid @GuardedBy expression: static member guarded by instance private static long sLastKeystoreAuthTimestamp; ^ (see https://errorprone.info/bugpattern/GuardedBy) • 12 src/com/github/iusmac/sevensim/telephony/PinStorage.java:381: error: [GuardedBy] This access should be guarded by 'PinStorage'; instead found: 'this' final long authTimeout = sLastKeystoreAuthTimestamp == 0 ? 0 : sLastKeystoreAuthTimestamp + ^ (see https://errorprone.info/bugpattern/GuardedBy) • 13 src/com/github/iusmac/sevensim/telephony/PinStorage.java:381: error: [GuardedBy] This access should be guarded by 'PinStorage'; instead found: 'this' final long authTimeout = sLastKeystoreAuthTimestamp == 0 ? 0 : sLastKeystoreAuthTimestamp + ^ (see https://errorprone.info/bugpattern/GuardedBy) • 14 src/com/github/iusmac/sevensim/telephony/PinStorage.java:394: error: [GuardedBy] This access should be guarded by 'PinStorage'; instead found: 'PinStorage.class' sLastKeystoreAuthTimestamp = timestamp; ^ (see https://errorprone.info/bugpattern/GuardedBy) • 15 src/com/github/iusmac/sevensim/ui/components/ItemAdapter.java:456: error: [EqualsHashCode] Classes that override equals should also override hashCode. public boolean equals(final Object o) { ^ (see https://errorprone.info/bugpattern/EqualsHashCode) Signed-off-by: iusmac <[email protected]>
- Loading branch information