Actions
Bug #4890
closedDotNetIterator class doesn't implement hasNext() correctly
Start date:
2021-02-04
Due date:
% Done:
100%
Estimated time:
Legacy ID:
Applies to branch:
10
Fix Committed on Branch:
10, trunk
Fixed in Maintenance Release:
Platforms:
Description
This problem may be asymptomatic, but the class net.sf.saxon.dotnet.DotNetIterator
, which is used on the .NET product to bridge a C# IEnumerator
to a Java Iterator
, is incorrect. According to the contract for java.lang.Iterator
, the hasNext()
method should leave the state of the iterator unchanged, but we're calling MoveNext()
, which means that if you make two calls on hasNext()
without an intervening call on next()
, the iterator will change position.
It works so long as the caller calls hasNext()
exactly once between successive calls on next()
.
Please register to edit this issue
Actions