Project

Profile

Help

Bug #2313

closed

index-of() -- iterator.getAnother() gives incorrect results

Added by Michael Kay about 9 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XPath conformance
Sprint/Milestone:
Start date:
2015-02-12
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.6
Fix Committed on Branch:
9.6
Fixed in Maintenance Release:
Platforms:

Description

The iterate() method of the index-of() function returns an iterator which does not correctly implement the getAnother() method, which is supposed to return a new iterator that returns the same results as the original. getAnother() is used mainly when implementing the last() function, but also has internal uses. The particular iterator returned is an ItemMappingIterator which is stateful, and which does not reset its state when the iterator is cloned. This could also cause problems when multi-threading. I do not have a specific repro: the problem was encountered during 9.7 development when getAnother() was called unnecessarily as a consequence of an unrelated problem. For 9.7 I have reimplemented the iterator used for index-of(), and this will be back-ported to 9.6 to resolve this issue.

Please register to edit this issue

Also available in: Atom PDF