Skip to content

Commit 36fe591

Browse files
committed
added break to not look above the class declaration
1 parent ff4c6ad commit 36fe591

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/main/java/org/openrewrite/staticanalysis/FallThroughVisitor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ private boolean isFinalTrue(Expression condition) {
296296
} else if (value instanceof J.ClassDeclaration) {
297297
List<Statement> statements = ((J.ClassDeclaration) value).getBody().getStatements();
298298
declaration = finalVariableDeclaration(statements, id);
299+
break;
299300
}
300301
cursor = cursor.getParentTreeCursor();
301302
if (cursor.isRoot()) {

0 commit comments

Comments
 (0)