Repository navigation
Complete JSpecify annotation coverage for public APIs and SPIs - #4301
Merged
Merged
Conversation
Contributor
Test ReportTest Results
Code Coverage (Java 25)
Changed Class Coverage (4 classes)
|
dondonz
commented
Mar 7, 2026
| public void compute() { | ||
| currentContext.setPhase(TraverserContext.Phase.ENTER); | ||
| currentContext.setVar(List.class, myZippers); | ||
| currentContext.setVar(NodeAdapter.class, nodeAdapter); |
Member
Author
There was a problem hiding this comment.
Another interesting bugfix surfaced by JSpecify
Member
Author
|
Note this is only failing the coverage test for now |
dondonz
marked this pull request as ready for review
May 24, 2026 00:31
dondonz
commented
May 24, 2026
dondonz
commented
May 24, 2026
| return objectTypeDefinition.build(); | ||
| } | ||
|
|
||
| @SuppressWarnings("NullAway") |
Member
Author
There was a problem hiding this comment.
Should remove these NullAway suppress warnings
andimarek
force-pushed
the
claude/jspecify-wave4
branch
from
August 6, 2026 22:09
e03fe2b to
c08d855
Compare
bbakerman
approved these changes
Nov 13, 2026
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.
This PR completes JSpecify coverage for public API, public SPI, and experimental API classes. It annotates the existing behavior and restrictions, including nullable resolver results, collection elements, future results, optional metadata, traversal state, and deleted transformation roots. All 42 remaining exemption entries across 41 source files are migrated; the ArchUnit exemption lists are removed. Builders remain
@NullUnmarkedwhere appropriate.Production changes beyond annotations are limited to supporting accurate nullness checking:
assertNotNullat required-value usesAssertExceptions instead of incidental NPEs.MutableRef<T>reducer accumulatorObject[]representation loses that relationship and produces four NullAway errors. Traversal order and callback behavior are unchanged.List<T>input andList<@NonNull T>output preserve the caller's element type while filtering nullable cancellation entries. The existing fast path still returns the input list when it contains no nulls; the cast narrows nullness without widening a mutable subtype list.CoercedVariablesandExtensionsBuilderbecause Guava's non-null generic bounds cannot represent nullable value types. The originalDataFetchingEnvironmentImplsupplier is retained. The empty extensions map remains unmodifiable in content, but permits no-opclear()/absent-keyremove()calls that Guava rejected.AbstractNode.deepCopyandSchemaPrinter.shouldPrintAsAstexpress the existing non-null-copy and guarded-definition relationships, avoiding 18 runtime assertions. Other helper contracts likewise preserve their implementations.NodeZippercontinues to accept a nullable adapter for operations that do not rebuild parents, including the existing parallel transformation path. The adapter is required only where parent reconstruction uses it.ValueTraverserretains its existing Guava copying restriction. Parser error handling, comparator equality, directive printing, and deferred-execution state retain their existing behavior. No new fallback policies, runtime bug fixes, algorithm refactors, or unrelated cleanups are included.The annotation contracts are verified by Java consumer fixtures compiled with NullAway, Kotlin nullable-resolver fixtures, reflection checks for nested type-use annotations, and ArchUnit. Positive fixtures include root zippers without adapters and preservation of execution-filter element subtypes; negative fixtures reject six unsafe API usages and six unsafe SPI usages. Three focused runtime features verify existing reducer, root-deletion, and predicate behavior affected by the annotation adaptations. The checker does not model every JDK collection/callback generic use, so reflection checks supplement compilation. Stricter published contracts can surface downstream nullness diagnostics.
The separately requested nullness-tooling upgrades are retained:
NullAway remains an error with
OnlyNullMarkedandJSpecifyMode; no nullness suppressions or dependencies are added. The existing merge of master at32e924f0c7d8f27f93ae923a0cfb18af9aaa8173is retained..claudefiles, unrelated local Unicode tests, CI configuration, and the coverage baseline are excluded.Validation:
./gradlew test testng check javadoc jacocoTestReportpassed for50cf905bb: 6,440 Spock cases (seven expected skips) and 190 reactive-streams TCK cases (49 expected skips), with zero failures/errors. The local total includes 33 unrelated, uncommitted Unicode cases.DataFetchingEnvironmentImplmatch the base executable code after stripping nullness annotations and imports.50cf905bbpassed Java 17/21/25 tests, concurrency tests, build checks, Javadoc, and the per-class coverage gate. File-validation checks also passed.