From 4ca0da456acaf415c6076f90e1e13c7f777c5bfd Mon Sep 17 00:00:00 2001 From: Stephen Colebourne Date: Fri, 13 Dec 2002 11:03:42 +0000 Subject: [PATCH] Fix remove method to throw correct exception git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130887 13f79535-47bb-0310-9956-ffa450edef68 --- .../collections/iterators/CollatingIterator.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/java/org/apache/commons/collections/iterators/CollatingIterator.java b/src/java/org/apache/commons/collections/iterators/CollatingIterator.java index 5779fa541..dda9f4077 100644 --- a/src/java/org/apache/commons/collections/iterators/CollatingIterator.java +++ b/src/java/org/apache/commons/collections/iterators/CollatingIterator.java @@ -1,7 +1,7 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/CollatingIterator.java,v 1.3 2002/09/07 00:28:53 rwaldhoff Exp $ - * $Revision: 1.3 $ - * $Date: 2002/09/07 00:28:53 $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/CollatingIterator.java,v 1.4 2002/12/13 11:03:42 scolebourne Exp $ + * $Revision: 1.4 $ + * $Date: 2002/12/13 11:03:42 $ * * ==================================================================== * @@ -78,7 +78,7 @@ import java.util.BitSet; * @since 2.1 * @author Rodney Waldhoff * @author Stephen Colebourne - * @version $Revision: 1.3 $ $Date: 2002/09/07 00:28:53 $ + * @version $Revision: 1.4 $ $Date: 2002/12/13 11:03:42 $ */ public class CollatingIterator implements Iterator { @@ -294,7 +294,7 @@ public class CollatingIterator implements Iterator { */ public void remove() { if(-1 == lastReturned) { - throw new NoSuchElementException("No value has been returned yet."); + throw new IllegalStateException("No value can be removed at present"); } else { Iterator iter = (Iterator)(iterators.get(lastReturned)); iter.remove();