diff options
author | Leif Åstrand <leif@vaadin.com> | 2013-04-17 11:04:42 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2013-04-17 08:17:47 +0000 |
commit | 1c4adacdc2c59a4dd33633806902cb6224141954 (patch) | |
tree | 311b735e3a07631f8b7f540c7fef80d8e11dcc21 | |
parent | 847389883fc5203624cc5df804c953fc5db19da6 (diff) | |
download | vaadin-framework-1c4adacdc2c59a4dd33633806902cb6224141954.tar.gz vaadin-framework-1c4adacdc2c59a4dd33633806902cb6224141954.zip |
Remove redundant locking (#8894)
Change-Id: I2a5176fe0c329e66d9e7a87825fc99a03fb5d708
-rw-r--r-- | server/src/com/vaadin/server/VaadinService.java | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/server/src/com/vaadin/server/VaadinService.java b/server/src/com/vaadin/server/VaadinService.java index 7d93904248..43d37a72b3 100644 --- a/server/src/com/vaadin/server/VaadinService.java +++ b/server/src/com/vaadin/server/VaadinService.java @@ -880,6 +880,7 @@ public abstract class VaadinService implements Serializable { * */ public UI findUI(VaadinRequest request) { + // getForSession asserts that the lock is held VaadinSession session = VaadinSession.getForSession(this, request.getWrappedSession()); @@ -887,16 +888,10 @@ public abstract class VaadinService implements Serializable { String uiIdString = request.getParameter(UIConstants.UI_ID_PARAMETER); int uiId = Integer.parseInt(uiIdString); - // Get lock before accessing data in session - session.lock(); - try { - UI ui = session.getUIById(uiId); + UI ui = session.getUIById(uiId); - UI.setCurrent(ui); - return ui; - } finally { - session.unlock(); - } + UI.setCurrent(ui); + return ui; } /** |