Skip to content

Commit

Permalink
5
Browse files Browse the repository at this point in the history
  • Loading branch information
xinyiZzz committed Sep 21, 2023
1 parent 42ce45c commit bb55cd4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package org.apache.doris.service.arrowflight.tokens;

import static com.google.common.base.Preconditions.checkNotNull;
import com.google.common.base.Preconditions;

/**
* Details of a token.
Expand All @@ -29,8 +29,10 @@ public final class TokenDetails {
public final long expiresAt;

private TokenDetails(String token, String username, long expiresAt) {
this.token = checkNotNull(token);
this.username = checkNotNull(username);
Preconditions.checkNotNull(token);
Preconditions.checkNotNull(username);
this.token = token;
this.username = username;
this.expiresAt = expiresAt;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

import org.apache.doris.service.arrowflight.auth2.DorisAuthResult;

import com.google.common.base.Preconditions;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import static com.google.common.base.Preconditions.checkArgument;
import com.google.common.cache.LoadingCache;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Expand Down Expand Up @@ -100,7 +100,7 @@ public void invalidateToken(final String token) {
}

private SessionState getSessionState(final String token) {
checkArgument(token != null, "invalid token");
Preconditions.checkNotNull(token, "invalid token");
final SessionState value;
try {
value = tokenCache.getUnchecked(token);
Expand All @@ -109,6 +109,4 @@ private SessionState getSessionState(final String token) {
}

return value;
}
}

0 comments on commit bb55cd4

Please sign in to comment.