Window.getParent() returned object changed?

In Vaadin 6.4.0, Window.getParent() returns a Component. So my code to find the top level window would use window.getParent().getWindow().

In Vaadin 6.4.5, Window.getParent() returns a Window instead. Should I change my code to just use Window.getParent() or Window.getParent().getWindow() like before? Both seem to have the same results (maybe a Window’s getWindow() just returns itself?).

Hi,

If you get the same result from both, I would use the shortest… less code typing and more clear code.

regards

Yes, indeed, that’s what we have now to no known ill effects, but wondered what it all meant since the API changed within the 6.4 timeframe.

The parent of a Window was always a Window (or null for a top-level application window), and Window.getWindow() does return the window itself. The return type of Window.getParent() was made more specific for user convenience, exploiting covariant return types.

I would recommend using the short form.