Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ public void execute(Configuration _files) {
@Override
public void execute(ErrorProneOptions options) {
options.option("NullAway:AnnotatedPackages", String.join(",", DEFAULT_ANNOTATED_PACKAGES));
// 2025-12-04: Disabled to avoid excessive logs
// See https://github.com/uber/NullAway/issues/1363
options.disable("RequireExplicitNullMarking");
// Relax some checks for test code
if (options.getCompilingTestOnlyCode().get()) {
// NullAway has some poor interactions with mockito and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,28 @@ void compileJava_succeeds_when_null_away_finds_no_errors(GradleInvoker gradle, R

gradle.withArgs("compileJava").buildsSuccessfully();
}

@Test
void requireExplicitNullMarking_is_disabled_by_default_to_avoid_excessive_logs(
GradleInvoker gradle, RootProject rootProject) {
standardBuildFile(rootProject);

// This file would trigger RequireExplicitNullMarking if it wasn't disabled
// because it lacks @NullMarked or @NullUnmarked annotations
// See https://github.com/uber/NullAway/issues/1363
rootProject.mainSourceSet().java().writeClass("""
package com.palantir.test;
public class Test {
void test() {
String s = "hello";
System.out.println(s);
}
}
""");

InvocationResult result = gradle.withArgs("compileJava").buildsSuccessfully();

// The check should be explicitly disabled, so we shouldn't see warnings
assertThat(result).output().doesNotContain("[RequireExplicitNullMarking]");
}
}