aboutsummaryrefslogtreecommitdiffstats
path: root/server/src
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2015-10-26 15:44:44 +0000
committerVaadin Code Review <review@vaadin.com>2015-11-25 09:21:51 +0000
commit082851e5479a19df17084598944b45b53b38fd73 (patch)
treeed9a2a78d2454ac9f1df1796647b59f004d1862b /server/src
parent5f43e12492e565b6e29e50966ecbd380119718eb (diff)
downloadvaadin-framework-082851e5479a19df17084598944b45b53b38fd73.tar.gz
vaadin-framework-082851e5479a19df17084598944b45b53b38fd73.zip
Set session as current while deserializing (#9953)
Change-Id: Ib420f99c621b7d508659907615a7e8a1ae47b4d9
Diffstat (limited to 'server/src')
-rw-r--r--server/src/com/vaadin/server/VaadinSession.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/server/src/com/vaadin/server/VaadinSession.java b/server/src/com/vaadin/server/VaadinSession.java
index ab24694964..bcc07acb99 100644
--- a/server/src/com/vaadin/server/VaadinSession.java
+++ b/server/src/com/vaadin/server/VaadinSession.java
@@ -1410,8 +1410,13 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable {
*/
private void readObject(ObjectInputStream stream) throws IOException,
ClassNotFoundException {
- stream.defaultReadObject();
- pendingAccessQueue = new ConcurrentLinkedQueue<FutureAccess>();
+ Map<Class<?>, CurrentInstance> old = CurrentInstance.setCurrent(this);
+ try {
+ stream.defaultReadObject();
+ pendingAccessQueue = new ConcurrentLinkedQueue<FutureAccess>();
+ } finally {
+ CurrentInstance.restoreInstances(old);
+ }
}
/**