Skip to content

Commit a59df24

Browse files
authored
Use passed-in TreePath in one more place when available (#1329)
Minor follow-up for #1328. When available, using `path` is more correct than `state.getPath()`.
1 parent 6c78a05 commit a59df24

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,8 +1599,8 @@ public Nullness getGenericParameterNullnessAtInvocation(
15991599
if (methodSelect instanceof IdentifierTree) {
16001600
// implicit this parameter, or a super call. in either case, use the type of the enclosing
16011601
// class.
1602-
ClassTree enclosingClassTree =
1603-
ASTHelpers.findEnclosingNode(state.getPath(), ClassTree.class);
1602+
TreePath basePath = (path != null) ? path : state.getPath();
1603+
ClassTree enclosingClassTree = ASTHelpers.findEnclosingNode(basePath, ClassTree.class);
16041604
if (enclosingClassTree != null) {
16051605
enclosingType = castToNonNull(ASTHelpers.getType(enclosingClassTree));
16061606
}

0 commit comments

Comments
 (0)