Bug #3072
closedNullPointerException if EXPAND_ATTRIBUTE_DEFAULTS off and selector on attribute
100%
Description
NLP for the attached test case:
Exception in thread "main" java.lang.NullPointerException
at net.sf.saxon.expr.CompareToIntegerConstant.effectiveBooleanValue(CompareToIntegerConstant.java:183)
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.expr.Expression.evaluateItem(Expression.java:772)
at net.sf.saxon.expr.SimpleStepExpression.iterate(SimpleStepExpression.java:110)
at net.sf.saxon.expr.Atomizer.iterate(Atomizer.java:307)
at net.sf.saxon.query.XQueryExpression.iterator(XQueryExpression.java:323)
at com.saxonica.xqj.SaxonXQPreparedExpression.executeQuery(SaxonXQPreparedExpression.java:93)
at com.saxonica.xqj.SaxonXQExpression.executeQuery(SaxonXQExpression.java:96)
at Run.main(Run.java:25)
Files
Updated by Michael Kay almost 8 years ago
- Category set to Schema-Aware processing
- Status changed from New to In Progress
- Assignee set to Michael Kay
It looks like the schema-aware type checking has assumed a cardinality of exactly-one for the attribute reference, which fails to take into account that the attribute can be absent if EXPAND_ATTRIBUTE_DEFAULTS is set to false.
Updated by Michael Kay almost 8 years ago
- Status changed from In Progress to Resolved
- Applies to branch 9.8 added
- Fix Committed on Branch 9.7, 9.8 added
Since the option to expand (or not expand) default and fixed attribute values can be set for an individual instance document (via the ParseOptions object), I think the safest solution is to change the cardinality inference that such attributes will always be present.
Patch committed on the 9.7 and 9.8 branches.
Note: the problem is present in all known previous releases.
Updated by Michael Kay almost 8 years ago
- Subject changed from NLP if EXPAND_ATTRIBUTE_DEFAULTS off and selector on attribute to NullPointerException if EXPAND_ATTRIBUTE_DEFAULTS off and selector on attribute
Updated by O'Neil Delpratt almost 8 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in Maintenance Release 9.7.0.15 added
Bug fix applied to the Saxon 9.7.0.15 maintenance release
Updated by O'Neil Delpratt over 7 years ago
- Fix Committed on Branch trunk added
- Fix Committed on Branch deleted (
9.8)
Please register to edit this issue