yasserzamani commented on code in PR #571:
URL: https://github.com/apache/struts/pull/571#discussion_r899800362


##########
core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java:
##########
@@ -656,6 +649,36 @@ public void serviceAction(HttpServletRequest request, 
HttpServletResponse respon
         }
     }
 
+    private ActionProxy prepareActionProxy(Map<String, Object> extraContext, 
String actionNamespace, String actionName, String actionMethod) {
+        ActionProxy proxy;
+        //check if we are probably in an async resuming
+        ActionInvocation invocation = 
ActionContext.getContext().getActionInvocation();
+        if (invocation == null || invocation.isExecuted()) {
+            LOG.trace("Creating a new action, namespace: {}, name: {}, method: 
{}", actionNamespace, actionName, actionMethod);
+            proxy = createActionProxy(actionNamespace, actionName, 
actionMethod, extraContext);
+        } else {
+            proxy = invocation.getProxy();
+            if (isSameAction(proxy, actionNamespace, actionName, 
actionMethod)) {
+                LOG.trace("Proxy: {} matches requested action, namespace: {}, 
name: {}, method: {} - reusing proxy", proxy, actionNamespace, actionName, 
actionMethod);
+            } else {
+                LOG.trace("Proxy: {} doesn't match action namespace: {}, name: 
{}, method: {} - creating new proxy", proxy, actionNamespace, actionName, 
actionMethod);
+                proxy = createActionProxy(actionNamespace, actionName, 
actionMethod, extraContext);

Review Comment:
   to avoid StackOverflowException, shouldn't this line go to if(isSame) 
statement instead of else statement? because I think StackOverflow happens when 
we forward to same action again and again, but the if statement is empty, 
doesn't do anything functional, just logs.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@struts.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to