diff --git a/fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/tokens/TokenDetails.java b/fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/tokens/TokenDetails.java index 7f55d37dd990f1..762601e47edcbb 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/tokens/TokenDetails.java +++ b/fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/tokens/TokenDetails.java @@ -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. @@ -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; } diff --git a/fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/tokens/TokenManagerImpl.java b/fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/tokens/TokenManagerImpl.java index dfc248811c6b84..f305eab8b440b4 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/tokens/TokenManagerImpl.java +++ b/fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/tokens/TokenManagerImpl.java @@ -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; @@ -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); @@ -109,6 +109,4 @@ private SessionState getSessionState(final String token) { } return value; - } -}