if(indexType != Type.ITEM && indexType != Type.IDX_FULLTEXT) { Item key; if(Type.subTypeOf(rightSeq.getItemType(), Type.STRING)) key = new StringValue(getComparisonString(rightSeq)); else key = rightSeq.itemAt(0); if(key instanceof Indexable) {
if(indexType != Type.ITEM) {  Item key = rightSeq.itemAt(0); if(key.getType() != indexType) {
	protected Sequence quickNodeSetCompare(Sequence contextSequence)		throws XPathException {		// if the context sequence hasn't changed we can return a cached result		if(cached != null && cached.isValid(contextSequence)) {//			LOG.debug("Returning cached result for " + pprint());			return cached.getResult();		}		//	evaluate left expression		NodeSet nodes = (NodeSet) getLeft().eval(contextSequence);		// get the type of a possible index		int indexType = nodes.getIndexType();				if(nodes.getLength() < 2)			// fall back to nodeSetCompare if we just have to check a single node			return nodeSetCompare(nodes, contextSequence);				// evaluate right expression		Sequence rightSeq = getRight().eval(contextSequence);		if (rightSeq.getLength() > 1)			// fall back to nodeSetCompare			return nodeSetCompare(nodes, contextSequence);				DocumentSet docs = nodes.getDocumentSet();		NodeSet result = null;	    if(indexType != Type.ITEM && indexType != Type.IDX_FULLTEXT) {	        Item key;	        if(Type.subTypeOf(rightSeq.getItemType(), Type.STRING))	            key = new StringValue(getComparisonString(rightSeq));	        else	            key = rightSeq.itemAt(0);	        if(key instanceof Indexable) {	            if(Type.subTypeOf(indexType, Type.NUMBER) &&	                    Type.subTypeOf(key.getType(), Type.NUMBER))	                key = key.convertTo(indexType);	            if(!Type.subTypeOf(key.getType(), indexType))	                return nodeSetCompare(nodes, contextSequence);//	            LOG.debug("Using value index");	            result = context.getBroker().getValueIndex().find(relation, docs, nodes, (Indexable)key);	        }	    } else if (relation == Constants.EQ				&& indexType == Type.IDX_FULLTEXT) {	        String cmp = getComparisonString(rightSeq);	        if(cmp.length() < NativeTextEngine.MAX_WORD_LENGTH)	            nodes = useFulltextIndex(cmp, nodes, docs);	        // now compare the input node set to the search expression			Collator collator = getCollator(contextSequence);			result =				context.getBroker().getNodesEqualTo(nodes, docs, relation, cmp, collator);		}				// can this result be cached? Don't cache if the result depends on local variables.		boolean canCache = 		    contextSequence instanceof NodeSet &&	        (getRight().getDependencies() & Dependency.LOCAL_VARS) == 0 &&	        (getLeft().getDependencies() & Dependency.LOCAL_VARS) == 0;		if(canCache)			cached = new CachedResult((NodeSet)contextSequence, result);		return result;	}