Bug #4750
closed
XdmSequenceIterator may return duplicate nodes
Applies to branch:
10, trunk
Fix Committed on Branch:
10, trunk
Fixed in Maintenance Release:
Description
If the next()
method on XdmSequenceIterator
is called repeatedly without calling hasNext()
, XdmSequenceIterator
may incorrectly return duplicate items.
- Status changed from New to In Progress
- Fix Committed on Branch 10, trunk added
- Status changed from In Progress to Resolved
Updated the fix to use LookaheadIterator
- 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.
- Status changed from In Progress to Resolved
I've made further changes to the code and the tests to reflect these comments.
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.
Bug fix applied in the Saxon 10.3 maintenance release
- 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
Also available in: Atom
PDF