Bug #1577
closedNullPointerException when function-lookup() retrieves a Java extension function
100%
Description
The following query (taken from W3C FOTS:fn-function-lookup-614) causes Saxon to throw an NullPointer exception:
let $f := function-lookup(QName("http://exslt.org/dates-and-times", "month-abbreviation"), 1)
return if (exists($f)) then $f("2012-02-28") else "not-available"
The problem will occur when looking up any function implemented as a Java external/extension function.
The stack trace of the exception thrown is as follows:
java.lang.NullPointerException
at com.saxonica.expr.JavaExtensionFunctionCall.setupParams(JavaExtensionFunctionCall.java:532)
at com.saxonica.expr.JavaExtensionFunctionCall.call(JavaExtensionFunctionCall.java:390)
at com.saxonica.expr.JavaExtensionFunctionCall.iterate(JavaExtensionFunctionCall.java:278)
at com.saxonica.functions.hof.FirstClassFunction.invoke(FirstClassFunction.java:104)
at com.saxonica.functions.hof.DynamicFunctionCallDefinition$DynamicFunctionCall.call(DynamicFunctionCallDefinition.java:158)
at net.sf.saxon.functions.IntegratedFunctionCall.iterate(IntegratedFunctionCall.java:235)
at net.sf.saxon.expr.instruct.Choose.iterate(Choose.java:863)
at net.sf.saxon.expr.LetExpression.iterate(LetExpression.java:338)
at net.sf.saxon.query.XQueryExpression.iterator(XQueryExpression.java:341)
at net.sf.saxon.s9api.XQueryEvaluator.evaluate(XQueryEvaluator.java:378)
at com.saxonica.testdriver.FOTestSuiteDriver.runTestCase(FOTestSuiteDriver.java:1142)
Updated by O'Neil Delpratt almost 12 years ago
- Category set to Internals
- Status changed from New to Resolved
- % Done changed from 0 to 100
Bug fixed. Fix applied to the FunctionLookup
class in the lookup
method. Change committed to svn repositiory
Updated by O'Neil Delpratt almost 12 years ago
Change committed to svn repository.
Updated by Michael Kay almost 12 years ago
Note that the effect of the fix is that function-lookup() treats Java extension functions as not available (that is, it fails cleanly rather than crashing). In a future release, function-lookup() will be able to discover Java extension functions and return them as function items.
Updated by Michael Kay almost 12 years ago
- Subject changed from NullPointer exception in JavaExtensionFunctionCall to NullPointerException when function-lookup() retrieves a Java extension function
- Description updated (diff)
Updated by O'Neil Delpratt over 11 years ago
- Status changed from Resolved to Closed
- Fixed in version set to 9.4.0.6
Please register to edit this issue