if ( context.isProfilingEnabled() && context.getProfiler().verbosity() > 1) { context.getProfiler().end(this, "Returning cached result. Length: " + cached.getResult().getLength()); }
	public Sequence eval(		Sequence contextSequence,		Item contextItem)		throws XPathException {		if (contextItem != null)			contextSequence = contextItem.toSequence();		if(contextSequence == null || contextSequence.getLength() == 0)			return NodeSet.EMPTY_SET;		if(cached != null &&			cached.isValid(contextSequence)) {//			LOG.debug("returning cached result for " + ExpressionDumper.dump(this));			return 			(predicates.size() == 0)			? cached.getResult() :				applyPredicate(contextSequence, cached.getResult());		}		Sequence temp;				if ( context.isProfilingEnabled() && context.getProfiler().verbosity() > 1) {			context.getProfiler().start(this);		}		switch (axis) {			case Constants.DESCENDANT_AXIS :			case Constants.DESCENDANT_SELF_AXIS :				temp =					getDescendants(						context,						contextSequence.toNodeSet());				break;			case Constants.CHILD_AXIS :				temp =					getChildren(context, contextSequence.toNodeSet());				break;			case Constants.ANCESTOR_AXIS :			case Constants.ANCESTOR_SELF_AXIS :				temp =					getAncestors(context, contextSequence.toNodeSet());				break;			case Constants.SELF_AXIS :				temp = getSelf(context, contextSequence.toNodeSet());				break;			case Constants.PARENT_AXIS :				temp =					getParents(context, contextSequence.toNodeSet());				break;			case Constants.ATTRIBUTE_AXIS :				// combines /descendant-or-self::node()/attribute:*			case Constants.DESCENDANT_ATTRIBUTE_AXIS :				temp =					getAttributes(						context,						contextSequence.toNodeSet());				break;			case Constants.PRECEDING_SIBLING_AXIS :			case Constants.FOLLOWING_SIBLING_AXIS :				temp =					getSiblings(context, contextSequence.toNodeSet());				break;			case Constants.FOLLOWING_AXIS:				temp = getFollowing(context, contextSequence.toNodeSet());                break;			case Constants.PRECEDING_AXIS:                temp = getPreceding(context, contextSequence.toNodeSet());                break;			default :				throw new IllegalArgumentException("Unsupported axis specified");		}				if(contextSequence instanceof NodeSet) {			cached = new CachedResult((NodeSet)contextSequence, temp);		}		// remove duplicate nodes		temp.removeDuplicates();		temp =			(predicates.size() == 0)				? temp				: applyPredicate(contextSequence, temp);        if ( context.isProfilingEnabled() && context.getProfiler().verbosity() > 1) {            context.getProfiler().end(this, " LocationStep" +                     ", " + Constants.AXISSPECIFIERS[axis] +                    "::" + test + ", found: " + temp.getLength()            );        }        return temp;	}