diff options
author | Artur Signell <artur@vaadin.com> | 2014-03-10 13:55:39 +0200 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2014-03-10 12:35:46 +0000 |
commit | c121c4e5ad72ab0705552ad8c614f179fc214a41 (patch) | |
tree | d7b14883d42d71942b376415dd012bddc0c8cf44 | |
parent | 7d74479ccaceb5a2eaa82b89016a9a45a5f3e181 (diff) | |
download | vaadin-framework-c121c4e5ad72ab0705552ad8c614f179fc214a41.tar.gz vaadin-framework-c121c4e5ad72ab0705552ad8c614f179fc214a41.zip |
Do not fail assertion if re-setting the same lock (#13440)
Change-Id: I2e7e9dcf8739a04583d8e42a86a1fede36011813
-rw-r--r-- | server/src/com/vaadin/server/VaadinService.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/server/src/com/vaadin/server/VaadinService.java b/server/src/com/vaadin/server/VaadinService.java index 216adce3c8..eda794438f 100644 --- a/server/src/com/vaadin/server/VaadinService.java +++ b/server/src/com/vaadin/server/VaadinService.java @@ -521,8 +521,13 @@ public abstract class VaadinService implements Serializable { * The lock object */ private void setSessionLock(WrappedSession wrappedSession, Lock lock) { - assert wrappedSession != null : "Can't set a lock for a null session"; - assert wrappedSession.getAttribute(getLockAttributeName()) == null : "Changing the lock for a session is not allowed"; + if (wrappedSession == null) { + throw new IllegalArgumentException( + "Can't set a lock for a null session"); + } + Object currentSessionLock = wrappedSession + .getAttribute(getLockAttributeName()); + assert (currentSessionLock == null || currentSessionLock == lock) : "Changing the lock for a session is not allowed"; wrappedSession.setAttribute(getLockAttributeName(), lock); } |