Bug #3124
closedGroundedIterator.materialize() returns the whole sequence, not just the residue
100%
Description
The method GroundedValue.materialize(SequenceIterator) is documented to return the whole sequence backed by the sequence iterator, but some callers are assuming that it returns the residue, that is, the items that have not yet been read. For example, the new code for FocusTrackingIterator.getLength() is doing this. Generally, methods that pass around a SequenceIterator are interested only in the part of the sequence that has not yet been read.
This is causing a failure in position-0102 when I change 9.7 to use the same logic as 9.8 for computing last(). The test works in 9.8 because 9.8 is using a ListIterator rather than a ChainIterator.
Updated by Michael Kay about 7 years ago
On the 9.7 branch I have implemented new methods SequenceExtent.makeResidue(SequenceIterator) and GroundedValue.getResidue(SequenceIterator) to get the items remaining in a sequence. Currently it is used only in computing last().
Leaving open because I have not yet made the changes for 9.8.
Updated by Michael Kay about 7 years ago
- Category set to Internals
- Assignee set to Michael Kay
- Priority changed from Low to Normal
- Applies to branch 9.7, 9.8 added
- Fix Committed on Branch 9.7, 9.8 added
Changes now applied also to 9.8
Updated by Michael Kay about 7 years ago
Committed a further patch, the change had caused a regression in the test case tail(12 to 15)
Updated by O'Neil Delpratt about 7 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in Maintenance Release 9.7.0.15 added
Bug fix applied to the Saxon 9.7.0.15 maintenance release
Updated by O'Neil Delpratt almost 7 years ago
- Fix Committed on Branch trunk added
- Fix Committed on Branch deleted (
9.8)
Please register to edit this issue