From 1c5f0d10d4461222e2b3b6f2d6331e9115d87c34 Mon Sep 17 00:00:00 2001 From: Jonatan Kronqvist Date: Fri, 23 Sep 2011 12:28:06 +0000 Subject: [PATCH] Yet another indexing issue found and fixed for #7620 svn changeset:21277/svn branch:6.7 --- src/com/vaadin/ui/Table.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/com/vaadin/ui/Table.java b/src/com/vaadin/ui/Table.java index fb8610f0b9..fa871faa3a 100644 --- a/src/com/vaadin/ui/Table.java +++ b/src/com/vaadin/ui/Table.java @@ -1517,7 +1517,10 @@ public class Table extends AbstractSelect implements Action.Container, Object[][] cells = getVisibleCellsNoCache(firstIndex, rows, false); int cacheIx = firstIndex - pageBufferFirstIndex; // update the new rows in the cache. - for (int ix = cacheIx; ix < cacheIx + rows; ix++) { + int totalCachedRows = pageBuffer[CELL_ITEMID].length; + int end = cacheIx + rows > totalCachedRows ? totalCachedRows : cacheIx + + rows; + for (int ix = cacheIx; ix < end; ix++) { for (int i = 0; i < pageBuffer.length; i++) { pageBuffer[i][ix] = cells[i][ix - cacheIx]; } -- 2.39.5