if (contextSequence == null) throw new XPathException(getASTNode(), "Null context sequence for '" + this.toString() + "'");
	public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathException {        if (context.getProfiler().isEnabled()) {            context.getProfiler().start(this);            context.getProfiler().message(this, Profiler.DEPENDENCIES, "DEPENDENCIES", Dependency.getDependenciesName(this.getDependencies()));            if (contextSequence != null)                context.getProfiler().message(this, Profiler.START_SEQUENCES, "CONTEXT SEQUENCE", contextSequence);            if (contextItem != null)                context.getProfiler().message(this, Profiler.START_SEQUENCES, "CONTEXT ITEM", contextItem.toSequence());        }                            Sequence result;                    if (contextItem != null)			contextSequence = contextItem.toSequence();        		if(contextSequence == null)                			result = NodeSet.EMPTY_SET;                //Try to return cached results        else if(cached != null && cached.isValid(contextSequence)) {                         //WARNING : commented since predicates are *also* applied below ! -pb            /*			if (predicates.size() > 0) {                applyPredicate(contextSequence, cached.getResult());            } else {            */                result = cached.getResult();                if (context.getProfiler().isEnabled())                                         context.getProfiler().message(this, Profiler.OPTIMIZATIONS,                             "Using cached results", result);                                            //}           		}           else if (needsComputation()) {     		switch (axis) {    			case Constants.DESCENDANT_AXIS :    			case Constants.DESCENDANT_SELF_AXIS :                    result = getDescendants(context, contextSequence.toNodeSet());    				break;    			case Constants.CHILD_AXIS :                    result = getChildren(context, contextSequence.toNodeSet());    				break;			                case Constants.ANCESTOR_SELF_AXIS :     			case Constants.ANCESTOR_AXIS  :                    result = getAncestors(context, contextSequence.toNodeSet());    				break;                case Constants.PARENT_AXIS :                    result = getParents(context, contextSequence.toNodeSet());                    break;                        			case Constants.SELF_AXIS :    				if (!(contextSequence instanceof VirtualNodeSet) &&     						Type.subTypeOf(contextSequence.getItemType(), Type.ATOMIC))    					result = getSelfAtomic(contextSequence);    				else    					result = getSelf(context, contextSequence.toNodeSet());    				break;    			case Constants.ATTRIBUTE_AXIS :    				    			case Constants.DESCENDANT_ATTRIBUTE_AXIS :                    result = getAttributes(context, contextSequence.toNodeSet());    				break;                case Constants.PRECEDING_AXIS:                    result = getPreceding(context, contextSequence.toNodeSet());                    break;                                    case Constants.FOLLOWING_AXIS:                    result = getFollowing(context, contextSequence.toNodeSet());                    break;                        			case Constants.PRECEDING_SIBLING_AXIS :    			case Constants.FOLLOWING_SIBLING_AXIS :                    result = getSiblings(context, contextSequence.toNodeSet());    				break;    			default :                    throw new IllegalArgumentException("Unsupported axis specified");    		}                       }         else result = NodeSet.EMPTY_SET;                //Caches the result        if(contextSequence instanceof NodeSet) {            //TODO : cache *after* removing duplicates ? -pb            cached = new CachedResult((NodeSet)contextSequence, result);            registerUpdateListener();        }        //Remove duplicate nodes        result.removeDuplicates();         //Apply the predicate        result = applyPredicate(contextSequence, result);                         if (context.getProfiler().isEnabled())             context.getProfiler().end(this, "", result);                return result;	}