From 998c9c97b4b7d9531028b442df4c38a33b60e5f0 Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Sun, 9 Sep 2012 22:16:51 +0300 Subject: Verify that lock is held when accessing state (#9515) --- server/src/com/vaadin/ui/ConnectorTracker.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'server/src/com/vaadin/ui/ConnectorTracker.java') diff --git a/server/src/com/vaadin/ui/ConnectorTracker.java b/server/src/com/vaadin/ui/ConnectorTracker.java index d454df98ee..dbada63a47 100644 --- a/server/src/com/vaadin/ui/ConnectorTracker.java +++ b/server/src/com/vaadin/ui/ConnectorTracker.java @@ -29,6 +29,7 @@ import com.vaadin.server.AbstractClientConnector; import com.vaadin.server.AbstractCommunicationManager; import com.vaadin.server.ClientConnector; import com.vaadin.server.GlobalResourceHandler; +import com.vaadin.server.VaadinSession; /** * A class which takes care of book keeping of {@link ClientConnector}s for a @@ -286,6 +287,8 @@ public class ConnectorTracker implements Serializable { * The connector that should be marked clean. */ public void markDirty(ClientConnector connector) { + assert uI.getSession() == null + || uI.getSession().getLock().isHeldByCurrentThread() : VaadinSession.SESSION_LOCK_MESSAGE; if (isWritingResponse()) { throw new IllegalStateException( "A connector should not be marked as dirty while a response is being written."); -- cgit v1.2.3