Skip to content

Commit dbe17e4

Browse files
dondonzclaude
andcommitted
Fix missing @nullable on chainedCtx return type and BiFunction type parameter
chainedCtx can return null in the single-instrumentation case since it passes the mapper result through directly, and the underlying Instrumentation begin* methods are @nullable (null is the opt-out signal). The BiFunction return type also needs @nullable so that mapper.apply() is correctly typed as nullable, allowing the nullability to flow from the underlying instrumentation through the lambda to chainedCtx's return. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 61e6320 commit dbe17e4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/java/graphql/execution/instrumentation/ChainedInstrumentation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public List<Instrumentation> getInstrumentations() {
6767
return instrumentations;
6868
}
6969

70-
private <T> InstrumentationContext<T> chainedCtx(InstrumentationState state, BiFunction<Instrumentation, InstrumentationState, InstrumentationContext<T>> mapper) {
70+
private <T> @Nullable InstrumentationContext<T> chainedCtx(InstrumentationState state, BiFunction<Instrumentation, InstrumentationState, @Nullable InstrumentationContext<T>> mapper) {
7171
// if we have zero or 1 instrumentations (and 1 is the most common), then we can avoid an object allocation
7272
// of the ChainedInstrumentationContext since it won't be needed
7373
if (instrumentations.isEmpty()) {

0 commit comments

Comments
 (0)