Make it easier to extend to override interceptor stack

Just as createAction is split out from init, it would be great to split out 
creating the interceptor iterator creation so it can be overridden without 
having to override all of init().  (Needed this to always prepend an i18n 
interceptor to all stacks).

Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/117f5fba
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/117f5fba
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/117f5fba

Branch: refs/heads/master
Commit: 117f5fbacc6193b1384f1cea3ee844252bfbdb3e
Parents: 41dd070
Author: Jasper <jasper_rosenb...@yahoo.com>
Authored: Fri Oct 9 07:41:05 2015 -0400
Committer: Jasper <jasper_rosenb...@yahoo.com>
Committed: Fri Oct 9 07:41:05 2015 -0400

----------------------------------------------------------------------
 .../java/com/opensymphony/xwork2/DefaultActionInvocation.java  | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/117f5fba/core/src/main/java/com/opensymphony/xwork2/DefaultActionInvocation.java
----------------------------------------------------------------------
diff --git 
a/core/src/main/java/com/opensymphony/xwork2/DefaultActionInvocation.java 
b/core/src/main/java/com/opensymphony/xwork2/DefaultActionInvocation.java
index a5b4723..d6385c6 100644
--- a/core/src/main/java/com/opensymphony/xwork2/DefaultActionInvocation.java
+++ b/core/src/main/java/com/opensymphony/xwork2/DefaultActionInvocation.java
@@ -396,7 +396,11 @@ public class DefaultActionInvocation implements 
ActionInvocation {
         invocationContext = new ActionContext(contextMap);
         invocationContext.setName(proxy.getActionName());
 
-        // get a new List so we don't get problems with the iterator if 
someone changes the list
+        createInterceptors(proxy);
+    }
+
+    protected void createInterceptors(ActionProxy proxy) {
+        // Get a new List so we don't get problems with the iterator if 
someone changes the original list
         List<InterceptorMapping> interceptorList = new 
ArrayList<>(proxy.getConfig().getInterceptors());
         interceptors = interceptorList.iterator();
     }

Reply via email to