summaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/ui/ComboBox.java
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2014-07-15 16:11:40 +0300
committerVaadin Code Review <review@vaadin.com>2014-07-17 08:18:18 +0000
commit2c1d7bdbc2e284264b485fbcf7d9f3d1ef3180f2 (patch)
tree1efca4a2aee81b76f5a9df587e910507bd3be067 /server/src/com/vaadin/ui/ComboBox.java
parentb8255a873283b610844b7dc9a535d2a0cd144844 (diff)
downloadvaadin-framework-2c1d7bdbc2e284264b485fbcf7d9f3d1ef3180f2.tar.gz
vaadin-framework-2c1d7bdbc2e284264b485fbcf7d9f3d1ef3180f2.zip
Add asserts checking for negative container sizes (#14232)
Change-Id: I5b6298be367e4fe820320a5e3fd6bf5aaa7e2047
Diffstat (limited to 'server/src/com/vaadin/ui/ComboBox.java')
-rw-r--r--server/src/com/vaadin/ui/ComboBox.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/server/src/com/vaadin/ui/ComboBox.java b/server/src/com/vaadin/ui/ComboBox.java
index 048726dc84..5367505c56 100644
--- a/server/src/com/vaadin/ui/ComboBox.java
+++ b/server/src/com/vaadin/ui/ComboBox.java
@@ -354,6 +354,7 @@ public class ComboBox extends AbstractSelect implements
if (pageLength == 0) {
// no paging: return all items
filteredSize = container.size();
+ assert filteredSize >= 0;
return new ArrayList<Object>(container.getItemIds());
}
@@ -391,6 +392,7 @@ public class ComboBox extends AbstractSelect implements
}
filteredSize = container.size();
+ assert filteredSize >= 0;
currentPage = adjustCurrentPage(currentPage, needNullSelectOption,
indexToEnsureInView, filteredSize);
int first = getFirstItemIndexOnCurrentPage(needNullSelectOption,