int firedListeners = 0;
if (!listenersToFire.isEmpty()) {
+ HashSet<Element> listenersCopy = new HashSet<Element>(
+ listenersToFire);
+ listenersToFire.clear();
firedListeners = listenersToFire.size();
Profiler.enter("Layout fire resize events");
- for (Element element : listenersToFire) {
+ for (Element element : listenersCopy) {
Collection<ElementResizeListener> listeners = elementResizeListeners
.get(element);
if (listeners != null) {
"Layout fire resize events - listeners not null");
}
}
- listenersToFire.clear();
-
Profiler.leave("Layout fire resize events");
}
--- /dev/null
+package com.vaadin.tests.layoutmanager;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.ui.Alignment;
+import com.vaadin.ui.CssLayout;
+import com.vaadin.ui.FormLayout;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.UI;
+
+public class ConcurrentModificationUI extends UI {
+
+ @Override
+ protected void init(VaadinRequest request) {
+ Panel panel = new Panel();
+ setContent(panel);
+
+ FormLayout form = new FormLayout();
+ panel.setContent(form);
+
+ HorizontalLayout horizLyt = new HorizontalLayout();
+ form.addComponent(horizLyt);
+
+ CssLayout cssLyt = new CssLayout();
+ horizLyt.addComponent(cssLyt);
+ horizLyt.setComponentAlignment(cssLyt, Alignment.MIDDLE_LEFT);
+ }
+
+}
--- /dev/null
+package com.vaadin.tests.layoutmanager;
+
+import org.junit.Test;
+
+import com.vaadin.tests.tb3.SingleBrowserTest;
+
+public class ConcurrentModificationUITest extends SingleBrowserTest {
+
+ @Test
+ public void noExceptionWhenEnlarging() {
+ testBench().resizeViewPortTo(100, 100);
+ openTestURL("debug");
+ testBench().resizeViewPortTo(200, 200);
+ assertNoErrorNotifications();
+ }
+}