cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r591678 - /cocoon/trunk/blocks/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/components/source/impl/BlobSource.java
Date Sat, 03 Nov 2007 20:36:52 GMT
Author: felixk
Date: Sat Nov  3 13:36:51 2007
New Revision: 591678

URL: http://svn.apache.org/viewvc?rev=591678&view=rev
Log:
Iterator next() method can't throw NoSuchElement exception

This class implements the java.util.Iterator interface.  However, its next() method is not
capable of throwing java.util.NoSuchElementException.  The next() method should be changed
so it throws NoSuchElementException if is called when there are no more elements to return.

Modified:
    cocoon/trunk/blocks/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/components/source/impl/BlobSource.java

Modified: cocoon/trunk/blocks/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/components/source/impl/BlobSource.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/components/source/impl/BlobSource.java?rev=591678&r1=591677&r2=591678&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/components/source/impl/BlobSource.java
(original)
+++ cocoon/trunk/blocks/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/components/source/impl/BlobSource.java
Sat Nov  3 13:36:51 2007
@@ -29,6 +29,7 @@
 import java.sql.Statement;
 import java.sql.Types;
 import java.util.Iterator;
+import java.util.NoSuchElementException;
 
 import org.apache.avalon.excalibur.datasource.DataSourceComponent;
 import org.apache.avalon.framework.service.ServiceManager;
@@ -306,7 +307,7 @@
 
     static class EmptyIterator implements Iterator {
         public boolean hasNext() { return false; }
-        public Object next() { return null; }
+        public Object next() { throw new NoSuchElementException(); }
         public void remove() {}
     }
 



Mime
View raw message