for (Iterator stmts = body.getUnits().snapshotIterator(); stmts
.hasNext();) {
Stmt stmt = (Stmt) stmts.next();
if (stmt instanceof MonitorStmt) {
MonitorStmt monitorStmt = (MonitorStmt) stmt;
Local lock = (Local) monitorStmt.getOp();
if (lock == thisLocal) {
Local classLocal = SynchronizerManager.v()
.addStmtsToFetchClassBefore(body, stmt);
monitorStmt.setOp(classLocal);
}
}
}
// remove the this identity statement.