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 warning on Objects.requireNonNullElse #1493
In my project I want to use NullAway Gradle plugin with warnOnGenericInferenceFailure feature enabled, but I am getting warnings on Objects.requireNonNullElse whenever I use it as return value of method. For example, this method:
[NullAway] Failed to infer type argument nullability for call Objects.requireNonNullElse(nullableString, defaultValue): Contradictory nullability for T: NONNULL vs. NULLABLE
The only workaround for now is to write something like this:
Thanks for the report @ADsty. This should be fixed when we get the JSpecify JDK models incorporated (#950). I've added a (currently ignored) test case for it in #1496. I'm hoping we can get the new JDK models in soon-ish.
Activity
msridhar commentedon Mar 21, 2026
Thanks for the report @ADsty. This should be fixed when we get the JSpecify JDK models incorporated (#950). I've added a (currently ignored) test case for it in #1496. I'm hoping we can get the new JDK models in soon-ish.
Test requireNonNullElse inference with and without the JSpecify JDK m…