Skip to content

Commit 3fc0a37

Browse files
committed
Upgrade to Nullability Gradle plugin 0.0.3
1 parent 0d79135 commit 3fc0a37

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id "io.spring.nullability" version "0.0.2" apply false
2+
id "io.spring.nullability" version "0.0.3" apply false
33
}
44

55
description = "Spring for GraphQL"

spring-graphql/src/main/java/org/springframework/graphql/execution/DefaultBatchLoaderRegistry.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,10 @@ public void registerDataLoaders(DataLoaderRegistry registry, GraphQLContext cont
111111
}
112112
}
113113

114-
@SuppressWarnings("NullAway") // DataLoaderRegistry#getDataLoader should be @Nullable
115114
private void registerDataLoader(DataLoader<?, ?> dataLoader, DataLoaderRegistry registry) {
115+
if (dataLoader.getName() == null) {
116+
throw new IllegalStateException("DataLoader '" + dataLoader.getClass() + "' should be named");
117+
}
116118
if (registry.getDataLoader(dataLoader.getName()) != null) {
117119
throw new IllegalStateException("More than one DataLoader named '" + dataLoader.getName() + "'");
118120
}

0 commit comments

Comments
 (0)