mirror of
https://github.com/apache/struts.git
synced 2026-08-07 07:37:20 +00:00
Cleans up code a bit
This commit is contained in:
@@ -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<String, Object> contextMap) {
|
||||
getContext().context = contextMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the context map.
|
||||
*
|
||||
* @return the context map.
|
||||
*/
|
||||
public Map<String, Object> getContextMap() {
|
||||
return new HashMap<>(getContext().context);
|
||||
return getContext().context;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -88,8 +88,9 @@ public class ActionContextTest extends XWorkTestCase {
|
||||
|
||||
public void testContextMap() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
context.setContextMap(map);
|
||||
assertEquals(map, context.getContextMap());
|
||||
ActionContext.setContext(new ActionContext(map));
|
||||
|
||||
assertEquals(map, ActionContext.getContext().getContextMap());
|
||||
}
|
||||
|
||||
public void testParameters() {
|
||||
|
||||
Reference in New Issue
Block a user