Statement stmt = flowPeek();
switch(stmt.typeOf()) {
case Statement.ST_BLOCK:
case Statement.ST_IMPLICIT_BLOCK:
{
TryStatement trystmt;
BlockStatement block = (BlockStatement)stmt;
stmt = block.getTail();
if (stmt != null && stmt.typeOf() == Statement.ST_TRY) {
trystmt = (TryStatement)stmt;
if (trystmt.hasFinally()) {
trystmt = block.replaceWithTry();
}
} else {
trystmt = block.replaceWithTry();
}
return trystmt;
}
default:
{
TryStatement trystmt = new TryStatement(stmt, stmt.getLocation());
stmt.setChildStatement(trystmt);
return trystmt;
}
}
}