Skip to content

Commit

Permalink
rewrite condition for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
msridhar committed Aug 12, 2023
1 parent 7ba7009 commit 054aab2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions nullaway/src/main/java/com/uber/nullaway/NullAway.java
Original file line number Diff line number Diff line change
Expand Up @@ -984,10 +984,12 @@ private boolean overriddenMethodReturnsNonNull(
}
// In JSpecify mode, for generic methods, we additionally need to check the return nullness
// using the type parameters from the type enclosing the overriding method
return !config.isJSpecifyMode()
|| GenericsChecks.getGenericMethodReturnTypeNullness(
overriddenMethod, overridingMethodType, state, config)
.equals(Nullness.NONNULL);
if (config.isJSpecifyMode()) {
return GenericsChecks.getGenericMethodReturnTypeNullness(
overriddenMethod, overridingMethodType, state, config)
.equals(Nullness.NONNULL);
}
return true;
}

@Override
Expand Down

0 comments on commit 054aab2

Please sign in to comment.