From 9c7035cbe2f1ad2b89308bbb490674667f9ee522 Mon Sep 17 00:00:00 2001 From: Automerge Date: Thu, 29 Mar 2012 17:06:16 +0000 Subject: [PATCH] [merge from 6.7] Fixed #8580: After a UIDL request, hasActiveRequest was set to false after a new request was already underway. This used to work when active requests were tracked with an integer counter, but not after the #8505 changes. Also added relevant sanity checks to startRequest() and endRequest(). svn changeset:23359/svn branch:6.8 --- .../terminal/gwt/client/ApplicationConnection.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java index a05dc7d758..dd998e760c 100644 --- a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java +++ b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java @@ -737,6 +737,10 @@ public class ApplicationConnection { } protected void startRequest() { + if (hasActiveRequest) { + throw new IllegalStateException( + "Trying to start a new request while another is active"); + } hasActiveRequest = true; requestStartTime = new Date(); // show initial throbber @@ -761,11 +765,14 @@ public class ApplicationConnection { } protected void endRequest() { + if (!hasActiveRequest) { + throw new IllegalStateException("No active request"); + } + hasActiveRequest = false; if (applicationRunning) { checkForPendingVariableBursts(); runPostRequestHooks(configuration.getRootPanelId()); } - hasActiveRequest = false; // deferring to avoid flickering Scheduler.get().scheduleDeferred(new Command() { public void execute() { -- 2.39.5