summaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/data/Container.java
diff options
context:
space:
mode:
authorHenri Sara <hesara@vaadin.com>2012-09-07 11:07:57 +0300
committerHenri Sara <hesara@vaadin.com>2012-09-07 11:07:57 +0300
commitc74a3d6d7b7db4eeedcda9c2ae215c89c3b1394e (patch)
tree8c5b87f20fc7b57e733a1973d320d552ab84049a /server/src/com/vaadin/data/Container.java
parent78fcee9817e2216eab619f8f750cf6eda7f545d9 (diff)
downloadvaadin-framework-c74a3d6d7b7db4eeedcda9c2ae215c89c3b1394e.tar.gz
vaadin-framework-c74a3d6d7b7db4eeedcda9c2ae215c89c3b1394e.zip
Return short list instead of exception if less items available (#8028)
Container.Indexed.getItemIds(int, int) does not throw an exception if too few items are available in the container.
Diffstat (limited to 'server/src/com/vaadin/data/Container.java')
-rw-r--r--server/src/com/vaadin/data/Container.java20
1 files changed, 7 insertions, 13 deletions
diff --git a/server/src/com/vaadin/data/Container.java b/server/src/com/vaadin/data/Container.java
index 28d6cad18d..47a0f9e7c8 100644
--- a/server/src/com/vaadin/data/Container.java
+++ b/server/src/com/vaadin/data/Container.java
@@ -503,17 +503,13 @@ public interface Container extends Serializable {
* container, starting with the item id at <code>startIndex</code>. <br>
* <br>
*
- * Implementations should return the exact number of item ids given by
- * <code>numberOfItems</code>. The returned list must hence contain all
- * of the item ids from the range: <br>
+ * Implementations should return at most <code>numberOfItems</code> item
+ * ids, but can contain less if the container has less items than
+ * required to fulfill the request. The returned list must hence contain
+ * all of the item ids from the range: <br>
* <br>
* <code>startIndex</code> to
- * <code>startIndex + (numberOfItems-1)</code>. <br>
- * <br>
- *
- * The returned list must contain all of the requested item ids or throw
- * a {@link RangeOutOfContainerBoundsException} to indicate that the
- * container does not contain all the requested item ids.<br>
+ * <code>max(startIndex + (numberOfItems-1), container.size()-1)</code>. <br>
* <br>
* For quick migration to new API see:
* {@link ContainerHelpers#getItemIdsUsingGetIdByIndex(int, int, Indexed)}
@@ -521,8 +517,6 @@ public interface Container extends Serializable {
* <br>
* <b>Throws:</b> {@link IllegalArgumentException} if
* <code>numberOfItems</code> is < 0 <br>
- * <b>Throws:</b> {@link RangeOutOfContainerBoundsException} if all of
- * the requested item ids cannot be fetched <br>
* <b>Throws:</b> {@link IndexOutOfBoundsException} if
* <code>startIndex</code> is outside the range of the container. (i.e.
* <code>startIndex &lt; 0 || container.size()-1 &lt; startIndex</code>)
@@ -532,8 +526,8 @@ public interface Container extends Serializable {
* @param numberOfItems
* the number of consecutive item ids to get from the given
* start index, must be >= 0
- * @return List containing all of the requested item ids or empty list
- * if <code>numberOfItems</code> == 0; not null
+ * @return List containing the requested item ids or empty list if
+ * <code>numberOfItems</code> == 0; not null
*
* @since 7.0
*/