Project

Profile

Help

Bug #6176

closed

Failure to test for UncheckedXPathException

Added by Michael Kay 9 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Internals
Sprint/Milestone:
-
Start date:
2023-08-17
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
11, 12, trunk
Fix Committed on Branch:
11, 12, trunk
Fixed in Maintenance Release:
Platforms:
.NET, Java

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.

Actions #1

Updated by Michael Kay 9 months 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.

Actions #2

Updated by Michael Kay 8 months 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.

Actions #3

Updated by Debbie Lockett 8 months 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.

Actions #4

Updated by O'Neil Delpratt 5 months 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

Also available in: Atom PDF