GrStatementOwner block = (GrStatementOwner) realContainer;
varDecl = (GrVariableDeclaration) block.addStatementBefore(varDecl, (GrStatement) anchorElement);
}
} else {
<BUG>GrStatement tempStatement = ((GrStatement) anchorElement);
boolean inThenIfBranch = realContainer instanceof GrIfStatement &&</BUG>
anchorElement.equals(((GrIfStatement) realContainer).getThenBranch());
String refId = varDecl.getVariables()[0].getName();
GrBlockStatement newBody;
if (tempStatement.equals(selectedExpr)) {

GrStatementOwner block = (GrStatementOwner) realContainer;
varDecl = (GrVariableDeclaration) block.addStatementBefore(varDecl, (GrStatement) anchorElement);
}
} else {
GrStatement tempStatement = anchorElement;
boolean inThenIfBranch = realContainer instanceof GrIfStatement &&
anchorElement.equals(((GrIfStatement) realContainer).getThenBranch());
String refId = varDecl.getVariables()[0].getName();
GrBlockStatement newBody;
if (tempStatement.equals(selectedExpr)) {
