Assignment assignment= (Assignment) reference.getParent();
Assignment assignment= (Assignment) parent;
	private void removeVariableReferences(ASTRewrite rewrite, SimpleName reference) {		int nameParentType= reference.getParent().getNodeType();		if (nameParentType == ASTNode.ASSIGNMENT) {			Assignment assignment= (Assignment) reference.getParent();			Expression rightHand= assignment.getRightHandSide();						ASTNode parent= assignment.getParent();			if (parent.getNodeType() == ASTNode.EXPRESSION_STATEMENT && rightHand.getNodeType() != ASTNode.ASSIGNMENT) {				removeVariableWithInitializer(rewrite, rightHand, parent);			}	else {				rewrite.replace(assignment, rewrite.createCopyTarget(rightHand), null);			}		} else if (nameParentType == ASTNode.SINGLE_VARIABLE_DECLARATION) {			rewrite.remove(reference.getParent(), null);		} else if (nameParentType == ASTNode.VARIABLE_DECLARATION_FRAGMENT) {			VariableDeclarationFragment frag= (VariableDeclarationFragment) reference.getParent();			ASTNode varDecl= frag.getParent();			List fragments;			if (varDecl instanceof VariableDeclarationExpression) {				fragments= ((VariableDeclarationExpression) varDecl).fragments();			} else if (varDecl instanceof FieldDeclaration) {				fragments= ((FieldDeclaration) varDecl).fragments();			} else {					fragments= ((VariableDeclarationStatement) varDecl).fragments();			}			if (fragments.size() == 1) {				rewrite.remove(varDecl, null);			} else {				rewrite.remove(frag, null); // don't try to preserve			}		}	}