Skip to content

Commit

Permalink
move null check
Browse files Browse the repository at this point in the history
  • Loading branch information
msridhar committed Oct 13, 2023
1 parent 77c7c4f commit 7c891d3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions nullaway/src/main/java/com/uber/nullaway/GenericsChecks.java
Original file line number Diff line number Diff line change
Expand Up @@ -879,11 +879,6 @@ public static Nullness getGenericMethodParameterNullness(
VisitorState state,
Config config) {
Type enclosingType = getTypeForSymbol(enclosingSymbol, state);
if (enclosingType == null) {
// we have no additional information from generics, so return NONNULL (presence of a @Nullable
// annotation should have been handled by the caller)
return Nullness.NONNULL;
}
return getGenericMethodParameterNullness(parameterIndex, method, enclosingType, state, config);
}

Expand All @@ -904,9 +899,14 @@ public static Nullness getGenericMethodParameterNullness(
public static Nullness getGenericMethodParameterNullness(
int parameterIndex,
Symbol.MethodSymbol method,
Type enclosingType,
@Nullable Type enclosingType,
VisitorState state,
Config config) {
if (enclosingType == null) {
// we have no additional information from generics, so return NONNULL (presence of a @Nullable
// annotation should have been handled by the caller)
return Nullness.NONNULL;
}
Type methodType = state.getTypes().memberType(enclosingType, method);
Type paramType = methodType.getParameterTypes().get(parameterIndex);
return getTypeNullness(paramType, config);
Expand Down

0 comments on commit 7c891d3

Please sign in to comment.