Bug #4056
closed
object?method() notation for reflexive extension functions does not work when there is an XPathContext parameter
Category:
Saxon extensions
Applies to branch:
9.9, trunk
Fix Committed on Branch:
9.9, trunk
Fixed in Maintenance Release:
Description
The new notation object?method()
used to call the methods of a Java external object does not work in the case of methods that declare a first argument of type XPathContext - the arity of the corresponding function is calculated incorrectly.
Also note: the run-time cost of using this notation is quite high. There is scope for optimization here, for example even if we can't determine the type of object
statically, there's a very good chance that when the expression is executed repeatedly, object
will have the same type (or even be the same instance!) each time, so we should be able to remember what method to call, rather than introspecting the class from scratch each time.
Created test TestReflexion.testLookupNotationWithContext()
to test this. It currently fails with an NPE.
- Status changed from New to Resolved
- Applies to branch 9.9, trunk added
- Fix Committed on Branch 9.9, trunk added
Fixed.
The new code:
-
Improves the error handling if there is no method with the given name, detecting this during type checking where possible
-
Identifies the method to be called at compile time where possible, reducing run-time cost
-
Allows methods that have XPathContext as a first argument to pass this argument implicitly.
Test case: TestReflexion.testLookupNotationWithContext
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in Maintenance Release 9.9.1.3 added
Bug fix applied to the Saxon 9.9.1.3 maintenance release
Please register to edit this issue
Also available in: Atom
PDF