From: Artur Signell Date: Fri, 19 Feb 2010 09:01:26 +0000 (+0000) Subject: Fix for #4204 - CssLayout throws ClassCastException when removing component with... X-Git-Tag: 6.7.0.beta1~2040 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=53e3bc30d45bee3b2e238621f247d9b12c216318;p=vaadin-framework.git Fix for #4204 - CssLayout throws ClassCastException when removing component with caption svn changeset:11390/svn branch:6.3 --- diff --git a/src/com/vaadin/terminal/gwt/client/ui/VCssLayout.java b/src/com/vaadin/terminal/gwt/client/ui/VCssLayout.java index bf13530d7f..90cf102cb9 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VCssLayout.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VCssLayout.java @@ -184,10 +184,11 @@ public class VCssLayout extends SimplePanel implements Paintable, Container { // loop oldWidgetWrappers that where not re-attached and unregister // them - for (final Iterator it = oldWidgets.iterator(); it - .hasNext();) { - final Paintable w = (Paintable) it.next(); - client.unregisterPaintable(w); + for (Widget w : oldWidgets) { + if (w instanceof Paintable) { + final Paintable p = (Paintable) w; + client.unregisterPaintable(p); + } widgetToCaption.remove(w); } }