Table bug?

I found an infinity loop in my project project. Here is a description:

When we using the table with multiselect and choosing Range of several lines the follow method is called:


Table.java

private Set<Object> getItemIdsInRange(int startRowKey, int endRowKey) {
...
        while (currentItemId != endItemId) {
            currentItemId = ordered.nextItemId(currentItemId);
            if (currentItemId != null) {
                ids.add(currentItemId);
            }
        }
...

If we used

QueryContainer

it will return
nextItemId()
by this code:

...
        return new Integer(i + 1);

And this check doesn’t work properly:

        while (currentItemId != endItemId) {

It must be equals method with not null checking (to prevent infinity loop):

        while ((currentItemId != null) && currentItemId.equals(endItemId)) {

You can find it here:

http://dev.vaadin.com/browser/releases/6.4.0/src/com/vaadin/ui/Table.java#L1867

May be i’m wrong and author assumed equality of object references, but it looks like a bug.
If it’s not a bug that QueryContainer must return another value.

Thank you for your attention.

Hi!

Looks to be a bug(regression) in the new multi select code. Thanks for pointing this out. It is probably a problem for most DB backed containers.

I created a ticket for it: http://dev.vaadin.com/ticket/5342

cheers,
matti