Project

Profile

Help

Bug #1753

EXSLT extension function NPE when passed empty sequence

Added by Michael Kay over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
EXSLT extensions
Sprint/Milestone:
-
Start date:
2013-04-30
Due date:
% Done:

100%

Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Found in version:
9.5
Fixed in version:
9.5.0.2

Description

In 9.5 an EXSLT extension function such as Date.difference() crashes with a NullPointerException when one of the arguments is supplied as an empty sequence.

The is a consequence of the fact that the conversion rules for calling reflexive extension functions have finally been aligned with the XPath 2.0 calling rules; an empty sequence as supplied argument is now mapped to a Java null. Previously, in line with the XPath 1.0 calling rules, an empty sequence was translated to a zero length string.

Most of the functions in the standard function library, where a string is expected, handle an empty sequence the same way as a zero-length string, and that seems the right thing to do here as well (we have to interpret the EXSLT specification in terms of the XPath 2.0 type system). But I think that it's for the Java code of the extension function to handle this, not for the calling mechanism itself.

History

#1 Updated by Michael Kay over 3 years ago

  • Status changed from In Progress to Resolved

Fixed on the 9.5 and 9.6 branches by making all the EXSLT Date functions accept a null string as equivalent to a zero-length string.

#2 Updated by O'Neil Delpratt over 3 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in version set to 9.5.0.2

Also available in: Atom PDF