Description
Describe the bug
Hi Folks,
The 3060a30 commit added JSpecify's @NonNull
annotation on the load
method key
argument but missed adding it on some methods that call the annotated ones, e.g.
public CompletableFuture<V> load(K key) {
return load(key, null);
}
As a result, IntelliJ IDE doesn't provide any hinting on passing a nullable argument to the dataLoader.load(key)
method.
Additional context: Some applications got caught by surprise since they picked up OSS Spring Boot 3.5 via automated dependency updates, which upgraded spring-graphql
and, as a result, java-dataloader
. Thanks to adding JSpecify nullity annotations, these old bugs are getting surfaced, but, unfortunately, this happens at runtime, and the tooling (e.g. IntelliJ IDE) doesn't help much. In one case, the key was derived from a several chained calls pulling data from the DgsDataFetchingEnvironment
.
Overall, org.dataloader.DataLoader
only has one method that takes key
annotated as @NonNull
. While it's self-explanatory that null
should be passed in all others, it would still be great to explicitly annotate all of them to make it easier to identify and catch issues.