diff --git a/nullaway/src/main/java/com/uber/nullaway/handlers/AssertionHandler.java b/nullaway/src/main/java/com/uber/nullaway/handlers/AssertionHandler.java index 72c7629fda..676d3b4743 100644 --- a/nullaway/src/main/java/com/uber/nullaway/handlers/AssertionHandler.java +++ b/nullaway/src/main/java/com/uber/nullaway/handlers/AssertionHandler.java @@ -61,7 +61,7 @@ public NullnessHint onDataflowVisitMethodInvocation( // assertThat(A).isInstanceOf(Foo.class) // A will not be NULL after this statement. if (methodNameUtil.isMethodIsNotNull(callee) || methodNameUtil.isMethodIsInstanceOf(callee)) { - AccessPath ap = getAccessPathForNotNullExpr(node, state, apContext); + AccessPath ap = getAccessPathForNotNullAssertThatExpr(node, state, apContext); if (ap != null) { bothUpdates.set(ap, NONNULL); } @@ -98,7 +98,7 @@ public NullnessHint onDataflowVisitMethodInvocation( * @return the AccessPath for the argument of the assertThat() call, if present, otherwise {@code * null} */ - private @Nullable AccessPath getAccessPathForNotNullExpr( + private @Nullable AccessPath getAccessPathForNotNullAssertThatExpr( MethodInvocationNode node, VisitorState state, AccessPath.AccessPathContext apContext) { Node receiver = node.getTarget().getReceiver(); if (receiver instanceof MethodInvocationNode) { @@ -109,7 +109,7 @@ public NullnessHint onDataflowVisitMethodInvocation( return AccessPath.getAccessPathForNode(arg, state, apContext); } else if (methodNameUtil.isMethodAssertJDescribedAs(receiver_symbol)) { // For calls to as() or describedAs(), we recursively search for the assertThat() call - return getAccessPathForNotNullExpr(receiver_method, state, apContext); + return getAccessPathForNotNullAssertThatExpr(receiver_method, state, apContext); } } return null;