From 930fd30a937ef69ba45e501bdee78773bad5523f Mon Sep 17 00:00:00 2001 From: Juuso Valli Date: Mon, 26 May 2014 17:22:18 +0300 Subject: Fix Push update race condition (#13562) Change-Id: I50094bc2d236f6dbb02a8b82d6cc9b5f7e4733a5 --- server/src/com/vaadin/ui/Table.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'server/src/com/vaadin/ui') diff --git a/server/src/com/vaadin/ui/Table.java b/server/src/com/vaadin/ui/Table.java index b4d79f304c..a8265662ea 100644 --- a/server/src/com/vaadin/ui/Table.java +++ b/server/src/com/vaadin/ui/Table.java @@ -2957,12 +2957,19 @@ public class Table extends AbstractSelect implements Action.Container, if (value != null) { reqFirstRowToPaint = value.intValue(); } + value = (Integer) variables.get("reqrows"); if (value != null) { reqRowsToPaint = value.intValue(); + int size = size(); // sanity check - if (reqFirstRowToPaint + reqRowsToPaint > size()) { - reqRowsToPaint = size() - reqFirstRowToPaint; + + if (reqFirstRowToPaint >= size) { + reqFirstRowToPaint = size; + } + + if (reqFirstRowToPaint + reqRowsToPaint > size) { + reqRowsToPaint = size - reqFirstRowToPaint; } } } -- cgit v1.2.3