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

Test Report

Test Results

Java Version Total Passed Failed Errors Skipped
Java 11 5865 (±0) 5809 (±0) 0 (±0) 0 (±0) 56 (±0)
Java 17 5865 (±0) 5808 (±0) 0 (±0) 0 (±0) 57 (±0)
Java 21 5865 (±0) 5808 (±0) 0 (±0) 0 (±0) 57 (±0)
Java 25 5865 (±0) 5808 (±0) 0 (±0) 0 (±0) 57 (±0)
jcstress 32 (±0) 32 (±0) 0 (±0) 0 (±0) 0 (±0)
Total 23492 (±0) 23265 (±0) 0 (±0) 0 (±0) 227 (±0)

Code Coverage (Java 25)

Metric Covered Missed Coverage vs Master
Lines 29642 3131 90.4% ±0.0%
Branches 8721 1537 85.0% ±0.0%
Methods 7913 1211 86.7% ±0.0%

Changed Class Coverage (9 classes)

Class Line Branch Method
g.i.Introspection ±0.0% +0.8% 🟢 ±0.0%
g.l.AstTransformer -5.0% 🔴 +50.0% 🟢 ±0.0%
g.n.n.NormalizedField ±0.0% -0.1% 🔴 ±0.0%
g.n.n.NormalizedOperationToAstCompiler ±0.0% ±0.0% -5.8% 🔴
g.p.Parser
$1
±0.0% -8.3% 🔴 ±0.0%
g.s.i.SchemaPrinter ±0.0% -0.4% 🔴 ±0.0%
g.s.SchemaTransformer +0.1% 🟢 ±0.0% ±0.0%
g.s.u.SchemaUsageSupport
$1
+0.1% 🟢 -2.4% 🔴 ±0.0%
g.u.q.QueryGenerator ±0.0% ±0.0% -10.7% 🔴
AstTransformer — method details
Method Line Branch
transform 85.7% (-14.3% 🔴) 50.0%
NormalizedField — method details
Method Line Branch
isConditional 79.2% (-2.7% 🔴) 65.4% (-1.3% 🔴)
NormalizedOperationToAstCompiler — method details
Method Line Branch
lambda$compileToDocument$0 new 0.0%
Parser.1 — method details
Method Line Branch
syntaxError 100.0% 66.7% (-8.3% 🔴)
SchemaPrinter — method details
Method Line Branch
printComments 100.0% 88.9% (-4.0% 🔴)
lambda$updateDeprecatedDirective$0 100.0% 66.7% (-8.3% 🔴)
QueryGenerator — method details
Method Line Branch
lambda$generateQuery$4 new 100.0%
lambda$generateQuery$3 new 100.0%
lambda$generateQuery$2 new 100.0%
lambda$generateQuery$1 new 100.0%
lambda$generateQuery$0 new 0.0%
lambda$generateQuery$3 removed removed
lambda$generateQuery$2 removed removed
lambda$generateQuery$1 removed removed
lambda$generateQuery$0 removed removed

Full HTML report: build artifact jacoco-html-report

Updated: 2026-05-24 00:47:46 UTC

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>
"graphql.analysis.QueryReducer",
"graphql.analysis.QueryTransformer",
"graphql.analysis.QueryTraversalOptions",
"graphql.analysis.QueryTraverser",

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