}
Declaration[] decls = varDecSearcher.getDeclarations();
boolean mergeWithGlobalScope = false;
for (int i = 0; i < decls.length; ++i) {
Declaration decl = decls[i];
// TODO check ArrayCreation and its element type
if (decl instanceof ArrayDeclaration) {
ArrayDeclaration arrayDeclaration = (ArrayDeclaration) decl;
subGoals.add(new ArrayDeclarationGoal(context,
arrayDeclaration));
} else if (decl.getNode() instanceof GlobalStatement) {
mergeWithGlobalScope = true;
} else {
ASTNode declNode = decl.getNode();
if (declNode instanceof ForEachStatement) {
subGoals.add(new ForeachStatementGoal(context,
((ForEachStatement) declNode)
.getExpression()));
} else {