diff --git a/core/src/main/java/com/opensymphony/xwork2/ActionContext.java b/core/src/main/java/com/opensymphony/xwork2/ActionContext.java index ac6b2bf94..d9f6f48cf 100644 --- a/core/src/main/java/com/opensymphony/xwork2/ActionContext.java +++ b/core/src/main/java/com/opensymphony/xwork2/ActionContext.java @@ -128,13 +128,13 @@ public class ActionContext implements Serializable { return new ActionContext(context); } - public static ActionContext bound(ActionContext actionContext) { + public static ActionContext bind(ActionContext actionContext) { ActionContext.setContext(actionContext); return ActionContext.getContext(); } - public static ActionContext ofAndBound(Map context) { - return bound(of(context)); + public static ActionContext ofAndBind(Map context) { + return bind(of(context)); } /** @@ -144,8 +144,8 @@ public class ActionContext implements Serializable { * @param actionContext ActionContext to be used for current thread * @return new ActionContext */ - public static ActionContext ofAndBound(ActionContext actionContext) { - return bound(actionContext); + public static ActionContext ofAndBind(ActionContext actionContext) { + return bind(actionContext); } /** diff --git a/core/src/main/java/com/opensymphony/xwork2/DefaultActionProxy.java b/core/src/main/java/com/opensymphony/xwork2/DefaultActionProxy.java index 85a7c1902..678a8309a 100644 --- a/core/src/main/java/com/opensymphony/xwork2/DefaultActionProxy.java +++ b/core/src/main/java/com/opensymphony/xwork2/DefaultActionProxy.java @@ -145,7 +145,7 @@ public class DefaultActionProxy implements ActionProxy, Serializable { public String execute() throws Exception { ActionContext nestedContext = ActionContext.getContext(); - ActionContext.bound(invocation.getInvocationContext()); + ActionContext.bind(invocation.getInvocationContext()); String retCode = null; @@ -153,7 +153,7 @@ public class DefaultActionProxy implements ActionProxy, Serializable { retCode = invocation.invoke(); } finally { if (cleanupContext) { - ActionContext.bound(nestedContext); + ActionContext.bind(nestedContext); } } diff --git a/core/src/main/java/com/opensymphony/xwork2/config/impl/DefaultConfiguration.java b/core/src/main/java/com/opensymphony/xwork2/config/impl/DefaultConfiguration.java index 4d65b2e79..b81813997 100644 --- a/core/src/main/java/com/opensymphony/xwork2/config/impl/DefaultConfiguration.java +++ b/core/src/main/java/com/opensymphony/xwork2/config/impl/DefaultConfiguration.java @@ -223,7 +223,7 @@ public class DefaultConfiguration implements Configuration { ActionContext context = ActionContext.getContext(); if (context == null) { ValueStack vs = cont.getInstance(ValueStackFactory.class).createValueStack(); - context = ActionContext.ofAndBound(vs.getContext()); + context = ActionContext.ofAndBind(vs.getContext()); } return context; } diff --git a/core/src/main/java/com/opensymphony/xwork2/util/XWorkTestCaseHelper.java b/core/src/main/java/com/opensymphony/xwork2/util/XWorkTestCaseHelper.java index 08913c814..f0ff4a64e 100644 --- a/core/src/main/java/com/opensymphony/xwork2/util/XWorkTestCaseHelper.java +++ b/core/src/main/java/com/opensymphony/xwork2/util/XWorkTestCaseHelper.java @@ -40,7 +40,7 @@ public class XWorkTestCaseHelper { // Reset the value stack ValueStack stack = container.getInstance(ValueStackFactory.class).createValueStack(); stack.getContext().put(ActionContext.CONTAINER, container); - ActionContext.ofAndBound(stack.getContext()); + ActionContext.ofAndBind(stack.getContext()); // clear out localization //container.getInstance(LocalizedTextUtil.class).reset(); @@ -80,7 +80,7 @@ public class XWorkTestCaseHelper { // Reset the value stack ValueStack stack = container.getInstance(ValueStackFactory.class).createValueStack(); stack.getContext().put(ActionContext.CONTAINER, container); - ActionContext.ofAndBound(stack.getContext()); + ActionContext.ofAndBind(stack.getContext()); return configurationManager; } diff --git a/core/src/main/java/org/apache/struts2/ServletActionContext.java b/core/src/main/java/org/apache/struts2/ServletActionContext.java index d3518cc2b..b85b5d179 100644 --- a/core/src/main/java/org/apache/struts2/ServletActionContext.java +++ b/core/src/main/java/org/apache/struts2/ServletActionContext.java @@ -49,7 +49,7 @@ public class ServletActionContext implements StrutsStatics { public static ActionContext getActionContext(HttpServletRequest req) { ValueStack vs = getValueStack(req); if (vs != null) { - return ActionContext.ofAndBound(vs.getContext()); + return ActionContext.ofAndBind(vs.getContext()); } else { return null; } diff --git a/core/src/main/java/org/apache/struts2/dispatcher/PrepareOperations.java b/core/src/main/java/org/apache/struts2/dispatcher/PrepareOperations.java index 3e4f268be..8415a56e2 100644 --- a/core/src/main/java/org/apache/struts2/dispatcher/PrepareOperations.java +++ b/core/src/main/java/org/apache/struts2/dispatcher/PrepareOperations.java @@ -77,13 +77,13 @@ public class PrepareOperations { ActionContext oldContext = ActionContext.getContext(); if (oldContext != null) { // detected existing context, so we are probably in a forward - ctx = ActionContext.ofAndBound(new HashMap<>(oldContext.getContextMap())); + ctx = ActionContext.ofAndBind(new HashMap<>(oldContext.getContextMap())); } else { ctx = ServletActionContext.getActionContext(request); //checks if we are probably in an async if (ctx == null) { ValueStack stack = dispatcher.getContainer().getInstance(ValueStackFactory.class).createValueStack(); stack.getContext().putAll(dispatcher.createContextMap(request, response, null)); - ctx = ActionContext.ofAndBound(stack.getContext()); + ctx = ActionContext.ofAndBind(stack.getContext()); } } request.setAttribute(CLEANUP_RECURSION_COUNTER, counter); diff --git a/core/src/main/java/org/apache/struts2/factory/StrutsActionProxy.java b/core/src/main/java/org/apache/struts2/factory/StrutsActionProxy.java index 56310d965..8b709529f 100644 --- a/core/src/main/java/org/apache/struts2/factory/StrutsActionProxy.java +++ b/core/src/main/java/org/apache/struts2/factory/StrutsActionProxy.java @@ -36,7 +36,7 @@ public class StrutsActionProxy extends DefaultActionProxy { public String execute() throws Exception { ActionContext previous = ActionContext.getContext(); - ActionContext.bound(invocation.getInvocationContext()); + ActionContext.bind(invocation.getInvocationContext()); try { // This is for the new API: // return RequestContextImpl.callInContext(invocation, new Callable() { @@ -48,7 +48,7 @@ public class StrutsActionProxy extends DefaultActionProxy { return invocation.invoke(); } finally { if (cleanupContext) - ActionContext.bound(previous); + ActionContext.bind(previous); } } diff --git a/core/src/main/java/org/apache/struts2/interceptor/BackgroundProcess.java b/core/src/main/java/org/apache/struts2/interceptor/BackgroundProcess.java index f9be7c198..eed1811e0 100644 --- a/core/src/main/java/org/apache/struts2/interceptor/BackgroundProcess.java +++ b/core/src/main/java/org/apache/struts2/interceptor/BackgroundProcess.java @@ -76,7 +76,7 @@ public class BackgroundProcess implements Serializable { * @throws Exception any exception thrown will be thrown, in turn, by the ExecuteAndWaitInterceptor */ protected void beforeInvocation() throws Exception { - ActionContext.bound(invocation.getInvocationContext()); + ActionContext.bind(invocation.getInvocationContext()); } /** diff --git a/core/src/main/java/org/apache/struts2/util/InvocationSessionStore.java b/core/src/main/java/org/apache/struts2/util/InvocationSessionStore.java index 5c8054c89..26965995b 100644 --- a/core/src/main/java/org/apache/struts2/util/InvocationSessionStore.java +++ b/core/src/main/java/org/apache/struts2/util/InvocationSessionStore.java @@ -62,7 +62,7 @@ public class InvocationSessionStore { // would already be closed at this point (causing failures if used for output). final ActionContext savedActionContext = savedInvocation.getInvocationContext(); final ActionContext previousActionContext = ActionContext.getContext(); - ActionContext.bound(savedActionContext); + ActionContext.bind(savedActionContext); savedActionContext.setValueStack(savedInvocation.getStack()); if (previousActionContext != null) { savedActionContext.setPageContext(previousActionContext.getPageContext()); diff --git a/core/src/main/java/org/apache/struts2/util/StrutsTestCaseHelper.java b/core/src/main/java/org/apache/struts2/util/StrutsTestCaseHelper.java index b46ffbec1..ca3323d1e 100644 --- a/core/src/main/java/org/apache/struts2/util/StrutsTestCaseHelper.java +++ b/core/src/main/java/org/apache/struts2/util/StrutsTestCaseHelper.java @@ -48,7 +48,7 @@ public class StrutsTestCaseHelper { Container container = du.getContainer(); ValueStack stack = container.getInstance(ValueStackFactory.class).createValueStack(); stack.getContext().put(ActionContext.CONTAINER, container); - ActionContext.ofAndBound(stack.getContext()); + ActionContext.ofAndBind(stack.getContext()); return du; } diff --git a/core/src/main/java/org/apache/struts2/views/jsp/TagUtils.java b/core/src/main/java/org/apache/struts2/views/jsp/TagUtils.java index a6fa1ea7a..0b610b199 100644 --- a/core/src/main/java/org/apache/struts2/views/jsp/TagUtils.java +++ b/core/src/main/java/org/apache/struts2/views/jsp/TagUtils.java @@ -69,7 +69,7 @@ public class TagUtils { req.setAttribute(ServletActionContext.STRUTS_VALUESTACK_KEY, stack); // also tie this stack/context to the ThreadLocal - ActionContext.ofAndBound(stack.getContext()); + ActionContext.ofAndBind(stack.getContext()); } else { // let's make sure that the current page context is in the action context // TODO: refactor this to stop using put() diff --git a/core/src/test/java/com/opensymphony/xwork2/ActionContextTest.java b/core/src/test/java/com/opensymphony/xwork2/ActionContextTest.java index 503aee78b..70bc3c5d5 100644 --- a/core/src/test/java/com/opensymphony/xwork2/ActionContextTest.java +++ b/core/src/test/java/com/opensymphony/xwork2/ActionContextTest.java @@ -57,7 +57,7 @@ public class ActionContextTest extends XWorkTestCase { extraContext.put(ActionContext.SESSION, session); extraContext.put(ActionContext.PARAMETERS, HttpParameters.create(params).build()); extraContext.put(ActionContext.ACTION_NAME, ACTION_NAME); - context = ActionContext.ofAndBound(extraContext); + context = ActionContext.ofAndBind(extraContext); } public void testContextParams() { @@ -87,7 +87,7 @@ public class ActionContextTest extends XWorkTestCase { public void testContextMap() { Map map = new HashMap<>(); - ActionContext.ofAndBound(map); + ActionContext.ofAndBind(map); assertEquals(map, ActionContext.getContext().getContextMap()); } diff --git a/core/src/test/java/com/opensymphony/xwork2/ActionContextThreadLocalTest.java b/core/src/test/java/com/opensymphony/xwork2/ActionContextThreadLocalTest.java index 75bc0d5cc..efc876b20 100644 --- a/core/src/test/java/com/opensymphony/xwork2/ActionContextThreadLocalTest.java +++ b/core/src/test/java/com/opensymphony/xwork2/ActionContextThreadLocalTest.java @@ -38,7 +38,7 @@ public class ActionContextThreadLocalTest extends TestCase { } public void testSetContext() { - ActionContext context = ActionContext.ofAndBound(new HashMap<>()); + ActionContext context = ActionContext.ofAndBind(new HashMap<>()); assertEquals(context, ActionContext.getContext()); } diff --git a/core/src/test/java/com/opensymphony/xwork2/ActionSupportTest.java b/core/src/test/java/com/opensymphony/xwork2/ActionSupportTest.java index 739c0dddb..c6ea0808c 100644 --- a/core/src/test/java/com/opensymphony/xwork2/ActionSupportTest.java +++ b/core/src/test/java/com/opensymphony/xwork2/ActionSupportTest.java @@ -159,7 +159,7 @@ public class ActionSupportTest extends XWorkTestCase { ActionContext.getContext().setLocale(Locale.ITALY); assertEquals(Locale.ITALY, as.getLocale()); - ActionContext.ofAndBound(new HashMap<>()); + ActionContext.ofAndBind(new HashMap<>()); assertEquals(defLocale, as.getLocale()); // ActionContext will create a new context, when it was set to null before } diff --git a/core/src/test/java/com/opensymphony/xwork2/ChainResultTest.java b/core/src/test/java/com/opensymphony/xwork2/ChainResultTest.java index c1e22ed24..f806cafdb 100644 --- a/core/src/test/java/com/opensymphony/xwork2/ChainResultTest.java +++ b/core/src/test/java/com/opensymphony/xwork2/ChainResultTest.java @@ -104,7 +104,7 @@ public class ChainResultTest extends XWorkTestCase { invocationMock.matchAndReturn("getInvocationContext", ActionContext.getContext()); try { - ActionContext.bound(stack.getActionContext()); + ActionContext.bind(stack.getActionContext()); result.execute((ActionInvocation) invocationMock.proxy()); actionProxyMock.verify(); } finally { diff --git a/core/src/test/java/com/opensymphony/xwork2/DefaultTextProviderTest.java b/core/src/test/java/com/opensymphony/xwork2/DefaultTextProviderTest.java index 51692b8c5..302439936 100644 --- a/core/src/test/java/com/opensymphony/xwork2/DefaultTextProviderTest.java +++ b/core/src/test/java/com/opensymphony/xwork2/DefaultTextProviderTest.java @@ -129,7 +129,7 @@ public class DefaultTextProviderTest extends XWorkTestCase { protected void setUp() throws Exception { super.setUp(); - ActionContext ctx = ActionContext.ofAndBound(new HashMap<>()); + ActionContext ctx = ActionContext.ofAndBind(new HashMap<>()); ctx.setLocale(Locale.CANADA); container.getInstance(LocalizedTextProvider.class).addDefaultResourceBundle(DefaultTextProviderTest.class.getName()); diff --git a/core/src/test/java/com/opensymphony/xwork2/LocaleAwareTest.java b/core/src/test/java/com/opensymphony/xwork2/LocaleAwareTest.java index 2db12eaa2..47f0f0f36 100644 --- a/core/src/test/java/com/opensymphony/xwork2/LocaleAwareTest.java +++ b/core/src/test/java/com/opensymphony/xwork2/LocaleAwareTest.java @@ -69,6 +69,6 @@ public class LocaleAwareTest extends XWorkTestCase { ValueStack stack = container.getInstance(ValueStackFactory.class).createValueStack(); stack.getActionContext().setContainer(container); - ActionContext.ofAndBound(stack.getContext()); + ActionContext.ofAndBind(stack.getContext()); } } diff --git a/core/src/test/java/com/opensymphony/xwork2/StubValueStack.java b/core/src/test/java/com/opensymphony/xwork2/StubValueStack.java index 197d3ad7a..6b5ed38e4 100644 --- a/core/src/test/java/com/opensymphony/xwork2/StubValueStack.java +++ b/core/src/test/java/com/opensymphony/xwork2/StubValueStack.java @@ -37,7 +37,7 @@ public class StubValueStack implements ValueStack { @Override public ActionContext getActionContext() { - return ActionContext.ofAndBound(ctx); + return ActionContext.ofAndBind(ctx); } public void setDefaultType(Class defaultType) { diff --git a/core/src/test/java/com/opensymphony/xwork2/interceptor/ChainingInterceptorTest.java b/core/src/test/java/com/opensymphony/xwork2/interceptor/ChainingInterceptorTest.java index a344ffcce..b89b5140b 100644 --- a/core/src/test/java/com/opensymphony/xwork2/interceptor/ChainingInterceptorTest.java +++ b/core/src/test/java/com/opensymphony/xwork2/interceptor/ChainingInterceptorTest.java @@ -154,7 +154,7 @@ public class ChainingInterceptorTest extends XWorkTestCase { mockInvocation = new Mock(ActionInvocation.class); mockInvocation.expectAndReturn("getStack", stack); mockInvocation.expectAndReturn("invoke", Action.SUCCESS); - mockInvocation.expectAndReturn("getInvocationContext", ActionContext.ofAndBound(new HashMap<>())); + mockInvocation.expectAndReturn("getInvocationContext", ActionContext.ofAndBind(new HashMap<>())); mockInvocation.expectAndReturn("getResult", new ActionChainResult()); invocation = (ActionInvocation) mockInvocation.proxy(); interceptor = new ChainingInterceptor(); diff --git a/core/src/test/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptorTest.java b/core/src/test/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptorTest.java index 5bbdc87ba..559cca80f 100644 --- a/core/src/test/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptorTest.java +++ b/core/src/test/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptorTest.java @@ -128,7 +128,7 @@ public class ConversionErrorInterceptorTest extends XWorkTestCase { } private ActionContext createActionContext() { - ActionContext ac = ActionContext.ofAndBound(stack.getContext()); + ActionContext ac = ActionContext.ofAndBind(stack.getContext()); ac.setConversionErrors(conversionErrors); ac.setValueStack(stack); return ac; @@ -141,7 +141,7 @@ public class ConversionErrorInterceptorTest extends XWorkTestCase { mockInvocation = new Mock(ActionInvocation.class); invocation = (ActionInvocation) mockInvocation.proxy(); stack = ActionContext.getContext().getValueStack(); - context = ActionContext.ofAndBound(stack.getContext()); + context = ActionContext.ofAndBind(stack.getContext()); conversionErrors = new HashMap<>(); context.setConversionErrors(conversionErrors); mockInvocation.matchAndReturn("getInvocationContext", context); diff --git a/core/src/test/java/com/opensymphony/xwork2/interceptor/DefaultWorkflowInterceptorTest.java b/core/src/test/java/com/opensymphony/xwork2/interceptor/DefaultWorkflowInterceptorTest.java index ce2a316d1..5af6f3f8a 100644 --- a/core/src/test/java/com/opensymphony/xwork2/interceptor/DefaultWorkflowInterceptorTest.java +++ b/core/src/test/java/com/opensymphony/xwork2/interceptor/DefaultWorkflowInterceptorTest.java @@ -183,7 +183,7 @@ public class DefaultWorkflowInterceptorTest extends XWorkTestCase { EasyMock.replay(action); EasyMock.replay(proxy); - ActionContext actionContext = ActionContext.ofAndBound(new HashMap<>()); + ActionContext actionContext = ActionContext.ofAndBind(new HashMap<>()); actionContext.setActionInvocation(invocation); } diff --git a/core/src/test/java/com/opensymphony/xwork2/interceptor/ExceptionMappingInterceptorTest.java b/core/src/test/java/com/opensymphony/xwork2/interceptor/ExceptionMappingInterceptorTest.java index c276bba17..37bcabc55 100644 --- a/core/src/test/java/com/opensymphony/xwork2/interceptor/ExceptionMappingInterceptorTest.java +++ b/core/src/test/java/com/opensymphony/xwork2/interceptor/ExceptionMappingInterceptorTest.java @@ -293,7 +293,7 @@ public class ExceptionMappingInterceptorTest extends XWorkTestCase { stack = ActionContext.getContext().getValueStack(); mockInvocation = new Mock(ActionInvocation.class); mockInvocation.expectAndReturn("getStack", stack); - mockInvocation.expectAndReturn("getInvocationContext", ActionContext.ofAndBound(new HashMap<>())); + mockInvocation.expectAndReturn("getInvocationContext", ActionContext.ofAndBind(new HashMap<>())); interceptor = new ExceptionMappingInterceptor(); interceptor.init(); } diff --git a/core/src/test/java/com/opensymphony/xwork2/interceptor/ParameterRemoverInterceptorTest.java b/core/src/test/java/com/opensymphony/xwork2/interceptor/ParameterRemoverInterceptorTest.java index 511b73a9c..c65376fd8 100644 --- a/core/src/test/java/com/opensymphony/xwork2/interceptor/ParameterRemoverInterceptorTest.java +++ b/core/src/test/java/com/opensymphony/xwork2/interceptor/ParameterRemoverInterceptorTest.java @@ -45,7 +45,7 @@ public class ParameterRemoverInterceptorTest extends TestCase { @Override protected void setUp() throws Exception { contextMap = new LinkedHashMap<>(); - context = ActionContext.ofAndBound(contextMap); + context = ActionContext.ofAndBind(contextMap); actionInvocation = createMock(ActionInvocation.class); expect(actionInvocation.getAction()).andStubReturn(new SampleAction()); diff --git a/core/src/test/java/com/opensymphony/xwork2/interceptor/ValidationErrorAwareTest.java b/core/src/test/java/com/opensymphony/xwork2/interceptor/ValidationErrorAwareTest.java index eadf1e990..8eb52ba0d 100644 --- a/core/src/test/java/com/opensymphony/xwork2/interceptor/ValidationErrorAwareTest.java +++ b/core/src/test/java/com/opensymphony/xwork2/interceptor/ValidationErrorAwareTest.java @@ -87,7 +87,7 @@ public class ValidationErrorAwareTest extends XWorkTestCase { EasyMock.replay(action); EasyMock.replay(proxy); - ActionContext context = ActionContext.ofAndBound(new HashMap<>()); + ActionContext context = ActionContext.ofAndBind(new HashMap<>()); context.setActionInvocation(invocation); } diff --git a/core/src/test/java/com/opensymphony/xwork2/interceptor/ValidationInterceptorPrefixMethodInvocationTest.java b/core/src/test/java/com/opensymphony/xwork2/interceptor/ValidationInterceptorPrefixMethodInvocationTest.java index 644b5fa91..11d5adcfc 100644 --- a/core/src/test/java/com/opensymphony/xwork2/interceptor/ValidationInterceptorPrefixMethodInvocationTest.java +++ b/core/src/test/java/com/opensymphony/xwork2/interceptor/ValidationInterceptorPrefixMethodInvocationTest.java @@ -101,7 +101,7 @@ public class ValidationInterceptorPrefixMethodInvocationTest extends XWorkTestCa EasyMock.replay(action); EasyMock.replay(proxy); - ActionContext context = ActionContext.ofAndBound(new HashMap<>()); + ActionContext context = ActionContext.ofAndBind(new HashMap<>()); context.setActionInvocation(invocation); } } diff --git a/core/src/test/java/com/opensymphony/xwork2/interceptor/annotations/AnnotationParameterFilterInterceptorTest.java b/core/src/test/java/com/opensymphony/xwork2/interceptor/annotations/AnnotationParameterFilterInterceptorTest.java index 580971644..05c01518f 100644 --- a/core/src/test/java/com/opensymphony/xwork2/interceptor/annotations/AnnotationParameterFilterInterceptorTest.java +++ b/core/src/test/java/com/opensymphony/xwork2/interceptor/annotations/AnnotationParameterFilterInterceptorTest.java @@ -55,7 +55,7 @@ public class AnnotationParameterFilterInterceptorTest extends TestCase { parameterMap.put("job", "Baker"); parameterMap.put("name", "Martin"); - ActionContext actionContext = ActionContext.ofAndBound(new HashMap<>()); + ActionContext actionContext = ActionContext.ofAndBind(new HashMap<>()); actionContext.setParameters(HttpParameters.create(parameterMap).build()); Action action = new BlockingByDefaultAction(); @@ -92,7 +92,7 @@ public class AnnotationParameterFilterInterceptorTest extends TestCase { parameterMap.put("job", "Baker"); parameterMap.put("name", "Martin"); - ActionContext actionContext = ActionContext.ofAndBound(new HashMap<>()); + ActionContext actionContext = ActionContext.ofAndBind(new HashMap<>()); actionContext.setParameters(HttpParameters.create(parameterMap).build()); Action action = new AllowingByDefaultAction(); @@ -131,7 +131,7 @@ public class AnnotationParameterFilterInterceptorTest extends TestCase { parameterMap.put("m1", "s1"); parameterMap.put("m2", "s2"); - ActionContext actionContext = ActionContext.ofAndBound(new HashMap<>()); + ActionContext actionContext = ActionContext.ofAndBind(new HashMap<>()); actionContext.setParameters(HttpParameters.create(parameterMap).build()); stack.push(new BlockingByDefaultModel()); @@ -170,7 +170,7 @@ public class AnnotationParameterFilterInterceptorTest extends TestCase { parameterMap.put("m1", "s1"); parameterMap.put("m2", "s2"); - ActionContext actionContext = ActionContext.ofAndBound(new HashMap<>()); + ActionContext actionContext = ActionContext.ofAndBind(new HashMap<>()); actionContext.setParameters(HttpParameters.create(parameterMap).build()); stack.push(new AllowingByDefaultModel()); diff --git a/core/src/test/java/com/opensymphony/xwork2/spring/interceptor/ActionAutowiringInterceptorTest.java b/core/src/test/java/com/opensymphony/xwork2/spring/interceptor/ActionAutowiringInterceptorTest.java index 3bb2b84e3..bb73d3605 100644 --- a/core/src/test/java/com/opensymphony/xwork2/spring/interceptor/ActionAutowiringInterceptorTest.java +++ b/core/src/test/java/com/opensymphony/xwork2/spring/interceptor/ActionAutowiringInterceptorTest.java @@ -78,7 +78,7 @@ public class ActionAutowiringInterceptorTest extends XWorkTestCase { protected void loadSpringApplicationContextIntoApplication(ApplicationContext appContext) { Map context = new HashMap<>(); - ActionContext actionContext = ActionContext.ofAndBound(context); + ActionContext actionContext = ActionContext.ofAndBind(context); Map application = new HashMap<>(); application.put(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, appContext); @@ -105,7 +105,7 @@ public class ActionAutowiringInterceptorTest extends XWorkTestCase { public void testIfApplicationContextIsNullThenBeanWillNotBeWiredUp() throws Exception { Map context = new HashMap<>(); - ActionContext actionContext = ActionContext.ofAndBound(context); + ActionContext actionContext = ActionContext.ofAndBind(context); actionContext.setApplication(new HashMap<>()); diff --git a/core/src/test/java/com/opensymphony/xwork2/validator/ConversionErrorFieldValidatorTest.java b/core/src/test/java/com/opensymphony/xwork2/validator/ConversionErrorFieldValidatorTest.java index 56c0732f3..cc343da75 100644 --- a/core/src/test/java/com/opensymphony/xwork2/validator/ConversionErrorFieldValidatorTest.java +++ b/core/src/test/java/com/opensymphony/xwork2/validator/ConversionErrorFieldValidatorTest.java @@ -49,7 +49,7 @@ public class ConversionErrorFieldValidatorTest extends XWorkTestCase { public void setUp() throws Exception { super.setUp(); ValueStack stack = ActionContext.getContext().getValueStack(); - ActionContext context = ActionContext.ofAndBound(stack.getContext()); + ActionContext context = ActionContext.ofAndBind(stack.getContext()); Map conversionErrors = new HashMap<>(); conversionErrors.put("foo", new ConversionData("bar", Integer.class)); diff --git a/core/src/test/java/com/opensymphony/xwork2/validator/DefaultActionValidatorManagerTest.java b/core/src/test/java/com/opensymphony/xwork2/validator/DefaultActionValidatorManagerTest.java index 98769242b..d0cad7551 100644 --- a/core/src/test/java/com/opensymphony/xwork2/validator/DefaultActionValidatorManagerTest.java +++ b/core/src/test/java/com/opensymphony/xwork2/validator/DefaultActionValidatorManagerTest.java @@ -67,7 +67,7 @@ public class DefaultActionValidatorManagerTest extends XWorkTestCase { actionValidatorManager.setValidatorFactory((ValidatorFactory)mockValidatorFactory.proxy()); stubValueStack = new StubValueStack(); - ActionContext actionContext = ActionContext.ofAndBound(new HashMap<>()); + ActionContext actionContext = ActionContext.ofAndBind(new HashMap<>()); actionContext.setValueStack(stubValueStack); DefaultFileManagerFactory factory = new DefaultFileManagerFactory(); diff --git a/core/src/test/java/com/opensymphony/xwork2/validator/SimpleActionValidationTest.java b/core/src/test/java/com/opensymphony/xwork2/validator/SimpleActionValidationTest.java index bd830cef4..363b331d4 100644 --- a/core/src/test/java/com/opensymphony/xwork2/validator/SimpleActionValidationTest.java +++ b/core/src/test/java/com/opensymphony/xwork2/validator/SimpleActionValidationTest.java @@ -54,7 +54,7 @@ public class SimpleActionValidationTest extends XWorkTestCase { assertFalse(validationAware.hasFieldErrors()); // put in an out-of-range value to see if the old validators still work - ActionContext.ofAndBound(new HashMap<>()); + ActionContext.ofAndBind(new HashMap<>()); params.put("bar", "42"); extraContext.put(ActionContext.PARAMETERS, HttpParameters.create(params).build()); @@ -124,7 +124,7 @@ public class SimpleActionValidationTest extends XWorkTestCase { try { ActionProxy proxy = actionProxyFactory.createActionProxy("", MockConfigurationProvider.VALIDATION_ACTION_NAME, null, extraContext); ValueStack stack = ActionContext.getContext().getValueStack(); - ActionContext actionContext = ActionContext.ofAndBound(stack.getContext()); + ActionContext actionContext = ActionContext.ofAndBind(stack.getContext()); actionContext.setLocale(Locale.US); proxy.execute(); diff --git a/core/src/test/java/org/apache/struts2/ServletActionContextTest.java b/core/src/test/java/org/apache/struts2/ServletActionContextTest.java index 4f12bb210..7a1913e19 100644 --- a/core/src/test/java/org/apache/struts2/ServletActionContextTest.java +++ b/core/src/test/java/org/apache/struts2/ServletActionContextTest.java @@ -54,7 +54,7 @@ public class ServletActionContextTest extends TestCase implements StrutsStatics extraContext.put(HTTP_RESPONSE, response); extraContext.put(SERVLET_CONTEXT, servletContext); - actionContext = ActionContext.ofAndBound(extraContext); + actionContext = ActionContext.ofAndBind(extraContext); } public void testContextParams() { diff --git a/core/src/test/java/org/apache/struts2/interceptor/ClearSessionInterceptorTest.java b/core/src/test/java/org/apache/struts2/interceptor/ClearSessionInterceptorTest.java index e0b0350e4..65d3a80c3 100644 --- a/core/src/test/java/org/apache/struts2/interceptor/ClearSessionInterceptorTest.java +++ b/core/src/test/java/org/apache/struts2/interceptor/ClearSessionInterceptorTest.java @@ -34,7 +34,7 @@ public class ClearSessionInterceptorTest extends StrutsInternalTestCase { public void testCreateSession() throws Exception { ClearSessionInterceptor interceptor = new ClearSessionInterceptor(); MockActionInvocation invocation = new MockActionInvocation(); - ActionContext context = ActionContext.ofAndBound(new HashMap<>()); + ActionContext context = ActionContext.ofAndBind(new HashMap<>()); Map session = new HashMap<>(); session.put("Test1", "Test1"); session.put("Test2", "Test2"); diff --git a/core/src/test/java/org/apache/struts2/interceptor/I18nInterceptorTest.java b/core/src/test/java/org/apache/struts2/interceptor/I18nInterceptorTest.java index 8570a9054..927ad29fd 100644 --- a/core/src/test/java/org/apache/struts2/interceptor/I18nInterceptorTest.java +++ b/core/src/test/java/org/apache/struts2/interceptor/I18nInterceptorTest.java @@ -256,7 +256,7 @@ public class I18nInterceptorTest extends TestCase { interceptor.init(); session = new HashMap<>(); - ac = ActionContext.ofAndBound(new HashMap<>()); + ac = ActionContext.ofAndBind(new HashMap<>()); ac.setSession(session); ac.setParameters(HttpParameters.create().build()); diff --git a/core/src/test/java/org/apache/struts2/interceptor/MessageStoreInterceptorTest.java b/core/src/test/java/org/apache/struts2/interceptor/MessageStoreInterceptorTest.java index 56d7f4d19..09e51c71b 100644 --- a/core/src/test/java/org/apache/struts2/interceptor/MessageStoreInterceptorTest.java +++ b/core/src/test/java/org/apache/struts2/interceptor/MessageStoreInterceptorTest.java @@ -66,7 +66,7 @@ public class MessageStoreInterceptorTest extends StrutsInternalTestCase { action.addActionMessage("some action message 1"); action.addFieldError("field2", "some field error 2"); - ActionContext actionContext = ActionContext.ofAndBound(new HashMap<>()); + ActionContext actionContext = ActionContext.ofAndBind(new HashMap<>()); actionContext.setParameters(HttpParameters.create().build()); HttpSession mockedSession = EasyMock.createControl().createMock(HttpSession.class); @@ -141,7 +141,7 @@ public class MessageStoreInterceptorTest extends StrutsInternalTestCase { EasyMock.replay(mockedRequest); - ActionContext actionContext = ActionContext.ofAndBound(new HashMap<>()); + ActionContext actionContext = ActionContext.ofAndBind(new HashMap<>()); actionContext.setParameters(HttpParameters.create().build()); actionContext.setSession(sessionMap); @@ -193,7 +193,7 @@ public class MessageStoreInterceptorTest extends StrutsInternalTestCase { action.addFieldError("field1", "some field error 1"); action.addFieldError("field2", "some field error 2"); - ActionContext actionContext = ActionContext.ofAndBound(new HashMap<>()); + ActionContext actionContext = ActionContext.ofAndBind(new HashMap<>()); actionContext.setParameters(HttpParameters.create().build()); actionContext.setSession(sessionMap); @@ -236,7 +236,7 @@ public class MessageStoreInterceptorTest extends StrutsInternalTestCase { Map paramMap = new LinkedHashMap<>(); paramMap.put("operationMode", new String[]{MessageStoreInterceptor.RETRIEVE_MODE}); - ActionContext actionContext = ActionContext.ofAndBound(new HashMap<>()); + ActionContext actionContext = ActionContext.ofAndBind(new HashMap<>()); actionContext.setParameters(HttpParameters.create(paramMap).build()); ActionInvocation mockActionInvocation = EasyMock.createControl().createMock(ActionInvocation.class); @@ -259,7 +259,7 @@ public class MessageStoreInterceptorTest extends StrutsInternalTestCase { Map paramMap = new LinkedHashMap<>(); paramMap.put("operationMode", new String[]{MessageStoreInterceptor.STORE_MODE}); - ActionContext actionContext = ActionContext.ofAndBound(new HashMap<>()); + ActionContext actionContext = ActionContext.ofAndBind(new HashMap<>()); actionContext.setParameters(HttpParameters.create(paramMap).build()); ActionInvocation mockActionInvocation = EasyMock.createControl().createMock(ActionInvocation.class); @@ -279,7 +279,7 @@ public class MessageStoreInterceptorTest extends StrutsInternalTestCase { public void testRequestOperationMode3() { - ActionContext actionContext = ActionContext.ofAndBound(new HashMap<>()); + ActionContext actionContext = ActionContext.ofAndBind(new HashMap<>()); actionContext.setParameters(HttpParameters.create().build()); ActionInvocation mockActionInvocation = EasyMock.createControl().createMock(ActionInvocation.class); diff --git a/core/src/test/java/org/apache/struts2/interceptor/MessageStorePreResultListenerTest.java b/core/src/test/java/org/apache/struts2/interceptor/MessageStorePreResultListenerTest.java index 9b65ace12..5d4f5034a 100644 --- a/core/src/test/java/org/apache/struts2/interceptor/MessageStorePreResultListenerTest.java +++ b/core/src/test/java/org/apache/struts2/interceptor/MessageStorePreResultListenerTest.java @@ -43,7 +43,7 @@ public class MessageStorePreResultListenerTest extends StrutsInternalTestCase { public void testSessionWasInvalidated() { // given - ActionContext actionContext = ActionContext.ofAndBound(new HashMap<>()); + ActionContext actionContext = ActionContext.ofAndBind(new HashMap<>()); actionContext.setParameters(HttpParameters.create().build()); ActionInvocation mockActionInvocation = EasyMock.createControl().createMock(ActionInvocation.class); @@ -84,7 +84,7 @@ public class MessageStorePreResultListenerTest extends StrutsInternalTestCase { public void testResponseWasComitted() { // given - ActionContext actionContext = ActionContext.ofAndBound(new HashMap<>()); + ActionContext actionContext = ActionContext.ofAndBind(new HashMap<>()); actionContext.setParameters(HttpParameters.create().build()); ActionInvocation mockActionInvocation = EasyMock.createControl().createMock(ActionInvocation.class); @@ -131,7 +131,7 @@ public class MessageStorePreResultListenerTest extends StrutsInternalTestCase { action.addFieldError("field1", "some field error 1"); action.addFieldError("field2", "some field error 2"); - ActionContext actionContext = ActionContext.ofAndBound(new HashMap<>()); + ActionContext actionContext = ActionContext.ofAndBind(new HashMap<>()); actionContext.setParameters(HttpParameters.create().build()); actionContext.setSession(sessionMap); @@ -212,7 +212,7 @@ public class MessageStorePreResultListenerTest extends StrutsInternalTestCase { action.addFieldError("field1", "some field error 1"); action.addFieldError("field2", "some field error 2"); - ActionContext actionContext = ActionContext.ofAndBound(new HashMap<>()); + ActionContext actionContext = ActionContext.ofAndBind(new HashMap<>()); actionContext.setParameters(HttpParameters.create().build()); actionContext.setSession(sessionMap); diff --git a/core/src/test/java/org/apache/struts2/interceptor/StrutsConversionErrorInterceptorTest.java b/core/src/test/java/org/apache/struts2/interceptor/StrutsConversionErrorInterceptorTest.java index 801c6071b..83705e04f 100644 --- a/core/src/test/java/org/apache/struts2/interceptor/StrutsConversionErrorInterceptorTest.java +++ b/core/src/test/java/org/apache/struts2/interceptor/StrutsConversionErrorInterceptorTest.java @@ -83,7 +83,7 @@ public class StrutsConversionErrorInterceptorTest extends StrutsInternalTestCase mockInvocation = new Mock(ActionInvocation.class); invocation = (ActionInvocation) mockInvocation.proxy(); stack = ActionContext.getContext().getValueStack(); - context = ActionContext.ofAndBound(stack.getContext()); + context = ActionContext.ofAndBind(stack.getContext()); conversionErrors = new HashMap<>(); context.setConversionErrors(conversionErrors); mockInvocation.matchAndReturn("getInvocationContext", context); diff --git a/core/src/test/java/org/apache/struts2/interceptor/TokenInterceptorTest.java b/core/src/test/java/org/apache/struts2/interceptor/TokenInterceptorTest.java index 45e9f8e87..d68d0dc7e 100644 --- a/core/src/test/java/org/apache/struts2/interceptor/TokenInterceptorTest.java +++ b/core/src/test/java/org/apache/struts2/interceptor/TokenInterceptorTest.java @@ -122,7 +122,7 @@ public class TokenInterceptorTest extends StrutsInternalTestCase { ValueStack stack = ActionContext.getContext().getValueStack(); stack.getContext().putAll(extraContext); - oldContext = ActionContext.ofAndBound(stack.getContext()); + oldContext = ActionContext.ofAndBind(stack.getContext()); } protected ActionProxy buildProxy(String actionName) throws Exception { diff --git a/core/src/test/java/org/apache/struts2/result/PlainTextResultTest.java b/core/src/test/java/org/apache/struts2/result/PlainTextResultTest.java index 16451292a..906a1e7d9 100644 --- a/core/src/test/java/org/apache/struts2/result/PlainTextResultTest.java +++ b/core/src/test/java/org/apache/struts2/result/PlainTextResultTest.java @@ -130,7 +130,7 @@ public class PlainTextResultTest extends StrutsInternalTestCase { response.setWriter(writer); servletContext = new StrutsMockServletContext(); stack = ActionContext.getContext().getValueStack(); - context = ActionContext.ofAndBound(stack.getContext()); + context = ActionContext.ofAndBind(stack.getContext()); context.put(StrutsStatics.HTTP_RESPONSE, response); context.put(StrutsStatics.SERVLET_CONTEXT, servletContext); invocation = new MockActionInvocation(); diff --git a/core/src/test/java/org/apache/struts2/util/InvocationSessionStoreTest.java b/core/src/test/java/org/apache/struts2/util/InvocationSessionStoreTest.java index 0a7976ce7..05027f36a 100644 --- a/core/src/test/java/org/apache/struts2/util/InvocationSessionStoreTest.java +++ b/core/src/test/java/org/apache/struts2/util/InvocationSessionStoreTest.java @@ -71,7 +71,7 @@ public class InvocationSessionStoreTest extends StrutsInternalTestCase { ActionContext actionContext = ActionContext.getContext(); InvocationSessionStore.storeInvocation(INVOCATION_KEY, TOKEN_VALUE, invocation); - ActionContext actionContext2 = ActionContext.ofAndBound(new HashMap<>()); + ActionContext actionContext2 = ActionContext.ofAndBind(new HashMap<>()); actionContext2.setSession(session); assertEquals(actionContext2, ActionContext.getContext()); @@ -112,7 +112,7 @@ public class InvocationSessionStoreTest extends StrutsInternalTestCase { InvocationSessionStore.storeInvocation(INVOCATION_KEY, TOKEN_VALUE, invocation); - ActionContext actionContext2 = ActionContext.ofAndBound(new HashMap<>()); + ActionContext actionContext2 = ActionContext.ofAndBind(new HashMap<>()); actionContext2.setSession(session); assertEquals(actionContext2, ActionContext.getContext()); @@ -134,7 +134,7 @@ public class InvocationSessionStoreTest extends StrutsInternalTestCase { super.setUp(); stack = ActionContext.getContext().getValueStack(); - ActionContext actionContext = ActionContext.ofAndBound(stack.getContext()); + ActionContext actionContext = ActionContext.ofAndBind(stack.getContext()); session = new HashMap<>(); actionContext.setSession(session); diff --git a/core/src/test/java/org/apache/struts2/util/TokenHelperTest.java b/core/src/test/java/org/apache/struts2/util/TokenHelperTest.java index bb489def8..f3abebdac 100644 --- a/core/src/test/java/org/apache/struts2/util/TokenHelperTest.java +++ b/core/src/test/java/org/apache/struts2/util/TokenHelperTest.java @@ -87,7 +87,7 @@ public class TokenHelperTest extends TestCase { protected void setUp() throws Exception { session = new HashMap<>(); Map ctxMap = new TreeMap<>(); - ActionContext ctx = ActionContext.ofAndBound(ctxMap); + ActionContext ctx = ActionContext.ofAndBind(ctxMap); ctx.setSession(session); ctx.setParameters(HttpParameters.create().build()); } diff --git a/core/src/test/java/org/apache/struts2/views/freemarker/FreeMarkerResultTest.java b/core/src/test/java/org/apache/struts2/views/freemarker/FreeMarkerResultTest.java index 07d1fb20f..ebd477b90 100644 --- a/core/src/test/java/org/apache/struts2/views/freemarker/FreeMarkerResultTest.java +++ b/core/src/test/java/org/apache/struts2/views/freemarker/FreeMarkerResultTest.java @@ -134,7 +134,7 @@ public class FreeMarkerResultTest extends StrutsInternalTestCase { servletContext = new StrutsMockServletContext(); stack = ActionContext.getContext().getValueStack(); - context = ActionContext.ofAndBound(stack.getContext()); + context = ActionContext.ofAndBind(stack.getContext()); context.setServletResponse(response); context.setServletRequest(request); context.setServletContext(servletContext); diff --git a/core/src/test/java/org/apache/struts2/views/freemarker/FreemarkerResultMockedTest.java b/core/src/test/java/org/apache/struts2/views/freemarker/FreemarkerResultMockedTest.java index d88b8abab..7bdbe3928 100644 --- a/core/src/test/java/org/apache/struts2/views/freemarker/FreemarkerResultMockedTest.java +++ b/core/src/test/java/org/apache/struts2/views/freemarker/FreemarkerResultMockedTest.java @@ -246,7 +246,7 @@ public class FreemarkerResultMockedTest extends StrutsInternalTestCase { request = new MockHttpServletRequest(); stack = ActionContext.getContext().getValueStack(); - context = ActionContext.ofAndBound(stack.getContext()); + context = ActionContext.ofAndBind(stack.getContext()); context.setServletResponse(response); context.setServletRequest(request); context.setServletContext(servletContext); diff --git a/core/src/test/java/org/apache/struts2/views/jsp/AbstractTagTest.java b/core/src/test/java/org/apache/struts2/views/jsp/AbstractTagTest.java index dc814fd61..dfc722654 100644 --- a/core/src/test/java/org/apache/struts2/views/jsp/AbstractTagTest.java +++ b/core/src/test/java/org/apache/struts2/views/jsp/AbstractTagTest.java @@ -121,7 +121,7 @@ public abstract class AbstractTagTest extends StrutsInternalTestCase { extraContext.remove(ActionContext.LOCALE); stack.getContext().putAll(extraContext); - ActionContext actionContext = ActionContext.ofAndBound(context); + ActionContext actionContext = ActionContext.ofAndBind(context); actionContext.setServletRequest(request); actionContext.setServletResponse(response); actionContext.setServletContext(servletContext); diff --git a/core/src/test/java/org/apache/struts2/views/jsp/TextTagTest.java b/core/src/test/java/org/apache/struts2/views/jsp/TextTagTest.java index 1ec01755c..d0c4bada6 100644 --- a/core/src/test/java/org/apache/struts2/views/jsp/TextTagTest.java +++ b/core/src/test/java/org/apache/struts2/views/jsp/TextTagTest.java @@ -308,7 +308,7 @@ public class TextTagTest extends AbstractTagTest { super.setUp(); tag = new TextTag(); tag.setPageContext(pageContext); - ActionContext.ofAndBound(stack.getContext()); + ActionContext.ofAndBind(stack.getContext()); } protected void tearDown() throws Exception { diff --git a/core/src/test/java/org/apache/struts2/views/jsp/URLTagTest.java b/core/src/test/java/org/apache/struts2/views/jsp/URLTagTest.java index 5f89ab1e4..1b257474e 100644 --- a/core/src/test/java/org/apache/struts2/views/jsp/URLTagTest.java +++ b/core/src/test/java/org/apache/struts2/views/jsp/URLTagTest.java @@ -556,7 +556,7 @@ public class URLTagTest extends AbstractUITagTest { extraContext.remove(ActionContext.LOCALE); stack.getContext().putAll(extraContext); - ActionContext actionContext = ActionContext.ofAndBound(context); + ActionContext actionContext = ActionContext.ofAndBind(context); actionContext.setServletRequest(request); actionContext.setServletResponse(response); actionContext.setServletContext(servletContext); diff --git a/plugins/convention/src/test/java/org/apache/struts2/convention/PackageBasedActionConfigBuilderTest.java b/plugins/convention/src/test/java/org/apache/struts2/convention/PackageBasedActionConfigBuilderTest.java index ad6f927dd..d2fe6efdf 100644 --- a/plugins/convention/src/test/java/org/apache/struts2/convention/PackageBasedActionConfigBuilderTest.java +++ b/plugins/convention/src/test/java/org/apache/struts2/convention/PackageBasedActionConfigBuilderTest.java @@ -89,7 +89,7 @@ public class PackageBasedActionConfigBuilderTest extends TestCase { @Override public void setUp() throws Exception { super.setUp(); - ActionContext context = ActionContext.ofAndBound(new HashMap<>()); + ActionContext context = ActionContext.ofAndBind(new HashMap<>()); context.setContainer(new DummyContainer()); } @@ -691,7 +691,7 @@ public class PackageBasedActionConfigBuilderTest extends TestCase { ObjectFactory workingFactory = configuration.getContainer().getInstance(ObjectFactory.class); ConventionUnknownHandler uh = new ConventionUnknownHandler(configuration, workingFactory, context, mockContainer, "struts-default", null, "-"); - ActionContext actionContext = ActionContext.ofAndBound(Collections.emptyMap()); + ActionContext actionContext = ActionContext.ofAndBind(Collections.emptyMap()); Result result = uh.handleUnknownResult(actionContext, "foo", pkgConfig.getActionConfigs().get("foo"), "bar"); assertNotNull(result); diff --git a/plugins/embeddedjsp/src/test/java/org/apache/struts2/EmbeddedJSPResultTest.java b/plugins/embeddedjsp/src/test/java/org/apache/struts2/EmbeddedJSPResultTest.java index 27321dc63..08c5fcb19 100644 --- a/plugins/embeddedjsp/src/test/java/org/apache/struts2/EmbeddedJSPResultTest.java +++ b/plugins/embeddedjsp/src/test/java/org/apache/struts2/EmbeddedJSPResultTest.java @@ -329,7 +329,7 @@ public class EmbeddedJSPResultTest extends TestCase { EasyMock.replay(request); - ActionContext actionContext = ActionContext.ofAndBound(new HashMap<>()); + ActionContext actionContext = ActionContext.ofAndBind(new HashMap<>()); actionContext.setParameters(HttpParameters.create(params).build()); actionContext.setServletRequest(request); actionContext.setServletResponse(response); @@ -406,7 +406,7 @@ class ServletGetRunnable implements Runnable { } public void run() { - actionContext = ActionContext.bound(actionContext); + actionContext = ActionContext.bind(actionContext); //wait to start all threads at once..or try at least try { startBarrier.await(); diff --git a/plugins/javatemplates/src/test/java/org/apache/struts2/views/java/simple/AbstractTest.java b/plugins/javatemplates/src/test/java/org/apache/struts2/views/java/simple/AbstractTest.java index 08104478f..6be2010a4 100644 --- a/plugins/javatemplates/src/test/java/org/apache/struts2/views/java/simple/AbstractTest.java +++ b/plugins/javatemplates/src/test/java/org/apache/struts2/views/java/simple/AbstractTest.java @@ -121,7 +121,7 @@ public abstract class AbstractTest extends TestCase { replay(stack); replay(container); - ActionContext actionContext = ActionContext.ofAndBound(stackContext); + ActionContext actionContext = ActionContext.ofAndBind(stackContext); actionContext.setServletRequest(request); } diff --git a/plugins/javatemplates/src/test/java/org/apache/struts2/views/java/simple/TokenTest.java b/plugins/javatemplates/src/test/java/org/apache/struts2/views/java/simple/TokenTest.java index 42b6ad380..a579e72b8 100644 --- a/plugins/javatemplates/src/test/java/org/apache/struts2/views/java/simple/TokenTest.java +++ b/plugins/javatemplates/src/test/java/org/apache/struts2/views/java/simple/TokenTest.java @@ -50,7 +50,7 @@ public class TokenTest extends AbstractTest { super.setUp(); this.tag = new Token(stack, request, response); - ActionContext actionContext = ActionContext.ofAndBound(new HashMap<>()); + ActionContext actionContext = ActionContext.ofAndBind(new HashMap<>()); actionContext.setSession(new HashMap<>()); } diff --git a/plugins/junit/src/main/java/org/apache/struts2/StrutsJUnit4TestCase.java b/plugins/junit/src/main/java/org/apache/struts2/StrutsJUnit4TestCase.java index f46371613..75ce279b4 100644 --- a/plugins/junit/src/main/java/org/apache/struts2/StrutsJUnit4TestCase.java +++ b/plugins/junit/src/main/java/org/apache/struts2/StrutsJUnit4TestCase.java @@ -138,7 +138,7 @@ public abstract class StrutsJUnit4TestCase extends XWorkJUnit4TestCase { actionContext.setParameters(HttpParameters.create(request.getParameterMap()).build()); initSession(actionContext); // set the action context to the one used by the proxy - ActionContext.bound(actionContext); + ActionContext.bind(actionContext); } protected void initSession(ActionContext actionContext) { diff --git a/plugins/junit/src/main/java/org/apache/struts2/StrutsRestTestCase.java b/plugins/junit/src/main/java/org/apache/struts2/StrutsRestTestCase.java index f065ceb71..b4f84a6bb 100644 --- a/plugins/junit/src/main/java/org/apache/struts2/StrutsRestTestCase.java +++ b/plugins/junit/src/main/java/org/apache/struts2/StrutsRestTestCase.java @@ -122,7 +122,7 @@ public class StrutsRestTestCase extends StrutsJUnit4TestCase { invocationContext.getContextMap().put(ServletActionContext.ACTION_MAPPING, mapping); invocationContext.setParameters(HttpParameters.create(request.getParameterMap()).build()); // set the action context to the one used by the proxy - ActionContext.bound(invocationContext); + ActionContext.bind(invocationContext); // this is normally done in onSetUp(), but we are using Struts internal // objects (proxy and action invocation) diff --git a/plugins/junit/src/main/java/org/apache/struts2/StrutsTestCase.java b/plugins/junit/src/main/java/org/apache/struts2/StrutsTestCase.java index cf4bf7946..808ef6302 100644 --- a/plugins/junit/src/main/java/org/apache/struts2/StrutsTestCase.java +++ b/plugins/junit/src/main/java/org/apache/struts2/StrutsTestCase.java @@ -122,7 +122,7 @@ public abstract class StrutsTestCase extends XWorkTestCase { initSession(actionContext); applyAdditionalParams(actionContext); // set the action context to the one used by the proxy - ActionContext.bound(actionContext); + ActionContext.bind(actionContext); } protected void initSession(ActionContext actionContext) { diff --git a/plugins/osgi/src/main/java/org/apache/struts2/osgi/OsgiConfigurationProvider.java b/plugins/osgi/src/main/java/org/apache/struts2/osgi/OsgiConfigurationProvider.java index ba9c0d06b..e0e029158 100644 --- a/plugins/osgi/src/main/java/org/apache/struts2/osgi/OsgiConfigurationProvider.java +++ b/plugins/osgi/src/main/java/org/apache/struts2/osgi/OsgiConfigurationProvider.java @@ -101,7 +101,7 @@ public class OsgiConfigurationProvider implements PackageProvider, BundleListene } protected ActionContext createActionContext() { - return ActionContext.ofAndBound(new HashMap<>()); + return ActionContext.ofAndBind(new HashMap<>()); } /** diff --git a/plugins/portlet/src/test/java/org/apache/struts2/portlet/context/PortletActionContextTest.java b/plugins/portlet/src/test/java/org/apache/struts2/portlet/context/PortletActionContextTest.java index f544c23d1..960765f42 100644 --- a/plugins/portlet/src/test/java/org/apache/struts2/portlet/context/PortletActionContextTest.java +++ b/plugins/portlet/src/test/java/org/apache/struts2/portlet/context/PortletActionContextTest.java @@ -84,7 +84,7 @@ public class PortletActionContextTest extends MockObjectTestCase { portletConfig = (PortletConfig)mockPortletConfig.proxy(); - ActionContext.ofAndBound(context); + ActionContext.ofAndBind(context); } public void testGetPhase() { diff --git a/plugins/portlet/src/test/java/org/apache/struts2/portlet/interceptor/PortletAwareInterceptorTest.java b/plugins/portlet/src/test/java/org/apache/struts2/portlet/interceptor/PortletAwareInterceptorTest.java index b75f44cf3..6da37d1c2 100644 --- a/plugins/portlet/src/test/java/org/apache/struts2/portlet/interceptor/PortletAwareInterceptorTest.java +++ b/plugins/portlet/src/test/java/org/apache/struts2/portlet/interceptor/PortletAwareInterceptorTest.java @@ -46,7 +46,7 @@ public class PortletAwareInterceptorTest extends TestCase { PortletRequest request = EasyMock.createMock(PortletRequest.class); Map ctx = new HashMap<>(); ctx.put(PortletConstants.REQUEST, request); - ActionContext actionContext = ActionContext.ofAndBound(ctx); + ActionContext actionContext = ActionContext.ofAndBind(ctx); PortletRequestAware action = EasyMock.createMock(PortletRequestAware.class); action.setPortletRequest(request); @@ -66,7 +66,7 @@ public class PortletAwareInterceptorTest extends TestCase { public void testActionPortletRequestAware() throws Exception { PortletRequest request = EasyMock.createMock(PortletRequest.class); Map ctx = new HashMap<>(); - ActionContext actionContext = ActionContext.ofAndBound(ctx); + ActionContext actionContext = ActionContext.ofAndBind(ctx); ctx.put(PortletConstants.REQUEST, request); org.apache.struts2.portlet.action.PortletRequestAware action = EasyMock.createMock(org.apache.struts2.portlet.action.PortletRequestAware.class); action.withPortletRequest(request); @@ -87,7 +87,7 @@ public class PortletAwareInterceptorTest extends TestCase { PortletResponse response = EasyMock.createMock(PortletResponse.class); Map ctx = new HashMap<>(); ctx.put(PortletConstants.RESPONSE, response); - ActionContext actionContext = ActionContext.ofAndBound(ctx); + ActionContext actionContext = ActionContext.ofAndBind(ctx); org.apache.struts2.portlet.action.PortletResponseAware action = EasyMock.createMock(org.apache.struts2.portlet.action.PortletResponseAware.class); action.withPortletResponse(response); diff --git a/plugins/portlet/src/test/java/org/apache/struts2/portlet/interceptor/PortletStateInterceptorTest.java b/plugins/portlet/src/test/java/org/apache/struts2/portlet/interceptor/PortletStateInterceptorTest.java index 796aa8f82..aa67a683f 100644 --- a/plugins/portlet/src/test/java/org/apache/struts2/portlet/interceptor/PortletStateInterceptorTest.java +++ b/plugins/portlet/src/test/java/org/apache/struts2/portlet/interceptor/PortletStateInterceptorTest.java @@ -57,7 +57,7 @@ public class PortletStateInterceptorTest extends StrutsTestCasePortletTests { ctxMap.put(RESPONSE, actionResponse); Map session = new HashMap<>(); - ActionContext ctx = ActionContext.ofAndBound(ctxMap); + ActionContext ctx = ActionContext.ofAndBind(ctxMap); ctx.setSession(session); EasyMock.expect(invocation.getInvocationContext()).andStubReturn(ctx); actionResponse.setRenderParameter(EVENT_ACTION, "true"); @@ -96,7 +96,7 @@ public class PortletStateInterceptorTest extends StrutsTestCasePortletTests { ctxMap.put(PHASE, PortletPhase.RENDER_PHASE); ctxMap.put(REQUEST, renderRequest); - ActionContext ctx = ActionContext.ofAndBound(ctxMap); + ActionContext ctx = ActionContext.ofAndBind(ctxMap); ctx.setSession(session); EasyMock.expect(invocation.getInvocationContext()).andStubReturn(ctx); @@ -137,7 +137,7 @@ public class PortletStateInterceptorTest extends StrutsTestCasePortletTests { ctxMap.put(PHASE, PortletPhase.RENDER_PHASE); ctxMap.put(REQUEST, renderRequest); - ActionContext ctx = ActionContext.ofAndBound(ctxMap); + ActionContext ctx = ActionContext.ofAndBind(ctxMap); ctx.setSession(session); EasyMock.expect(invocation.getInvocationContext()).andStubReturn(ctx); diff --git a/plugins/portlet/src/test/java/org/apache/struts2/portlet/result/PortletResultTest.java b/plugins/portlet/src/test/java/org/apache/struts2/portlet/result/PortletResultTest.java index b7ee3d1b6..b522add49 100644 --- a/plugins/portlet/src/test/java/org/apache/struts2/portlet/result/PortletResultTest.java +++ b/plugins/portlet/src/test/java/org/apache/struts2/portlet/result/PortletResultTest.java @@ -65,7 +65,7 @@ public class PortletResultTest extends MockObjectTestCase implements StrutsStati Map sessionMap = new HashMap<>(); - ActionContext actionContext = ActionContext.ofAndBound(new HashMap<>()); + ActionContext actionContext = ActionContext.ofAndBind(new HashMap<>()); actionContext.setSession(sessionMap); actionContext.setParameters(HttpParameters.create().build()); actionContext.put(STRUTS_PORTLET_CONTEXT, mockCtx.proxy()); diff --git a/plugins/portlet/src/test/java/org/apache/struts2/portlet/util/PortletUrlHelperTest.java b/plugins/portlet/src/test/java/org/apache/struts2/portlet/util/PortletUrlHelperTest.java index 15dbe3ebf..1cd1b35ca 100644 --- a/plugins/portlet/src/test/java/org/apache/struts2/portlet/util/PortletUrlHelperTest.java +++ b/plugins/portlet/src/test/java/org/apache/struts2/portlet/util/PortletUrlHelperTest.java @@ -69,7 +69,7 @@ public class PortletUrlHelperTest extends TestCase { modeNamespaceMap.put("edit", "/edit"); modeNamespaceMap.put("help", "/help"); - ActionContext actionContext = ActionContext.ofAndBound(new HashMap<>()); + ActionContext actionContext = ActionContext.ofAndBind(new HashMap<>()); actionContext.put(REQUEST, renderRequest); actionContext.put(RESPONSE, renderResponse); actionContext.put(PHASE, PortletPhase.RENDER_PHASE); diff --git a/plugins/portlet/src/test/java/org/apache/struts2/views/jsp/PortletUrlTagTest.java b/plugins/portlet/src/test/java/org/apache/struts2/views/jsp/PortletUrlTagTest.java index 8628ef594..5419c853e 100644 --- a/plugins/portlet/src/test/java/org/apache/struts2/views/jsp/PortletUrlTagTest.java +++ b/plugins/portlet/src/test/java/org/apache/struts2/views/jsp/PortletUrlTagTest.java @@ -153,7 +153,7 @@ public class PortletUrlTagTest extends MockObjectTestCase { contextMap.put(PortletConstants.DEFAULT_ACTION_MAP, actionMap); contextMap.put(STRUTS_PORTLET_CONTEXT, mockCtx.proxy()); - ActionContext ctx = ActionContext.ofAndBound(contextMap); + ActionContext ctx = ActionContext.ofAndBind(contextMap); ctx.setValueStack(stack); ctx.setContainer(dispatcher.getContainer()); diff --git a/plugins/rest/src/test/java/org/apache/struts2/rest/ContentTypeHandlerManagerTest.java b/plugins/rest/src/test/java/org/apache/struts2/rest/ContentTypeHandlerManagerTest.java index 567f64ac9..aded3d195 100644 --- a/plugins/rest/src/test/java/org/apache/struts2/rest/ContentTypeHandlerManagerTest.java +++ b/plugins/rest/src/test/java/org/apache/struts2/rest/ContentTypeHandlerManagerTest.java @@ -58,7 +58,7 @@ public class ContentTypeHandlerManagerTest extends TestCase { mockResponse = new MockHttpServletResponse(); mockRequest = new MockHttpServletRequest(); mockRequest.setMethod("GET"); - ActionContext actionContext = ActionContext.ofAndBound(new HashMap<>()); + ActionContext actionContext = ActionContext.ofAndBind(new HashMap<>()); actionContext.setServletRequest(mockRequest); actionContext.setServletResponse(mockResponse); diff --git a/plugins/rest/src/test/java/org/apache/struts2/rest/RestWorkflowInterceptorTest.java b/plugins/rest/src/test/java/org/apache/struts2/rest/RestWorkflowInterceptorTest.java index c291dced9..9094c8f5f 100644 --- a/plugins/rest/src/test/java/org/apache/struts2/rest/RestWorkflowInterceptorTest.java +++ b/plugins/rest/src/test/java/org/apache/struts2/rest/RestWorkflowInterceptorTest.java @@ -51,7 +51,7 @@ public class RestWorkflowInterceptorTest extends TestCase { }, null); wf.setContentTypeHandlerManager((ContentTypeHandlerManager) mockContentTypeHandlerManager.proxy()); - ActionContext actionContext = ActionContext.ofAndBound(new HashMap<>()); + ActionContext actionContext = ActionContext.ofAndBind(new HashMap<>()); actionContext.setActionMapping(new ActionMapping()); wf.doIntercept((ActionInvocation) mockActionInvocation.proxy()); diff --git a/plugins/rest/src/test/java/org/apache/struts2/rest/handler/JuneauXmlHandlerTest.java b/plugins/rest/src/test/java/org/apache/struts2/rest/handler/JuneauXmlHandlerTest.java index 52e3d5feb..1241f2395 100644 --- a/plugins/rest/src/test/java/org/apache/struts2/rest/handler/JuneauXmlHandlerTest.java +++ b/plugins/rest/src/test/java/org/apache/struts2/rest/handler/JuneauXmlHandlerTest.java @@ -51,7 +51,7 @@ public class JuneauXmlHandlerTest extends XWorkTestCase { ""; handler = new JuneauXmlHandler(); ai = new MockActionInvocation(); - ActionContext context = ActionContext.ofAndBound(new HashMap<>()); + ActionContext context = ActionContext.ofAndBind(new HashMap<>()); context.setLocale(Locale.US); ((MockActionInvocation) ai).setInvocationContext(context); }