Bug #6176
closedFailure to test for UncheckedXPathException
100%
Description
Some low-level utility methods in Saxon throw an UncheckedXPathException
; this is so that they can implement the increasing number of JDK interfaces (Iterator
being a classical example) that don't allow checked exceptions.
This puts the onus on the calling code to check for UncheckedXPathException
and convert it to a (checked) XPathException
.
We have a crash in test case map:for-each-405 caused by the fact that method FunctionSequenceCoercer.simplify()
fails to make this check; while we're about it we'll search for other methods that call SequenceTool.toGroundedValue()
and fail to check for the exception.
Updated by Michael Kay over 1 year ago
I've gone through the calls on SequenceTool.toGroundedValue()
and have fixed most of them to check for the unchecked exception.
However, it's worth noting that there are two lines of defence against unchecked exceptions: the point where it is first thrown, and also at the point of the API call to Saxon from user code. In this case the API call is XPathCompiler.compile()
and I've added a check at that point too.
Updated by Michael Kay over 1 year ago
- Status changed from New to Resolved
- Applies to branch 11, 12, trunk added
- Fix Committed on Branch 11 added
- Platforms .NET, Java added
Fixed many instances of this in the 11.x and 12.x branches; marking as resolved, although there are almost certainly further affected paths that we haven't discovered.
Updated by Debbie Lockett over 1 year ago
- Fix Committed on Branch 12, trunk added
- Fixed in Maintenance Release 11.6 added
Bug fix applied in the Saxon 11.6 maintenance release.
Updated by O'Neil Delpratt about 1 year ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in Maintenance Release 12.4 added
Bug fix applied in the Saxon 12.4 Maintenance release
Please register to edit this issue