summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonatan Kronqvist <jonatan.kronqvist@itmill.com>2011-09-23 12:28:06 +0000
committerJonatan Kronqvist <jonatan.kronqvist@itmill.com>2011-09-23 12:28:06 +0000
commit1c5f0d10d4461222e2b3b6f2d6331e9115d87c34 (patch)
treed4455946bf33b197529ff5b09ea289f028c9ca2b
parent27d65473ccecc08a2b4927d3a5183bd2b3b46b6a (diff)
downloadvaadin-framework-1c5f0d10d4461222e2b3b6f2d6331e9115d87c34.tar.gz
vaadin-framework-1c5f0d10d4461222e2b3b6f2d6331e9115d87c34.zip
Yet another indexing issue found and fixed for #7620
svn changeset:21277/svn branch:6.7
-rw-r--r--src/com/vaadin/ui/Table.java5
1 files changed, 4 insertions, 1 deletions
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];
}