Adopt jspecify + NullAway null-checking on fdb-java-annotations - #4576
Draft
arnaud-lacurie wants to merge 1 commit into
Draft
Conversation
Adds jspecify + NullAway (via net.ltgt.errorprone), scoped to this module only; com.apple.foundationdb.annotation is marked @NullMarked. This worktree's checkout predates the grpc/jdbc precedent branches, so the jspecify/errorprone/nullaway catalog entries in gradle/libs.versions.toml (assumed already present) had to be added here instead, mirroring exactly what the grpc branch added. Only real @nonnull usages (annotating this module's own method params/ return types) were swapped away, relying on the @NullMarked default. GenerateVisitorAnnotationHelper.java also uses javax.annotation.Nonnull.class as a JavaPoet Class literal to annotate *generated* visitor interfaces consumed by other modules (e.g. fdb-record-layer-core, via @GenerateVisitor); that import/usage is intentionally left untouched, since swapping it would inject an org.jspecify import into generated code compiled in modules that don't have jspecify on their classpath, breaking their builds. No @nullable annotations were needed: nothing in this module's 2 files returns or accepts null. compileJava, compileTestJava (no test sources), test (no test sources), and check (with SpotBugs HTML report) all pass clean with no NullAway suppressions required.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
3rd of a 14-PR stack adopting jspecify + NullAway null-checking, stacked on #4533 (
fdb-relational-jdbc). Same treatment applied tofdb-java-annotations. See inline comments for specific findings.