From 898db674f971d1744c8a723f42fa904786f84859 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leif=20=C3=85strand?= Date: Thu, 22 Dec 2011 13:39:55 +0200 Subject: [PATCH] Also check contents of BrowserDetails to determine if details are there --- src/com/vaadin/Application.java | 8 +++++--- .../com/vaadin/tests/components/root/LazyInitRoots.java | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/com/vaadin/Application.java b/src/com/vaadin/Application.java index bc2575a5fe..9d38c72dcd 100644 --- a/src/com/vaadin/Application.java +++ b/src/com/vaadin/Application.java @@ -2217,8 +2217,10 @@ public class Application implements Terminal.ErrorListener, Serializable { synchronized (this) { BrowserDetails browserDetails = request.getBrowserDetails(); + boolean hasBrowserDetails = browserDetails != null + && browserDetails.getUriFragment() != null; - if (browserDetails != null) { + if (hasBrowserDetails) { // Don't wait for a second request any more pendingRoots.remove(rootId); } @@ -2234,7 +2236,7 @@ public class Application implements Terminal.ErrorListener, Serializable { } Integer retainedRootId; - if (browserDetails == null) { + if (!hasBrowserDetails) { throw new RootRequiresMoreInformationException(); } else { String windowName = browserDetails.getWindowName(); @@ -2270,7 +2272,7 @@ public class Application implements Terminal.ErrorListener, Serializable { boolean initRequiresBrowserDetails = preserveRoot || !root.getClass() .isAnnotationPresent(EagerInit.class); - if (initRequiresBrowserDetails && browserDetails == null) { + if (initRequiresBrowserDetails && !hasBrowserDetails) { pendingRoots.put(rootId, new PendingRootRequest(request)); } else { if (preserveRoot) { diff --git a/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.java b/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.java index 93bbc3995e..109e93f1b8 100644 --- a/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.java +++ b/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.java @@ -28,7 +28,8 @@ public class LazyInitRoots extends AbstractTestApplication { if (request.getParameter("lazyCreate") != null) { // Root created on second request final BrowserDetails browserDetails = request.getBrowserDetails(); - if (browserDetails == null) { + if (browserDetails == null + || browserDetails.getUriFragment() == null) { throw new RootRequiresMoreInformationException(); } else { Root root = new Root() { -- 2.39.5