Problem with table getItemIds and getItem


i have a quite strange problem , may be i’m missing something (i’m not a vaadin expert) but this piece of code sometime don’t work and i could not understand why:

Vaadin version 6.8.13

Method with bug:

    public List<LemmaEntry> getEntriesList() {
        List<LemmaEntry> list = new ArrayList<LemmaEntry>();
Collection itemsId = table.getItemIds();
        for (Object item : itemsId) {
            LemmaTableEntry elem = ((BeanItem<LemmaTableEntry>) [b]
        return list;

Some times this code dos’nt work, i.e the getItem(item) return null.

Particulary i add dinamically a Row to the table(see method below) ,
the data taking value from table (Read value not changing the value), and then try to execute this code , and i receive a null from the item i have added
i.e. getItem(item) is null.
are being taken from Collection itemsId = table.getItemIds(); so how could it be null? so i’m missing something but i need some help to found it.

Row are added with this code

    public void addRowToTable() {
        LemmaEntry campo = entityFactory.newLemmaEntry();
        table.addItem(new LemmaTableEntry(campo));

Table data source is as:

      table.setContainerDataSource(new BeanItemContainer<LemmaTableEntry>(


public class LemmaTableEntry {
    private final LemmaEntry lemmaEntry;

    public LemmaTableEntry(LemmaEntry lemmaEntry) {
        this.lemmaEntry = lemmaEntry;

    public String getName() {
        return lemmaEntry.getName();

    public void setName(String name) {

    public LemmaEntry toLemmaEntry() {
        return lemmaEntry;

    public boolean equals(Object o) {
        return this == o || (o instanceof LemmaTableEntry && lemmaEntry == ((LemmaTableEntry) o).lemmaEntry);

    public int hashCode() {
        return lemmaEntry != null ? lemmaEntry.hashCode() : 0;

LemmaEntry extends some other class and is CGLIB enanched and instanced using CDI, may be this could create some problem?
Save operation apparently did not modified the object reference, anyway the object contained in itemdIs is the same as the item i.e. :

Should i check some other thing?
Any hint is appreciated.

Note that BeanItemContainer store itemids in a List and BeanItems in a Map, so if the hascode of your LemmaEntry changes after adding it, you will get a null when looking for it later.