Java: Make loop classes extend LoopStmt and use getBody instead of getStmt.

This commit is contained in:
Anders Schack-Mulligen
2026-02-04 14:30:00 +01:00
parent 6f40ac15b4
commit 4fcf3fbff8
5 changed files with 73 additions and 59 deletions

View File

@@ -37,12 +37,12 @@ class EmptyLoop extends Stmt {
exists(ForStmt stmt | stmt = this |
not exists(stmt.getAnInit()) and
not exists(stmt.getAnUpdate()) and
stmt.getStmt() instanceof Empty
stmt.getBody() instanceof Empty
)
or
this.(WhileStmt).getStmt() instanceof Empty
this.(WhileStmt).getBody() instanceof Empty
or
this.(DoStmt).getStmt() instanceof Empty
this.(DoStmt).getBody() instanceof Empty
}
Expr getCondition() {