[java-support] branch maint-7 updated: JSPT-89 Fix test by making class follow javadoc

Rod Widdowson rdw at steadingsoftware.com
Tue Jun 11 03:36:59 EDT 2019


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch maint-7
in repository java-support.

View the commit online:
http://git.shibboleth.net/view/?p=java-support.git;a=commit;h=343e3a216c7750bc95f6cf44587f905c48bd6b45

The following commit(s) were added to refs/heads/maint-7 by this push:
       new  343e3a2   JSPT-89 Fix test by making class follow javadoc
343e3a2 is described below

commit 343e3a216c7750bc95f6cf44587f905c48bd6b45
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Tue Jun 11 08:36:08 2019 +0100

    JSPT-89 Fix test by making class follow javadoc
    
    https://issues.shibboleth.net/jira/browse/JSPT-89
    
    Rewrite of Brent's patch from  9df63ce4d7ee
---
 .../utilities/java/support/httpclient/IdleConnectionSweeper.java | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/main/java/net/shibboleth/utilities/java/support/httpclient/IdleConnectionSweeper.java b/src/main/java/net/shibboleth/utilities/java/support/httpclient/IdleConnectionSweeper.java
index dd383f1..cb68fce 100644
--- a/src/main/java/net/shibboleth/utilities/java/support/httpclient/IdleConnectionSweeper.java
+++ b/src/main/java/net/shibboleth/utilities/java/support/httpclient/IdleConnectionSweeper.java
@@ -22,6 +22,7 @@ import java.util.TimerTask;
 import java.util.concurrent.TimeUnit;
 
 import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
 
 import net.shibboleth.utilities.java.support.component.DestroyedComponentException;
 import net.shibboleth.utilities.java.support.component.DestructableComponent;
@@ -50,6 +51,9 @@ public class IdleConnectionSweeper implements DestructableComponent {
 
     /** Sweeping task executed by the timer. */
     private final TimerTask sweeper;
+    
+    /** Time at which the sweeper last executed. */
+    @Nullable private long executionTime;
 
     /**
      * Constructor. This method will create a daemon {@link Timer} and use it to periodically sweep connections.
@@ -81,6 +85,8 @@ public class IdleConnectionSweeper implements DestructableComponent {
         sweeper = new TimerTask() {
             public void run() {
                 connectionManager.closeIdleConnections(idleTimeout, TimeUnit.MILLISECONDS);
+                executionTime = System.currentTimeMillis();
+
             }
         };
 
@@ -97,6 +103,9 @@ public class IdleConnectionSweeper implements DestructableComponent {
         if (isDestroyed()) {
             throw new DestroyedComponentException();
         }
+        if (executionTime != 0) {
+            return executionTime;
+        }
 
         return sweeper.scheduledExecutionTime();
     }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list