Author: lukaszlenart Date: Tue Mar 26 06:14:18 2013 New Revision: 1460983 URL: http://svn.apache.org/r1460983 Log: WW-2537 Cleans up code and adds usage of generics
Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/ActionContext.java Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/ActionContext.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/ActionContext.java?rev=1460983&r1=1460982&r2=1460983&view=diff ============================================================================== --- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/ActionContext.java (original) +++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/ActionContext.java Tue Mar 26 06:14:18 2013 @@ -40,14 +40,8 @@ import java.util.Map; * @author Bill Lynch (docs) */ public class ActionContext implements Serializable { - static ThreadLocal actionContext = new ThreadLocal(); - /** - * Constant that indicates the action is running under a "development mode". - * This mode provides more feedback that is useful for developers but probably - * too verbose/error prone for production. - */ - //public static final String DEV_MODE = "__devMode"; + static ThreadLocal<ActionContext> actionContext = new ThreadLocal<ActionContext>(); /** * Constant for the name of the action being executed. @@ -100,8 +94,7 @@ public class ActionContext implements Se */ public static final String CONTAINER = "com.opensymphony.xwork2.ActionContext.container"; - Map<String, Object> context; - + private Map<String, Object> context; /** * Creates a new ActionContext initialized with another context. @@ -164,16 +157,7 @@ public class ActionContext implements Se * @return the ActionContext for the current thread, is never <tt>null</tt>. */ public static ActionContext getContext() { - return (ActionContext) actionContext.get(); - - // Don't do lazy context creation, as it requires container; the creation of which may - // precede the context creation - //if (context == null) { - // ValueStack vs = ValueStackFactory.getFactory().createValueStack(); - // context = new ActionContext(vs.getContext()); - // setContext(context); - //} - + return actionContext.get(); } /**