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
staticObjecthandleNullableEnumCaseNullDefaultStatement(@NullableNullableEnumnullableEnum) {
Objectresult;
switch (nullableEnum) {
casenull -> result = newObject();
default -> result = nullableEnum.toString();
};
returnresult;
}
NullAway warns of a possible null dereference for the switch, but it should not, as there is a case null. (We currently don't warn on switch expressions as we don't match them yet due to google/error-prone#4119, but similar logic is required there.)
The text was updated successfully, but these errors were encountered:
Example:
NullAway warns of a possible null dereference for the switch, but it should not, as there is a
case null
. (We currently don't warn on switch expressions as we don't match them yet due to google/error-prone#4119, but similar logic is required there.)The text was updated successfully, but these errors were encountered: