Bug #4500
closedArrayIndexOutOfBounds exception processing XDM Arrays in XSLT
100%
Description
Failure reported by Ruud Grossmann on saxon-help mailing list. Reproduced as XSLT3 test case arrays-304.
StackTrace:
java.lang.IndexOutOfBoundsException: Requested 2, actual size 1
at net.sf.saxon.ma.parray.ImmList.outOfBounds(ImmList.java:194)
at net.sf.saxon.ma.parray.ImmList1.subList(ImmList1.java:95)
at net.sf.saxon.ma.parray.ImmList2.subList(ImmList2.java:114)
at net.sf.saxon.ma.parray.ImmList2.subList(ImmList2.java:112)
at net.sf.saxon.ma.parray.ImmList2.subList(ImmList2.java:114)
Updated by Michael Kay about 4 years ago
- Status changed from New to Resolved
- Fix Committed on Branch 10, 9.9 added
There's an error in the logic for array:subarray()
. Probably not worth going into the detail. Arrays are implemented using an immutable binary tree structure, and the implementation for subarray()
make recursive calls to extract and concatenate parts of the subtrees, as can be seen on the stack trace.
Patch applies to ImmList2.subList()
.
Updated by Michael Kay about 4 years ago
Looking at the QT3 tests for array:subarray, they have the problem that none of the arrays used as arguments to array:subarray()
have been through any kind of incremental modification process. This means that the internal structure is likely to be very "clean". Some implementations might even use a completely different data structure for an array that is incrementally modified and an array that is static and unchanging after initialisation. The same criticism can also be applied to other array tests in QT3.
Added an XSLT3 test arrays-305 to exercise the code a bit more heavily.
Updated by O'Neil Delpratt almost 4 years ago
- % Done changed from 0 to 100
- Fixed in Maintenance Release 10.1 added
Bug fix committed in the Saxon 10.1 maintenance release.
Updated by O'Neil Delpratt over 3 years ago
- Status changed from Resolved to Closed
- Fixed in Maintenance Release 10.2, 9.9.1.8 added
- Fixed in Maintenance Release deleted (
10.1)
Bug fix applied on the Saxon 9.9.1.8 maintenance release.
Please register to edit this issue