]> source.dussan.org Git - vaadin-framework.git/commitdiff
#8455 Root.getCurrentRoot can now be used in Root.init()
authorArtur Signell <artur@vaadin.com>
Mon, 19 Mar 2012 13:23:47 +0000 (15:23 +0200)
committerArtur Signell <artur@vaadin.com>
Wed, 21 Mar 2012 13:27:44 +0000 (15:27 +0200)
src/com/vaadin/Application.java

index fdb7de0454071aff6267966708ce90230e103d78..4d29654fef831594661d2c3eab6ba3283e6a4703 100644 (file)
@@ -2155,6 +2155,9 @@ public class Application implements Terminal.ErrorListener, Serializable {
                 }
             }
 
+            // Set thread local here so it is available in init
+            Root.setCurrentRoot(root);
+
             if (!initedRoots.contains(rootId)) {
                 boolean initRequiresBrowserDetails = isRootPreserved()
                         || !root.getClass()
@@ -2176,7 +2179,6 @@ public class Application implements Terminal.ErrorListener, Serializable {
             }
         } // end synchronized block
 
-        Root.setCurrentRoot(root);
         return root;
     }