Bug #1753
closedEXSLT extension function NPE when passed empty sequence
100%
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.
Updated by Michael Kay about 11 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.
Updated by O'Neil Delpratt almost 11 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in version set to 9.5.0.2
Please register to edit this issue