diff --git a/core/src/main/java/org/apache/struts2/interceptor/ProfilingActivationInterceptor.java b/core/src/main/java/org/apache/struts2/interceptor/ProfilingActivationInterceptor.java index d5be374e1..70927a468 100644 --- a/core/src/main/java/org/apache/struts2/interceptor/ProfilingActivationInterceptor.java +++ b/core/src/main/java/org/apache/struts2/interceptor/ProfilingActivationInterceptor.java @@ -27,6 +27,7 @@ import com.opensymphony.xwork2.interceptor.AbstractInterceptor; import com.opensymphony.xwork2.util.profiling.UtilTimerStack; import org.apache.commons.lang3.BooleanUtils; import org.apache.struts2.StrutsConstants; +import org.apache.struts2.dispatcher.Parameter; /** * @@ -93,9 +94,9 @@ public class ProfilingActivationInterceptor extends AbstractInterceptor { @Override public String intercept(ActionInvocation invocation) throws Exception { if (devMode) { - Object val = invocation.getInvocationContext().getParameters().get(profilingKey); - if (val != null) { - String sval = (val instanceof String ? (String)val : ((String[])val)[0]); + Parameter val = invocation.getInvocationContext().getParameters().get(profilingKey); + if (val.isDefined()) { + String sval = val.getValue(); boolean enable = BooleanUtils.toBoolean(sval); UtilTimerStack.setActive(enable); invocation.getInvocationContext().getParameters().remove(profilingKey); diff --git a/core/src/main/java/org/apache/struts2/interceptor/ScopeInterceptor.java b/core/src/main/java/org/apache/struts2/interceptor/ScopeInterceptor.java index fff296b30..3bdad8ea9 100644 --- a/core/src/main/java/org/apache/struts2/interceptor/ScopeInterceptor.java +++ b/core/src/main/java/org/apache/struts2/interceptor/ScopeInterceptor.java @@ -299,7 +299,7 @@ public class ScopeInterceptor extends AbstractInterceptor implements PreResultLi } } - if (ActionContext.getContext().getParameters().get(sessionReset) != null) { + if (ActionContext.getContext().getParameters().get(sessionReset).isDefined()) { return; }