markAsLinked(rewrite, param.getType(), false, argTypeKey); markAsLinked(rewrite, param.getName(), false, argNameKey);
addLinkedPosition(rewrite.track(param.getType()), false, argTypeKey); addLinkedPosition(rewrite.track(param.getName()), false, argNameKey);
	private MethodDeclaration getStub(ASTRewrite rewrite, ASTNode targetTypeDecl) throws CoreException {		AST ast= targetTypeDecl.getAST();		MethodDeclaration decl= ast.newMethodDeclaration();				decl.setConstructor(isConstructor());		decl.setModifiers(evaluateModifiers(targetTypeDecl));		decl.setName(ast.newSimpleName(getMethodName()));				List arguments= fArguments;		List params= decl.parameters();				int nArguments= arguments.size();		ArrayList takenNames= new ArrayList(nArguments);		IVariableBinding[] declaredFields= fSenderBinding.getDeclaredFields();		for (int i= 0; i < declaredFields.length; i++) { // avoid to take parameter names that are equal to field names			takenNames.add(declaredFields[i].getName());		}				for (int i= 0; i < arguments.size(); i++) {			Expression elem= (Expression) arguments.get(i);			SingleVariableDeclaration param= ast.newSingleVariableDeclaration();			// argument type			String argTypeKey= "arg_type_" + i; //$NON-NLS-1$			Type type= evaluateParameterTypes(ast, elem, argTypeKey);			param.setType(type);			// argument name			String argNameKey= "arg_name_" + i; //$NON-NLS-1$			String name= evaluateParameterNames(takenNames, elem, type, argNameKey);			param.setName(ast.newSimpleName(name));			params.add(param);						markAsLinked(rewrite, param.getType(), false, argTypeKey);			markAsLinked(rewrite, param.getName(), false, argNameKey);		}				Block body= null;		String bodyStatement= ""; //$NON-NLS-1$		if (!isConstructor()) {			Type returnType= evaluateMethodType(ast);			if (returnType == null) {				decl.setReturnType(ast.newPrimitiveType(PrimitiveType.VOID));			} else {				decl.setReturnType(returnType);			}			if (!fSenderBinding.isInterface() && returnType != null) {				ReturnStatement returnStatement= ast.newReturnStatement();				returnStatement.setExpression(ASTNodeFactory.newDefaultExpression(ast, returnType, 0));				bodyStatement= ASTNodes.asFormattedString(returnStatement, 0, String.valueOf('\n'));			}		}		if (!fSenderBinding.isInterface()) {			body= ast.newBlock();			String placeHolder= CodeGeneration.getMethodBodyContent(getCompilationUnit(), fSenderBinding.getName(), getMethodName(), isConstructor(), bodyStatement, String.valueOf('\n')); 				if (placeHolder != null) {				ASTNode todoNode= rewrite.createStringPlaceholder(placeHolder, ASTNode.RETURN_STATEMENT);				body.statements().add(todoNode);			}		}		decl.setBody(body);		CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings();		if (settings.createComments && !fSenderBinding.isAnonymous()) {			String string= CodeGeneration.getMethodComment(getCompilationUnit(), fSenderBinding.getName(), decl, null, String.valueOf('\n'));			if (string != null) {				Javadoc javadoc= (Javadoc) rewrite.createStringPlaceholder(string, ASTNode.JAVADOC);				decl.setJavadoc(javadoc);			}		}		return decl;	}