public MethodReturnTypeEvaluator(IGoal goal) {
super(goal);
}
public IGoal[] init() {
MethodElementReturnTypeGoal goal = (MethodElementReturnTypeGoal) getGoal();
String methodName = goal.getMethodName();
final List<IGoal> subGoals = new LinkedList<IGoal>();
MethodsAndTypes mat = getMethodsAndTypes();
for (int i = 0; i < mat.methods.length; i++) {
IMethod method = mat.methods[i];
ISourceModule sourceModule = method.getSourceModule();
ModuleDeclaration module = SourceParserUtil
.getModuleDeclaration(sourceModule);
MethodDeclaration decl = null;
try {
decl = PHPModelUtils.getNodeByMethod(module, method);
} catch (ModelException e) {
if (DLTKCore.DEBUG) {
e.printStackTrace();
}
}
// final boolean found[] = new boolean[1];
if (decl != null) {
final IContext innerContext = ASTUtils.findContext(
sourceModule, module, decl);
if (innerContext instanceof MethodContext) {
MethodContext mc = (MethodContext) innerContext;
mc.setCurrentType(mat.types[i]);
}
if (goal.getContext() instanceof IModelCacheContext
&& innerContext instanceof IModelCacheContext) {
((IModelCacheContext) innerContext)
.setCache(((IModelCacheContext) goal.getContext())
.getCache());
}
ASTVisitor visitor = new ASTVisitor() {
public boolean visitGeneral(ASTNode node) throws Exception {