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
False Positive when using JSpecify Nullable on varargs elements #1088
When using Nullaway 0.12.1 in default mode in combination with JSpecify Nullable on vararg elements, like public static void foo(@org.jspecify.annotations.Nullable String... args), I get the following error when passing a nullable parameter: [NullAway] passing @Nullable parameter (String) null where @NonNull is required, although Nullable elements are explicitly permitted.
If the function is defined in the same class or even the same module of the caller, this works without any error.
The issue only arises when the function is defined outside the caller's module. I suspect this has to do with the differences between the source and bytecode analysis that Nullaway does.
I have the same issue even when using classic "javax.annotation" Nullable. And those I can't place like the JSpecify anotations.
Even when both methods are part of the same class (but there is an interface involved, no idea it this creates the same scenario ans in @lukasgraef example)
Activity
N1k145 commentedon Dec 11, 2024
I have the same issue even when using classic "javax.annotation" Nullable. And those I can't place like the JSpecify anotations.
Even when both methods are part of the same class (but there is an interface involved, no idea it this creates the same scenario ans in @lukasgraef example)
msridhar commentedon Dec 11, 2024
I'll try to look at this soon. @N1k145 for your case an example would be helpful
N1k145 commentedon Dec 12, 2024
@msridhar https://github.com/N1k145/NullAway/tree/issue1088
msridhar commentedon Dec 12, 2024
@N1k145 for clarity I've split out your issue into #1090. Let's discuss there. #1089 should fix the original issue reported here.
Fix reading of JSpecify @nullable annotations from varargs parameter …
msridhar commentedon Dec 13, 2024
NullAway 0.12.2 is released with the fix for this issue. FYI @sdeleuze