String string= getImportRewrite().addImport(fCastType); return ASTNodeFactory.newType(ast, string);
if (fCastType instanceof ITypeBinding) { return getImportRewrite().addImport((ITypeBinding) fCastType, ast); } else { String string= getImportRewrite().addImport((String) fCastType); return ASTNodeFactory.newType(ast, string); }
	private Type getNewCastTypeNode(ASTRewrite rewrite) throws CoreException {		AST ast= rewrite.getAST();		if (fCastType != null) {			String string= getImportRewrite().addImport(fCastType);			return ASTNodeFactory.newType(ast, string);		}				ASTNode node= fNodeToCast;		ASTNode parent= node.getParent();		if (parent instanceof CastExpression) {			node= parent;			parent= parent.getParent();		}		while (parent instanceof ParenthesizedExpression) {			node= parent;			parent= parent.getParent();		}		if (parent instanceof MethodInvocation) {			MethodInvocation invocation= (MethodInvocation) node.getParent();			if (invocation.getExpression() == node) {				ITypeBinding[] bindings= ASTResolving.getQualifierGuess(node.getRoot(), invocation.getName().getIdentifier(), invocation.arguments());				if (bindings.length > 0) {					ITypeBinding first= getCastFavorite(bindings, fNodeToCast.resolveTypeBinding());					Type newTypeNode= getImportRewrite().addImport(first, ast);					addLinkedPosition(rewrite.track(newTypeNode), true, "casttype"); //$NON-NLS-1$					for (int i= 0; i < bindings.length; i++) {						addLinkedPositionProposal("casttype", bindings[i]); //$NON-NLS-1$					}					return newTypeNode;				}			}		}		Type newCastType= ast.newSimpleType(ast.newSimpleName("Object")); //$NON-NLS-1$		addLinkedPosition(rewrite.track(newCastType), true, "casttype"); //$NON-NLS-1$		return newCastType;	}