Repository: struts
Updated Branches:
  refs/heads/master ef2939ffd -> 931df54ab


WW-4715 Uses isDefined function instead of null-checking


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/a245226b
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/a245226b
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/a245226b

Branch: refs/heads/master
Commit: a245226b7f1fa2a2cd94508b132f0220989c1e5b
Parents: ef2939f
Author: Lukasz Lenart <lukaszlen...@apache.org>
Authored: Wed Nov 16 07:21:38 2016 +0100
Committer: Lukasz Lenart <lukaszlen...@apache.org>
Committed: Wed Nov 16 07:21:38 2016 +0100

----------------------------------------------------------------------
 .../struts2/interceptor/ProfilingActivationInterceptor.java   | 7 ++++---
 .../java/org/apache/struts2/interceptor/ScopeInterceptor.java | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/a245226b/core/src/main/java/org/apache/struts2/interceptor/ProfilingActivationInterceptor.java
----------------------------------------------------------------------
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 d5be374..70927a4 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;
 
 /**
  * <!-- START SNIPPET: description -->
@@ -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);

http://git-wip-us.apache.org/repos/asf/struts/blob/a245226b/core/src/main/java/org/apache/struts2/interceptor/ScopeInterceptor.java
----------------------------------------------------------------------
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 fff296b..3bdad8e 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;
         }
 

Reply via email to