Undetected @Nullable
annotation in a method reference #1128
Open
Description
With the JSpecify mode enabled, I have this interface:
public interface WebFluxConfigurer {
default @Nullable WebSocketService getWebSocketService() {
return null;
}
}
And:
public @Nullable WebSocketService getWebSocketService() {
return createSingleBean(WebFluxConfigurer::getWebSocketService, WebSocketService.class);
}
private <T> @Nullable T createSingleBean(Function<WebFluxConfigurer, @Nullable T> factory, Class<T> beanType) {
// ...
}
I get the following IMO invalid error:
error: [NullAway] Cannot pass parameter of type Function<WebFluxConfigurer, WebSocketService>, as formal parameter has type Function<WebFluxConfigurer, @org.jspecify.annotations.Nullable T>, which has mismatched type parameter nullability
Metadata
Assignees
Labels
No labels