You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Undetected @Nullable annotation in a method reference #1128
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
changed the title [-]Undetected `@Nullable` annotation in a default method reference[/-][+]Undetected `@Nullable` annotation in a method reference[/+]on Jan 13, 2025
I can reproduce this one. It's not about default methods, but the fact that the call is to a generic method and we don't handle the instances of @Nullable T correctly. This one will be a bit trickier to fix and will take a bit; probably best to just suppress for now.
[WARNING] /path/to/Test.java:[15,17] [NullAway] referenced method returns @Nullable, but functional interface method java.util.function.Function.apply(T) returns @NonNull
(see http://t.uber.com/nullaway )
[WARNING] /path/to/Test.java:[15,40] [NullAway] referenced method returns @Nullable, but functional interface method java.util.function.Function.apply(T) returns @NonNull
(see http://t.uber.com/nullaway )
[WARNING] /path/to/Test.java:[15,66] [NullAway] referenced method returns @Nullable, but functional interface method java.util.function.Function.apply(T) returns @NonNull
(see http://t.uber.com/nullaway )
This happens only in JSpecify mode. The three flagged methods have had @ParametricNullness for four years, but the issue only reproduces with Guava 33.4.1-jre and above, likely because in that version @ElementTypesAreNonnullByDefault was replaced with @NullMarked.
Activity
[-]Undetected `@Nullable` annotation in a default method reference[/-][+]Undetected `@Nullable` annotation in a method reference[/+]msridhar commentedon Jan 31, 2025
I can reproduce this one. It's not about default methods, but the fact that the call is to a generic method and we don't handle the instances of
@Nullable Tcorrectly. This one will be a bit trickier to fix and will take a bit; probably best to just suppress for now.Stephan202 commentedon Mar 22, 2025
As suggested here by @msridhar, I'm sharing a test case that may be relevant to this issue:
This triggers the following warnings:
This happens only in JSpecify mode. The three flagged methods have had
@ParametricNullnessfor four years, but the issue only reproduces with Guava 33.4.1-jre and above, likely because in that version@ElementTypesAreNonnullByDefaultwas replaced with@NullMarked.sdeleuze commentedon Oct 1, 2025
@msridhar Should probably be tagged with the
jspecifylabel.JSpecify: Improve handling of method references (#1430)