if (settings != null && settings.createComments) {
if (settings.createComments) {
	public static MethodDeclaration createDelegationStub(ICompilationUnit unit, ASTRewrite rewrite, ImportRewrite imports, AST ast, IBinding[] bindings, CodeGenerationSettings settings) throws CoreException {		Assert.isNotNull(bindings);		Assert.isTrue(bindings.length == 2);		Assert.isTrue(bindings[0] instanceof IVariableBinding);		Assert.isTrue(bindings[1] instanceof IMethodBinding);		IVariableBinding variableBinding= (IVariableBinding) bindings[0];		IMethodBinding methodBinding= (IMethodBinding) bindings[1];		MethodDeclaration decl= ast.newMethodDeclaration();		decl.modifiers().addAll(ASTNodeFactory.newModifiers(ast, methodBinding.getModifiers() & ~Modifier.SYNCHRONIZED & ~Modifier.ABSTRACT & ~Modifier.NATIVE));		decl.setName(ast.newSimpleName(methodBinding.getName()));		decl.setConstructor(false);		ITypeBinding[] typeParams= methodBinding.getTypeParameters();		List typeParameters= decl.typeParameters();		for (int i= 0; i < typeParams.length; i++) {			ITypeBinding curr= typeParams[i];			TypeParameter newTypeParam= ast.newTypeParameter();			newTypeParam.setName(ast.newSimpleName(curr.getName()));			ITypeBinding[] typeBounds= curr.getTypeBounds();			if (typeBounds.length != 1 || !"java.lang.Object".equals(typeBounds[0].getQualifiedName())) {//$NON-NLS-1$				List newTypeBounds= newTypeParam.typeBounds();				for (int k= 0; k < typeBounds.length; k++) {					newTypeBounds.add(imports.addImport(typeBounds[k], ast));				}			}			typeParameters.add(newTypeParam);		}		decl.setReturnType2(imports.addImport(methodBinding.getReturnType(), ast));		List parameters= decl.parameters();		ITypeBinding[] params= methodBinding.getParameterTypes();		String[] paramNames= suggestArgumentNames(unit.getJavaProject(), methodBinding);		for (int i= 0; i < params.length; i++) {			SingleVariableDeclaration varDecl= ast.newSingleVariableDeclaration();			if (params[i].isWildcardType() && !params[i].isUpperbound())				varDecl.setType(imports.addImport(params[i].getBound(), ast));			else {				if (methodBinding.isVarargs() && params[i].isArray() && i == params.length - 1) {					StringBuffer buffer= new StringBuffer(imports.addImport(params[i].getElementType()));					for (int dim= 1; dim < params[i].getDimensions(); dim++)						buffer.append("[]"); //$NON-NLS-1$					varDecl.setType(ASTNodeFactory.newType(ast, buffer.toString()));					varDecl.setVarargs(true);				} else					varDecl.setType(imports.addImport(params[i], ast));			}			varDecl.setName(ast.newSimpleName(paramNames[i]));			parameters.add(varDecl);		}		List thrownExceptions= decl.thrownExceptions();		ITypeBinding[] excTypes= methodBinding.getExceptionTypes();		for (int i= 0; i < excTypes.length; i++) {			String excTypeName= imports.addImport(excTypes[i]);			thrownExceptions.add(ASTNodeFactory.newName(ast, excTypeName));		}		Block body= ast.newBlock();		decl.setBody(body);		String delimiter= StubUtility.getLineDelimiterUsed(unit);		Statement statement= null;		MethodInvocation invocation= ast.newMethodInvocation();		invocation.setName(ast.newSimpleName(methodBinding.getName()));		List arguments= invocation.arguments();		for (int i= 0; i < params.length; i++)			arguments.add(ast.newSimpleName(paramNames[i]));		if (settings.useKeywordThis) {			FieldAccess access= ast.newFieldAccess();			access.setExpression(ast.newThisExpression());			access.setName(ast.newSimpleName(variableBinding.getName()));			invocation.setExpression(access);		} else			invocation.setExpression(ast.newSimpleName(variableBinding.getName()));		if (methodBinding.getReturnType().isPrimitive() && methodBinding.getReturnType().getName().equals("void")) {//$NON-NLS-1$			statement= ast.newExpressionStatement(invocation);		} else {			ReturnStatement returnStatement= ast.newReturnStatement();			returnStatement.setExpression(invocation);			statement= returnStatement;		}		body.statements().add(statement);		ITypeBinding declaringType= variableBinding.getDeclaringClass();		String qualifiedName= declaringType.getQualifiedName();		IPackageBinding packageBinding= declaringType.getPackage();		if (packageBinding != null) {			if (packageBinding.getName().length() > 0 && qualifiedName.startsWith(packageBinding.getName()))				qualifiedName= qualifiedName.substring(packageBinding.getName().length());		}		if (settings != null && settings.createComments) {			String string= CodeGeneration.getMethodComment(unit, qualifiedName, decl, methodBinding, delimiter);			if (string != null) {				Javadoc javadoc= (Javadoc) rewrite.createStringPlaceholder(string, ASTNode.JAVADOC);				decl.setJavadoc(javadoc);			}		}		return decl;	}