summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2013-04-17 11:04:42 +0300
committerVaadin Code Review <review@vaadin.com>2013-04-17 08:17:47 +0000
commit1c4adacdc2c59a4dd33633806902cb6224141954 (patch)
tree311b735e3a07631f8b7f540c7fef80d8e11dcc21
parent847389883fc5203624cc5df804c953fc5db19da6 (diff)
downloadvaadin-framework-1c4adacdc2c59a4dd33633806902cb6224141954.tar.gz
vaadin-framework-1c4adacdc2c59a4dd33633806902cb6224141954.zip
Remove redundant locking (#8894)
Change-Id: I2a5176fe0c329e66d9e7a87825fc99a03fb5d708
-rw-r--r--server/src/com/vaadin/server/VaadinService.java13
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;
}
/**