Skip to content

Commit c975fc0

Browse files
committed
upgrade error-prone static analyzer
1 parent d8e0a92 commit c975fc0

5 files changed

Lines changed: 11 additions & 8 deletions

File tree

caffeine/src/test/java/com/github/benmanes/caffeine/cache/BoundedLocalCacheTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,8 @@ static void checkStatus(Node<Int, Int> node, Status expected) {
945945

946946
@Test(dataProvider = "caches")
947947
@CacheSpec(compute = Compute.SYNC, implementation = Implementation.Caffeine,
948-
population = Population.EMPTY, maximumSize = Maximum.TEN, weigher = CacheWeigher.DISABLED)
948+
population = Population.EMPTY, keys = ReferenceType.STRONG,
949+
maximumSize = Maximum.TEN, weigher = CacheWeigher.DISABLED)
949950
public void evict_wtinylfu(Cache<Int, Int> cache, CacheContext context) {
950951
// Enforce full initialization of internal structures; clear sketch
951952
asBoundedLocalCache(cache).frequencySketch().ensureCapacity(context.maximumSize());

caffeine/src/test/java/com/github/benmanes/caffeine/cache/issues/HashClashTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@
4242
@Test(dataProviderClass = CacheProvider.class)
4343
public final class HashClashTest {
4444
private static final int STEP = 5;
45-
private static final Long LONG_1 = 1L;
45+
private static final long LONG_1 = 1L;
4646
private static final long ITERS = 200_000;
47-
private static final Long CLASH = (ITERS << 32) ^ ITERS ^ 1;
47+
private static final long CLASH = (ITERS << 32) ^ ITERS ^ 1;
4848

4949
private static final boolean debug = false;
5050

@@ -60,7 +60,7 @@ public void testCache(Cache<Long, Long> cache, CacheContext context) {
6060
printKeys(cache);
6161

6262
// add a hashcode clash for 1
63-
assertThat(CLASH.hashCode()).isEqualTo(LONG_1.hashCode());
63+
assertThat(Long.hashCode(CLASH)).isEqualTo(Long.hashCode(LONG_1));
6464
cache.get(CLASH, identity());
6565
printKeys(cache);
6666

gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dependency-check = "12.1.8"
1919
ecj = "3.43.0"
2020
eclipse-collections = "13.0.0"
2121
ehcache3 = "3.11.1"
22-
errorprone = "2.42.0"
22+
errorprone = "2.43.0"
2323
errorprone-plugin = "4.3.0"
2424
errorprone-support = "0.25.0"
2525
expiring-map = "0.5.11"
@@ -83,7 +83,7 @@ protobuf = "4.33.0"
8383
revapi = "1.8.0"
8484
slf4j = "2.0.17"
8585
slf4j-test = "3.0.3"
86-
sigstore = "2.0.0-rc1"
86+
sigstore = "2.0.0-rc2"
8787
sonarqube = "7.0.0.6105"
8888
spotbugs = "4.9.8"
8989
spotbugs-contrib = "7.6.15"

gradle/plugins/src/main/kotlin/lifecycle/java-library.caffeine.gradle.kts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ tasks.withType<JavaCompile>().configureEach {
4343
}
4444

4545
options.apply {
46-
javaModuleVersion = provider { version as String }
46+
javaModuleVersion = provider {
47+
version.toString().takeIf { it.first().isDigit() } ?: "0.0.0-$version"
48+
}
4749
compilerArgs.addAll(listOf("-Xlint:all", "-parameters",
4850
"-Xmaxerrs", "500", "-Xmaxwarns", "500"))
4951
val failOnWarnings = isCI()

gradle/plugins/src/main/kotlin/quality/errorprone.caffeine.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ tasks.withType<JavaCompile>().configureEach {
8484
}
8585

8686
fun disabledChecks() = listOf(
87-
"AndroidJdkLibsChecker",
8887
"AssignmentExpression",
8988
"AvoidObjectArrays",
9089
"CannotMockMethod",
@@ -95,6 +94,7 @@ fun disabledChecks() = listOf(
9594
"MissingSummary",
9695
"MultipleTopLevelClasses",
9796
"PatternMatchingInstanceof",
97+
"RedundantNullCheck",
9898
"Slf4jLoggerDeclaration",
9999
"StatementSwitchToExpressionSwitch",
100100
"StaticImport",

0 commit comments

Comments
 (0)