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
All, we faced the following NullAway error: [NullAway] unboxing of a @Nullable value in the snippet below. However, as you can see, x can't be null at the point due to the triggered boolean value.
public double execute(Entity entity, int a, int b) {
Long x = entity != null ? 123L : null;
boolean triggered;
if (a > b) {
triggered = x != null;
} else {
triggered = false;
}
double score = 1.0;
if (triggered) {
score = score - Utils.function(x); // <-- ERROR HERE!
}
return score;
}
Now that I'm opening up this issue, I believe this can actually be due to #98 (i.e., lack of support for nullability stored in boolean variables). I'll still open up this issue to record that we faced it in a real-world project.
Thanks, @mauricioaniche! Yes, I believe this is #98 but I'll leave this one open as well since it's a good example to test on for when we try to fix that one.
All, we faced the following NullAway error:
[NullAway] unboxing of a @Nullable value
in the snippet below. However, as you can see,x
can't benull
at the point due to thetriggered
boolean value.Now that I'm opening up this issue, I believe this can actually be due to #98 (i.e., lack of support for nullability stored in boolean variables). I'll still open up this issue to record that we faced it in a real-world project.
Project reproducing it: https://github.com/mauricioaniche/nullaway-bug.
Library versions:
The text was updated successfully, but these errors were encountered: