/** * Evaluate the expression. This always throws the exception registered when the expression * was first parsed. */ public Item evaluateItem(XPathContext context) throws XPathException { if (exception != null) { // copy the exception for thread-safety, because we want to add context information XPathException err = new XPathException(exception); err.setLocation(exception.getLocator()); err.maybeSetLocation(getLocation()); err.setErrorCodeQName(exception.getErrorCodeQName()); err.setXPathContext(exception.getXPathContext()); err.maybeSetContext(context); err.setIsTypeError(exception.isTypeError()); err.setIsStaticError(exception.isStaticError()); err.setIsGlobalError(exception.isGlobalError()); throw err; } else { XPathException err = new XPathException(message); err.setLocation(getLocation()); err.setErrorCode(errorCode); err.setXPathContext(context); err.setIsTypeError(isTypeError); throw err; } }
/** * Evaluate the expression. This always throws the exception registered when the expression * was first parsed. */ public Item evaluateItem(XPathContext context) throws XPathException { if (exception != null) { // copy the exception for thread-safety, because we want to add context information XPathException err = new XPathException(exception); err.setLocation(exception.getLocator()); err.maybeSetLocation(getLocation()); err.setErrorCodeQName(exception.getErrorCodeQName()); err.setXPathContext(exception.getXPathContext()); err.maybeSetContext(context); err.setIsTypeError(exception.isTypeError()); err.setIsStaticError(exception.isStaticError()); err.setIsGlobalError(exception.isGlobalError()); throw err; } else { XPathException err = new XPathException(message); err.setLocation(getLocation()); err.setErrorCode(errorCode); err.setXPathContext(context); err.setIsTypeError(isTypeError); throw err; } }