Possible bug in ContainerOrderedWrapper

ContainerOrderedWrapper seems to have bug. I have test application where is have Table component. I have set ContainerDataSource to be a class which is simple, unordered Container. Table component seems to wrap my container using ContainerOrderedWrapper. Browsing and displaying data is ok, but I cannot delete first or last row from table.

I get NullPointerException from ContainerOrderedWrapper line 128 from method removeFromOrderWrapper() . Exception is thrown by Hashtable.put(k,v), because “v” cannot be null. If I delete first row, then local variable ‘pid’ is null and if I delete last row, then ‘nid’ is null. Method does not check if pid/nid is null when used with “put” as second operand.

This behavior was tested with Vaadin 6.4.7.

/Niko

I agree this is a bug, created
ticket 5975
.

We should also get rid of using Hashtable and Vector - HashMap and ArrayList (sometimes with synchronization wrappers) are better in almost all cases. However, null handling needs to be looked at carefully in the case of Hashtable vs. HashMap, as their behaviors differ.