From 0e048a5ba6cf734485fc83cb3b264b8ff104ecb9 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Mon, 16 Sep 2013 15:49:35 +0300 Subject: [PATCH] Clarified error message (#12583) Change-Id: I542046158f6e78c8bb26aaee110bd5b123ae13e6 --- server/src/com/vaadin/ui/UI.java | 7 +++++-- 1 file 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) + "."); -- 2.39.5