Skip to content

Commit

Permalink
Don't re-compute the enclosing method (#6876)
Browse files Browse the repository at this point in the history
  • Loading branch information
mernst authored Oct 28, 2024
1 parent a70e1e9 commit 07d8845
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2262,9 +2262,8 @@ public Void visitReturn(ReturnTree tree, Void p) {

AnnotatedTypeMirror ret = null;
if (enclosing.getKind() == Tree.Kind.METHOD) {

MethodTree enclosingMethod = TreePathUtil.enclosingMethod(getCurrentPath());
boolean valid = validateTypeOf(enclosing);
MethodTree enclosingMethod = (MethodTree) enclosing;
boolean valid = validateTypeOf(enclosingMethod);
if (valid) {
ret = atypeFactory.getMethodReturnType(enclosingMethod, tree);
}
Expand Down

0 comments on commit 07d8845

Please sign in to comment.