Skip to content

Adopt jspecify + NullAway null-checking on fdb-java-annotations - #4576

Draft
arnaud-lacurie wants to merge 1 commit into
apple/arnaud-lacurie/jspecify-nullaway/jdbcfrom
apple/arnaud-lacurie/jspecify-nullaway/java-annotations
Draft

Adopt jspecify + NullAway null-checking on fdb-java-annotations#4576
arnaud-lacurie wants to merge 1 commit into
apple/arnaud-lacurie/jspecify-nullaway/jdbcfrom
apple/arnaud-lacurie/jspecify-nullaway/java-annotations

Conversation

@arnaud-lacurie

@arnaud-lacurie arnaud-lacurie commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

3rd of a 14-PR stack adopting jspecify + NullAway null-checking, stacked on #4533 (fdb-relational-jdbc). Same treatment applied to fdb-java-annotations. See inline comments for specific findings.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build improvement Improvement to the build system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant