Add JSpecify annotations to normalized, schema, and util classes (Wave 5) by dondonz · Pull Request #4303 · graphql-java/graphql-java · GitHub
Skip to content

Add JSpecify annotations to normalized, schema, and util classes (Wave 5)#4303

Draft
dondonz wants to merge 216 commits into
masterfrom
claude/jspecify-wave5
Draft

Add JSpecify annotations to normalized, schema, and util classes (Wave 5)#4303
dondonz wants to merge 216 commits into
masterfrom
claude/jspecify-wave5

Conversation

@dondonz

@dondonz dondonz commented Mar 7, 2026

Copy link
Copy Markdown
Member

This is the final wave of JSpecify annotations

Summary

  • Adds @NullMarked annotations to 12 remaining classes not covered by other open PRs
  • Fixes all NullAway compilation errors from the new annotations
  • Removes 13 entries from the JSpecify exemption list

Classes annotated

graphql.normalized

  • NormalizedDeferredExecution, NormalizedDocument, NormalizedDocumentFactory
  • NormalizedField, NormalizedOperation, NormalizedOperationToAstCompiler

graphql.schema

  • SchemaGraph, OneOfInputObjectRules

graphql.util

  • CyclicSchemaAnalyzer, QueryGenerator, QueryGeneratorOptions, QueryGeneratorResult

Test plan

  • ./gradlew compileJava passes (NullAway clean)
  • Full CI passes

🤖 Generated with Claude Code

claude and others added 30 commits February 28, 2026 23:21
dondonz and others added 9 commits March 8, 2026 07:27
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Mar 7, 2026

Copy link
Copy Markdown
Contributor

dondonz and others added 4 commits March 8, 2026 08:38
TreeParallelTransformer only set List.class as a context var but never
NodeAdapter.class. After JSpecify annotations wrapped getVar() calls with
assertNotNull(), this caused test failures in TreeParallelTransformerTest
and AstTransformerTest.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are still some classes left in this diff - these are in other currently open PRs

dondonz and others added 11 commits April 5, 2026 06:51
# Conflicts:
#	.claude/commands/jspecify-annotate.md
#	src/main/java/graphql/execution/ExecutionContext.java
#	src/main/java/graphql/introspection/GoodFaithIntrospection.java
#	src/main/java/graphql/normalized/ExecutableNormalizedOperation.java
#	src/test/groovy/graphql/archunit/JSpecifyAnnotationsCheck.groovy
# Conflicts:
#	src/main/java/graphql/execution/directives/QueryAppliedDirectiveArgument.java
#	src/main/java/graphql/execution/preparsed/PreparsedDocumentEntry.java
#	src/main/java/graphql/util/Anonymizer.java
Removes 31 classes from JSPECIFY_EXEMPTION_LIST in JSpecifyAnnotationsCheck.groovy
that have already been annotated with @NullMarked/@NullUnmarked across the wave 4
work. The "exempted classes should not be annotated" archunit test was failing
because these classes were both exempt and annotated.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
# Conflicts:
#	src/main/java/graphql/language/AstSignature.java
#	src/main/java/graphql/language/VariableDefinition.java
# Conflicts:
#	.claude/commands/jspecify-annotate.md
#	src/main/java/graphql/execution/ExecutionContext.java
#	src/main/java/graphql/execution/SubscriptionExecutionStrategy.java
#	src/main/java/graphql/execution/directives/QueryAppliedDirectiveArgument.java
#	src/main/java/graphql/execution/preparsed/PreparsedDocumentEntry.java
#	src/main/java/graphql/introspection/GoodFaithIntrospection.java
#	src/main/java/graphql/language/VariableDefinition.java
#	src/main/java/graphql/normalized/ExecutableNormalizedOperation.java
#	src/main/java/graphql/util/Anonymizer.java
#	src/test/groovy/graphql/archunit/JSpecifyAnnotationsCheck.groovy
# Conflicts:
#	src/main/java/graphql/introspection/GoodFaithIntrospection.java
#	src/main/java/graphql/language/AstTransformer.java
#	src/main/java/graphql/language/NodeTraverser.java
#	src/main/java/graphql/normalized/ExecutableNormalizedOperation.java
#	src/main/java/graphql/schema/idl/SchemaPrinter.java
#	src/test/groovy/graphql/archunit/JSpecifyAnnotationsCheck.groovy
@dondonz dondonz marked this pull request as ready for review May 24, 2026 00:33
@dondonz dondonz marked this pull request as draft May 24, 2026 06:05
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.

2 participants