diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/DirectReturn.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/DirectReturn.java index 1f7dec3416c..98799bec80b 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/DirectReturn.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/DirectReturn.java @@ -69,8 +69,8 @@ public DirectReturn() {} @Override public Description matchBlock(BlockTree tree, VisitorState state) { List statements = tree.getStatements(); - ClassTree enclosingNode = ASTHelpers.findEnclosingNode(state.getPath(), ClassTree.class); - if (statements.size() < 2 || HAS_LOMBOK_DATA.matches(enclosingNode, state)) { + ClassTree enclosingClass = ASTHelpers.findEnclosingNode(state.getPath(), ClassTree.class); + if (statements.size() < 2 || HAS_LOMBOK_DATA.matches(enclosingClass, state)) { return Description.NO_MATCH; }