From: Artur Signell Date: Mon, 16 Sep 2013 12:49:35 +0000 (+0300) Subject: Clarified error message (#12583) X-Git-Tag: 7.1.7~40 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0e048a5ba6cf734485fc83cb3b264b8ff104ecb9;p=vaadin-framework.git Clarified error message (#12583) Change-Id: I542046158f6e78c8bb26aaee110bd5b123ae13e6 --- 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) + ".");