Skip to content

Commit 2fe9ddb

Browse files
committed
Fix DataFetcherResult.newResult() type parameter bounds for Kotlin JSpecify compatibility
Add `@Nullable` bound to the type parameter of the no-arg `newResult()` factory method, matching the bounds already present on the class and Builder. Without this, Kotlin 2.1+ under `@NullMarked` infers `T : Any`, preventing nullable type arguments like `DataFetcherResult.newResult<String?>()`. Fixes #4364 https://claude.ai/code/session_01UHAYBmjcgRoFPZbxWFYeF3
1 parent e0ca061 commit 2fe9ddb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/main/java/graphql/execution/DataFetcherResult.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public String toString() {
171171
*
172172
* @return a new builder
173173
*/
174-
public static <T> Builder<T> newResult() {
174+
public static <T extends @Nullable Object> Builder<T> newResult() {
175175
return new Builder<>();
176176
}
177177

0 commit comments

Comments
 (0)