FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Remove incorrect @Nullable from GraphQLSchema.getCodeRegistry() by andimarek · Pull Request #4247 · graphql-java/graphql-java · GitHub

Remove incorrect @Nullable from GraphQLSchema.getCodeRegistry() - #4247

Merged
andimarek merged 1 commit into
masterfrom
schema-codregistry-nullable
Feb 15, 2026
Merged

Remove incorrect @Nullable from GraphQLSchema.getCodeRegistry()#4247
andimarek merged 1 commit into
masterfrom
schema-codregistry-nullable

Conversation

Copy link
Copy Markdown
Member

Summary

  • Remove @Nullable annotation from GraphQLSchema.codeRegistry field and getCodeRegistry() return type
  • Fix first-pass constructor to use builder.codeRegistry instead of discarding it and setting the field to null

Why

The field was annotated @Nullable and the first-pass constructor (private GraphQLSchema(Builder)) set this.codeRegistry = null — despite asserting builder.codeRegistry was non-null on the line above. All three constructors require a non-null codeRegistry, and no fully-constructed schema ever exposes a null value.

The @Nullable annotation was misleading and caused downstream code to add unnecessary null checks (e.g. schema.getCodeRegistry() != null guards in validation).

Test plan

  • Full test suite passes

🤖 Generated with Claude Code

The codeRegistry field was annotated @nullable and the first-pass
constructor set it to null, even though it asserted the builder value
was non-null. All three constructors require a non-null codeRegistry,
and no fully-constructed schema ever has a null codeRegistry.

Fix the first-pass constructor to use the builder's codeRegistry
instead of discarding it, and remove @nullable from the field and
getter.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
andimarek merged commit bd87652 into master Feb 15, 2026
7 checks passed
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL