jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r762334 - /jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/iterator/ArrayIterator.java
Date Mon, 06 Apr 2009 13:37:23 GMT
Author: jukka
Date: Mon Apr  6 13:37:23 2009
New Revision: 762334

URL: http://svn.apache.org/viewvc?rev=762334&view=rev
Log:
JCRRMI-17: Multiple TCK test failures

RangeIterator.skip() is expected to throw a NoSuchElementException when skipping past the
last element.

Modified:
    jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/iterator/ArrayIterator.java

Modified: jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/iterator/ArrayIterator.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/iterator/ArrayIterator.java?rev=762334&r1=762333&r2=762334&view=diff
==============================================================================
--- jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/iterator/ArrayIterator.java
(original)
+++ jackrabbit/commons/jcr-rmi/trunk/jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/iterator/ArrayIterator.java
Mon Apr  6 13:37:23 2009
@@ -16,6 +16,8 @@
  */
 package org.apache.jackrabbit.rmi.iterator;
 
+import java.util.NoSuchElementException;
+
 import javax.jcr.RangeIterator;
 
 /**
@@ -61,6 +63,11 @@
     /** {@inheritDoc} */
     public void skip(long items) {
         position += items;
+        if (position > array.length) {
+            position = array.length;
+            throw new NoSuchElementException(
+                    "Skipped past the last element of the iterator");
+        }
     }
 
     /** {@inheritDoc} */



Mime
View raw message