fix: add JSpecify @Nullable annotations to SearchService parameters#109
Closed
adityamparikh wants to merge 1 commit into
Closed
fix: add JSpecify @Nullable annotations to SearchService parameters#109adityamparikh wants to merge 1 commit into
adityamparikh wants to merge 1 commit into
Conversation
…meters Add @nullable annotations from JSpecify to optional parameters in SearchService.search() (query, filterQueries, facetFields, sortClauses, start, rows) and to SearchResponse.maxScore. This correctly expresses the nullability contract for MCP tool parameters that AI clients may omit. Also add @NullMarked package-info.java for the search subpackage so NullAway enforces null safety, and fix test code to use null-safe patterns (assertNotNull before dereference) for Map.get() results. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: adityamparikh <aditya.m.parikh@gmail.com>
c1d43d6 to
d7bca27
Compare
3 tasks
Contributor
Author
|
Closing as superseded by #133, which rolls @NullMarked out to every sub-package (not just |
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.
Summary
@Nullableannotations to optional parameters inSearchService.search()(query,filterQueries,facetFields,sortClauses,start,rows)@NullabletoSearchResponse.maxScore(nullable when scoring is disabled)@NullMarkedpackage-info.javafor thesearchsubpackage so NullAway enforces null safetyassertNotNullbeforeMap.get()results)@NullMarkedpackage declarationTest plan
./gradlew buildpasses (including NullAway checks)./gradlew nativeTest -Pnativepasses (119/119 tests)🤖 Generated with Claude Code