Bug #5829
closed
NullPointerException calling XdmFunctionItem.call() on a context-dependent function
Applies to branch:
11, 12, trunk
Fixed in Maintenance Release:
Description
When a context-dependent function such as fn:local-name() is obtained using XdmFunctionItem.getSystemFunction()
, a NullPointerException occurs when the function is called.
Occurs with both the Java and .NET APIs.
Added unit tests; fixed the code to throw a SaxonApiException with error code XPDE0002.
I have taken the opportunity to convert all the JUnit tests in TestXdmFunction into NUnit tests and run them against SaxonCS 12; this is revealing some additional minor issues.
- XdmFunctionItem.Invoke does not throw a SaxonApiException if execution fails with a dynamic error
- A System.InvalidCastException is thrown if the argument to a function is of the wrong type
- Status changed from In Progress to Resolved
- Fix Committed on Branch 11, 12, trunk added
I've added the new NUnit tests to the SaxonCS 11 branch as well as SaxonCS 12.
- Status changed from Resolved to In Progress
- Fix Committed on Branch deleted (
11, 12, trunk)
The SaxonJ method XdmFunctionItem.call() had been enhanced to apply the function conversion rules to the supplied parameters. This is not happening in SaxonCS. The actual implementation code for system functions assumes that the arguments have been type-checked, and that it can safely cast the supplied values to the required type. On SaxonCS we're throwing a Cast exception because this isn't the case.
I've now changed the C# XdmFunctionItem.Invoke() to apply the function conversion rules in the same way that SaxonJ does.
- Status changed from In Progress to Resolved
- Status changed from Resolved to Closed
- Fixed in Maintenance Release 12.1 added
Please register to edit this issue
Also available in: Atom
PDF