diff options
author | Artur Signell <artur@vaadin.com> | 2013-09-16 15:49:35 +0300 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2013-09-16 15:50:16 +0300 |
commit | 0e048a5ba6cf734485fc83cb3b264b8ff104ecb9 (patch) | |
tree | 03729c56e616d77a7a71a4b1bf0163f05e806d4f | |
parent | 3a4351f9b777009d8e226d26125f758861ddcbb3 (diff) | |
download | vaadin-framework-0e048a5ba6cf734485fc83cb3b264b8ff104ecb9.tar.gz vaadin-framework-0e048a5ba6cf734485fc83cb3b264b8ff104ecb9.zip |
Clarified error message (#12583)
Change-Id: I542046158f6e78c8bb26aaee110bd5b123ae13e6
-rw-r--r-- | server/src/com/vaadin/ui/UI.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/server/src/com/vaadin/ui/UI.java b/server/src/com/vaadin/ui/UI.java index 0746431302..27f04c39e1 100644 --- a/server/src/com/vaadin/ui/UI.java +++ b/server/src/com/vaadin/ui/UI.java @@ -402,9 +402,12 @@ public abstract class UI extends AbstractSingleComponentContainer implements * @see #getSession() */ public void setSession(VaadinSession session) { - if ((session == null) == (this.session == null)) { + if (session == null && this.session == null) { throw new IllegalStateException( - "VaadinServiceSession has already been set. Old session: " + "Session should never be set to null when UI.session is already null"); + } else if (session != null && this.session != null) { + throw new IllegalStateException( + "Session has already been set. Old session: " + getSessionDetails(this.session) + ". New session: " + getSessionDetails(session) + "."); |