public Entry next() { // hasNext() will initialize this.next if (!nextSet && !hasNext()) return null; // if we get here, then we're about to return a next value nextSet = false; if (containsKey(next.getKey())) return next; // something has changed since the last iteration (presumably // due to multi-threaded access to the underlying data // structure); recurse return next(); }
public Entry next() { // hasNext() will initialize this.next if (!nextSet && !hasNext()) return null; // if we get here, then we're about to return a next value nextSet = false; if (containsKey(next.getKey())) return next; // something has changed since the last iteration (presumably // due to multi-threaded access to the underlying data // structure); recurse return next(); }