Bug #4750
closedXdmSequenceIterator may return duplicate nodes
100%
Description
If the next()
method on XdmSequenceIterator
is called repeatedly without calling hasNext()
, XdmSequenceIterator
may incorrectly return duplicate items.
Updated by Norm Tovey-Walsh over 3 years ago
- Status changed from New to In Progress
Updated by Norm Tovey-Walsh over 3 years ago
- Status changed from In Progress to Resolved
Updated by Norm Tovey-Walsh over 3 years ago
Updated the fix to use LookaheadIterator
Updated by Michael Kay over 3 years ago
- Status changed from Resolved to In Progress
Reviewed the changes.
I think the contract for Iterator
(and the behaviour of the current XdmSequenceIterator
) is that after hasNext()
returns false, a further call on next()
should throw NoSuchElementException
rather than return null.
Also, I think the comment in next()
that the exception cannot occur is wrong. I will try and construct an example.
Updated by Michael Kay over 3 years ago
- Status changed from In Progress to Resolved
I've made further changes to the code and the tests to reflect these comments.
Updated by Michael Kay over 3 years ago
Applied a further patch: one of the JUnit tests in StreamTest was failing because XdmSequenceIterator.close() was no longer causing the next call on hasNext() to return false.
Updated by O'Neil Delpratt over 3 years ago
Bug fix applied in the Saxon 10.3 maintenance release
Updated by O'Neil Delpratt over 3 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in Maintenance Release 10.3 added
Please register to edit this issue