diff options
author | Johannes Dahlström <johannesd@vaadin.com> | 2012-10-18 13:41:09 +0000 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2012-10-18 13:41:09 +0000 |
commit | 06efa74eafcf78e3654c60bd5c14bb97bed2b13d (patch) | |
tree | fed6cbf8fbbe4de94df4b90341eabe9ad377876e | |
parent | 81f4c52f79b1c79d5b3bf4299874f20dbf0d90a5 (diff) | |
parent | f32a6384d86cb264f7aa57658072ab82430fc6a4 (diff) | |
download | vaadin-framework-06efa74eafcf78e3654c60bd5c14bb97bed2b13d.tar.gz vaadin-framework-06efa74eafcf78e3654c60bd5c14bb97bed2b13d.zip |
Merge "Improve message when session is already set (#9989)"
-rw-r--r-- | server/src/com/vaadin/ui/UI.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/server/src/com/vaadin/ui/UI.java b/server/src/com/vaadin/ui/UI.java index 2878d10fa1..d57d38b371 100644 --- a/server/src/com/vaadin/ui/UI.java +++ b/server/src/com/vaadin/ui/UI.java @@ -709,7 +709,10 @@ public abstract class UI extends AbstractComponentContainer implements public void setSession(VaadinServiceSession session) { if ((session == null) == (this.session == null)) { throw new IllegalStateException( - "VaadinSession has already been set"); + "VaadinServiceSession has already been set. Old session: " + + getSessionDetails(this.session) + + ". New session: " + getSessionDetails(session) + + "."); } else { if (session == null) { detach(); @@ -722,6 +725,15 @@ public abstract class UI extends AbstractComponentContainer implements } } + private static String getSessionDetails(VaadinServiceSession session) { + if (session == null) { + return null; + } else { + return session.toString() + " for " + + session.getService().getServiceName(); + } + } + /** * Gets the id of the UI, used to identify this UI within its application * when processing requests. The UI id should be present in every request to |