Actions
Bug #2736
closedNullPointerException in Saxon 9.7 evaluating an expression which involves an anonymous type
Status:
Closed
Priority:
Normal
Assignee:
Category:
Schema-Aware processing
Sprint/Milestone:
Start date:
2016-05-06
Due date:
% Done:
100%
Estimated time:
Legacy ID:
Applies to branch:
9.7, trunk
Fix Committed on Branch:
9.7, trunk
Fixed in Maintenance Release:
Platforms:
Description
We have an XPath expression containing an attribute predicate of the form:
[@foo = 3].
The 'foo' attribute in question has a named union type which is the union of xs:integer and an anonymous restriction of xs:string to a single enumerated value.
When the value of the attribute is the allowed string value we expect a type error from evaluation of the predicate but generating the error is giving an NPE from the type's toString in Saxon 9.7 (it was successful in Saxon 9.6).
The stack trace is:
java.lang.NullPointerException
at com.saxonica.ee.schema.UserAtomicType.toString(UserAtomicType.java:490)
at net.sf.saxon.type.Type.displayTypeName(Type.java:256)
at net.sf.saxon.expr.ValueComparison.compare(ValueComparison.java:720)
at net.sf.saxon.expr.GeneralComparison.compare(GeneralComparison.java:820)
at net.sf.saxon.expr.GeneralComparison.evaluateManyToOne(GeneralComparison.java:676)
at net.sf.saxon.expr.GeneralComparison.effectiveBooleanValue(GeneralComparison.java:625)
at net.sf.saxon.expr.FilterIterator$NonNumeric.matches(FilterIterator.java:198)
at net.sf.saxon.expr.FilterIterator.getNextMatchingItem(FilterIterator.java:81)
at net.sf.saxon.expr.FilterIterator.next(FilterIterator.java:64)
at net.sf.saxon.tree.iter.AtomizingIterator.next(AtomizingIterator.java:54)
at net.sf.saxon.tree.iter.AtomizingIterator.next(AtomizingIterator.java:27)
at com.saxonica.ee.optim.GeneralComparisonEE.effectiveBooleanValue(GeneralComparisonEE.java:113)
at net.sf.saxon.sxpath.XPathExpression.effectiveBooleanValue(XPathExpression.java:229)
at net.sf.saxon.s9api.XPathSelector.effectiveBooleanValue(XPathSelector.java:232)
... (non-Saxon code)
Please register to edit this issue
Actions