]> source.dussan.org Git - vaadin-framework.git/commitdiff
#4303 BeanItemContainer.addItem(null, Object) did not respect contract
authorHenri Sara <henri.sara@itmill.com>
Thu, 11 Mar 2010 15:29:42 +0000 (15:29 +0000)
committerHenri Sara <henri.sara@itmill.com>
Thu, 11 Mar 2010 15:29:42 +0000 (15:29 +0000)
svn changeset:11794/svn branch:6.3

src/com/vaadin/data/util/BeanItemContainer.java

index f0d806204f3eab7694b4b8ab9428cd2f5513a77e..3e3c4a55388aeb721224f73d9a748ffd98e49400 100644 (file)
@@ -258,7 +258,9 @@ public class BeanItemContainer<BT> implements Indexed, Sortable, Filterable,
     public BeanItem<BT> addItemAfter(Object previousItemId, Object newItemId)
             throws UnsupportedOperationException {
         // only add if the previous item is visible
-        if (containsId(previousItemId)) {
+        if (previousItemId == null) {
+            return addItemAtInternalIndex(0, newItemId);
+        } else if (containsId(previousItemId)) {
             return addItemAtInternalIndex(allItems.indexOf(previousItemId) + 1,
                     newItemId);
         } else {