Project

Profile

Help

Bug #3072

closed

NullPointerException if EXPAND_ATTRIBUTE_DEFAULTS off and selector on attribute

Added by Petr K almost 8 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Schema-Aware processing
Sprint/Milestone:
-
Start date:
2016-12-14
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.7
Fix Committed on Branch:
9.7, trunk
Fixed in Maintenance Release:
Platforms:

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

AbstractType.zip (2.56 KB) AbstractType.zip Petr K, 2016-12-14 13:23
Actions #1

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.

Actions #2

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.

Actions #3

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
Actions #4

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

Actions #5

Updated by O'Neil Delpratt over 7 years ago

  • Fix Committed on Branch trunk added
  • Fix Committed on Branch deleted (9.8)
Actions #6

Updated by O'Neil Delpratt over 7 years ago

  • Applies to branch deleted (9.8)

Please register to edit this issue

Also available in: Atom PDF