} else
if(decl.getParent() instanceof MethodDeclaration){
// the case of a parameter -- add the actuals and recurse
//showMessage(decl.toString() + " is a parameter of " + parent.getClass());
MethodDeclaration methodDecl = (MethodDeclaration) decl.getParent();
IMethod method = new MethodFinder((IFile) resource).convertMethodDecl2IMethod(methodDecl);
if(method == null) {
JavaPlugin.logErrorMessage("Internal error: No method found for " + methodDecl);
return;
}
HistoryDefinitionLocation paramDL = new HistoryDefinitionLocation(
decl.toString(),
resource,
cu.getLineNumber(decl.getStartPosition()),
decl, parent, HistoryDefinitionLocation.FORMAL_PARAMETER);
if(!registerExpansion(paramDL)) {
// recursion detected here
return;
}
Expression onlyCall = (Expression) (stack.isEmpty() ? null : stack.getLast());
log("Looking for calls from " + onlyCall);
Collection/*<ExpressionUnitPair>*/ c = CallerFinder.getActualsForFormal(method, name, onlyCall, monitor, null);
if(c.isEmpty()){
logError(
"No suitable actual arguments for formal argument " +
name + " of " + method.getElementName() + " at " +
resource.getName() + " found");
} else
for (Iterator iter = c.iterator(); iter.hasNext();) {
Utils.ExpressionUnitPair eup = (Utils.ExpressionUnitPair) iter.next();
Expression e = eup.getExpression();