#17 distinct() fails with ArrayBoundCheck

v6.4
closed
Michael Kay
5
2012-10-08
2001-07-25
Michael Kay
No

When the saxon:distinct() or EXSLT set:distinct()
function is called to process a node-set containing
exactly 20*(2^n) nodes (e.g. 20, 40, 80, 160, ...),
and the nodes need to be sorted into document order,
an ArrayOutOfBoundsException occurs
(com.icl.saxon.NodeSetExtent, line 337)

Raised by David Benny [david.benny@btconnect.com]

Present in 6.4.3 and probably in most previous
releases.

Source code has been fixed (advance() method in
DistinctEnumeration must call hasMoreElements() before
calling nextElement()).

The bug report also revealed that the path
expression ./descendant::/attribute:: was being
evaluated with an unnecessary sort.

MK

Discussion