if (binding.getKind() != IBinding.VARIABLE) { ASTNode declaration= root.findDeclaringNode(binding);
if (binding.getKind() == IBinding.METHOD) { IMethodBinding decl= ((IMethodBinding) binding).getMethodDeclaration(); ASTNode declaration= root.findDeclaringNode(decl); rewrite= ASTRewrite.create(root.getAST()); rewrite.remove(declaration, null); } else if (binding.getKind() == IBinding.TYPE) { ITypeBinding decl= ((ITypeBinding) binding).getTypeDeclaration(); ASTNode declaration= root.findDeclaringNode(decl);
	protected ASTRewrite getRewrite() {		IBinding binding= fName.resolveBinding();		CompilationUnit root= (CompilationUnit) fName.getRoot();		ASTRewrite rewrite;		if (binding.getKind() != IBinding.VARIABLE) {			ASTNode declaration= root.findDeclaringNode(binding);			rewrite= ASTRewrite.create(root.getAST());			rewrite.remove(declaration, null);		} else { // variable			// needs full AST			CompilationUnit completeRoot= JavaPlugin.getDefault().getASTProvider().getAST(getCompilationUnit(), ASTProvider.WAIT_YES, null);			SimpleName nameNode= (SimpleName) NodeFinder.perform(completeRoot, fName.getStartPosition(), fName.getLength());			rewrite= ASTRewrite.create(completeRoot.getAST()); 			SimpleName[] references= LinkedNodeFinder.findByBinding(completeRoot, nameNode.resolveBinding());			for (int i= 0; i < references.length; i++) {				removeVariableReferences(rewrite, references[i]);			}						ASTNode declaringNode= completeRoot.findDeclaringNode(nameNode.resolveBinding());			if (declaringNode instanceof SingleVariableDeclaration) {				removeParamTag(rewrite, (SingleVariableDeclaration) declaringNode);			}		}		return rewrite;	}