diff options
author | mlindfors <majuli@vaadin.com> | 2017-08-09 14:14:10 +0300 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-08-09 14:14:10 +0300 |
commit | 62d50a66e0216eb5210e93ef39cce8dbdde0ca9f (patch) | |
tree | 94295175307b74cf2f38c1273cdd6656bb3dc414 /server | |
parent | e981dfbe1f782ae93844886270cac9651be5fb8d (diff) | |
download | vaadin-framework-62d50a66e0216eb5210e93ef39cce8dbdde0ca9f.tar.gz vaadin-framework-62d50a66e0216eb5210e93ef39cce8dbdde0ca9f.zip |
Fix occasional empty rows in Table and TreeTable (#9551)
There's an intermittently happening issue with both Table and TreeTable, which results in row data disappearing.
This change removes a method which is probably a vestigial one from over five years ago and other changes are handling the things the method used to perform. Currently the method removes rows deemed unnecessary from the row buffer. The problem is, those rows are visible to the user and removing causes row contents to be lost.
Also included are manually runnable test cases which demonstrate that this removal actually prevents the issue from happening.
Fixes #7964
Fixes #5030
Diffstat (limited to 'server')
-rw-r--r-- | server/src/main/java/com/vaadin/ui/Table.java | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/server/src/main/java/com/vaadin/ui/Table.java b/server/src/main/java/com/vaadin/ui/Table.java index 15f0672fb9..e59ac47c84 100644 --- a/server/src/main/java/com/vaadin/ui/Table.java +++ b/server/src/main/java/com/vaadin/ui/Table.java @@ -1749,9 +1749,6 @@ public class Table extends AbstractSelect implements Action.Container, if (rows > 0) { pageBufferFirstIndex = firstIndex; } - if (getPageLength() != 0) { - removeUnnecessaryRows(); - } setRowCacheInvalidated(true); markAsDirty(); @@ -1818,48 +1815,6 @@ public class Table extends AbstractSelect implements Action.Container, } /** - * Removes rows that fall outside the required cache. - */ - private void removeUnnecessaryRows() { - int minPageBufferIndex = getMinPageBufferIndex(); - int maxPageBufferIndex = getMaxPageBufferIndex(); - - int maxBufferSize = maxPageBufferIndex - minPageBufferIndex + 1; - - /* - * Number of rows that were previously cached. This is not necessarily - * the same as pageLength if we do not have enough rows in the - * container. - */ - int currentlyCachedRowCount = pageBuffer[CELL_ITEMID].length; - - if (currentlyCachedRowCount <= maxBufferSize) { - // removal unnecessary - return; - } - - /* Figure out which rows to get rid of. */ - int firstCacheRowToRemoveInPageBuffer = -1; - if (minPageBufferIndex > pageBufferFirstIndex) { - firstCacheRowToRemoveInPageBuffer = pageBufferFirstIndex; - } else if (maxPageBufferIndex < pageBufferFirstIndex - + currentlyCachedRowCount) { - firstCacheRowToRemoveInPageBuffer = maxPageBufferIndex + 1; - } - - if (firstCacheRowToRemoveInPageBuffer - - pageBufferFirstIndex < currentlyCachedRowCount) { - /* - * Unregister all components that fall beyond the cache limits after - * inserting the new rows. - */ - unregisterComponentsAndPropertiesInRows( - firstCacheRowToRemoveInPageBuffer, currentlyCachedRowCount - - firstCacheRowToRemoveInPageBuffer); - } - } - - /** * Requests that the Table should be repainted as soon as possible. * * Note that a {@code Table} does not necessarily repaint its contents when |