Skip to content

Commit

Permalink
fix warnings flagged by ArgumentSelectionDefectChecker
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-manes committed Nov 7, 2024
1 parent 8b835c9 commit 8186ff8
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
18 changes: 11 additions & 7 deletions caffeine/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,18 @@ dependencies {
val compileCodeGenJava by tasks.existing(JavaCompile::class) {
classpath = sourceSets["main"].runtimeClasspath + sourceSets["main"].output
dependsOn(tasks.compileJava)
options.isDebug = false

options.errorprone {
disable("FieldMissingNullable")
disable("MissingOverride")
disable("MemberName")
disable("Varifier")
nullaway.disable()
options.apply {
compilerArgs.remove("-parameters")
isDebug = false

errorprone {
disable("FieldMissingNullable")
disable("MissingOverride")
disable("MemberName")
disable("Varifier")
nullaway.disable()
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private void reformat() throws IOException {
.filter(path -> path.endsWith(".java"))
.collect(toImmutableList());
ToolProvider.findFirst("google-java-format").ifPresent(formatter -> {
int result = formatter.run(System.err, System.out,
int result = formatter.run(System.out, System.err,
Stream.concat(Stream.of("-i"), files.stream()).toArray(String[]::new));
checkState(result == 0, "Java formatting failed with %s exit code", result);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private void reformat() throws IOException {
.filter(path -> path.endsWith(".java"))
.collect(toImmutableList());
ToolProvider.findFirst("google-java-format").ifPresent(formatter -> {
int result = formatter.run(System.err, System.out,
int result = formatter.run(System.out, System.err,
Stream.concat(Stream.of("-i"), files.stream()).toArray(String[]::new));
checkState(result == 0, "Java formatting failed with %s exit code", result);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ default void handleCompletion(K key, CompletableFuture<? extends V> valueFuture,
long startTime, boolean recordMiss) {
var completed = new AtomicBoolean();
valueFuture.whenComplete((value, error) -> {
if (!completed.compareAndSet(false, true)) {
if (!completed.compareAndSet(/* expectedValue= */ false, /* newValue= */ true)) {
// Ignore multiple invocations due to ForkJoinPool retrying on delays
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ tasks.withType<JavaCompile>().configureEach {
}

options.compilerArgs.addAll(listOf("-Xlint:all", "-Xlint:-auxiliaryclass", "-Xlint:-classfile",
"-Xlint:-exports", "-Xlint:-processing", "-Xlint:-removal", "-Xlint:-requires-automatic"))
"-Xlint:-exports", "-Xlint:-processing", "-Xlint:-removal", "-Xlint:-requires-automatic",
"-parameters"))
if (javaVersion.canCompileOrRun(21)) {
options.compilerArgs.add("-proc:full")
}
Expand Down

0 comments on commit 8186ff8

Please sign in to comment.