Fixed a bug with hasNext().

git-svn-id: https://samskivert.googlecode.com/svn/trunk@469 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2001-11-26 19:21:33 +00:00
parent e97604580c
commit d784505217
@@ -1,5 +1,5 @@
// //
// $Id: CompoundIterator.java,v 1.1 2001/11/20 03:35:53 mdb Exp $ // $Id: CompoundIterator.java,v 1.2 2001/11/26 19:21:33 mdb Exp $
// //
// samskivert library - useful routines for java programs // samskivert library - useful routines for java programs
// Copyright (C) 2001 Michael Bayne // Copyright (C) 2001 Michael Bayne
@@ -57,12 +57,9 @@ public class CompoundIterator implements Iterator
{ {
// keep trying iterators until we run out or find an element // keep trying iterators until we run out or find an element
while (_iter != null) { while (_iter != null) {
try { if (_iter.hasNext()) {
if (_iter.hasNext()) { return true;
return true; } else {
}
} catch (NoSuchElementException nsee) {
// have to catch this and move to the next iterator
_iter = _provider.nextIterator(); _iter = _provider.nextIterator();
} }
} }