From da161c2168a48b7aed83a86f64238eff54eae583 Mon Sep 17 00:00:00 2001 From: Ben Manes Date: Sun, 11 Aug 2024 10:16:46 -0700 Subject: [PATCH] upgrade errorprone static analyzer --- .../caffeine/cache/testing/CacheValidationListener.java | 2 +- gradle/libs.versions.toml | 4 ++-- .../src/main/kotlin/quality/errorprone.caffeine.gradle.kts | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/caffeine/src/test/java/com/github/benmanes/caffeine/cache/testing/CacheValidationListener.java b/caffeine/src/test/java/com/github/benmanes/caffeine/cache/testing/CacheValidationListener.java index 99e8eae9ba..7aa951d9c1 100644 --- a/caffeine/src/test/java/com/github/benmanes/caffeine/cache/testing/CacheValidationListener.java +++ b/caffeine/src/test/java/com/github/benmanes/caffeine/cache/testing/CacheValidationListener.java @@ -143,7 +143,7 @@ public void afterInvocation(IInvokedMethod method, ITestResult testResult) { private void validate(ITestResult testResult) { CacheContext context = Arrays.stream(testResult.getParameters()) .filter(CacheContext.class::isInstance) - .findFirst().map(param -> (CacheContext) param) + .findFirst().map(CacheContext.class::cast) .orElse(null); if (context != null) { awaitExecutor(context); diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 52bd479d1f..cc098c07b5 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -22,9 +22,9 @@ coveralls = "2.12.2" dependency-check = "10.0.3" eclipse-collections = "12.0.0.M3" ehcache3 = "3.10.8" -errorprone = "2.29.2" +errorprone = "2.30.0" errorprone-plugin = "4.0.1" -errorprone-support = "0.17.0" +errorprone-support = "0.18.0" expiring-map = "0.5.11" fast-filter = "1.0.2" fastutil = "8.5.14" diff --git a/gradle/plugins/src/main/kotlin/quality/errorprone.caffeine.gradle.kts b/gradle/plugins/src/main/kotlin/quality/errorprone.caffeine.gradle.kts index c10088283b..225ca865b3 100644 --- a/gradle/plugins/src/main/kotlin/quality/errorprone.caffeine.gradle.kts +++ b/gradle/plugins/src/main/kotlin/quality/errorprone.caffeine.gradle.kts @@ -88,6 +88,7 @@ fun disabledChecks() = listOf( ) fun enabledChecks() = listOf( "AssertFalse", + "AutoValueBoxedValues", "BanClassLoader", "BuilderReturnThis", "CatchingUnchecked", @@ -97,6 +98,7 @@ fun enabledChecks() = listOf( "ComparisonContractViolated", "CannotMockFinalClass", "CannotMockFinalMethod", + "DefaultLocale", "DepAnn", "EmptyIf", "EqualsBrokenForNull", @@ -142,6 +144,7 @@ fun enabledChecks() = listOf( "YodaCondition", ) fun disabledRules() = listOf( + "AssertJBigDecimalRules", "ImmutableListRules\\\$ImmutableListBuilder", "ImmutableListRules\\\$ImmutableListOf\\d*", "ImmutableMapRules\\\$ImmutableMapBuilder",