smolnar82 commented on a change in pull request #365:
URL: https://github.com/apache/knox/pull/365#discussion_r480022903
##########
File path:
gateway-server/src/main/java/org/apache/knox/gateway/services/token/impl/DefaultTokenStateService.java
##########
@@ -154,17 +177,16 @@ public long getTokenExpiration(final String tokenId)
throws UnknownTokenExceptio
@Override
public long getTokenExpiration(String tokenId, boolean validate) throws
UnknownTokenException {
- long expiration;
-
if (validate) {
validateToken(tokenId);
}
+ long expiration = -1;
synchronized (tokenExpirations) {
- if (!tokenExpirations.containsKey(tokenId)) {
- throw new UnknownTokenException(tokenId);
- }
- expiration = tokenExpirations.get(tokenId);
+ expiration = tokenExpirations.getOrDefault(tokenId, -1L);
+ }
+ if (expiration == -1) {
Review comment:
I left it as-is based on my previous comment.
----------------------------------------------------------------
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]