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
When enabling NullAway's jspecify mode, the use of arrays needs to be annotated for stricter nullability. For example,
.../LocalAsyncCache.java:818: warning: [NullAway] Writing @Nullable expression into array with @NonNull contents. oldValue[0] = Async.getIfReady(oldValueFuture);
To satisfy this check without a suppression requires the change
-var oldValue = (V[]) new Object[1];+@Nullable V[] oldValue = (V[]) new Object[1];
ErrorProne then emits a warning,
.../LocalAsyncCache.java:800: warning: [Varifier] Consider using `var` here to avoid boilerplate. @Nullable V[] oldValue = (V[]) new Object[1]; ^ (see https://errorprone.info/bugpattern/Varifier) Did you mean '@Nullable var oldValue = (V[]) new Object[1];'?
However that suggestion is invalid by JLS and instead the warning must be suppressed.
.../LocalAsyncCache.java:800: error: annotation interface not applicable to this kind of declaration @Nullable var oldValue = (V[]) new Object[1]; ^ 1 error
Note that the annotation is not carried forward in the inferred type for NullAway to use if instead trying to resolve both checks
varoldValue = (@NullableV[]) newObject[1];
The text was updated successfully, but these errors were encountered:
When enabling NullAway's jspecify mode, the use of arrays needs to be annotated for stricter nullability. For example,
To satisfy this check without a suppression requires the change
ErrorProne then emits a warning,
However that suggestion is invalid by JLS and instead the warning must be suppressed.
Note that the annotation is not carried forward in the inferred type for NullAway to use if instead trying to resolve both checks
The text was updated successfully, but these errors were encountered: