From d7845052171fbd9b0a2750eff09ce8a14f6d009c Mon Sep 17 00:00:00 2001 From: mdb Date: Mon, 26 Nov 2001 19:21:33 +0000 Subject: [PATCH] Fixed a bug with hasNext(). git-svn-id: https://samskivert.googlecode.com/svn/trunk@469 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../java/com/samskivert/util/CompoundIterator.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/projects/samskivert/src/java/com/samskivert/util/CompoundIterator.java b/projects/samskivert/src/java/com/samskivert/util/CompoundIterator.java index 4d4f8db7..b593f930 100644 --- a/projects/samskivert/src/java/com/samskivert/util/CompoundIterator.java +++ b/projects/samskivert/src/java/com/samskivert/util/CompoundIterator.java @@ -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 // 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 while (_iter != null) { - try { - if (_iter.hasNext()) { - return true; - } - } catch (NoSuchElementException nsee) { - // have to catch this and move to the next iterator + if (_iter.hasNext()) { + return true; + } else { _iter = _provider.nextIterator(); } }