From 4e94b5bed86aceadea9aca19be6f3d8bf1ffda61 Mon Sep 17 00:00:00 2001 From: Lukasz Lenart Date: Fri, 23 Mar 2018 08:51:06 +0100 Subject: [PATCH] Cleans up code a bit --- .../com/opensymphony/xwork2/ActionContext.java | 16 +--------------- .../opensymphony/xwork2/ActionContextTest.java | 5 +++-- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/core/src/main/java/com/opensymphony/xwork2/ActionContext.java b/core/src/main/java/com/opensymphony/xwork2/ActionContext.java index 010323040..f5a020c0e 100644 --- a/core/src/main/java/com/opensymphony/xwork2/ActionContext.java +++ b/core/src/main/java/com/opensymphony/xwork2/ActionContext.java @@ -83,11 +83,6 @@ public class ActionContext implements Serializable { */ public static final String LOCALE = "com.opensymphony.xwork2.ActionContext.locale"; - /** - * Constant for the action's type converter. - */ - public static final String TYPE_CONVERTER = "com.opensymphony.xwork2.ActionContext.typeConverter"; - /** * Constant for the action's {@link com.opensymphony.xwork2.ActionInvocation invocation} context. */ @@ -170,22 +165,13 @@ public class ActionContext implements Serializable { return actionContext.get(); } - /** - * Sets the action's context map. - * - * @param contextMap the context map. - */ - public void setContextMap(Map contextMap) { - getContext().context = contextMap; - } - /** * Gets the context map. * * @return the context map. */ public Map getContextMap() { - return new HashMap<>(getContext().context); + return getContext().context; } /** diff --git a/core/src/test/java/com/opensymphony/xwork2/ActionContextTest.java b/core/src/test/java/com/opensymphony/xwork2/ActionContextTest.java index ed8f39b31..05fcc3540 100644 --- a/core/src/test/java/com/opensymphony/xwork2/ActionContextTest.java +++ b/core/src/test/java/com/opensymphony/xwork2/ActionContextTest.java @@ -88,8 +88,9 @@ public class ActionContextTest extends XWorkTestCase { public void testContextMap() { Map map = new HashMap<>(); - context.setContextMap(map); - assertEquals(map, context.getContextMap()); + ActionContext.setContext(new ActionContext(map)); + + assertEquals(map, ActionContext.getContext().getContextMap()); } public void testParameters() {