pzampino commented on a change in pull request #337:
URL: https://github.com/apache/knox/pull/337#discussion_r433856451



##########
File path: 
gateway-server/src/main/java/org/apache/knox/gateway/services/token/impl/DefaultTokenStateService.java
##########
@@ -319,16 +366,17 @@ protected void evictExpiredTokens() {
    */
   protected boolean needsEviction(final String tokenId) throws 
UnknownTokenException {
     // If the expiration time(+ grace period) has already passed, it should be 
considered expired
-    long expirationWithGrace = getTokenExpiration(tokenId) + 
TimeUnit.SECONDS.toMillis(tokenEvictionGracePeriod);
+    long expirationWithGrace = getTokenExpiration(tokenId, false) + 
TimeUnit.SECONDS.toMillis(tokenEvictionGracePeriod);
     return (expirationWithGrace <= System.currentTimeMillis());
   }
 
   /**
    * Get a list of tokens
    *
-   * @return List of tokens
+   * @return
    */
   protected List<String> getTokens() {
-    return new ArrayList<>(tokenExpirations.keySet());
+    return tokenExpirations.keySet().stream().collect(Collectors.toList());

Review comment:
       Yes, good catch




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to