tlaukkan/vaadin-lazyquerycontainer — Issue #27: LazyQueryContainer method getItem makes invalid call to queryView
Author: jenica
Created: 2012-02-03 20:41:07+00:00
State: open

Situation: Table is backed by LazyQueryContainer. Table has an ItemClickEvent.ItemClickListener defined. Container is changed(refreshed) and is in process of reloading. Table is clicked, this calls LazyQueryContainer.getItem passing 'null' as the itemId.

QueryView interface defines getItem as taking an int (not Integer) parameter.

This causes a NullPointerException since while null is a valid Integer, it's not a valid int.

Proposed code fix:
public final Item getItem(final Object itemId) {
return itemId == null ? null : queryView.getItem((Integer) itemId);
}