Project

Profile

Help

Bug #2736

NullPointerException in Saxon 9.7 evaluating an expression which involves an anonymous type

Added by Stuart Barker over 4 years ago. Updated about 3 years ago.

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:

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)

History

#1 Updated by Stuart Barker over 4 years ago

We are using 9.7.0.4

#2 Updated by Michael Kay over 4 years ago

  • Category set to Schema-Aware processing
  • Assignee set to Michael Kay
  • Priority changed from High to Normal

Thanks for reporting it. It looks as if the NPE occurs while we are formatting the error message to report the type error.

#3 Updated by Michael Kay over 4 years ago

  • Status changed from New to Resolved
  • Applies to branch 9.8 added
  • Fix Committed on Branch 9.7, 9.8 added

Reproduced the failure with new QT3 test value-comparison-14. Patch committed on the 9.7 and 9.8 branches.

#4 Updated by O'Neil Delpratt over 4 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 9.7.0.5 added

Bug fix applied in the Saxon 9.7.0.5 maintenance release.

#5 Updated by O'Neil Delpratt over 4 years ago

  • Sprint/Milestone set to 9.7.0.5

#6 Updated by O'Neil Delpratt about 3 years ago

  • Applies to branch trunk added
  • Applies to branch deleted (9.8)

#7 Updated by O'Neil Delpratt about 3 years ago

  • Fix Committed on Branch trunk added
  • Fix Committed on Branch deleted (9.8)

Please register to edit this issue

Also available in: Atom PDF