You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ta...@apache.org on 2015/09/22 21:21:39 UTC

svn commit: r1704699 - in /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces: cdi/view/ViewScopeBeanHolder.java flow/cdi/FlowScopeBeanHolder.java

Author: tandraschko
Date: Tue Sep 22 19:21:36 2015
New Revision: 1704699

URL: http://svn.apache.org/viewvc?rev=1704699&view=rev
Log:
MYFACES-3985 [perf] avoid field initialization on CDI beans

Modified:
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/cdi/view/ViewScopeBeanHolder.java
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/flow/cdi/FlowScopeBeanHolder.java

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/cdi/view/ViewScopeBeanHolder.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/cdi/view/ViewScopeBeanHolder.java?rev=1704699&r1=1704698&r2=1704699&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/cdi/view/ViewScopeBeanHolder.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/cdi/view/ViewScopeBeanHolder.java Tue Sep 22 19:21:36 2015
@@ -48,8 +48,7 @@ public class ViewScopeBeanHolder impleme
      * value: the {@link ViewScopeContextualStorage} which holds all the
      * {@link javax.enterprise.inject.spi.Bean}s.
      */
-    private Map<String, ViewScopeContextualStorage> storageMap = 
-        new ConcurrentHashMap<String, ViewScopeContextualStorage>();
+    private Map<String, ViewScopeContextualStorage> storageMap;
     
     private static final Random RANDOM_GENERATOR = new Random();
     
@@ -67,6 +66,7 @@ public class ViewScopeBeanHolder impleme
     @PostConstruct
     public void init()
     {
+        storageMap = new ConcurrentHashMap<String, ViewScopeContextualStorage>();
         FacesContext facesContext = FacesContext.getCurrentInstance();
         facesContext.getExternalContext().getSessionMap().put(VIEW_SCOPE_PREFIX_KEY,
             1);

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/flow/cdi/FlowScopeBeanHolder.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/flow/cdi/FlowScopeBeanHolder.java?rev=1704699&r1=1704698&r2=1704699&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/flow/cdi/FlowScopeBeanHolder.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/flow/cdi/FlowScopeBeanHolder.java Tue Sep 22 19:21:36 2015
@@ -66,11 +66,11 @@ public class FlowScopeBeanHolder impleme
      * value: the {@link ContextualStorage} which holds all the
      * {@link javax.enterprise.inject.spi.Bean}s.
      */
-    private Map<String, ContextualStorage> storageMap = new ConcurrentHashMap<String, ContextualStorage>();
+    private Map<String, ContextualStorage> storageMap;
     
-    private Map<String, List<String>> activeFlowMapKeys = new ConcurrentHashMap<String, List<String>>();
+    private Map<String, List<String>> activeFlowMapKeys;
     
-    private FacesFlowClientWindowCollection windowCollection = null;
+    private FacesFlowClientWindowCollection windowCollection;
     
     public static final String CURRENT_FLOW_SCOPE_MAP = "oam.CURRENT_FLOW_SCOPE_MAP";
     
@@ -88,6 +88,10 @@ public class FlowScopeBeanHolder impleme
     @PostConstruct
     public void init()
     {
+        storageMap = new ConcurrentHashMap<String, ContextualStorage>();
+        activeFlowMapKeys = new ConcurrentHashMap<String, List<String>>();
+        windowCollection = null;
+        
         FacesContext facesContext = FacesContext.getCurrentInstance();
         this.refreshClientWindow(facesContext);
         facesContext.getExternalContext().getSessionMap().put(FLOW_SCOPE_PREFIX_KEY,