You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by me...@apache.org on 2023/01/06 22:30:21 UTC

[myfaces] branch main updated: MYFACES-4542 - fix outbound-parameters not passed to nested flows (#472)

This is an automated email from the ASF dual-hosted git repository.

melloware pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/myfaces.git


The following commit(s) were added to refs/heads/main by this push:
     new 75a006d33 MYFACES-4542 - fix outbound-parameters not passed to nested flows (#472)
75a006d33 is described below

commit 75a006d3356027dfdd27961889a5dc3140142e10
Author: Volodymyr Siedlecki <vo...@gmail.com>
AuthorDate: Fri Jan 6 17:30:16 2023 -0500

    MYFACES-4542 - fix outbound-parameters not passed to nested flows (#472)
---
 .../apache/myfaces/flow/cdi/FlowScopeContext.java  | 42 ++++++----------------
 1 file changed, 10 insertions(+), 32 deletions(-)

diff --git a/impl/src/main/java/org/apache/myfaces/flow/cdi/FlowScopeContext.java b/impl/src/main/java/org/apache/myfaces/flow/cdi/FlowScopeContext.java
index e88be9c21..05e48798a 100644
--- a/impl/src/main/java/org/apache/myfaces/flow/cdi/FlowScopeContext.java
+++ b/impl/src/main/java/org/apache/myfaces/flow/cdi/FlowScopeContext.java
@@ -152,24 +152,20 @@ public class FlowScopeContext implements Context
             }
         }
         
-        List<String> activeFlowMapKeys = getStorageHolder(facesContext).getActiveFlowMapKeys(facesContext);
-        for (String flowMapKey : activeFlowMapKeys)
+        ContextualStorage storage = getContextualStorage(facesContext, true,
+                getCurrentClientWindowFlowId(facesContext));
+        Map<Object, ContextualInstanceInfo<?>> contextMap = storage.getStorage();
+        ContextualInstanceInfo<?> contextualInstanceInfo = contextMap.get(storage.getBeanKey(bean));
+        if (contextualInstanceInfo != null)
         {
-            ContextualStorage storage = getContextualStorage(facesContext, false, flowMapKey);
-            if (storage == null)
-            {
-                continue;
-            }
-
-            Map<Object, ContextualInstanceInfo<?>> contextMap = storage.getStorage();
-            ContextualInstanceInfo<?> contextualInstanceInfo = contextMap.get(storage.getBeanKey(bean));
-            if (contextualInstanceInfo == null)
+            @SuppressWarnings("unchecked")
+            final T instance = (T) contextualInstanceInfo.getContextualInstance();
+            if (instance != null)
             {
-                continue;
+                return instance;
             }
-
-            return (T) contextualInstanceInfo.getContextualInstance();
         }
+        
         return null;
     }
 
@@ -240,24 +236,6 @@ public class FlowScopeContext implements Context
 
             return storage.createContextualInstance(bean, creationalContext);
         }
-
-        List<String> activeFlowMapKeys = getStorageHolder(facesContext).getActiveFlowMapKeys(facesContext);
-        for (String flowMapKey : activeFlowMapKeys)
-        {
-            ContextualStorage storage = getContextualStorage(facesContext, true, flowMapKey);
-
-            Map<Object, ContextualInstanceInfo<?>> contextMap = storage.getStorage();
-            ContextualInstanceInfo<?> contextualInstanceInfo = contextMap.get(storage.getBeanKey(bean));
-            if (contextualInstanceInfo != null)
-            {
-                @SuppressWarnings("unchecked")
-                final T instance = (T) contextualInstanceInfo.getContextualInstance();
-                if (instance != null)
-                {
-                    return instance;
-                }
-            }
-        }
         
         ContextualStorage storage = getContextualStorage(facesContext, true,
                 getCurrentClientWindowFlowId(facesContext));