SHIRO-515 [1/2] Mark the ExecutorServiceSessionValidationScheduler "enabled" 
even with a 0 interval


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

Branch: refs/heads/1.3.x
Commit: 21f7fe4b73251dedcc768c89f1427120f1708e94
Parents: b7f846b
Author: Andreas Kohn <[email protected]>
Authored: Tue Jun 28 18:46:51 2016 +0200
Committer: Brian Demers <[email protected]>
Committed: Wed Jun 29 10:12:36 2016 -0700

----------------------------------------------------------------------
 .../session/mgt/ExecutorServiceSessionValidationScheduler.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/shiro/blob/21f7fe4b/core/src/main/java/org/apache/shiro/session/mgt/ExecutorServiceSessionValidationScheduler.java
----------------------------------------------------------------------
diff --git 
a/core/src/main/java/org/apache/shiro/session/mgt/ExecutorServiceSessionValidationScheduler.java
 
b/core/src/main/java/org/apache/shiro/session/mgt/ExecutorServiceSessionValidationScheduler.java
index 6c24c1b..3b4cf70 100644
--- 
a/core/src/main/java/org/apache/shiro/session/mgt/ExecutorServiceSessionValidationScheduler.java
+++ 
b/core/src/main/java/org/apache/shiro/session/mgt/ExecutorServiceSessionValidationScheduler.java
@@ -90,8 +90,8 @@ public class ExecutorServiceSessionValidationScheduler 
implements SessionValidat
                 }  
             });                  
             this.service.scheduleAtFixedRate(this, interval, interval, 
TimeUnit.MILLISECONDS);
-            this.enabled = true;
         }
+        this.enabled = true;
     }
 
     public void run() {
@@ -107,7 +107,9 @@ public class ExecutorServiceSessionValidationScheduler 
implements SessionValidat
     }
 
     public void disableSessionValidation() {
-        this.service.shutdownNow();
+        if (this.service != null) {
+            this.service.shutdownNow();
+        }
         this.enabled = false;
     }
 }

Reply via email to