GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Backport 26.1: Mark InstrumentationState callback params as @Nullable by andimarek · Pull Request #4457 · graphql-java/graphql-java

Conversation

@andimarek

@andimarek andimarek commented Aug 23, 2026

Copy link
Copy Markdown
Member

Backport of #4435 to the 26.x maintenance branch.

Summary

  • mark instrumentation callback InstrumentationState parameters as @Nullable, matching the existing optional-state runtime contract
  • propagate nullable child states through ChainedInstrumentation and NoContextChainedInstrumentation
  • cover the Kotlin-facing signatures with compile fixtures exercised by Spock
  • retain the existing 26.x field-fetching implementation while applying the nullability fix

This backports the fix for #4433. Kotlin implementations overriding these callbacks must declare the state parameter as InstrumentationState?.

Verification

  • ./gradlew test --tests graphql.execution.instrumentation.InstrumentationStateNullabilityTest --tests graphql.execution.instrumentation.InstrumentationTest --tests graphql.execution.instrumentation.ChainedInstrumentationStateTest --tests graphql.execution.instrumentation.NoContextChainedInstrumentationTest --tests graphql.execution.instrumentation.TracingInstrumentationTest
  • 28 focused tests passed
  • Kotlin compilation and NullAway/ErrorProne checks passed as part of the build

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
arimu1 and others added 2 commits August 23, 2026 20:12
@arimu1 @andimarek
fix: mark InstrumentationState callback params as @nullable
ac661d0
createState()/createStateAsync() may return null, and the default
SimplePerformantInstrumentation.createState() does. After @NullMarked
on instrumentation classes (#4272), unannotated state parameters were
treated as non-null in Kotlin, causing NPEs for stateless subclasses.

Annotate callback state parameters as @nullable to match the optional-
state runtime contract. ChainedInstrumentation asserts non-null when
casting its own materialized ChainedInstrumentationState.

Fixes #4433
@andimarek
Propagate nullable chained instrumentation state
9be7527
@github-actions

github-actions Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Test Report

Test Results

Java Version Total Passed Failed Errors Skipped
Java 11 - - - - -
Java 17 - - - - -
Java 21 - - - - -
Java 25 - - - - -
jcstress - - - - -

Updated: 2026-08-23 10:25:03 UTC

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@andimarek
andimarek merged commit 7a7774d into 26.x Aug 23, 2026
10 checks passed

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@andimarek @arimu1
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.