diff --git a/client/trino-cli/pom.xml b/client/trino-cli/pom.xml index ffb955431ed7..cc5d0ca10db7 100644 --- a/client/trino-cli/pom.xml +++ b/client/trino-cli/pom.xml @@ -26,8 +26,8 @@ - com.google.code.findbugs - jsr305 + com.google.errorprone + error_prone_annotations true @@ -68,6 +68,11 @@ trino-parser + + jakarta.annotation + jakarta.annotation-api + + net.sf.opencsv opencsv diff --git a/client/trino-cli/src/main/java/io/trino/cli/Pager.java b/client/trino-cli/src/main/java/io/trino/cli/Pager.java index db0c8e592d52..27ea0e1d173d 100644 --- a/client/trino-cli/src/main/java/io/trino/cli/Pager.java +++ b/client/trino-cli/src/main/java/io/trino/cli/Pager.java @@ -14,8 +14,7 @@ package io.trino.cli; import com.google.common.collect.ImmutableList; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.FilterOutputStream; import java.io.IOException; diff --git a/client/trino-cli/src/main/java/io/trino/cli/ThreadInterruptor.java b/client/trino-cli/src/main/java/io/trino/cli/ThreadInterruptor.java index 6d23f2369b4e..f7386fa5563a 100644 --- a/client/trino-cli/src/main/java/io/trino/cli/ThreadInterruptor.java +++ b/client/trino-cli/src/main/java/io/trino/cli/ThreadInterruptor.java @@ -13,7 +13,7 @@ */ package io.trino.cli; -import javax.annotation.concurrent.GuardedBy; +import com.google.errorprone.annotations.concurrent.GuardedBy; import java.io.Closeable; diff --git a/client/trino-client/pom.xml b/client/trino-client/pom.xml index 18a7d41413fa..b498968e8dca 100644 --- a/client/trino-client/pom.xml +++ b/client/trino-client/pom.xml @@ -39,8 +39,8 @@ - com.google.code.findbugs - jsr305 + com.google.errorprone + error_prone_annotations true @@ -71,6 +71,11 @@ 1.7 + + jakarta.annotation + jakarta.annotation-api + + com.google.inject guice diff --git a/client/trino-client/src/main/java/io/trino/client/ClientTypeSignature.java b/client/trino-client/src/main/java/io/trino/client/ClientTypeSignature.java index 36e7c992e0b2..b408006b9949 100644 --- a/client/trino-client/src/main/java/io/trino/client/ClientTypeSignature.java +++ b/client/trino-client/src/main/java/io/trino/client/ClientTypeSignature.java @@ -16,10 +16,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.Immutable; import io.trino.client.ClientTypeSignatureParameter.ParameterKind; -import javax.annotation.concurrent.Immutable; - import java.util.ArrayList; import java.util.List; import java.util.Locale; diff --git a/client/trino-client/src/main/java/io/trino/client/ClientTypeSignatureParameter.java b/client/trino-client/src/main/java/io/trino/client/ClientTypeSignatureParameter.java index a180607a883f..a4c900d338c0 100644 --- a/client/trino-client/src/main/java/io/trino/client/ClientTypeSignatureParameter.java +++ b/client/trino-client/src/main/java/io/trino/client/ClientTypeSignatureParameter.java @@ -21,8 +21,7 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; import java.io.IOException; import java.util.Objects; diff --git a/client/trino-client/src/main/java/io/trino/client/Column.java b/client/trino-client/src/main/java/io/trino/client/Column.java index e7fb2ca50dbb..2aabb8033cce 100644 --- a/client/trino-client/src/main/java/io/trino/client/Column.java +++ b/client/trino-client/src/main/java/io/trino/client/Column.java @@ -15,8 +15,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; import static java.util.Objects.requireNonNull; diff --git a/client/trino-client/src/main/java/io/trino/client/ErrorLocation.java b/client/trino-client/src/main/java/io/trino/client/ErrorLocation.java index 5cf8c84f9b36..f8817091050a 100644 --- a/client/trino-client/src/main/java/io/trino/client/ErrorLocation.java +++ b/client/trino-client/src/main/java/io/trino/client/ErrorLocation.java @@ -15,8 +15,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; import static com.google.common.base.MoreObjects.toStringHelper; import static com.google.common.base.Preconditions.checkArgument; diff --git a/client/trino-client/src/main/java/io/trino/client/FailureInfo.java b/client/trino-client/src/main/java/io/trino/client/FailureInfo.java index 7db0642bad72..040a730e75fa 100644 --- a/client/trino-client/src/main/java/io/trino/client/FailureInfo.java +++ b/client/trino-client/src/main/java/io/trino/client/FailureInfo.java @@ -16,9 +16,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; +import jakarta.annotation.Nullable; import java.util.List; import java.util.regex.Matcher; diff --git a/client/trino-client/src/main/java/io/trino/client/JsonResponse.java b/client/trino-client/src/main/java/io/trino/client/JsonResponse.java index c5f1aee3a3a3..db73bb98883e 100644 --- a/client/trino-client/src/main/java/io/trino/client/JsonResponse.java +++ b/client/trino-client/src/main/java/io/trino/client/JsonResponse.java @@ -14,6 +14,7 @@ package io.trino.client; import com.fasterxml.jackson.core.JsonProcessingException; +import jakarta.annotation.Nullable; import okhttp3.Headers; import okhttp3.MediaType; import okhttp3.OkHttpClient; @@ -21,8 +22,6 @@ import okhttp3.Response; import okhttp3.ResponseBody; -import javax.annotation.Nullable; - import java.io.IOException; import java.io.UncheckedIOException; import java.util.Optional; diff --git a/client/trino-client/src/main/java/io/trino/client/NodeVersion.java b/client/trino-client/src/main/java/io/trino/client/NodeVersion.java index 2f5c7f5bb6c0..c9c9ea1591c9 100644 --- a/client/trino-client/src/main/java/io/trino/client/NodeVersion.java +++ b/client/trino-client/src/main/java/io/trino/client/NodeVersion.java @@ -15,8 +15,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; import java.util.Objects; diff --git a/client/trino-client/src/main/java/io/trino/client/QueryError.java b/client/trino-client/src/main/java/io/trino/client/QueryError.java index 8947d168672d..8efeacabb1fe 100644 --- a/client/trino-client/src/main/java/io/trino/client/QueryError.java +++ b/client/trino-client/src/main/java/io/trino/client/QueryError.java @@ -15,9 +15,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; +import jakarta.annotation.Nullable; import static com.google.common.base.MoreObjects.toStringHelper; diff --git a/client/trino-client/src/main/java/io/trino/client/QueryResults.java b/client/trino-client/src/main/java/io/trino/client/QueryResults.java index faedf1b4fdf1..741d20b710fd 100644 --- a/client/trino-client/src/main/java/io/trino/client/QueryResults.java +++ b/client/trino-client/src/main/java/io/trino/client/QueryResults.java @@ -16,9 +16,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; +import jakarta.annotation.Nullable; import java.net.URI; import java.util.List; diff --git a/client/trino-client/src/main/java/io/trino/client/Row.java b/client/trino-client/src/main/java/io/trino/client/Row.java index df6ffbfe5392..913c8d9eddb5 100644 --- a/client/trino-client/src/main/java/io/trino/client/Row.java +++ b/client/trino-client/src/main/java/io/trino/client/Row.java @@ -14,8 +14,7 @@ package io.trino.client; import com.google.common.collect.ImmutableList; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.List; import java.util.Objects; diff --git a/client/trino-client/src/main/java/io/trino/client/RowField.java b/client/trino-client/src/main/java/io/trino/client/RowField.java index 420b5a86c48e..547c99258218 100644 --- a/client/trino-client/src/main/java/io/trino/client/RowField.java +++ b/client/trino-client/src/main/java/io/trino/client/RowField.java @@ -13,7 +13,7 @@ */ package io.trino.client; -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Objects; import java.util.Optional; diff --git a/client/trino-client/src/main/java/io/trino/client/ServerInfo.java b/client/trino-client/src/main/java/io/trino/client/ServerInfo.java index cad74dbfa9cd..5e5229dacb4f 100644 --- a/client/trino-client/src/main/java/io/trino/client/ServerInfo.java +++ b/client/trino-client/src/main/java/io/trino/client/ServerInfo.java @@ -15,10 +15,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.errorprone.annotations.Immutable; import io.airlift.units.Duration; -import javax.annotation.concurrent.Immutable; - import java.util.Objects; import java.util.Optional; diff --git a/client/trino-client/src/main/java/io/trino/client/StageStats.java b/client/trino-client/src/main/java/io/trino/client/StageStats.java index d18b8d8846b9..8305c127b392 100644 --- a/client/trino-client/src/main/java/io/trino/client/StageStats.java +++ b/client/trino-client/src/main/java/io/trino/client/StageStats.java @@ -16,8 +16,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; - -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; import java.util.List; diff --git a/client/trino-client/src/main/java/io/trino/client/StatementClient.java b/client/trino-client/src/main/java/io/trino/client/StatementClient.java index 79fd84a61177..f927bde0716b 100644 --- a/client/trino-client/src/main/java/io/trino/client/StatementClient.java +++ b/client/trino-client/src/main/java/io/trino/client/StatementClient.java @@ -13,7 +13,7 @@ */ package io.trino.client; -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.Closeable; import java.time.ZoneId; diff --git a/client/trino-client/src/main/java/io/trino/client/StatementClientV1.java b/client/trino-client/src/main/java/io/trino/client/StatementClientV1.java index 6532c6610c8a..99d82bfa7b51 100644 --- a/client/trino-client/src/main/java/io/trino/client/StatementClientV1.java +++ b/client/trino-client/src/main/java/io/trino/client/StatementClientV1.java @@ -18,7 +18,9 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Sets; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.units.Duration; +import jakarta.annotation.Nullable; import okhttp3.Headers; import okhttp3.HttpUrl; import okhttp3.MediaType; @@ -26,9 +28,6 @@ import okhttp3.Request; import okhttp3.RequestBody; -import javax.annotation.Nullable; -import javax.annotation.concurrent.ThreadSafe; - import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URI; diff --git a/client/trino-client/src/main/java/io/trino/client/StatementStats.java b/client/trino-client/src/main/java/io/trino/client/StatementStats.java index fd7e44fac3de..f0a4d8d8a5bd 100644 --- a/client/trino-client/src/main/java/io/trino/client/StatementStats.java +++ b/client/trino-client/src/main/java/io/trino/client/StatementStats.java @@ -15,9 +15,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; +import jakarta.annotation.Nullable; import java.util.OptionalDouble; diff --git a/client/trino-client/src/main/java/io/trino/client/auth/external/ExternalAuthenticator.java b/client/trino-client/src/main/java/io/trino/client/auth/external/ExternalAuthenticator.java index e91ff6572dcd..d97a324ac964 100644 --- a/client/trino-client/src/main/java/io/trino/client/auth/external/ExternalAuthenticator.java +++ b/client/trino-client/src/main/java/io/trino/client/auth/external/ExternalAuthenticator.java @@ -15,6 +15,7 @@ import com.google.common.annotations.VisibleForTesting; import io.trino.client.ClientException; +import jakarta.annotation.Nullable; import okhttp3.Authenticator; import okhttp3.Challenge; import okhttp3.Interceptor; @@ -22,8 +23,6 @@ import okhttp3.Response; import okhttp3.Route; -import javax.annotation.Nullable; - import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; diff --git a/client/trino-client/src/main/java/io/trino/client/auth/external/MemoryCachedKnownToken.java b/client/trino-client/src/main/java/io/trino/client/auth/external/MemoryCachedKnownToken.java index e8513e4bd87f..1d429d8465a6 100644 --- a/client/trino-client/src/main/java/io/trino/client/auth/external/MemoryCachedKnownToken.java +++ b/client/trino-client/src/main/java/io/trino/client/auth/external/MemoryCachedKnownToken.java @@ -13,7 +13,7 @@ */ package io.trino.client.auth.external; -import javax.annotation.concurrent.ThreadSafe; +import com.google.errorprone.annotations.ThreadSafe; import java.util.Optional; import java.util.concurrent.locks.Lock; diff --git a/client/trino-client/src/main/java/io/trino/client/auth/kerberos/LoginBasedSubjectProvider.java b/client/trino-client/src/main/java/io/trino/client/auth/kerberos/LoginBasedSubjectProvider.java index e385cbefc8d1..3e7c16fa0006 100644 --- a/client/trino-client/src/main/java/io/trino/client/auth/kerberos/LoginBasedSubjectProvider.java +++ b/client/trino-client/src/main/java/io/trino/client/auth/kerberos/LoginBasedSubjectProvider.java @@ -14,10 +14,10 @@ package io.trino.client.auth.kerberos; import com.google.common.collect.ImmutableMap; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.sun.security.auth.module.Krb5LoginModule; import org.ietf.jgss.GSSException; -import javax.annotation.concurrent.GuardedBy; import javax.security.auth.Subject; import javax.security.auth.login.AppConfigurationEntry; import javax.security.auth.login.Configuration; diff --git a/client/trino-client/src/main/java/io/trino/client/auth/kerberos/SpnegoHandler.java b/client/trino-client/src/main/java/io/trino/client/auth/kerberos/SpnegoHandler.java index f603d905464f..d0b828a0af65 100644 --- a/client/trino-client/src/main/java/io/trino/client/auth/kerberos/SpnegoHandler.java +++ b/client/trino-client/src/main/java/io/trino/client/auth/kerberos/SpnegoHandler.java @@ -14,6 +14,7 @@ package io.trino.client.auth.kerberos; import com.google.common.base.Splitter; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.units.Duration; import io.trino.client.ClientException; import okhttp3.Authenticator; @@ -27,7 +28,6 @@ import org.ietf.jgss.GSSManager; import org.ietf.jgss.Oid; -import javax.annotation.concurrent.GuardedBy; import javax.security.auth.Subject; import javax.security.auth.login.LoginException; diff --git a/client/trino-jdbc/pom.xml b/client/trino-jdbc/pom.xml index b0af5d9c3e66..c946737ff6d1 100644 --- a/client/trino-jdbc/pom.xml +++ b/client/trino-jdbc/pom.xml @@ -20,8 +20,8 @@ - com.google.code.findbugs - jsr305 + com.google.errorprone + error_prone_annotations true @@ -29,6 +29,10 @@ com.google.guava guava + + com.google.code.findbugs + jsr305 + com.google.errorprone error_prone_annotations @@ -65,6 +69,11 @@ trino-client + + jakarta.annotation + jakarta.annotation-api + + joda-time joda-time @@ -349,10 +358,6 @@ io.airlift ${shadeBase}.airlift - - javax.annotation - ${shadeBase}.javax.annotation - jakarta.annotation ${shadeBase}.jakarta.annotation @@ -390,6 +395,7 @@ org/jetbrains/** org/intellij/** + com/google/errorprone/** META-INF/maven/** META-INF/services/com.fasterxml.** META-INF/proguard/** diff --git a/client/trino-jdbc/src/main/java/io/trino/jdbc/AbstractTrinoResultSet.java b/client/trino-jdbc/src/main/java/io/trino/jdbc/AbstractTrinoResultSet.java index 2462d75de61e..c6df30cda2a1 100644 --- a/client/trino-jdbc/src/main/java/io/trino/jdbc/AbstractTrinoResultSet.java +++ b/client/trino-jdbc/src/main/java/io/trino/jdbc/AbstractTrinoResultSet.java @@ -651,8 +651,8 @@ public Object getObject(int columnIndex) return column(columnIndex); } - @javax.annotation.Nullable - private static Object convertFromClientRepresentation(ClientTypeSignature columnType, @javax.annotation.Nullable Object value) + @jakarta.annotation.Nullable + private static Object convertFromClientRepresentation(ClientTypeSignature columnType, @jakarta.annotation.Nullable Object value) throws SQLException { requireNonNull(columnType, "columnType is null"); diff --git a/client/trino-jdbc/src/main/java/io/trino/jdbc/Row.java b/client/trino-jdbc/src/main/java/io/trino/jdbc/Row.java index 28297c890df5..21b061110539 100644 --- a/client/trino-jdbc/src/main/java/io/trino/jdbc/Row.java +++ b/client/trino-jdbc/src/main/java/io/trino/jdbc/Row.java @@ -14,8 +14,7 @@ package io.trino.jdbc; import com.google.common.collect.ImmutableList; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.List; import java.util.Objects; diff --git a/client/trino-jdbc/src/main/java/io/trino/jdbc/RowField.java b/client/trino-jdbc/src/main/java/io/trino/jdbc/RowField.java index a2b7bcfbd576..49a9184a3a67 100644 --- a/client/trino-jdbc/src/main/java/io/trino/jdbc/RowField.java +++ b/client/trino-jdbc/src/main/java/io/trino/jdbc/RowField.java @@ -13,7 +13,7 @@ */ package io.trino.jdbc; -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Objects; import java.util.Optional; diff --git a/client/trino-jdbc/src/main/java/io/trino/jdbc/TrinoConnection.java b/client/trino-jdbc/src/main/java/io/trino/jdbc/TrinoConnection.java index b2675de1180b..5009c902aa65 100644 --- a/client/trino-jdbc/src/main/java/io/trino/jdbc/TrinoConnection.java +++ b/client/trino-jdbc/src/main/java/io/trino/jdbc/TrinoConnection.java @@ -22,10 +22,9 @@ import io.trino.client.ClientSelectedRole; import io.trino.client.ClientSession; import io.trino.client.StatementClient; +import jakarta.annotation.Nullable; import okhttp3.OkHttpClient; -import javax.annotation.Nullable; - import java.net.URI; import java.nio.charset.CharsetEncoder; import java.sql.Array; diff --git a/client/trino-jdbc/src/main/java/io/trino/jdbc/TrinoDatabaseMetaData.java b/client/trino-jdbc/src/main/java/io/trino/jdbc/TrinoDatabaseMetaData.java index f88295936b82..e0d18523f47e 100644 --- a/client/trino-jdbc/src/main/java/io/trino/jdbc/TrinoDatabaseMetaData.java +++ b/client/trino-jdbc/src/main/java/io/trino/jdbc/TrinoDatabaseMetaData.java @@ -19,8 +19,7 @@ import io.trino.client.ClientTypeSignature; import io.trino.client.ClientTypeSignatureParameter; import io.trino.client.Column; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.sql.Connection; import java.sql.DatabaseMetaData; diff --git a/client/trino-jdbc/src/main/java/io/trino/jdbc/TrinoResultSet.java b/client/trino-jdbc/src/main/java/io/trino/jdbc/TrinoResultSet.java index 8611b6733653..bb29e8c8ba48 100644 --- a/client/trino-jdbc/src/main/java/io/trino/jdbc/TrinoResultSet.java +++ b/client/trino-jdbc/src/main/java/io/trino/jdbc/TrinoResultSet.java @@ -17,12 +17,11 @@ import com.google.common.collect.AbstractIterator; import com.google.common.collect.Streams; import com.google.common.util.concurrent.ThreadFactoryBuilder; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.trino.client.Column; import io.trino.client.QueryStatusInfo; import io.trino.client.StatementClient; -import javax.annotation.concurrent.GuardedBy; - import java.sql.SQLException; import java.sql.Statement; import java.util.Iterator; diff --git a/client/trino-jdbc/src/main/java/io/trino/jdbc/WarningsManager.java b/client/trino-jdbc/src/main/java/io/trino/jdbc/WarningsManager.java index 5dddd7216246..832524a2b199 100644 --- a/client/trino-jdbc/src/main/java/io/trino/jdbc/WarningsManager.java +++ b/client/trino-jdbc/src/main/java/io/trino/jdbc/WarningsManager.java @@ -13,11 +13,10 @@ */ package io.trino.jdbc; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.trino.client.Warning; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.sql.SQLWarning; import java.util.HashSet; import java.util.List; diff --git a/core/trino-main/pom.xml b/core/trino-main/pom.xml index e4fd00ba4704..2aa6f214c895 100644 --- a/core/trino-main/pom.xml +++ b/core/trino-main/pom.xml @@ -56,11 +56,6 @@ oshi-core - - com.google.code.findbugs - jsr305 - - com.google.errorprone error_prone_annotations @@ -224,6 +219,12 @@ io.airlift.discovery discovery-server + + + javax.validation + validation-api + + @@ -317,13 +318,13 @@ - jakarta.ws.rs - jakarta.ws.rs-api + jakarta.validation + jakarta.validation-api - javax.validation - validation-api + jakarta.ws.rs + jakarta.ws.rs-api diff --git a/core/trino-main/src/main/java/io/trino/FeaturesConfig.java b/core/trino-main/src/main/java/io/trino/FeaturesConfig.java index f7941957bcd9..948fed4e6ad4 100644 --- a/core/trino-main/src/main/java/io/trino/FeaturesConfig.java +++ b/core/trino-main/src/main/java/io/trino/FeaturesConfig.java @@ -23,11 +23,10 @@ import io.airlift.units.DataSize; import io.airlift.units.MaxDataSize; import io.trino.sql.analyzer.RegexLibrary; - -import javax.validation.constraints.DecimalMax; -import javax.validation.constraints.DecimalMin; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.DecimalMax; +import jakarta.validation.constraints.DecimalMin; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import java.nio.file.Path; import java.nio.file.Paths; diff --git a/core/trino-main/src/main/java/io/trino/connector/CatalogFactory.java b/core/trino-main/src/main/java/io/trino/connector/CatalogFactory.java index 2922387f532f..fc1cce6cc606 100644 --- a/core/trino-main/src/main/java/io/trino/connector/CatalogFactory.java +++ b/core/trino-main/src/main/java/io/trino/connector/CatalogFactory.java @@ -13,12 +13,11 @@ */ package io.trino.connector; +import com.google.errorprone.annotations.ThreadSafe; import io.trino.spi.connector.CatalogHandle; import io.trino.spi.connector.Connector; import io.trino.spi.connector.ConnectorFactory; -import javax.annotation.concurrent.ThreadSafe; - import java.util.function.Function; @ThreadSafe diff --git a/core/trino-main/src/main/java/io/trino/connector/CatalogManagerConfig.java b/core/trino-main/src/main/java/io/trino/connector/CatalogManagerConfig.java index be06b3249199..e621e00dae88 100644 --- a/core/trino-main/src/main/java/io/trino/connector/CatalogManagerConfig.java +++ b/core/trino-main/src/main/java/io/trino/connector/CatalogManagerConfig.java @@ -14,8 +14,7 @@ package io.trino.connector; import io.airlift.configuration.Config; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class CatalogManagerConfig { diff --git a/core/trino-main/src/main/java/io/trino/connector/CatalogPruneTaskConfig.java b/core/trino-main/src/main/java/io/trino/connector/CatalogPruneTaskConfig.java index 2568c2cfc861..5251e3b18ad3 100644 --- a/core/trino-main/src/main/java/io/trino/connector/CatalogPruneTaskConfig.java +++ b/core/trino-main/src/main/java/io/trino/connector/CatalogPruneTaskConfig.java @@ -16,8 +16,7 @@ import io.airlift.configuration.Config; import io.airlift.units.Duration; import io.airlift.units.MinDuration; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import static java.util.concurrent.TimeUnit.SECONDS; diff --git a/core/trino-main/src/main/java/io/trino/connector/CatalogServiceProvider.java b/core/trino-main/src/main/java/io/trino/connector/CatalogServiceProvider.java index ec0502d3fff9..d3f8fd344493 100644 --- a/core/trino-main/src/main/java/io/trino/connector/CatalogServiceProvider.java +++ b/core/trino-main/src/main/java/io/trino/connector/CatalogServiceProvider.java @@ -14,8 +14,7 @@ package io.trino.connector; import io.trino.spi.connector.CatalogHandle; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import static com.google.common.base.Preconditions.checkArgument; diff --git a/core/trino-main/src/main/java/io/trino/connector/CatalogStoreConfig.java b/core/trino-main/src/main/java/io/trino/connector/CatalogStoreConfig.java index 9a5cf248df1e..5862e20a7b25 100644 --- a/core/trino-main/src/main/java/io/trino/connector/CatalogStoreConfig.java +++ b/core/trino-main/src/main/java/io/trino/connector/CatalogStoreConfig.java @@ -14,8 +14,7 @@ package io.trino.connector; import io.airlift.configuration.Config; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class CatalogStoreConfig { diff --git a/core/trino-main/src/main/java/io/trino/connector/CoordinatorDynamicCatalogManager.java b/core/trino-main/src/main/java/io/trino/connector/CoordinatorDynamicCatalogManager.java index d83e05a0f71f..68cef226315e 100644 --- a/core/trino-main/src/main/java/io/trino/connector/CoordinatorDynamicCatalogManager.java +++ b/core/trino-main/src/main/java/io/trino/connector/CoordinatorDynamicCatalogManager.java @@ -15,6 +15,8 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.airlift.log.Logger; import io.trino.Session; @@ -27,9 +29,6 @@ import io.trino.spi.connector.CatalogHandle.CatalogVersion; import jakarta.annotation.PreDestroy; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.util.ArrayList; import java.util.Iterator; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/connector/DefaultCatalogFactory.java b/core/trino-main/src/main/java/io/trino/connector/DefaultCatalogFactory.java index fdefe6e25e04..b924eb30edd7 100644 --- a/core/trino-main/src/main/java/io/trino/connector/DefaultCatalogFactory.java +++ b/core/trino-main/src/main/java/io/trino/connector/DefaultCatalogFactory.java @@ -13,6 +13,8 @@ */ package io.trino.connector; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.airlift.node.NodeInfo; import io.opentelemetry.api.OpenTelemetry; @@ -39,9 +41,6 @@ import io.trino.spi.type.TypeManager; import io.trino.transaction.TransactionManager; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.util.Map; import java.util.Optional; import java.util.concurrent.ConcurrentHashMap; diff --git a/core/trino-main/src/main/java/io/trino/connector/FileCatalogStoreConfig.java b/core/trino-main/src/main/java/io/trino/connector/FileCatalogStoreConfig.java index bfdffda54294..79bfc2cb0ba0 100644 --- a/core/trino-main/src/main/java/io/trino/connector/FileCatalogStoreConfig.java +++ b/core/trino-main/src/main/java/io/trino/connector/FileCatalogStoreConfig.java @@ -17,8 +17,7 @@ import com.google.common.collect.ImmutableList; import io.airlift.configuration.Config; import io.airlift.configuration.LegacyConfig; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.io.File; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/connector/StaticCatalogManager.java b/core/trino-main/src/main/java/io/trino/connector/StaticCatalogManager.java index 38cbf815de6c..3e0277002b0d 100644 --- a/core/trino-main/src/main/java/io/trino/connector/StaticCatalogManager.java +++ b/core/trino-main/src/main/java/io/trino/connector/StaticCatalogManager.java @@ -17,6 +17,7 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.io.Files; +import com.google.errorprone.annotations.ThreadSafe; import com.google.inject.Inject; import io.airlift.log.Logger; import io.trino.Session; @@ -29,8 +30,6 @@ import io.trino.spi.connector.CatalogHandle.CatalogVersion; import jakarta.annotation.PreDestroy; -import javax.annotation.concurrent.ThreadSafe; - import java.io.File; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/core/trino-main/src/main/java/io/trino/connector/StaticCatalogManagerConfig.java b/core/trino-main/src/main/java/io/trino/connector/StaticCatalogManagerConfig.java index 4969dff82e30..0484685aee15 100644 --- a/core/trino-main/src/main/java/io/trino/connector/StaticCatalogManagerConfig.java +++ b/core/trino-main/src/main/java/io/trino/connector/StaticCatalogManagerConfig.java @@ -17,8 +17,7 @@ import com.google.common.collect.ImmutableList; import io.airlift.configuration.Config; import io.airlift.configuration.LegacyConfig; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.io.File; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/connector/WorkerDynamicCatalogManager.java b/core/trino-main/src/main/java/io/trino/connector/WorkerDynamicCatalogManager.java index 7e875446866b..7403f3d2d14b 100644 --- a/core/trino-main/src/main/java/io/trino/connector/WorkerDynamicCatalogManager.java +++ b/core/trino-main/src/main/java/io/trino/connector/WorkerDynamicCatalogManager.java @@ -14,6 +14,8 @@ package io.trino.connector; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.airlift.log.Logger; import io.trino.Session; @@ -21,9 +23,6 @@ import io.trino.spi.connector.CatalogHandle; import jakarta.annotation.PreDestroy; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.util.ArrayList; import java.util.Iterator; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/cost/CostCalculator.java b/core/trino-main/src/main/java/io/trino/cost/CostCalculator.java index 372584716637..113ca6e2b01f 100644 --- a/core/trino-main/src/main/java/io/trino/cost/CostCalculator.java +++ b/core/trino-main/src/main/java/io/trino/cost/CostCalculator.java @@ -14,13 +14,12 @@ package io.trino.cost; +import com.google.errorprone.annotations.ThreadSafe; import com.google.inject.BindingAnnotation; import io.trino.Session; import io.trino.sql.planner.TypeProvider; import io.trino.sql.planner.plan.PlanNode; -import javax.annotation.concurrent.ThreadSafe; - import java.lang.annotation.Retention; import java.lang.annotation.Target; diff --git a/core/trino-main/src/main/java/io/trino/cost/CostCalculatorUsingExchanges.java b/core/trino-main/src/main/java/io/trino/cost/CostCalculatorUsingExchanges.java index ddd0d2943757..571fd7d8d835 100644 --- a/core/trino-main/src/main/java/io/trino/cost/CostCalculatorUsingExchanges.java +++ b/core/trino-main/src/main/java/io/trino/cost/CostCalculatorUsingExchanges.java @@ -15,6 +15,7 @@ package io.trino.cost; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.ThreadSafe; import com.google.inject.Inject; import io.trino.Session; import io.trino.sql.planner.Symbol; @@ -38,8 +39,6 @@ import io.trino.sql.planner.plan.UnionNode; import io.trino.sql.planner.plan.ValuesNode; -import javax.annotation.concurrent.ThreadSafe; - import java.util.List; import java.util.Objects; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/cost/CostCalculatorWithEstimatedExchanges.java b/core/trino-main/src/main/java/io/trino/cost/CostCalculatorWithEstimatedExchanges.java index d97fdb50441e..d536ca27c102 100644 --- a/core/trino-main/src/main/java/io/trino/cost/CostCalculatorWithEstimatedExchanges.java +++ b/core/trino-main/src/main/java/io/trino/cost/CostCalculatorWithEstimatedExchanges.java @@ -14,6 +14,7 @@ package io.trino.cost; +import com.google.errorprone.annotations.ThreadSafe; import com.google.inject.Inject; import io.trino.Session; import io.trino.sql.planner.TypeProvider; @@ -28,8 +29,6 @@ import io.trino.sql.planner.plan.SpatialJoinNode; import io.trino.sql.planner.plan.UnionNode; -import javax.annotation.concurrent.ThreadSafe; - import java.util.Objects; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/cost/FilterStatsCalculator.java b/core/trino-main/src/main/java/io/trino/cost/FilterStatsCalculator.java index e3d692684580..6698d7625a99 100644 --- a/core/trino-main/src/main/java/io/trino/cost/FilterStatsCalculator.java +++ b/core/trino-main/src/main/java/io/trino/cost/FilterStatsCalculator.java @@ -48,8 +48,7 @@ import io.trino.sql.tree.NotExpression; import io.trino.sql.tree.SymbolReference; import io.trino.util.DisjointSet; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.List; import java.util.Map; diff --git a/core/trino-main/src/main/java/io/trino/dispatcher/DecoratingListeningExecutorService.java b/core/trino-main/src/main/java/io/trino/dispatcher/DecoratingListeningExecutorService.java index bd555bb43eba..a04fc7ea44ca 100644 --- a/core/trino-main/src/main/java/io/trino/dispatcher/DecoratingListeningExecutorService.java +++ b/core/trino-main/src/main/java/io/trino/dispatcher/DecoratingListeningExecutorService.java @@ -16,8 +16,7 @@ import com.google.common.util.concurrent.ForwardingListeningExecutorService; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListeningExecutorService; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; diff --git a/core/trino-main/src/main/java/io/trino/dispatcher/QueuedStatementResource.java b/core/trino-main/src/main/java/io/trino/dispatcher/QueuedStatementResource.java index ff914f251145..d1aba95523de 100644 --- a/core/trino-main/src/main/java/io/trino/dispatcher/QueuedStatementResource.java +++ b/core/trino-main/src/main/java/io/trino/dispatcher/QueuedStatementResource.java @@ -18,6 +18,7 @@ import com.google.common.util.concurrent.FluentFuture; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; +import com.google.errorprone.annotations.ThreadSafe; import com.google.inject.Inject; import io.airlift.log.Logger; import io.airlift.units.Duration; @@ -42,6 +43,7 @@ import io.trino.spi.QueryId; import io.trino.spi.security.Identity; import io.trino.tracing.TrinoAttributes; +import jakarta.annotation.Nullable; import jakarta.annotation.PostConstruct; import jakarta.annotation.PreDestroy; import jakarta.servlet.http.HttpServletRequest; @@ -63,9 +65,6 @@ import jakarta.ws.rs.core.UriBuilder; import jakarta.ws.rs.core.UriInfo; -import javax.annotation.Nullable; -import javax.annotation.concurrent.ThreadSafe; - import java.net.URI; import java.util.Optional; import java.util.OptionalDouble; diff --git a/core/trino-main/src/main/java/io/trino/event/QueryMonitorConfig.java b/core/trino-main/src/main/java/io/trino/event/QueryMonitorConfig.java index 9ff1d46b6055..914c2d00d520 100644 --- a/core/trino-main/src/main/java/io/trino/event/QueryMonitorConfig.java +++ b/core/trino-main/src/main/java/io/trino/event/QueryMonitorConfig.java @@ -18,8 +18,7 @@ import io.airlift.units.DataSize.Unit; import io.airlift.units.MaxDataSize; import io.airlift.units.MinDataSize; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class QueryMonitorConfig { diff --git a/core/trino-main/src/main/java/io/trino/event/SplitMonitor.java b/core/trino-main/src/main/java/io/trino/event/SplitMonitor.java index 1bb0501b09ee..9696326da2f3 100644 --- a/core/trino-main/src/main/java/io/trino/event/SplitMonitor.java +++ b/core/trino-main/src/main/java/io/trino/event/SplitMonitor.java @@ -25,8 +25,7 @@ import io.trino.spi.eventlistener.SplitCompletedEvent; import io.trino.spi.eventlistener.SplitFailureInfo; import io.trino.spi.eventlistener.SplitStatistics; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.time.Duration; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/eventlistener/EventListenerConfig.java b/core/trino-main/src/main/java/io/trino/eventlistener/EventListenerConfig.java index 625feaf58182..8cd69fe1ce0f 100644 --- a/core/trino-main/src/main/java/io/trino/eventlistener/EventListenerConfig.java +++ b/core/trino-main/src/main/java/io/trino/eventlistener/EventListenerConfig.java @@ -17,8 +17,7 @@ import com.google.common.collect.ImmutableList; import io.airlift.configuration.Config; import io.airlift.configuration.validation.FileExists; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.io.File; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/execution/ClusterSizeMonitor.java b/core/trino-main/src/main/java/io/trino/execution/ClusterSizeMonitor.java index 79817ba7f505..d44c521ef5a0 100644 --- a/core/trino-main/src/main/java/io/trino/execution/ClusterSizeMonitor.java +++ b/core/trino-main/src/main/java/io/trino/execution/ClusterSizeMonitor.java @@ -17,6 +17,7 @@ import com.google.common.collect.Sets; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.airlift.units.Duration; import io.trino.execution.scheduler.NodeSchedulerConfig; @@ -27,8 +28,6 @@ import jakarta.annotation.PreDestroy; import org.weakref.jmx.Managed; -import javax.annotation.concurrent.GuardedBy; - import java.util.PriorityQueue; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; diff --git a/core/trino-main/src/main/java/io/trino/execution/DataDefinitionExecution.java b/core/trino-main/src/main/java/io/trino/execution/DataDefinitionExecution.java index a1fcd114e7b7..93035bdc2f45 100644 --- a/core/trino-main/src/main/java/io/trino/execution/DataDefinitionExecution.java +++ b/core/trino-main/src/main/java/io/trino/execution/DataDefinitionExecution.java @@ -30,10 +30,9 @@ import io.trino.sql.planner.Plan; import io.trino.sql.tree.Expression; import io.trino.sql.tree.Statement; +import jakarta.annotation.Nullable; import org.joda.time.DateTime; -import javax.annotation.Nullable; - import java.util.List; import java.util.Map; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/execution/DynamicFilterConfig.java b/core/trino-main/src/main/java/io/trino/execution/DynamicFilterConfig.java index f41b91a32091..75579bf38a0b 100644 --- a/core/trino-main/src/main/java/io/trino/execution/DynamicFilterConfig.java +++ b/core/trino-main/src/main/java/io/trino/execution/DynamicFilterConfig.java @@ -19,9 +19,8 @@ import io.airlift.configuration.LegacyConfig; import io.airlift.units.DataSize; import io.airlift.units.MaxDataSize; - -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import static io.airlift.units.DataSize.Unit.KILOBYTE; import static io.airlift.units.DataSize.Unit.MEGABYTE; diff --git a/core/trino-main/src/main/java/io/trino/execution/DynamicFiltersCollector.java b/core/trino-main/src/main/java/io/trino/execution/DynamicFiltersCollector.java index df4023d1d3f8..09b69f45d904 100644 --- a/core/trino-main/src/main/java/io/trino/execution/DynamicFiltersCollector.java +++ b/core/trino-main/src/main/java/io/trino/execution/DynamicFiltersCollector.java @@ -16,11 +16,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableMap; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.trino.spi.predicate.Domain; import io.trino.sql.planner.plan.DynamicFilterId; -import javax.annotation.concurrent.GuardedBy; - import java.util.HashMap; import java.util.Map; diff --git a/core/trino-main/src/main/java/io/trino/execution/ExecutionFailureInfo.java b/core/trino-main/src/main/java/io/trino/execution/ExecutionFailureInfo.java index 41c407b042da..9ecb0cf04ec5 100644 --- a/core/trino-main/src/main/java/io/trino/execution/ExecutionFailureInfo.java +++ b/core/trino-main/src/main/java/io/trino/execution/ExecutionFailureInfo.java @@ -16,13 +16,12 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.Immutable; import io.trino.client.ErrorLocation; import io.trino.client.FailureInfo; import io.trino.spi.ErrorCode; import io.trino.spi.HostAddress; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.Immutable; +import jakarta.annotation.Nullable; import java.util.List; import java.util.regex.Matcher; diff --git a/core/trino-main/src/main/java/io/trino/execution/Failure.java b/core/trino-main/src/main/java/io/trino/execution/Failure.java index 1e6899e865e1..34061b0d64af 100644 --- a/core/trino-main/src/main/java/io/trino/execution/Failure.java +++ b/core/trino-main/src/main/java/io/trino/execution/Failure.java @@ -14,8 +14,7 @@ package io.trino.execution; import io.trino.spi.ErrorCode; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import static java.util.Objects.requireNonNull; diff --git a/core/trino-main/src/main/java/io/trino/execution/FailureInjectionConfig.java b/core/trino-main/src/main/java/io/trino/execution/FailureInjectionConfig.java index db6379879b2a..2ee459b52484 100644 --- a/core/trino-main/src/main/java/io/trino/execution/FailureInjectionConfig.java +++ b/core/trino-main/src/main/java/io/trino/execution/FailureInjectionConfig.java @@ -16,8 +16,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; import io.airlift.units.Duration; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import static java.util.concurrent.TimeUnit.MINUTES; diff --git a/core/trino-main/src/main/java/io/trino/execution/FutureStateChange.java b/core/trino-main/src/main/java/io/trino/execution/FutureStateChange.java index bc8e02e72842..67aeecec4438 100644 --- a/core/trino-main/src/main/java/io/trino/execution/FutureStateChange.java +++ b/core/trino-main/src/main/java/io/trino/execution/FutureStateChange.java @@ -16,9 +16,8 @@ import com.google.common.collect.ImmutableList; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; - -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import java.util.HashSet; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/execution/Input.java b/core/trino-main/src/main/java/io/trino/execution/Input.java index 54d46316481e..a2d498a088c3 100644 --- a/core/trino-main/src/main/java/io/trino/execution/Input.java +++ b/core/trino-main/src/main/java/io/trino/execution/Input.java @@ -16,12 +16,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.Immutable; import io.trino.spi.connector.CatalogHandle.CatalogVersion; import io.trino.sql.planner.plan.PlanFragmentId; import io.trino.sql.planner.plan.PlanNodeId; -import javax.annotation.concurrent.Immutable; - import java.util.List; import java.util.Objects; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/execution/MemoryRevokingScheduler.java b/core/trino-main/src/main/java/io/trino/execution/MemoryRevokingScheduler.java index 42740816b60e..07e4b5ed6e03 100644 --- a/core/trino-main/src/main/java/io/trino/execution/MemoryRevokingScheduler.java +++ b/core/trino-main/src/main/java/io/trino/execution/MemoryRevokingScheduler.java @@ -26,11 +26,10 @@ import io.trino.operator.OperatorContext; import io.trino.operator.PipelineContext; import io.trino.operator.TaskContext; +import jakarta.annotation.Nullable; import jakarta.annotation.PostConstruct; import jakarta.annotation.PreDestroy; -import javax.annotation.Nullable; - import java.util.Collection; import java.util.List; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/execution/NodeTaskMap.java b/core/trino-main/src/main/java/io/trino/execution/NodeTaskMap.java index 0285d4644209..aefe550d4543 100644 --- a/core/trino-main/src/main/java/io/trino/execution/NodeTaskMap.java +++ b/core/trino-main/src/main/java/io/trino/execution/NodeTaskMap.java @@ -14,13 +14,12 @@ package io.trino.execution; import com.google.common.collect.Sets; +import com.google.errorprone.annotations.ThreadSafe; import com.google.inject.Inject; import io.airlift.log.Logger; import io.trino.metadata.InternalNode; import io.trino.util.FinalizerService; -import javax.annotation.concurrent.ThreadSafe; - import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; diff --git a/core/trino-main/src/main/java/io/trino/execution/QueryIdGenerator.java b/core/trino-main/src/main/java/io/trino/execution/QueryIdGenerator.java index cdbdadab5de7..8799f4a69a27 100644 --- a/core/trino-main/src/main/java/io/trino/execution/QueryIdGenerator.java +++ b/core/trino-main/src/main/java/io/trino/execution/QueryIdGenerator.java @@ -16,10 +16,9 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableSet; import com.google.common.primitives.Chars; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.trino.spi.QueryId; -import javax.annotation.concurrent.GuardedBy; - import java.time.Instant; import java.time.format.DateTimeFormatter; import java.util.concurrent.ThreadLocalRandom; diff --git a/core/trino-main/src/main/java/io/trino/execution/QueryInfo.java b/core/trino-main/src/main/java/io/trino/execution/QueryInfo.java index f186e0836bef..65f1ed3f6ef0 100644 --- a/core/trino-main/src/main/java/io/trino/execution/QueryInfo.java +++ b/core/trino-main/src/main/java/io/trino/execution/QueryInfo.java @@ -18,6 +18,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; +import com.google.errorprone.annotations.Immutable; import io.trino.SessionRepresentation; import io.trino.client.NodeVersion; import io.trino.operator.RetryPolicy; @@ -32,9 +33,7 @@ import io.trino.spi.security.SelectedRole; import io.trino.sql.analyzer.Output; import io.trino.transaction.TransactionId; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.Immutable; +import jakarta.annotation.Nullable; import java.net.URI; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/execution/QueryManagerConfig.java b/core/trino-main/src/main/java/io/trino/execution/QueryManagerConfig.java index 5c7bb5d07985..d71af80bb249 100644 --- a/core/trino-main/src/main/java/io/trino/execution/QueryManagerConfig.java +++ b/core/trino-main/src/main/java/io/trino/execution/QueryManagerConfig.java @@ -22,11 +22,10 @@ import io.airlift.units.MinDataSize; import io.airlift.units.MinDuration; import io.trino.operator.RetryPolicy; - -import javax.validation.constraints.DecimalMin; -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.DecimalMin; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import java.util.Optional; import java.util.concurrent.TimeUnit; diff --git a/core/trino-main/src/main/java/io/trino/execution/QueryManagerStats.java b/core/trino-main/src/main/java/io/trino/execution/QueryManagerStats.java index 5adb668e04e6..92f4ea047196 100644 --- a/core/trino-main/src/main/java/io/trino/execution/QueryManagerStats.java +++ b/core/trino-main/src/main/java/io/trino/execution/QueryManagerStats.java @@ -13,6 +13,7 @@ */ package io.trino.execution; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.stats.CounterStat; import io.airlift.stats.DistributionStat; import io.airlift.stats.TimeStat; @@ -22,8 +23,6 @@ import org.weakref.jmx.Managed; import org.weakref.jmx.Nested; -import javax.annotation.concurrent.GuardedBy; - import java.util.Optional; import java.util.function.Supplier; diff --git a/core/trino-main/src/main/java/io/trino/execution/QueryStateMachine.java b/core/trino-main/src/main/java/io/trino/execution/QueryStateMachine.java index 6fae84cf4445..84a2edbaa3bf 100644 --- a/core/trino-main/src/main/java/io/trino/execution/QueryStateMachine.java +++ b/core/trino-main/src/main/java/io/trino/execution/QueryStateMachine.java @@ -22,6 +22,8 @@ import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.log.Logger; import io.airlift.units.Duration; import io.opentelemetry.api.common.Attributes; @@ -57,12 +59,9 @@ import io.trino.transaction.TransactionId; import io.trino.transaction.TransactionInfo; import io.trino.transaction.TransactionManager; +import jakarta.annotation.Nullable; import org.joda.time.DateTime; -import javax.annotation.Nullable; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.net.URI; import java.util.ArrayDeque; import java.util.ArrayList; diff --git a/core/trino-main/src/main/java/io/trino/execution/QueryStats.java b/core/trino-main/src/main/java/io/trino/execution/QueryStats.java index 0e5e9cf1a00b..68d5d7fb77b8 100644 --- a/core/trino-main/src/main/java/io/trino/execution/QueryStats.java +++ b/core/trino-main/src/main/java/io/trino/execution/QueryStats.java @@ -24,10 +24,9 @@ import io.trino.operator.TableWriterOperator; import io.trino.spi.eventlistener.QueryPlanOptimizerStatistics; import io.trino.spi.eventlistener.StageGcStatistics; +import jakarta.annotation.Nullable; import org.joda.time.DateTime; -import javax.annotation.Nullable; - import java.util.List; import java.util.OptionalDouble; import java.util.Set; diff --git a/core/trino-main/src/main/java/io/trino/execution/QueryTracker.java b/core/trino-main/src/main/java/io/trino/execution/QueryTracker.java index afd81baba987..78267db6e416 100644 --- a/core/trino-main/src/main/java/io/trino/execution/QueryTracker.java +++ b/core/trino-main/src/main/java/io/trino/execution/QueryTracker.java @@ -14,6 +14,8 @@ package io.trino.execution; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.log.Logger; import io.airlift.units.Duration; import io.trino.Session; @@ -22,9 +24,6 @@ import io.trino.spi.TrinoException; import org.joda.time.DateTime; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.util.Collection; import java.util.NoSuchElementException; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/execution/SqlQueryExecution.java b/core/trino-main/src/main/java/io/trino/execution/SqlQueryExecution.java index 73d219650129..65093e2fdd72 100644 --- a/core/trino-main/src/main/java/io/trino/execution/SqlQueryExecution.java +++ b/core/trino-main/src/main/java/io/trino/execution/SqlQueryExecution.java @@ -14,6 +14,7 @@ package io.trino.execution; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.ThreadSafe; import com.google.inject.Inject; import io.airlift.concurrent.SetThreadName; import io.airlift.units.DataSize; @@ -72,8 +73,6 @@ import io.trino.sql.tree.Statement; import org.joda.time.DateTime; -import javax.annotation.concurrent.ThreadSafe; - import java.util.Collection; import java.util.List; import java.util.Map; diff --git a/core/trino-main/src/main/java/io/trino/execution/SqlQueryManager.java b/core/trino-main/src/main/java/io/trino/execution/SqlQueryManager.java index cd33ef663a6f..fa3ee37b9454 100644 --- a/core/trino-main/src/main/java/io/trino/execution/SqlQueryManager.java +++ b/core/trino-main/src/main/java/io/trino/execution/SqlQueryManager.java @@ -15,6 +15,7 @@ import com.google.common.collect.Ordering; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.ThreadSafe; import com.google.inject.Inject; import io.airlift.concurrent.SetThreadName; import io.airlift.concurrent.ThreadPoolExecutorMBean; @@ -37,8 +38,6 @@ import org.weakref.jmx.Managed; import org.weakref.jmx.Nested; -import javax.annotation.concurrent.ThreadSafe; - import java.util.List; import java.util.NoSuchElementException; import java.util.Objects; diff --git a/core/trino-main/src/main/java/io/trino/execution/SqlStage.java b/core/trino-main/src/main/java/io/trino/execution/SqlStage.java index 06005a36d2be..0d8a146ee925 100644 --- a/core/trino-main/src/main/java/io/trino/execution/SqlStage.java +++ b/core/trino-main/src/main/java/io/trino/execution/SqlStage.java @@ -15,6 +15,8 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Multimap; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.units.DataSize; import io.airlift.units.Duration; import io.opentelemetry.api.trace.Span; @@ -29,9 +31,6 @@ import io.trino.sql.planner.plan.DynamicFilterId; import io.trino.sql.planner.plan.PlanNodeId; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.util.HashSet; import java.util.List; import java.util.Map; diff --git a/core/trino-main/src/main/java/io/trino/execution/SqlTask.java b/core/trino-main/src/main/java/io/trino/execution/SqlTask.java index 607fe1ee6947..0df8b1534fee 100644 --- a/core/trino-main/src/main/java/io/trino/execution/SqlTask.java +++ b/core/trino-main/src/main/java/io/trino/execution/SqlTask.java @@ -17,6 +17,7 @@ import com.google.common.collect.ImmutableSet; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.concurrent.SetThreadName; import io.airlift.log.Logger; import io.airlift.stats.CounterStat; @@ -46,11 +47,9 @@ import io.trino.sql.planner.plan.DynamicFilterId; import io.trino.sql.planner.plan.PlanNodeId; import io.trino.tracing.TrinoAttributes; +import jakarta.annotation.Nullable; import org.joda.time.DateTime; -import javax.annotation.Nullable; -import javax.annotation.concurrent.GuardedBy; - import java.net.URI; import java.util.List; import java.util.Map; diff --git a/core/trino-main/src/main/java/io/trino/execution/SqlTaskExecution.java b/core/trino-main/src/main/java/io/trino/execution/SqlTaskExecution.java index 6d6b3326c9f5..b0fc34aa3a31 100644 --- a/core/trino-main/src/main/java/io/trino/execution/SqlTaskExecution.java +++ b/core/trino-main/src/main/java/io/trino/execution/SqlTaskExecution.java @@ -19,6 +19,7 @@ import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.concurrent.SetThreadName; import io.airlift.units.Duration; import io.opentelemetry.api.trace.Span; @@ -42,9 +43,7 @@ import io.trino.sql.planner.LocalExecutionPlanner.LocalExecutionPlan; import io.trino.sql.planner.plan.PlanNodeId; import io.trino.tracing.TrinoAttributes; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.GuardedBy; +import jakarta.annotation.Nullable; import java.lang.ref.WeakReference; import java.util.ArrayList; diff --git a/core/trino-main/src/main/java/io/trino/execution/StageInfo.java b/core/trino-main/src/main/java/io/trino/execution/StageInfo.java index f406f3e90722..b12bc71849d4 100644 --- a/core/trino-main/src/main/java/io/trino/execution/StageInfo.java +++ b/core/trino-main/src/main/java/io/trino/execution/StageInfo.java @@ -17,13 +17,12 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import com.google.errorprone.annotations.Immutable; import io.trino.spi.QueryId; import io.trino.spi.type.Type; import io.trino.sql.planner.PlanFragment; import io.trino.sql.planner.plan.PlanNodeId; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.Immutable; +import jakarta.annotation.Nullable; import java.util.List; import java.util.Map; diff --git a/core/trino-main/src/main/java/io/trino/execution/StageStateMachine.java b/core/trino-main/src/main/java/io/trino/execution/StageStateMachine.java index 5d5d87d3aad1..ce3046f0c8ae 100644 --- a/core/trino-main/src/main/java/io/trino/execution/StageStateMachine.java +++ b/core/trino-main/src/main/java/io/trino/execution/StageStateMachine.java @@ -15,6 +15,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.log.Logger; import io.airlift.stats.Distribution; import io.airlift.units.Duration; @@ -38,8 +39,6 @@ import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; import org.joda.time.DateTime; -import javax.annotation.concurrent.ThreadSafe; - import java.util.ArrayList; import java.util.HashSet; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/execution/StageStats.java b/core/trino-main/src/main/java/io/trino/execution/StageStats.java index d939b08c6940..ee7998313425 100644 --- a/core/trino-main/src/main/java/io/trino/execution/StageStats.java +++ b/core/trino-main/src/main/java/io/trino/execution/StageStats.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; +import com.google.errorprone.annotations.Immutable; import io.airlift.stats.Distribution; import io.airlift.stats.Distribution.DistributionSnapshot; import io.airlift.units.DataSize; @@ -27,8 +28,6 @@ import io.trino.spi.eventlistener.StageGcStatistics; import org.joda.time.DateTime; -import javax.annotation.concurrent.Immutable; - import java.util.List; import java.util.Optional; import java.util.OptionalDouble; diff --git a/core/trino-main/src/main/java/io/trino/execution/StateMachine.java b/core/trino-main/src/main/java/io/trino/execution/StateMachine.java index 34db60a09f6f..77fb0f42e4a8 100644 --- a/core/trino-main/src/main/java/io/trino/execution/StateMachine.java +++ b/core/trino-main/src/main/java/io/trino/execution/StateMachine.java @@ -17,12 +17,11 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.log.Logger; import io.trino.spi.TrinoException; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.util.ArrayList; import java.util.List; import java.util.Set; diff --git a/core/trino-main/src/main/java/io/trino/execution/TableExecuteContext.java b/core/trino-main/src/main/java/io/trino/execution/TableExecuteContext.java index ff0b796c8018..5f73ce670ae5 100644 --- a/core/trino-main/src/main/java/io/trino/execution/TableExecuteContext.java +++ b/core/trino-main/src/main/java/io/trino/execution/TableExecuteContext.java @@ -14,8 +14,7 @@ package io.trino.execution; import com.google.common.collect.ImmutableList; - -import javax.annotation.concurrent.GuardedBy; +import com.google.errorprone.annotations.concurrent.GuardedBy; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/execution/TableExecuteContextManager.java b/core/trino-main/src/main/java/io/trino/execution/TableExecuteContextManager.java index aa85c44f52de..116deb0169f3 100644 --- a/core/trino-main/src/main/java/io/trino/execution/TableExecuteContextManager.java +++ b/core/trino-main/src/main/java/io/trino/execution/TableExecuteContextManager.java @@ -13,10 +13,9 @@ */ package io.trino.execution; +import com.google.errorprone.annotations.ThreadSafe; import io.trino.spi.QueryId; -import javax.annotation.concurrent.ThreadSafe; - import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; diff --git a/core/trino-main/src/main/java/io/trino/execution/TableInfo.java b/core/trino-main/src/main/java/io/trino/execution/TableInfo.java index 5f82fcc518a9..97db3946e217 100644 --- a/core/trino-main/src/main/java/io/trino/execution/TableInfo.java +++ b/core/trino-main/src/main/java/io/trino/execution/TableInfo.java @@ -15,6 +15,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.errorprone.annotations.Immutable; import io.trino.Session; import io.trino.connector.ConnectorName; import io.trino.metadata.CatalogInfo; @@ -29,8 +30,6 @@ import io.trino.sql.planner.plan.PlanNodeId; import io.trino.sql.planner.plan.TableScanNode; -import javax.annotation.concurrent.Immutable; - import java.util.Map; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/execution/TaskInfo.java b/core/trino-main/src/main/java/io/trino/execution/TaskInfo.java index 836117cb4506..121bc8aa864b 100644 --- a/core/trino-main/src/main/java/io/trino/execution/TaskInfo.java +++ b/core/trino-main/src/main/java/io/trino/execution/TaskInfo.java @@ -16,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableSet; +import com.google.errorprone.annotations.Immutable; import io.airlift.units.DataSize; import io.trino.execution.buffer.OutputBufferInfo; import io.trino.execution.buffer.PipelinedBufferInfo; @@ -23,8 +24,6 @@ import io.trino.sql.planner.plan.PlanNodeId; import org.joda.time.DateTime; -import javax.annotation.concurrent.Immutable; - import java.net.URI; import java.util.List; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/execution/TaskManagerConfig.java b/core/trino-main/src/main/java/io/trino/execution/TaskManagerConfig.java index 571078f272ad..a1a42afc66a7 100644 --- a/core/trino-main/src/main/java/io/trino/execution/TaskManagerConfig.java +++ b/core/trino-main/src/main/java/io/trino/execution/TaskManagerConfig.java @@ -23,9 +23,8 @@ import io.airlift.units.MaxDuration; import io.airlift.units.MinDuration; import io.trino.util.PowerOfTwo; - -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import java.math.BigDecimal; import java.util.concurrent.TimeUnit; diff --git a/core/trino-main/src/main/java/io/trino/execution/TaskStateMachine.java b/core/trino-main/src/main/java/io/trino/execution/TaskStateMachine.java index c41e6e054bfe..a7998d6d8d89 100644 --- a/core/trino-main/src/main/java/io/trino/execution/TaskStateMachine.java +++ b/core/trino-main/src/main/java/io/trino/execution/TaskStateMachine.java @@ -16,13 +16,12 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.log.Logger; import io.trino.execution.StateMachine.StateChangeListener; import org.joda.time.DateTime; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/execution/buffer/ArbitraryOutputBuffer.java b/core/trino-main/src/main/java/io/trino/execution/buffer/ArbitraryOutputBuffer.java index c38123a7164a..9ec5805f5c21 100644 --- a/core/trino-main/src/main/java/io/trino/execution/buffer/ArbitraryOutputBuffer.java +++ b/core/trino-main/src/main/java/io/trino/execution/buffer/ArbitraryOutputBuffer.java @@ -18,6 +18,8 @@ import com.google.common.collect.Sets; import com.google.common.collect.Sets.SetView; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.slice.Slice; import io.airlift.units.DataSize; import io.trino.execution.StateMachine.StateChangeListener; @@ -27,9 +29,6 @@ import io.trino.memory.context.LocalMemoryContext; import io.trino.plugin.base.metrics.TDigestHistogram; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.util.ArrayList; import java.util.Collection; import java.util.LinkedList; diff --git a/core/trino-main/src/main/java/io/trino/execution/buffer/BroadcastOutputBuffer.java b/core/trino-main/src/main/java/io/trino/execution/buffer/BroadcastOutputBuffer.java index 1b857e2780ca..aecbc8454f9e 100644 --- a/core/trino-main/src/main/java/io/trino/execution/buffer/BroadcastOutputBuffer.java +++ b/core/trino-main/src/main/java/io/trino/execution/buffer/BroadcastOutputBuffer.java @@ -18,6 +18,7 @@ import com.google.common.collect.Sets; import com.google.common.collect.Sets.SetView; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.slice.Slice; import io.airlift.units.DataSize; import io.trino.execution.StateMachine.StateChangeListener; @@ -26,8 +27,6 @@ import io.trino.memory.context.LocalMemoryContext; import io.trino.plugin.base.metrics.TDigestHistogram; -import javax.annotation.concurrent.GuardedBy; - import java.util.ArrayList; import java.util.Collection; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/execution/buffer/ClientBuffer.java b/core/trino-main/src/main/java/io/trino/execution/buffer/ClientBuffer.java index f3a0fd1c1529..9566bf04c331 100644 --- a/core/trino-main/src/main/java/io/trino/execution/buffer/ClientBuffer.java +++ b/core/trino-main/src/main/java/io/trino/execution/buffer/ClientBuffer.java @@ -16,15 +16,14 @@ import com.google.common.collect.ImmutableList; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; +import com.google.errorprone.annotations.Immutable; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.slice.Slice; import io.airlift.units.DataSize; import io.trino.execution.buffer.PipelinedOutputBuffers.OutputBufferId; import io.trino.execution.buffer.SerializedPageReference.PagesReleasedListener; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.Immutable; -import javax.annotation.concurrent.ThreadSafe; - import java.util.ArrayList; import java.util.Collection; import java.util.LinkedList; diff --git a/core/trino-main/src/main/java/io/trino/execution/buffer/LazyOutputBuffer.java b/core/trino-main/src/main/java/io/trino/execution/buffer/LazyOutputBuffer.java index 173e76756dd3..bf4885d4d012 100644 --- a/core/trino-main/src/main/java/io/trino/execution/buffer/LazyOutputBuffer.java +++ b/core/trino-main/src/main/java/io/trino/execution/buffer/LazyOutputBuffer.java @@ -17,6 +17,7 @@ import com.google.common.collect.ImmutableSet; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.slice.Slice; import io.airlift.units.DataSize; import io.trino.exchange.ExchangeManagerRegistry; @@ -27,9 +28,7 @@ import io.trino.spi.exchange.ExchangeManager; import io.trino.spi.exchange.ExchangeSink; import io.trino.spi.exchange.ExchangeSinkInstanceHandle; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.GuardedBy; +import jakarta.annotation.Nullable; import java.util.ArrayList; import java.util.HashSet; diff --git a/core/trino-main/src/main/java/io/trino/execution/buffer/OutputBufferMemoryManager.java b/core/trino-main/src/main/java/io/trino/execution/buffer/OutputBufferMemoryManager.java index c06b4b41e8ce..04ecb522df98 100644 --- a/core/trino-main/src/main/java/io/trino/execution/buffer/OutputBufferMemoryManager.java +++ b/core/trino-main/src/main/java/io/trino/execution/buffer/OutputBufferMemoryManager.java @@ -18,12 +18,11 @@ import com.google.common.base.Ticker; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.stats.TDigest; import io.trino.memory.context.LocalMemoryContext; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; +import jakarta.annotation.Nullable; import java.util.concurrent.Executor; import java.util.concurrent.atomic.AtomicBoolean; diff --git a/core/trino-main/src/main/java/io/trino/execution/buffer/SerializedPageReference.java b/core/trino-main/src/main/java/io/trino/execution/buffer/SerializedPageReference.java index 51d7cc939f31..b3551a69e2c3 100644 --- a/core/trino-main/src/main/java/io/trino/execution/buffer/SerializedPageReference.java +++ b/core/trino-main/src/main/java/io/trino/execution/buffer/SerializedPageReference.java @@ -13,10 +13,9 @@ */ package io.trino.execution.buffer; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.slice.Slice; -import javax.annotation.concurrent.ThreadSafe; - import java.util.List; import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; diff --git a/core/trino-main/src/main/java/io/trino/execution/buffer/SpoolingExchangeOutputBuffer.java b/core/trino-main/src/main/java/io/trino/execution/buffer/SpoolingExchangeOutputBuffer.java index cc2070f868c7..0ceadee2e631 100644 --- a/core/trino-main/src/main/java/io/trino/execution/buffer/SpoolingExchangeOutputBuffer.java +++ b/core/trino-main/src/main/java/io/trino/execution/buffer/SpoolingExchangeOutputBuffer.java @@ -14,6 +14,7 @@ package io.trino.execution.buffer; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.log.Logger; import io.airlift.slice.Slice; import io.airlift.units.DataSize; @@ -21,8 +22,6 @@ import io.trino.memory.context.LocalMemoryContext; import io.trino.spi.exchange.ExchangeSink; -import javax.annotation.concurrent.ThreadSafe; - import java.util.List; import java.util.Optional; import java.util.concurrent.atomic.AtomicLong; diff --git a/core/trino-main/src/main/java/io/trino/execution/buffer/SpoolingOutputStats.java b/core/trino-main/src/main/java/io/trino/execution/buffer/SpoolingOutputStats.java index 32c51a7928eb..aff307fc5b32 100644 --- a/core/trino-main/src/main/java/io/trino/execution/buffer/SpoolingOutputStats.java +++ b/core/trino-main/src/main/java/io/trino/execution/buffer/SpoolingOutputStats.java @@ -15,11 +15,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.slice.Slice; import io.airlift.slice.Slices; -import javax.annotation.concurrent.ThreadSafe; - import java.util.Optional; import java.util.concurrent.atomic.AtomicLongArray; diff --git a/core/trino-main/src/main/java/io/trino/execution/executor/MultilevelSplitQueue.java b/core/trino-main/src/main/java/io/trino/execution/executor/MultilevelSplitQueue.java index 4da3d216e1c2..344c4662fb4e 100644 --- a/core/trino-main/src/main/java/io/trino/execution/executor/MultilevelSplitQueue.java +++ b/core/trino-main/src/main/java/io/trino/execution/executor/MultilevelSplitQueue.java @@ -14,15 +14,14 @@ package io.trino.execution.executor; import com.google.common.annotations.VisibleForTesting; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.airlift.stats.CounterStat; import io.trino.execution.TaskManagerConfig; import org.weakref.jmx.Managed; import org.weakref.jmx.Nested; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.util.Collection; import java.util.PriorityQueue; import java.util.concurrent.atomic.AtomicLong; diff --git a/core/trino-main/src/main/java/io/trino/execution/executor/Priority.java b/core/trino-main/src/main/java/io/trino/execution/executor/Priority.java index d1b5c9fa8345..180f698742ae 100644 --- a/core/trino-main/src/main/java/io/trino/execution/executor/Priority.java +++ b/core/trino-main/src/main/java/io/trino/execution/executor/Priority.java @@ -13,7 +13,7 @@ */ package io.trino.execution.executor; -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; import static com.google.common.base.MoreObjects.toStringHelper; diff --git a/core/trino-main/src/main/java/io/trino/execution/executor/TaskExecutor.java b/core/trino-main/src/main/java/io/trino/execution/executor/TaskExecutor.java index 0e58d27fb0fd..f7ed83aa7b7e 100644 --- a/core/trino-main/src/main/java/io/trino/execution/executor/TaskExecutor.java +++ b/core/trino-main/src/main/java/io/trino/execution/executor/TaskExecutor.java @@ -17,6 +17,8 @@ import com.google.common.base.Ticker; import com.google.common.collect.ComparisonChain; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.airlift.concurrent.SetThreadName; import io.airlift.concurrent.ThreadPoolExecutorMBean; @@ -40,9 +42,6 @@ import org.weakref.jmx.Managed; import org.weakref.jmx.Nested; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; diff --git a/core/trino-main/src/main/java/io/trino/execution/executor/TaskHandle.java b/core/trino-main/src/main/java/io/trino/execution/executor/TaskHandle.java index b8be2c577721..f3d99d0fb1b7 100644 --- a/core/trino-main/src/main/java/io/trino/execution/executor/TaskHandle.java +++ b/core/trino-main/src/main/java/io/trino/execution/executor/TaskHandle.java @@ -14,13 +14,12 @@ package io.trino.execution.executor; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.units.Duration; import io.trino.execution.SplitConcurrencyController; import io.trino.execution.TaskId; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.util.ArrayDeque; import java.util.ArrayList; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/execution/querystats/PlanOptimizersStatsCollector.java b/core/trino-main/src/main/java/io/trino/execution/querystats/PlanOptimizersStatsCollector.java index 2c9810308c78..099cf02e3c10 100644 --- a/core/trino-main/src/main/java/io/trino/execution/querystats/PlanOptimizersStatsCollector.java +++ b/core/trino-main/src/main/java/io/trino/execution/querystats/PlanOptimizersStatsCollector.java @@ -13,12 +13,11 @@ */ package io.trino.execution.querystats; +import com.google.errorprone.annotations.ThreadSafe; import io.trino.spi.eventlistener.QueryPlanOptimizerStatistics; import io.trino.sql.planner.iterative.Rule; import io.trino.sql.planner.optimizations.PlanOptimizer; -import javax.annotation.concurrent.ThreadSafe; - import java.util.Comparator; import java.util.List; import java.util.Map; diff --git a/core/trino-main/src/main/java/io/trino/execution/querystats/QueryPlanOptimizerStats.java b/core/trino-main/src/main/java/io/trino/execution/querystats/QueryPlanOptimizerStats.java index d154b8825afc..457ff4d3abe5 100644 --- a/core/trino-main/src/main/java/io/trino/execution/querystats/QueryPlanOptimizerStats.java +++ b/core/trino-main/src/main/java/io/trino/execution/querystats/QueryPlanOptimizerStats.java @@ -13,10 +13,9 @@ */ package io.trino.execution.querystats; +import com.google.errorprone.annotations.ThreadSafe; import io.trino.spi.eventlistener.QueryPlanOptimizerStatistics; -import javax.annotation.concurrent.ThreadSafe; - import java.util.concurrent.atomic.AtomicLong; import static com.google.common.base.Preconditions.checkArgument; diff --git a/core/trino-main/src/main/java/io/trino/execution/resourcegroups/InternalResourceGroup.java b/core/trino-main/src/main/java/io/trino/execution/resourcegroups/InternalResourceGroup.java index 05813cc68c5e..8f830685d177 100644 --- a/core/trino-main/src/main/java/io/trino/execution/resourcegroups/InternalResourceGroup.java +++ b/core/trino-main/src/main/java/io/trino/execution/resourcegroups/InternalResourceGroup.java @@ -15,6 +15,8 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.stats.CounterStat; import io.trino.execution.ManagedQueryExecution; import io.trino.execution.resourcegroups.WeightedFairQueue.Usage; @@ -28,9 +30,6 @@ import org.weakref.jmx.Managed; import org.weakref.jmx.Nested; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.time.Duration; import java.util.Collection; import java.util.HashMap; diff --git a/core/trino-main/src/main/java/io/trino/execution/resourcegroups/InternalResourceGroupManager.java b/core/trino-main/src/main/java/io/trino/execution/resourcegroups/InternalResourceGroupManager.java index 5b80c0b2b100..1d47a478fc29 100644 --- a/core/trino-main/src/main/java/io/trino/execution/resourcegroups/InternalResourceGroupManager.java +++ b/core/trino-main/src/main/java/io/trino/execution/resourcegroups/InternalResourceGroupManager.java @@ -15,6 +15,7 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableMap; +import com.google.errorprone.annotations.ThreadSafe; import com.google.inject.Inject; import io.airlift.log.Logger; import io.airlift.node.NodeInfo; @@ -35,8 +36,6 @@ import org.weakref.jmx.MBeanExporter; import org.weakref.jmx.Managed; -import javax.annotation.concurrent.ThreadSafe; - import java.io.File; import java.util.HashMap; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/execution/resourcegroups/ResourceGroupManager.java b/core/trino-main/src/main/java/io/trino/execution/resourcegroups/ResourceGroupManager.java index b52f10404cef..43d23bae727f 100644 --- a/core/trino-main/src/main/java/io/trino/execution/resourcegroups/ResourceGroupManager.java +++ b/core/trino-main/src/main/java/io/trino/execution/resourcegroups/ResourceGroupManager.java @@ -13,6 +13,7 @@ */ package io.trino.execution.resourcegroups; +import com.google.errorprone.annotations.ThreadSafe; import io.trino.execution.ManagedQueryExecution; import io.trino.server.ResourceGroupInfo; import io.trino.spi.resourcegroups.ResourceGroupConfigurationManagerFactory; @@ -20,8 +21,6 @@ import io.trino.spi.resourcegroups.SelectionContext; import io.trino.spi.resourcegroups.SelectionCriteria; -import javax.annotation.concurrent.ThreadSafe; - import java.util.List; import java.util.Optional; import java.util.concurrent.Executor; diff --git a/core/trino-main/src/main/java/io/trino/execution/resourcegroups/ResourceUsage.java b/core/trino-main/src/main/java/io/trino/execution/resourcegroups/ResourceUsage.java index c65b20c4dc25..bb9c13f56298 100644 --- a/core/trino-main/src/main/java/io/trino/execution/resourcegroups/ResourceUsage.java +++ b/core/trino-main/src/main/java/io/trino/execution/resourcegroups/ResourceUsage.java @@ -13,7 +13,7 @@ */ package io.trino.execution.resourcegroups; -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; import java.util.Objects; diff --git a/core/trino-main/src/main/java/io/trino/execution/scheduler/BinPackingNodeAllocatorService.java b/core/trino-main/src/main/java/io/trino/execution/scheduler/BinPackingNodeAllocatorService.java index 0a9be4f0431d..c40d27fbb19d 100644 --- a/core/trino-main/src/main/java/io/trino/execution/scheduler/BinPackingNodeAllocatorService.java +++ b/core/trino-main/src/main/java/io/trino/execution/scheduler/BinPackingNodeAllocatorService.java @@ -22,6 +22,7 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; +import com.google.errorprone.annotations.ThreadSafe; import com.google.inject.Inject; import io.airlift.log.Logger; import io.airlift.stats.TDigest; @@ -41,8 +42,6 @@ import jakarta.annotation.PreDestroy; import org.assertj.core.util.VisibleForTesting; -import javax.annotation.concurrent.ThreadSafe; - import java.time.Duration; import java.util.Comparator; import java.util.Deque; diff --git a/core/trino-main/src/main/java/io/trino/execution/scheduler/BroadcastPipelinedOutputBufferManager.java b/core/trino-main/src/main/java/io/trino/execution/scheduler/BroadcastPipelinedOutputBufferManager.java index 11923483f2f3..e5b0f3ce4aad 100644 --- a/core/trino-main/src/main/java/io/trino/execution/scheduler/BroadcastPipelinedOutputBufferManager.java +++ b/core/trino-main/src/main/java/io/trino/execution/scheduler/BroadcastPipelinedOutputBufferManager.java @@ -13,12 +13,11 @@ */ package io.trino.execution.scheduler; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.trino.execution.buffer.PipelinedOutputBuffers; import io.trino.execution.buffer.PipelinedOutputBuffers.OutputBufferId; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import static io.trino.execution.buffer.PipelinedOutputBuffers.BROADCAST_PARTITION_ID; import static io.trino.execution.buffer.PipelinedOutputBuffers.BufferType.BROADCAST; diff --git a/core/trino-main/src/main/java/io/trino/execution/scheduler/EventDrivenFaultTolerantQueryScheduler.java b/core/trino-main/src/main/java/io/trino/execution/scheduler/EventDrivenFaultTolerantQueryScheduler.java index 59f0d17a5081..a1fecf5e5e48 100644 --- a/core/trino-main/src/main/java/io/trino/execution/scheduler/EventDrivenFaultTolerantQueryScheduler.java +++ b/core/trino-main/src/main/java/io/trino/execution/scheduler/EventDrivenFaultTolerantQueryScheduler.java @@ -30,6 +30,8 @@ import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.UncheckedExecutionException; import com.google.errorprone.annotations.CheckReturnValue; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.log.Logger; import io.airlift.units.DataSize; import io.airlift.units.Duration; @@ -90,10 +92,7 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; import it.unimi.dsi.fastutil.ints.IntOpenHashSet; import it.unimi.dsi.fastutil.ints.IntSet; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; +import jakarta.annotation.Nullable; import java.io.Closeable; import java.io.IOException; diff --git a/core/trino-main/src/main/java/io/trino/execution/scheduler/EventDrivenTaskSource.java b/core/trino-main/src/main/java/io/trino/execution/scheduler/EventDrivenTaskSource.java index 0f9b06d5236a..a84d13b7861a 100644 --- a/core/trino-main/src/main/java/io/trino/execution/scheduler/EventDrivenTaskSource.java +++ b/core/trino-main/src/main/java/io/trino/execution/scheduler/EventDrivenTaskSource.java @@ -24,6 +24,8 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.trino.exchange.SpoolingExchangeInput; import io.trino.execution.TableExecuteContext; import io.trino.execution.TableExecuteContextManager; @@ -41,9 +43,6 @@ import io.trino.sql.planner.plan.PlanFragmentId; import io.trino.sql.planner.plan.PlanNodeId; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.io.Closeable; import java.io.IOException; import java.util.HashMap; diff --git a/core/trino-main/src/main/java/io/trino/execution/scheduler/FileBasedNetworkTopology.java b/core/trino-main/src/main/java/io/trino/execution/scheduler/FileBasedNetworkTopology.java index 3c8e85f87174..70114136cc99 100644 --- a/core/trino-main/src/main/java/io/trino/execution/scheduler/FileBasedNetworkTopology.java +++ b/core/trino-main/src/main/java/io/trino/execution/scheduler/FileBasedNetworkTopology.java @@ -17,14 +17,13 @@ import com.google.common.base.Ticker; import com.google.common.collect.ImmutableMap; import com.google.common.io.Files; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.airlift.log.Logger; import io.airlift.units.Duration; import io.trino.spi.HostAddress; import org.weakref.jmx.Managed; -import javax.annotation.concurrent.GuardedBy; - import java.io.File; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/core/trino-main/src/main/java/io/trino/execution/scheduler/NetworkTopology.java b/core/trino-main/src/main/java/io/trino/execution/scheduler/NetworkTopology.java index 4a446172c6a2..c3cc5df0cedb 100644 --- a/core/trino-main/src/main/java/io/trino/execution/scheduler/NetworkTopology.java +++ b/core/trino-main/src/main/java/io/trino/execution/scheduler/NetworkTopology.java @@ -13,10 +13,9 @@ */ package io.trino.execution.scheduler; +import com.google.errorprone.annotations.ThreadSafe; import io.trino.spi.HostAddress; -import javax.annotation.concurrent.ThreadSafe; - /** * Implementations of this interface must be thread safe. */ diff --git a/core/trino-main/src/main/java/io/trino/execution/scheduler/NodeSchedulerConfig.java b/core/trino-main/src/main/java/io/trino/execution/scheduler/NodeSchedulerConfig.java index 075c56beef9a..361021493f25 100644 --- a/core/trino-main/src/main/java/io/trino/execution/scheduler/NodeSchedulerConfig.java +++ b/core/trino-main/src/main/java/io/trino/execution/scheduler/NodeSchedulerConfig.java @@ -18,9 +18,8 @@ import io.airlift.configuration.DefunctConfig; import io.airlift.configuration.LegacyConfig; import io.airlift.units.Duration; - -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import java.util.concurrent.TimeUnit; diff --git a/core/trino-main/src/main/java/io/trino/execution/scheduler/NodeSchedulerExporter.java b/core/trino-main/src/main/java/io/trino/execution/scheduler/NodeSchedulerExporter.java index fffd55f3cd30..14ee617d40bb 100644 --- a/core/trino-main/src/main/java/io/trino/execution/scheduler/NodeSchedulerExporter.java +++ b/core/trino-main/src/main/java/io/trino/execution/scheduler/NodeSchedulerExporter.java @@ -14,6 +14,7 @@ package io.trino.execution.scheduler; import com.google.common.collect.ImmutableMap; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.airlift.stats.CounterStat; import jakarta.annotation.PreDestroy; @@ -21,8 +22,6 @@ import org.weakref.jmx.MBeanExport; import org.weakref.jmx.MBeanExporter; -import javax.annotation.concurrent.GuardedBy; - import java.util.ArrayList; import java.util.List; import java.util.Map; diff --git a/core/trino-main/src/main/java/io/trino/execution/scheduler/PartitionedPipelinedOutputBufferManager.java b/core/trino-main/src/main/java/io/trino/execution/scheduler/PartitionedPipelinedOutputBufferManager.java index baf801169194..7f77d2ac88dd 100644 --- a/core/trino-main/src/main/java/io/trino/execution/scheduler/PartitionedPipelinedOutputBufferManager.java +++ b/core/trino-main/src/main/java/io/trino/execution/scheduler/PartitionedPipelinedOutputBufferManager.java @@ -14,12 +14,11 @@ package io.trino.execution.scheduler; import com.google.common.collect.ImmutableMap; +import com.google.errorprone.annotations.ThreadSafe; import io.trino.execution.buffer.PipelinedOutputBuffers; import io.trino.execution.buffer.PipelinedOutputBuffers.OutputBufferId; import io.trino.sql.planner.PartitioningHandle; -import javax.annotation.concurrent.ThreadSafe; - import static com.google.common.base.Preconditions.checkArgument; import static java.util.Objects.requireNonNull; diff --git a/core/trino-main/src/main/java/io/trino/execution/scheduler/PipelinedQueryScheduler.java b/core/trino-main/src/main/java/io/trino/execution/scheduler/PipelinedQueryScheduler.java index abf55b461e77..f664f7d30e3c 100644 --- a/core/trino-main/src/main/java/io/trino/execution/scheduler/PipelinedQueryScheduler.java +++ b/core/trino-main/src/main/java/io/trino/execution/scheduler/PipelinedQueryScheduler.java @@ -21,6 +21,7 @@ import com.google.common.primitives.Ints; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.concurrent.SetThreadName; import io.airlift.log.Logger; import io.airlift.stats.TimeStat; @@ -71,8 +72,6 @@ import io.trino.sql.planner.plan.RemoteSourceNode; import io.trino.sql.planner.plan.TableScanNode; -import javax.annotation.concurrent.GuardedBy; - import java.net.URI; import java.util.ArrayList; import java.util.Collection; diff --git a/core/trino-main/src/main/java/io/trino/execution/scheduler/PipelinedStageExecution.java b/core/trino-main/src/main/java/io/trino/execution/scheduler/PipelinedStageExecution.java index 0310084bfa01..c5aa469b9b68 100644 --- a/core/trino-main/src/main/java/io/trino/execution/scheduler/PipelinedStageExecution.java +++ b/core/trino-main/src/main/java/io/trino/execution/scheduler/PipelinedStageExecution.java @@ -19,6 +19,7 @@ import com.google.common.collect.ImmutableMultimap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Multimap; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.log.Logger; import io.opentelemetry.api.trace.Span; import io.trino.exchange.DirectExchangeInput; @@ -45,8 +46,6 @@ import io.trino.sql.planner.plan.RemoteSourceNode; import io.trino.util.Failures; -import javax.annotation.concurrent.GuardedBy; - import java.net.URI; import java.util.HashSet; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/execution/scheduler/ScaledPipelinedOutputBufferManager.java b/core/trino-main/src/main/java/io/trino/execution/scheduler/ScaledPipelinedOutputBufferManager.java index 94692bd9d6b0..28493e00ce90 100644 --- a/core/trino-main/src/main/java/io/trino/execution/scheduler/ScaledPipelinedOutputBufferManager.java +++ b/core/trino-main/src/main/java/io/trino/execution/scheduler/ScaledPipelinedOutputBufferManager.java @@ -13,11 +13,10 @@ */ package io.trino.execution.scheduler; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.trino.execution.buffer.PipelinedOutputBuffers; import io.trino.execution.buffer.PipelinedOutputBuffers.OutputBufferId; -import javax.annotation.concurrent.GuardedBy; - import static io.trino.execution.buffer.PipelinedOutputBuffers.BufferType.ARBITRARY; public class ScaledPipelinedOutputBufferManager diff --git a/core/trino-main/src/main/java/io/trino/execution/scheduler/SplitSchedulerStats.java b/core/trino-main/src/main/java/io/trino/execution/scheduler/SplitSchedulerStats.java index 810acf2af4b1..89493ebed0a4 100644 --- a/core/trino-main/src/main/java/io/trino/execution/scheduler/SplitSchedulerStats.java +++ b/core/trino-main/src/main/java/io/trino/execution/scheduler/SplitSchedulerStats.java @@ -13,14 +13,13 @@ */ package io.trino.execution.scheduler; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.stats.CounterStat; import io.airlift.stats.DistributionStat; import io.airlift.stats.TimeStat; import org.weakref.jmx.Managed; import org.weakref.jmx.Nested; -import javax.annotation.concurrent.ThreadSafe; - import static java.util.concurrent.TimeUnit.MILLISECONDS; @ThreadSafe diff --git a/core/trino-main/src/main/java/io/trino/execution/scheduler/TaskDescriptorStorage.java b/core/trino-main/src/main/java/io/trino/execution/scheduler/TaskDescriptorStorage.java index 79cfa0f399bb..2bfe58c5770a 100644 --- a/core/trino-main/src/main/java/io/trino/execution/scheduler/TaskDescriptorStorage.java +++ b/core/trino-main/src/main/java/io/trino/execution/scheduler/TaskDescriptorStorage.java @@ -16,6 +16,7 @@ import com.google.common.base.VerifyException; import com.google.common.collect.Multimap; import com.google.common.math.Stats; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.airlift.log.Logger; import io.airlift.units.DataSize; @@ -28,8 +29,6 @@ import io.trino.sql.planner.plan.PlanNodeId; import org.weakref.jmx.Managed; -import javax.annotation.concurrent.GuardedBy; - import java.util.Collection; import java.util.Comparator; import java.util.HashMap; diff --git a/core/trino-main/src/main/java/io/trino/execution/scheduler/TopologyAwareNodeSelector.java b/core/trino-main/src/main/java/io/trino/execution/scheduler/TopologyAwareNodeSelector.java index 9a27f8114215..1d897df549bc 100644 --- a/core/trino-main/src/main/java/io/trino/execution/scheduler/TopologyAwareNodeSelector.java +++ b/core/trino-main/src/main/java/io/trino/execution/scheduler/TopologyAwareNodeSelector.java @@ -27,8 +27,7 @@ import io.trino.spi.HostAddress; import io.trino.spi.SplitWeight; import io.trino.spi.TrinoException; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.HashSet; import java.util.Iterator; diff --git a/core/trino-main/src/main/java/io/trino/execution/scheduler/TopologyAwareNodeSelectorConfig.java b/core/trino-main/src/main/java/io/trino/execution/scheduler/TopologyAwareNodeSelectorConfig.java index 2dd6d6fafb7a..b2a68a7321ae 100644 --- a/core/trino-main/src/main/java/io/trino/execution/scheduler/TopologyAwareNodeSelectorConfig.java +++ b/core/trino-main/src/main/java/io/trino/execution/scheduler/TopologyAwareNodeSelectorConfig.java @@ -16,8 +16,7 @@ import com.google.common.base.Splitter; import com.google.common.collect.ImmutableList; import io.airlift.configuration.Config; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/execution/scheduler/UniformNodeSelector.java b/core/trino-main/src/main/java/io/trino/execution/scheduler/UniformNodeSelector.java index 37ca0098bdeb..359380eb96c6 100644 --- a/core/trino-main/src/main/java/io/trino/execution/scheduler/UniformNodeSelector.java +++ b/core/trino-main/src/main/java/io/trino/execution/scheduler/UniformNodeSelector.java @@ -33,8 +33,7 @@ import io.trino.spi.HostAddress; import io.trino.spi.SplitWeight; import io.trino.spi.TrinoException; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.net.InetAddress; import java.net.UnknownHostException; diff --git a/core/trino-main/src/main/java/io/trino/execution/scheduler/policy/PhasedExecutionSchedule.java b/core/trino-main/src/main/java/io/trino/execution/scheduler/policy/PhasedExecutionSchedule.java index 4e95441ac040..13729037a03b 100644 --- a/core/trino-main/src/main/java/io/trino/execution/scheduler/policy/PhasedExecutionSchedule.java +++ b/core/trino-main/src/main/java/io/trino/execution/scheduler/policy/PhasedExecutionSchedule.java @@ -22,6 +22,7 @@ import com.google.common.graph.MutableGraph; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.log.Logger; import io.trino.execution.scheduler.StageExecution; import io.trino.execution.scheduler.StageExecution.State; @@ -39,8 +40,6 @@ import io.trino.sql.planner.plan.SemiJoinNode; import io.trino.sql.planner.plan.SpatialJoinNode; -import javax.annotation.concurrent.GuardedBy; - import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; diff --git a/core/trino-main/src/main/java/io/trino/execution/warnings/DefaultWarningCollector.java b/core/trino-main/src/main/java/io/trino/execution/warnings/DefaultWarningCollector.java index 1e8eb41c254c..a8400cfe4945 100644 --- a/core/trino-main/src/main/java/io/trino/execution/warnings/DefaultWarningCollector.java +++ b/core/trino-main/src/main/java/io/trino/execution/warnings/DefaultWarningCollector.java @@ -14,11 +14,10 @@ package io.trino.execution.warnings; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.trino.spi.TrinoWarning; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.util.LinkedHashSet; import java.util.List; import java.util.Set; diff --git a/core/trino-main/src/main/java/io/trino/failuredetector/FailureDetectorConfig.java b/core/trino-main/src/main/java/io/trino/failuredetector/FailureDetectorConfig.java index 085e05caefc1..ed3ea1e402ed 100644 --- a/core/trino-main/src/main/java/io/trino/failuredetector/FailureDetectorConfig.java +++ b/core/trino-main/src/main/java/io/trino/failuredetector/FailureDetectorConfig.java @@ -17,10 +17,9 @@ import io.airlift.configuration.ConfigDescription; import io.airlift.units.Duration; import io.airlift.units.MinDuration; - -import javax.validation.constraints.DecimalMax; -import javax.validation.constraints.DecimalMin; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.DecimalMax; +import jakarta.validation.constraints.DecimalMin; +import jakarta.validation.constraints.NotNull; import java.util.concurrent.TimeUnit; diff --git a/core/trino-main/src/main/java/io/trino/failuredetector/HeartbeatFailureDetector.java b/core/trino-main/src/main/java/io/trino/failuredetector/HeartbeatFailureDetector.java index c55ab4aba813..6d1ea0247eee 100644 --- a/core/trino-main/src/main/java/io/trino/failuredetector/HeartbeatFailureDetector.java +++ b/core/trino-main/src/main/java/io/trino/failuredetector/HeartbeatFailureDetector.java @@ -17,6 +17,8 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableMap; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.airlift.concurrent.ThreadPoolExecutorMBean; import io.airlift.discovery.client.ServiceDescriptor; @@ -35,16 +37,13 @@ import io.trino.server.InternalCommunicationConfig; import io.trino.spi.HostAddress; import io.trino.util.Failures; +import jakarta.annotation.Nullable; import jakarta.annotation.PostConstruct; import jakarta.annotation.PreDestroy; import org.joda.time.DateTime; import org.weakref.jmx.Managed; import org.weakref.jmx.Nested; -import javax.annotation.Nullable; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.net.ConnectException; import java.net.SocketTimeoutException; import java.net.URI; diff --git a/core/trino-main/src/main/java/io/trino/json/ir/IrJsonPathVisitor.java b/core/trino-main/src/main/java/io/trino/json/ir/IrJsonPathVisitor.java index 846e7e006370..edc0bf9d04ad 100644 --- a/core/trino-main/src/main/java/io/trino/json/ir/IrJsonPathVisitor.java +++ b/core/trino-main/src/main/java/io/trino/json/ir/IrJsonPathVisitor.java @@ -13,7 +13,7 @@ */ package io.trino.json.ir; -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; public abstract class IrJsonPathVisitor { diff --git a/core/trino-main/src/main/java/io/trino/memory/ClusterMemoryLeakDetector.java b/core/trino-main/src/main/java/io/trino/memory/ClusterMemoryLeakDetector.java index 5ca46639a185..d2f2d8074929 100644 --- a/core/trino-main/src/main/java/io/trino/memory/ClusterMemoryLeakDetector.java +++ b/core/trino-main/src/main/java/io/trino/memory/ClusterMemoryLeakDetector.java @@ -15,14 +15,13 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Maps; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.log.Logger; import io.trino.server.BasicQueryInfo; import io.trino.spi.QueryId; import org.joda.time.DateTime; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.util.List; import java.util.Map; import java.util.Map.Entry; diff --git a/core/trino-main/src/main/java/io/trino/memory/ClusterMemoryManager.java b/core/trino-main/src/main/java/io/trino/memory/ClusterMemoryManager.java index 57edcc2fbea9..629dcafd3dad 100644 --- a/core/trino-main/src/main/java/io/trino/memory/ClusterMemoryManager.java +++ b/core/trino-main/src/main/java/io/trino/memory/ClusterMemoryManager.java @@ -21,6 +21,7 @@ import com.google.common.collect.Iterables; import com.google.common.collect.Streams; import com.google.common.io.Closer; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.airlift.http.client.HttpClient; import io.airlift.json.JsonCodec; @@ -50,8 +51,6 @@ import org.weakref.jmx.MBeanExporter; import org.weakref.jmx.Managed; -import javax.annotation.concurrent.GuardedBy; - import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; diff --git a/core/trino-main/src/main/java/io/trino/memory/ClusterMemoryPool.java b/core/trino-main/src/main/java/io/trino/memory/ClusterMemoryPool.java index e36c001e9916..901748099a09 100644 --- a/core/trino-main/src/main/java/io/trino/memory/ClusterMemoryPool.java +++ b/core/trino-main/src/main/java/io/trino/memory/ClusterMemoryPool.java @@ -14,14 +14,13 @@ package io.trino.memory; import com.google.common.collect.ImmutableMap; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.trino.spi.QueryId; import io.trino.spi.memory.MemoryAllocation; import io.trino.spi.memory.MemoryPoolInfo; import org.weakref.jmx.Managed; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/memory/MemoryManagerConfig.java b/core/trino-main/src/main/java/io/trino/memory/MemoryManagerConfig.java index f146a595c26c..577efd860c09 100644 --- a/core/trino-main/src/main/java/io/trino/memory/MemoryManagerConfig.java +++ b/core/trino-main/src/main/java/io/trino/memory/MemoryManagerConfig.java @@ -18,8 +18,7 @@ import io.airlift.configuration.DefunctConfig; import io.airlift.units.DataSize; import io.airlift.units.Duration; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import static com.google.common.base.Preconditions.checkArgument; import static io.airlift.units.DataSize.Unit.GIGABYTE; diff --git a/core/trino-main/src/main/java/io/trino/memory/MemoryPool.java b/core/trino-main/src/main/java/io/trino/memory/MemoryPool.java index 41a38d22e195..b330931af945 100644 --- a/core/trino-main/src/main/java/io/trino/memory/MemoryPool.java +++ b/core/trino-main/src/main/java/io/trino/memory/MemoryPool.java @@ -17,16 +17,15 @@ import com.google.common.collect.ImmutableMap; import com.google.common.util.concurrent.AbstractFuture; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.units.DataSize; import io.trino.execution.TaskId; import io.trino.spi.QueryId; import io.trino.spi.memory.MemoryAllocation; import io.trino.spi.memory.MemoryPoolInfo; +import jakarta.annotation.Nullable; import org.weakref.jmx.Managed; -import javax.annotation.Nullable; -import javax.annotation.concurrent.GuardedBy; - import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/memory/NodeMemoryConfig.java b/core/trino-main/src/main/java/io/trino/memory/NodeMemoryConfig.java index d4ef3fcd6959..5ea55b480895 100644 --- a/core/trino-main/src/main/java/io/trino/memory/NodeMemoryConfig.java +++ b/core/trino-main/src/main/java/io/trino/memory/NodeMemoryConfig.java @@ -17,8 +17,7 @@ import io.airlift.configuration.ConfigDescription; import io.airlift.configuration.DefunctConfig; import io.airlift.units.DataSize; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; // This is separate from MemoryManagerConfig because it's difficult to test the default value of maxQueryMemoryPerNode @DefunctConfig({ diff --git a/core/trino-main/src/main/java/io/trino/memory/QueryContext.java b/core/trino-main/src/main/java/io/trino/memory/QueryContext.java index 9aec16d5fb36..82a535bf0097 100644 --- a/core/trino-main/src/main/java/io/trino/memory/QueryContext.java +++ b/core/trino-main/src/main/java/io/trino/memory/QueryContext.java @@ -15,6 +15,8 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.stats.GcMonitor; import io.airlift.units.DataSize; import io.trino.Session; @@ -26,9 +28,6 @@ import io.trino.spi.QueryId; import io.trino.spiller.SpillSpaceTracker; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.util.Comparator; import java.util.List; import java.util.Map; diff --git a/core/trino-main/src/main/java/io/trino/memory/RemoteNodeMemory.java b/core/trino-main/src/main/java/io/trino/memory/RemoteNodeMemory.java index f71081fa4e92..34d743b232b9 100644 --- a/core/trino-main/src/main/java/io/trino/memory/RemoteNodeMemory.java +++ b/core/trino-main/src/main/java/io/trino/memory/RemoteNodeMemory.java @@ -15,6 +15,7 @@ import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.http.client.FullJsonResponseHandler.JsonResponse; import io.airlift.http.client.HttpClient; import io.airlift.http.client.HttpClient.HttpResponseFuture; @@ -23,9 +24,7 @@ import io.airlift.log.Logger; import io.airlift.units.Duration; import io.trino.metadata.InternalNode; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.ThreadSafe; +import jakarta.annotation.Nullable; import java.net.URI; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/metadata/CatalogProcedures.java b/core/trino-main/src/main/java/io/trino/metadata/CatalogProcedures.java index f0409cfb5a38..0ba67d35d70f 100644 --- a/core/trino-main/src/main/java/io/trino/metadata/CatalogProcedures.java +++ b/core/trino-main/src/main/java/io/trino/metadata/CatalogProcedures.java @@ -15,6 +15,7 @@ import com.google.common.collect.Maps; import com.google.common.primitives.Primitives; +import com.google.errorprone.annotations.ThreadSafe; import io.trino.spi.TrinoException; import io.trino.spi.connector.ConnectorAccessControl; import io.trino.spi.connector.ConnectorSession; @@ -24,8 +25,6 @@ import io.trino.spi.type.MapType; import io.trino.spi.type.Type; -import javax.annotation.concurrent.ThreadSafe; - import java.util.Collection; import java.util.List; import java.util.Map; diff --git a/core/trino-main/src/main/java/io/trino/metadata/CatalogTableFunctions.java b/core/trino-main/src/main/java/io/trino/metadata/CatalogTableFunctions.java index 23430d768b7a..34ffbedc49a8 100644 --- a/core/trino-main/src/main/java/io/trino/metadata/CatalogTableFunctions.java +++ b/core/trino-main/src/main/java/io/trino/metadata/CatalogTableFunctions.java @@ -14,11 +14,10 @@ package io.trino.metadata; import com.google.common.collect.Maps; +import com.google.errorprone.annotations.ThreadSafe; import io.trino.spi.function.SchemaFunctionName; import io.trino.spi.function.table.ConnectorTableFunction; -import javax.annotation.concurrent.ThreadSafe; - import java.util.Collection; import java.util.Map; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/metadata/CatalogTableProcedures.java b/core/trino-main/src/main/java/io/trino/metadata/CatalogTableProcedures.java index 345eb937d973..3794df65b4b0 100644 --- a/core/trino-main/src/main/java/io/trino/metadata/CatalogTableProcedures.java +++ b/core/trino-main/src/main/java/io/trino/metadata/CatalogTableProcedures.java @@ -14,11 +14,10 @@ package io.trino.metadata; import com.google.common.collect.Maps; +import com.google.errorprone.annotations.ThreadSafe; import io.trino.spi.TrinoException; import io.trino.spi.connector.TableProcedureMetadata; -import javax.annotation.concurrent.ThreadSafe; - import java.util.Collection; import java.util.Map; diff --git a/core/trino-main/src/main/java/io/trino/metadata/CatalogTransaction.java b/core/trino-main/src/main/java/io/trino/metadata/CatalogTransaction.java index 13cb22b3aa60..9da038f307f2 100644 --- a/core/trino-main/src/main/java/io/trino/metadata/CatalogTransaction.java +++ b/core/trino-main/src/main/java/io/trino/metadata/CatalogTransaction.java @@ -13,6 +13,7 @@ */ package io.trino.metadata; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.opentelemetry.api.trace.Tracer; import io.trino.Session; import io.trino.connector.informationschema.InformationSchemaMetadata; @@ -24,8 +25,6 @@ import io.trino.spi.connector.ConnectorTransactionHandle; import io.trino.tracing.TracingConnectorMetadata; -import javax.annotation.concurrent.GuardedBy; - import java.util.concurrent.atomic.AtomicBoolean; import static com.google.common.base.Preconditions.checkState; diff --git a/core/trino-main/src/main/java/io/trino/metadata/DiscoveryNodeManager.java b/core/trino-main/src/main/java/io/trino/metadata/DiscoveryNodeManager.java index a0b621915879..a11e018d3396 100644 --- a/core/trino-main/src/main/java/io/trino/metadata/DiscoveryNodeManager.java +++ b/core/trino-main/src/main/java/io/trino/metadata/DiscoveryNodeManager.java @@ -20,6 +20,8 @@ import com.google.common.collect.SetMultimap; import com.google.common.collect.Sets; import com.google.common.collect.Sets.SetView; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.airlift.discovery.client.ServiceDescriptor; import io.airlift.discovery.client.ServiceSelector; @@ -37,9 +39,6 @@ import jakarta.annotation.PreDestroy; import org.weakref.jmx.Managed; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.net.URI; import java.net.URISyntaxException; import java.util.ArrayList; diff --git a/core/trino-main/src/main/java/io/trino/metadata/GlobalFunctionCatalog.java b/core/trino-main/src/main/java/io/trino/metadata/GlobalFunctionCatalog.java index d844211d5376..92d584314bbd 100644 --- a/core/trino-main/src/main/java/io/trino/metadata/GlobalFunctionCatalog.java +++ b/core/trino-main/src/main/java/io/trino/metadata/GlobalFunctionCatalog.java @@ -17,6 +17,7 @@ import com.google.common.collect.ImmutableListMultimap; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Multimap; +import com.google.errorprone.annotations.ThreadSafe; import io.trino.operator.table.ExcludeColumns.ExcludeColumnsFunctionHandle; import io.trino.operator.table.Sequence.SequenceFunctionHandle; import io.trino.spi.function.AggregationFunctionMetadata; @@ -37,8 +38,6 @@ import io.trino.spi.function.table.TableFunctionProcessorProvider; import io.trino.spi.type.TypeSignature; -import javax.annotation.concurrent.ThreadSafe; - import java.util.Collection; import java.util.Collections; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/metadata/HandleResolver.java b/core/trino-main/src/main/java/io/trino/metadata/HandleResolver.java index 0f661cd4c1f8..452a568f1783 100644 --- a/core/trino-main/src/main/java/io/trino/metadata/HandleResolver.java +++ b/core/trino-main/src/main/java/io/trino/metadata/HandleResolver.java @@ -13,11 +13,10 @@ */ package io.trino.metadata; +import com.google.errorprone.annotations.ThreadSafe; import com.google.inject.Inject; import io.trino.server.PluginClassLoader; -import javax.annotation.concurrent.ThreadSafe; - import java.util.Map; import java.util.concurrent.ConcurrentHashMap; diff --git a/core/trino-main/src/main/java/io/trino/metadata/InMemoryNodeManager.java b/core/trino-main/src/main/java/io/trino/metadata/InMemoryNodeManager.java index 085f5817cc30..f85dc0c7a8e3 100644 --- a/core/trino-main/src/main/java/io/trino/metadata/InMemoryNodeManager.java +++ b/core/trino-main/src/main/java/io/trino/metadata/InMemoryNodeManager.java @@ -14,11 +14,10 @@ package io.trino.metadata; import com.google.common.collect.ImmutableSet; +import com.google.errorprone.annotations.ThreadSafe; import io.trino.client.NodeVersion; import io.trino.spi.connector.CatalogHandle; -import javax.annotation.concurrent.ThreadSafe; - import java.net.URI; import java.util.Optional; import java.util.Set; diff --git a/core/trino-main/src/main/java/io/trino/metadata/MetadataManager.java b/core/trino-main/src/main/java/io/trino/metadata/MetadataManager.java index 988ff1050d2e..1edb86ff8d2b 100644 --- a/core/trino-main/src/main/java/io/trino/metadata/MetadataManager.java +++ b/core/trino-main/src/main/java/io/trino/metadata/MetadataManager.java @@ -22,6 +22,7 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.UncheckedExecutionException; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.airlift.slice.Slice; import io.trino.FeaturesConfig; @@ -113,8 +114,6 @@ import io.trino.transaction.TransactionManager; import io.trino.type.BlockTypeOperators; -import javax.annotation.concurrent.GuardedBy; - import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; diff --git a/core/trino-main/src/main/java/io/trino/metadata/ProcedureRegistry.java b/core/trino-main/src/main/java/io/trino/metadata/ProcedureRegistry.java index c0e53cfd3218..ec8f76910afe 100644 --- a/core/trino-main/src/main/java/io/trino/metadata/ProcedureRegistry.java +++ b/core/trino-main/src/main/java/io/trino/metadata/ProcedureRegistry.java @@ -13,14 +13,13 @@ */ package io.trino.metadata; +import com.google.errorprone.annotations.ThreadSafe; import com.google.inject.Inject; import io.trino.connector.CatalogServiceProvider; import io.trino.spi.connector.CatalogHandle; import io.trino.spi.connector.SchemaTableName; import io.trino.spi.procedure.Procedure; -import javax.annotation.concurrent.ThreadSafe; - import static java.util.Objects.requireNonNull; @ThreadSafe diff --git a/core/trino-main/src/main/java/io/trino/metadata/QualifiedObjectName.java b/core/trino-main/src/main/java/io/trino/metadata/QualifiedObjectName.java index 3ab21e6c6603..13651107dd69 100644 --- a/core/trino-main/src/main/java/io/trino/metadata/QualifiedObjectName.java +++ b/core/trino-main/src/main/java/io/trino/metadata/QualifiedObjectName.java @@ -17,13 +17,12 @@ import com.fasterxml.jackson.annotation.JsonValue; import com.google.common.base.Splitter; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.Immutable; import io.trino.spi.connector.CatalogSchemaRoutineName; import io.trino.spi.connector.CatalogSchemaTableName; import io.trino.spi.connector.SchemaRoutineName; import io.trino.spi.connector.SchemaTableName; -import javax.annotation.concurrent.Immutable; - import java.util.Objects; import java.util.function.Function; diff --git a/core/trino-main/src/main/java/io/trino/metadata/QualifiedTablePrefix.java b/core/trino-main/src/main/java/io/trino/metadata/QualifiedTablePrefix.java index 3666e85c082b..2c153a97dbc7 100644 --- a/core/trino-main/src/main/java/io/trino/metadata/QualifiedTablePrefix.java +++ b/core/trino-main/src/main/java/io/trino/metadata/QualifiedTablePrefix.java @@ -15,10 +15,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.errorprone.annotations.Immutable; import io.trino.spi.connector.SchemaTablePrefix; -import javax.annotation.concurrent.Immutable; - import java.util.Objects; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/metadata/RemoteNodeState.java b/core/trino-main/src/main/java/io/trino/metadata/RemoteNodeState.java index 88672773bf31..0a1756ec8802 100644 --- a/core/trino-main/src/main/java/io/trino/metadata/RemoteNodeState.java +++ b/core/trino-main/src/main/java/io/trino/metadata/RemoteNodeState.java @@ -15,6 +15,7 @@ import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.http.client.FullJsonResponseHandler.JsonResponse; import io.airlift.http.client.HttpClient; import io.airlift.http.client.HttpClient.HttpResponseFuture; @@ -22,9 +23,7 @@ import io.airlift.json.JsonCodec; import io.airlift.log.Logger; import io.airlift.units.Duration; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.ThreadSafe; +import jakarta.annotation.Nullable; import java.net.URI; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/metadata/SessionPropertyManager.java b/core/trino-main/src/main/java/io/trino/metadata/SessionPropertyManager.java index 2f4bcd57217d..53b0cec41f39 100644 --- a/core/trino-main/src/main/java/io/trino/metadata/SessionPropertyManager.java +++ b/core/trino-main/src/main/java/io/trino/metadata/SessionPropertyManager.java @@ -41,8 +41,7 @@ import io.trino.sql.tree.ExpressionTreeRewriter; import io.trino.sql.tree.NodeRef; import io.trino.sql.tree.Parameter; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.List; import java.util.Map; diff --git a/core/trino-main/src/main/java/io/trino/metadata/TableFunctionRegistry.java b/core/trino-main/src/main/java/io/trino/metadata/TableFunctionRegistry.java index 5534ffa27385..f1b00ca6d0b3 100644 --- a/core/trino-main/src/main/java/io/trino/metadata/TableFunctionRegistry.java +++ b/core/trino-main/src/main/java/io/trino/metadata/TableFunctionRegistry.java @@ -13,14 +13,13 @@ */ package io.trino.metadata; +import com.google.errorprone.annotations.ThreadSafe; import com.google.inject.Inject; import io.trino.connector.CatalogServiceProvider; import io.trino.spi.connector.CatalogHandle; import io.trino.spi.function.SchemaFunctionName; import io.trino.spi.function.table.ConnectorTableFunction; -import javax.annotation.concurrent.ThreadSafe; - import java.util.Optional; import static java.util.Objects.requireNonNull; diff --git a/core/trino-main/src/main/java/io/trino/metadata/TypeRegistry.java b/core/trino-main/src/main/java/io/trino/metadata/TypeRegistry.java index aec89580207b..4d6f1f9708b7 100644 --- a/core/trino-main/src/main/java/io/trino/metadata/TypeRegistry.java +++ b/core/trino-main/src/main/java/io/trino/metadata/TypeRegistry.java @@ -19,6 +19,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.Multimap; import com.google.common.util.concurrent.UncheckedExecutionException; +import com.google.errorprone.annotations.ThreadSafe; import com.google.inject.Inject; import io.trino.FeaturesConfig; import io.trino.cache.NonEvictableCache; @@ -38,8 +39,6 @@ import io.trino.type.Re2JRegexpType; import io.trino.type.VarcharParametricType; -import javax.annotation.concurrent.ThreadSafe; - import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; diff --git a/core/trino-main/src/main/java/io/trino/operator/AssignUniqueIdOperator.java b/core/trino-main/src/main/java/io/trino/operator/AssignUniqueIdOperator.java index 6bc2835ba442..d098c545988c 100644 --- a/core/trino-main/src/main/java/io/trino/operator/AssignUniqueIdOperator.java +++ b/core/trino-main/src/main/java/io/trino/operator/AssignUniqueIdOperator.java @@ -20,8 +20,7 @@ import io.trino.spi.block.Block; import io.trino.spi.block.BlockBuilder; import io.trino.sql.planner.plan.PlanNodeId; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.concurrent.atomic.AtomicLong; diff --git a/core/trino-main/src/main/java/io/trino/operator/CompletedWork.java b/core/trino-main/src/main/java/io/trino/operator/CompletedWork.java index fd1e603b8e57..220ed136e35a 100644 --- a/core/trino-main/src/main/java/io/trino/operator/CompletedWork.java +++ b/core/trino-main/src/main/java/io/trino/operator/CompletedWork.java @@ -13,7 +13,7 @@ */ package io.trino.operator; -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import static java.util.Objects.requireNonNull; diff --git a/core/trino-main/src/main/java/io/trino/operator/DeduplicatingDirectExchangeBuffer.java b/core/trino-main/src/main/java/io/trino/operator/DeduplicatingDirectExchangeBuffer.java index 8f39cdc5c8f9..a77f07600cf7 100644 --- a/core/trino-main/src/main/java/io/trino/operator/DeduplicatingDirectExchangeBuffer.java +++ b/core/trino-main/src/main/java/io/trino/operator/DeduplicatingDirectExchangeBuffer.java @@ -22,6 +22,8 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.log.Logger; import io.airlift.slice.DynamicSliceOutput; import io.airlift.slice.Slice; @@ -45,9 +47,6 @@ import io.trino.spi.exchange.ExchangeSource; import io.trino.spi.exchange.ExchangeSourceOutputSelector; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.io.Closeable; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/core/trino-main/src/main/java/io/trino/operator/DirectExchangeClient.java b/core/trino-main/src/main/java/io/trino/operator/DirectExchangeClient.java index 85c726045e13..b7b58d079a12 100644 --- a/core/trino-main/src/main/java/io/trino/operator/DirectExchangeClient.java +++ b/core/trino-main/src/main/java/io/trino/operator/DirectExchangeClient.java @@ -16,6 +16,8 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableList; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.http.client.HttpClient; import io.airlift.log.Logger; import io.airlift.slice.Slice; @@ -29,10 +31,7 @@ import io.trino.operator.HttpPageBufferClient.ClientCallback; import io.trino.operator.WorkProcessor.ProcessState; import io.trino.plugin.base.metrics.TDigestHistogram; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; +import jakarta.annotation.Nullable; import java.io.Closeable; import java.net.URI; diff --git a/core/trino-main/src/main/java/io/trino/operator/DirectExchangeClientConfig.java b/core/trino-main/src/main/java/io/trino/operator/DirectExchangeClientConfig.java index f6e252f4c90f..615f5ed75a4b 100644 --- a/core/trino-main/src/main/java/io/trino/operator/DirectExchangeClientConfig.java +++ b/core/trino-main/src/main/java/io/trino/operator/DirectExchangeClientConfig.java @@ -21,9 +21,8 @@ import io.airlift.units.Duration; import io.airlift.units.MinDataSize; import io.airlift.units.MinDuration; - -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import java.util.concurrent.TimeUnit; diff --git a/core/trino-main/src/main/java/io/trino/operator/Driver.java b/core/trino-main/src/main/java/io/trino/operator/Driver.java index 218fed73eb92..f6949c4bb204 100644 --- a/core/trino-main/src/main/java/io/trino/operator/Driver.java +++ b/core/trino-main/src/main/java/io/trino/operator/Driver.java @@ -21,6 +21,7 @@ import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; import com.google.errorprone.annotations.FormatMethod; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.log.Logger; import io.airlift.units.Duration; import io.trino.execution.ScheduledSplit; @@ -29,8 +30,6 @@ import io.trino.spi.Page; import io.trino.spi.TrinoException; -import javax.annotation.concurrent.GuardedBy; - import java.io.Closeable; import java.util.ArrayList; import java.util.HashMap; diff --git a/core/trino-main/src/main/java/io/trino/operator/DriverFactory.java b/core/trino-main/src/main/java/io/trino/operator/DriverFactory.java index e637c8ef8727..b2a4a27e88b7 100644 --- a/core/trino-main/src/main/java/io/trino/operator/DriverFactory.java +++ b/core/trino-main/src/main/java/io/trino/operator/DriverFactory.java @@ -14,10 +14,9 @@ package io.trino.operator; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.trino.sql.planner.plan.PlanNodeId; -import javax.annotation.concurrent.GuardedBy; - import java.util.ArrayList; import java.util.List; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/operator/DriverStats.java b/core/trino-main/src/main/java/io/trino/operator/DriverStats.java index 1fd1954539b8..3c985a00a355 100644 --- a/core/trino-main/src/main/java/io/trino/operator/DriverStats.java +++ b/core/trino-main/src/main/java/io/trino/operator/DriverStats.java @@ -17,13 +17,12 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; +import com.google.errorprone.annotations.Immutable; import io.airlift.units.DataSize; import io.airlift.units.Duration; +import jakarta.annotation.Nullable; import org.joda.time.DateTime; -import javax.annotation.Nullable; -import javax.annotation.concurrent.Immutable; - import java.util.List; import java.util.Set; diff --git a/core/trino-main/src/main/java/io/trino/operator/DriverYieldSignal.java b/core/trino-main/src/main/java/io/trino/operator/DriverYieldSignal.java index cb600183f2e8..abec9bd963eb 100644 --- a/core/trino-main/src/main/java/io/trino/operator/DriverYieldSignal.java +++ b/core/trino-main/src/main/java/io/trino/operator/DriverYieldSignal.java @@ -14,9 +14,8 @@ package io.trino.operator; import com.google.common.annotations.VisibleForTesting; - -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; diff --git a/core/trino-main/src/main/java/io/trino/operator/DynamicFilterSourceOperator.java b/core/trino-main/src/main/java/io/trino/operator/DynamicFilterSourceOperator.java index 342e81d64e53..c0608fb5b5e3 100644 --- a/core/trino-main/src/main/java/io/trino/operator/DynamicFilterSourceOperator.java +++ b/core/trino-main/src/main/java/io/trino/operator/DynamicFilterSourceOperator.java @@ -30,8 +30,7 @@ import io.trino.sql.planner.plan.PlanNodeId; import io.trino.type.BlockTypeOperators; import io.trino.type.BlockTypeOperators.BlockPositionComparison; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/operator/ExchangeOperator.java b/core/trino-main/src/main/java/io/trino/operator/ExchangeOperator.java index 34b1b5d58948..29b6e4f9b833 100644 --- a/core/trino-main/src/main/java/io/trino/operator/ExchangeOperator.java +++ b/core/trino-main/src/main/java/io/trino/operator/ExchangeOperator.java @@ -14,6 +14,7 @@ package io.trino.operator; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.slice.Slice; import io.trino.exchange.ExchangeDataSource; import io.trino.exchange.ExchangeManagerRegistry; @@ -33,8 +34,6 @@ import it.unimi.dsi.fastutil.ints.IntOpenHashSet; import it.unimi.dsi.fastutil.ints.IntSet; -import javax.annotation.concurrent.ThreadSafe; - import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkState; import static io.trino.spi.connector.CatalogHandle.createRootCatalogHandle; diff --git a/core/trino-main/src/main/java/io/trino/operator/GroupedTopNRankAccumulator.java b/core/trino-main/src/main/java/io/trino/operator/GroupedTopNRankAccumulator.java index 807aa8820df4..c57e7bf02953 100644 --- a/core/trino-main/src/main/java/io/trino/operator/GroupedTopNRankAccumulator.java +++ b/core/trino-main/src/main/java/io/trino/operator/GroupedTopNRankAccumulator.java @@ -18,8 +18,7 @@ import io.trino.spi.Page; import io.trino.util.HeapTraversal; import io.trino.util.LongBigArrayFIFOQueue; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.function.LongConsumer; diff --git a/core/trino-main/src/main/java/io/trino/operator/GroupedTopNRowNumberAccumulator.java b/core/trino-main/src/main/java/io/trino/operator/GroupedTopNRowNumberAccumulator.java index 578cc354741d..1ccce5c69811 100644 --- a/core/trino-main/src/main/java/io/trino/operator/GroupedTopNRowNumberAccumulator.java +++ b/core/trino-main/src/main/java/io/trino/operator/GroupedTopNRowNumberAccumulator.java @@ -18,8 +18,7 @@ import io.trino.spi.Page; import io.trino.util.HeapTraversal; import io.trino.util.LongBigArrayFIFOQueue; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.function.LongConsumer; diff --git a/core/trino-main/src/main/java/io/trino/operator/HashSemiJoinOperator.java b/core/trino-main/src/main/java/io/trino/operator/HashSemiJoinOperator.java index 8a02762962fe..f8b597edbf56 100644 --- a/core/trino-main/src/main/java/io/trino/operator/HashSemiJoinOperator.java +++ b/core/trino-main/src/main/java/io/trino/operator/HashSemiJoinOperator.java @@ -27,8 +27,7 @@ import io.trino.spi.block.BlockBuilder; import io.trino.spi.type.Type; import io.trino.sql.planner.plan.PlanNodeId; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.List; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/operator/HttpPageBufferClient.java b/core/trino-main/src/main/java/io/trino/operator/HttpPageBufferClient.java index 66004b83a462..2ab26e3953fe 100644 --- a/core/trino-main/src/main/java/io/trino/operator/HttpPageBufferClient.java +++ b/core/trino-main/src/main/java/io/trino/operator/HttpPageBufferClient.java @@ -20,6 +20,8 @@ import com.google.common.net.MediaType; import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.http.client.HttpClient; import io.airlift.http.client.HttpClient.HttpResponseFuture; import io.airlift.http.client.HttpStatus; @@ -38,12 +40,9 @@ import io.trino.server.remotetask.Backoff; import io.trino.spi.TrinoException; import io.trino.spi.TrinoTransportException; +import jakarta.annotation.Nullable; import org.joda.time.DateTime; -import javax.annotation.Nullable; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.io.BufferedReader; import java.io.Closeable; import java.io.IOException; diff --git a/core/trino-main/src/main/java/io/trino/operator/InterpretedHashGenerator.java b/core/trino-main/src/main/java/io/trino/operator/InterpretedHashGenerator.java index 233789e5c8f9..7e2faf9cc064 100644 --- a/core/trino-main/src/main/java/io/trino/operator/InterpretedHashGenerator.java +++ b/core/trino-main/src/main/java/io/trino/operator/InterpretedHashGenerator.java @@ -22,8 +22,7 @@ import io.trino.sql.planner.optimizations.HashGenerationOptimizer; import io.trino.type.BlockTypeOperators; import io.trino.type.BlockTypeOperators.BlockPositionHashCode; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Arrays; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/operator/MultiChannelGroupByHash.java b/core/trino-main/src/main/java/io/trino/operator/MultiChannelGroupByHash.java index f79b4d9b4a91..f5683ed8a197 100644 --- a/core/trino-main/src/main/java/io/trino/operator/MultiChannelGroupByHash.java +++ b/core/trino-main/src/main/java/io/trino/operator/MultiChannelGroupByHash.java @@ -26,8 +26,7 @@ import io.trino.sql.gen.JoinCompiler; import io.trino.type.BlockTypeOperators; import it.unimi.dsi.fastutil.objects.ObjectArrayList; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Arrays; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/operator/OperationTimer.java b/core/trino-main/src/main/java/io/trino/operator/OperationTimer.java index a7d4ac0deed2..5919cbbdcf8d 100644 --- a/core/trino-main/src/main/java/io/trino/operator/OperationTimer.java +++ b/core/trino-main/src/main/java/io/trino/operator/OperationTimer.java @@ -13,10 +13,9 @@ */ package io.trino.operator; +import com.google.errorprone.annotations.ThreadSafe; import io.trino.annotation.NotThreadSafe; -import javax.annotation.concurrent.ThreadSafe; - import java.lang.management.ManagementFactory; import java.lang.management.ThreadMXBean; import java.util.concurrent.atomic.AtomicLong; diff --git a/core/trino-main/src/main/java/io/trino/operator/OperatorContext.java b/core/trino-main/src/main/java/io/trino/operator/OperatorContext.java index f75d08035517..46b1090f73e5 100644 --- a/core/trino-main/src/main/java/io/trino/operator/OperatorContext.java +++ b/core/trino-main/src/main/java/io/trino/operator/OperatorContext.java @@ -19,6 +19,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.stats.CounterStat; import io.airlift.units.DataSize; import io.airlift.units.Duration; @@ -33,10 +35,7 @@ import io.trino.spi.TrinoException; import io.trino.spi.metrics.Metrics; import io.trino.sql.planner.plan.PlanNodeId; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; +import jakarta.annotation.Nullable; import java.util.List; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/operator/OperatorStats.java b/core/trino-main/src/main/java/io/trino/operator/OperatorStats.java index f5f09ab08168..a7a8b63b2595 100644 --- a/core/trino-main/src/main/java/io/trino/operator/OperatorStats.java +++ b/core/trino-main/src/main/java/io/trino/operator/OperatorStats.java @@ -16,14 +16,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.Immutable; import io.airlift.units.DataSize; import io.airlift.units.Duration; import io.trino.spi.Mergeable; import io.trino.spi.metrics.Metrics; import io.trino.sql.planner.plan.PlanNodeId; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.Immutable; +import jakarta.annotation.Nullable; import java.util.List; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/operator/PageBuffer.java b/core/trino-main/src/main/java/io/trino/operator/PageBuffer.java index 2c180cf8d84a..ef8385f5fee6 100644 --- a/core/trino-main/src/main/java/io/trino/operator/PageBuffer.java +++ b/core/trino-main/src/main/java/io/trino/operator/PageBuffer.java @@ -15,8 +15,7 @@ import io.trino.operator.WorkProcessorOperatorAdapter.AdapterWorkProcessorOperator; import io.trino.spi.Page; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import static com.google.common.base.Preconditions.checkState; import static io.trino.operator.WorkProcessor.ProcessState.finished; diff --git a/core/trino-main/src/main/java/io/trino/operator/PagesSpatialIndexFactory.java b/core/trino-main/src/main/java/io/trino/operator/PagesSpatialIndexFactory.java index b28b677c6710..18b620d24038 100644 --- a/core/trino-main/src/main/java/io/trino/operator/PagesSpatialIndexFactory.java +++ b/core/trino-main/src/main/java/io/trino/operator/PagesSpatialIndexFactory.java @@ -16,11 +16,10 @@ import com.google.common.collect.ImmutableList; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; +import jakarta.annotation.Nullable; import java.util.ArrayList; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/operator/PipelineContext.java b/core/trino-main/src/main/java/io/trino/operator/PipelineContext.java index 364c030d3257..8c5c7a7d59a8 100644 --- a/core/trino-main/src/main/java/io/trino/operator/PipelineContext.java +++ b/core/trino-main/src/main/java/io/trino/operator/PipelineContext.java @@ -19,6 +19,7 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.ListMultimap; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.stats.CounterStat; import io.airlift.stats.Distribution; import io.airlift.units.Duration; @@ -29,8 +30,6 @@ import io.trino.memory.context.MemoryTrackingContext; import org.joda.time.DateTime; -import javax.annotation.concurrent.ThreadSafe; - import java.util.Iterator; import java.util.List; import java.util.TreeMap; diff --git a/core/trino-main/src/main/java/io/trino/operator/PipelineStats.java b/core/trino-main/src/main/java/io/trino/operator/PipelineStats.java index f5cac2aabd9c..edeb73224e38 100644 --- a/core/trino-main/src/main/java/io/trino/operator/PipelineStats.java +++ b/core/trino-main/src/main/java/io/trino/operator/PipelineStats.java @@ -17,14 +17,13 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; +import com.google.errorprone.annotations.Immutable; import io.airlift.stats.Distribution.DistributionSnapshot; import io.airlift.units.DataSize; import io.airlift.units.Duration; +import jakarta.annotation.Nullable; import org.joda.time.DateTime; -import javax.annotation.Nullable; -import javax.annotation.concurrent.Immutable; - import java.util.List; import java.util.Set; diff --git a/core/trino-main/src/main/java/io/trino/operator/PipelineStatus.java b/core/trino-main/src/main/java/io/trino/operator/PipelineStatus.java index 41969556e617..5c2801be2972 100644 --- a/core/trino-main/src/main/java/io/trino/operator/PipelineStatus.java +++ b/core/trino-main/src/main/java/io/trino/operator/PipelineStatus.java @@ -13,7 +13,7 @@ */ package io.trino.operator; -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; @Immutable public final class PipelineStatus diff --git a/core/trino-main/src/main/java/io/trino/operator/ReferenceCount.java b/core/trino-main/src/main/java/io/trino/operator/ReferenceCount.java index aa6e5f70f50a..55f96fdb4ceb 100644 --- a/core/trino-main/src/main/java/io/trino/operator/ReferenceCount.java +++ b/core/trino-main/src/main/java/io/trino/operator/ReferenceCount.java @@ -15,9 +15,8 @@ import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; - -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkState; diff --git a/core/trino-main/src/main/java/io/trino/operator/RefreshMaterializedViewOperator.java b/core/trino-main/src/main/java/io/trino/operator/RefreshMaterializedViewOperator.java index be287edee9c6..6a17fb3c92f3 100644 --- a/core/trino-main/src/main/java/io/trino/operator/RefreshMaterializedViewOperator.java +++ b/core/trino-main/src/main/java/io/trino/operator/RefreshMaterializedViewOperator.java @@ -18,8 +18,7 @@ import io.trino.metadata.QualifiedObjectName; import io.trino.spi.Page; import io.trino.sql.planner.plan.PlanNodeId; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import static com.google.common.base.Preconditions.checkState; import static io.airlift.concurrent.MoreFutures.getDone; diff --git a/core/trino-main/src/main/java/io/trino/operator/RowReferencePageManager.java b/core/trino-main/src/main/java/io/trino/operator/RowReferencePageManager.java index faa7023cdefe..cce070a08cee 100644 --- a/core/trino-main/src/main/java/io/trino/operator/RowReferencePageManager.java +++ b/core/trino-main/src/main/java/io/trino/operator/RowReferencePageManager.java @@ -20,8 +20,7 @@ import io.trino.util.LongBigArrayFIFOQueue; import it.unimi.dsi.fastutil.ints.IntIterator; import it.unimi.dsi.fastutil.ints.IntOpenHashSet; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Arrays; diff --git a/core/trino-main/src/main/java/io/trino/operator/ScanFilterAndProjectOperator.java b/core/trino-main/src/main/java/io/trino/operator/ScanFilterAndProjectOperator.java index 3daf5d94d0d7..c04e5ffca005 100644 --- a/core/trino-main/src/main/java/io/trino/operator/ScanFilterAndProjectOperator.java +++ b/core/trino-main/src/main/java/io/trino/operator/ScanFilterAndProjectOperator.java @@ -45,8 +45,7 @@ import io.trino.split.EmptySplit; import io.trino.split.PageSourceProvider; import io.trino.sql.planner.plan.PlanNodeId; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/core/trino-main/src/main/java/io/trino/operator/SetBuilderOperator.java b/core/trino-main/src/main/java/io/trino/operator/SetBuilderOperator.java index c2273d9d6599..bd1190b9720d 100644 --- a/core/trino-main/src/main/java/io/trino/operator/SetBuilderOperator.java +++ b/core/trino-main/src/main/java/io/trino/operator/SetBuilderOperator.java @@ -16,15 +16,14 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; +import com.google.errorprone.annotations.ThreadSafe; import io.trino.operator.ChannelSet.ChannelSetBuilder; import io.trino.spi.Page; import io.trino.spi.type.Type; import io.trino.sql.gen.JoinCompiler; import io.trino.sql.planner.plan.PlanNodeId; import io.trino.type.BlockTypeOperators; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.ThreadSafe; +import jakarta.annotation.Nullable; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/operator/SpatialJoinOperator.java b/core/trino-main/src/main/java/io/trino/operator/SpatialJoinOperator.java index 1f8d4212537a..7621e3204a10 100644 --- a/core/trino-main/src/main/java/io/trino/operator/SpatialJoinOperator.java +++ b/core/trino-main/src/main/java/io/trino/operator/SpatialJoinOperator.java @@ -22,8 +22,7 @@ import io.trino.spi.type.Type; import io.trino.sql.planner.plan.PlanNodeId; import io.trino.sql.planner.plan.SpatialJoinNode; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.List; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/operator/StreamingAggregationOperator.java b/core/trino-main/src/main/java/io/trino/operator/StreamingAggregationOperator.java index 0706e416c1ad..3afe0164304b 100644 --- a/core/trino-main/src/main/java/io/trino/operator/StreamingAggregationOperator.java +++ b/core/trino-main/src/main/java/io/trino/operator/StreamingAggregationOperator.java @@ -28,8 +28,7 @@ import io.trino.sql.gen.JoinCompiler; import io.trino.sql.planner.plan.PlanNodeId; import it.unimi.dsi.fastutil.objects.ObjectArrayList; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Deque; import java.util.LinkedList; diff --git a/core/trino-main/src/main/java/io/trino/operator/StreamingDirectExchangeBuffer.java b/core/trino-main/src/main/java/io/trino/operator/StreamingDirectExchangeBuffer.java index 770bb306f569..3bd36377402a 100644 --- a/core/trino-main/src/main/java/io/trino/operator/StreamingDirectExchangeBuffer.java +++ b/core/trino-main/src/main/java/io/trino/operator/StreamingDirectExchangeBuffer.java @@ -15,14 +15,13 @@ import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.log.Logger; import io.airlift.slice.Slice; import io.airlift.units.DataSize; import io.trino.execution.TaskId; import io.trino.spi.TrinoException; -import javax.annotation.concurrent.GuardedBy; - import java.util.ArrayDeque; import java.util.HashSet; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/operator/TableScanOperator.java b/core/trino-main/src/main/java/io/trino/operator/TableScanOperator.java index 648f6529b322..e7da28d6699c 100644 --- a/core/trino-main/src/main/java/io/trino/operator/TableScanOperator.java +++ b/core/trino-main/src/main/java/io/trino/operator/TableScanOperator.java @@ -30,8 +30,7 @@ import io.trino.split.EmptySplit; import io.trino.split.PageSourceProvider; import io.trino.sql.planner.plan.PlanNodeId; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/core/trino-main/src/main/java/io/trino/operator/TableScanWorkProcessorOperator.java b/core/trino-main/src/main/java/io/trino/operator/TableScanWorkProcessorOperator.java index 49a620be8355..5df8b0f47d47 100644 --- a/core/trino-main/src/main/java/io/trino/operator/TableScanWorkProcessorOperator.java +++ b/core/trino-main/src/main/java/io/trino/operator/TableScanWorkProcessorOperator.java @@ -34,8 +34,7 @@ import io.trino.spi.metrics.Metrics; import io.trino.split.EmptySplit; import io.trino.split.PageSourceProvider; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/core/trino-main/src/main/java/io/trino/operator/TaskContext.java b/core/trino-main/src/main/java/io/trino/operator/TaskContext.java index dc693037b66a..4f214e5c1828 100644 --- a/core/trino-main/src/main/java/io/trino/operator/TaskContext.java +++ b/core/trino-main/src/main/java/io/trino/operator/TaskContext.java @@ -18,6 +18,8 @@ import com.google.common.collect.ImmutableSet; import com.google.common.util.concurrent.AtomicDouble; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.stats.CounterStat; import io.airlift.stats.GcMonitor; import io.airlift.units.DataSize; @@ -39,9 +41,6 @@ import io.trino.sql.planner.plan.DynamicFilterId; import org.joda.time.DateTime; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.util.List; import java.util.Map; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/operator/TaskStats.java b/core/trino-main/src/main/java/io/trino/operator/TaskStats.java index 492634e2daf5..1dc3e3d6103d 100644 --- a/core/trino-main/src/main/java/io/trino/operator/TaskStats.java +++ b/core/trino-main/src/main/java/io/trino/operator/TaskStats.java @@ -19,10 +19,9 @@ import com.google.common.collect.ImmutableSet; import io.airlift.units.DataSize; import io.airlift.units.Duration; +import jakarta.annotation.Nullable; import org.joda.time.DateTime; -import javax.annotation.Nullable; - import java.util.List; import java.util.Optional; import java.util.Set; diff --git a/core/trino-main/src/main/java/io/trino/operator/TopNProcessor.java b/core/trino-main/src/main/java/io/trino/operator/TopNProcessor.java index 92e10b236171..54b3e9d8914c 100644 --- a/core/trino-main/src/main/java/io/trino/operator/TopNProcessor.java +++ b/core/trino-main/src/main/java/io/trino/operator/TopNProcessor.java @@ -19,8 +19,7 @@ import io.trino.spi.connector.SortOrder; import io.trino.spi.type.Type; import io.trino.spi.type.TypeOperators; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Iterator; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/operator/WindowInfo.java b/core/trino-main/src/main/java/io/trino/operator/WindowInfo.java index 2f6c778d11ab..23c987271695 100644 --- a/core/trino-main/src/main/java/io/trino/operator/WindowInfo.java +++ b/core/trino-main/src/main/java/io/trino/operator/WindowInfo.java @@ -16,11 +16,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.Immutable; import io.trino.operator.window.WindowPartition; import io.trino.spi.Mergeable; -import javax.annotation.concurrent.Immutable; - import java.util.List; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/operator/WorkProcessor.java b/core/trino-main/src/main/java/io/trino/operator/WorkProcessor.java index 1fc142069a5a..b8662979dcf5 100644 --- a/core/trino-main/src/main/java/io/trino/operator/WorkProcessor.java +++ b/core/trino-main/src/main/java/io/trino/operator/WorkProcessor.java @@ -15,9 +15,8 @@ import com.google.common.collect.Iterators; import com.google.common.util.concurrent.ListenableFuture; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; +import jakarta.annotation.Nullable; import java.util.Comparator; import java.util.Iterator; diff --git a/core/trino-main/src/main/java/io/trino/operator/WorkProcessorPipelineSourceOperator.java b/core/trino-main/src/main/java/io/trino/operator/WorkProcessorPipelineSourceOperator.java index 267f0eaabc02..b6ca026a3d5a 100644 --- a/core/trino-main/src/main/java/io/trino/operator/WorkProcessorPipelineSourceOperator.java +++ b/core/trino-main/src/main/java/io/trino/operator/WorkProcessorPipelineSourceOperator.java @@ -32,8 +32,7 @@ import io.trino.spi.type.Type; import io.trino.sql.planner.LocalExecutionPlanner.OperatorFactoryWithTypes; import io.trino.sql.planner.plan.PlanNodeId; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.ArrayDeque; import java.util.ArrayList; diff --git a/core/trino-main/src/main/java/io/trino/operator/WorkProcessorUtils.java b/core/trino-main/src/main/java/io/trino/operator/WorkProcessorUtils.java index 5a06e4e1ca75..16c6aa33fadf 100644 --- a/core/trino-main/src/main/java/io/trino/operator/WorkProcessorUtils.java +++ b/core/trino-main/src/main/java/io/trino/operator/WorkProcessorUtils.java @@ -18,8 +18,7 @@ import io.trino.operator.WorkProcessor.ProcessState; import io.trino.operator.WorkProcessor.Transformation; import io.trino.operator.WorkProcessor.TransformationState; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Comparator; import java.util.Iterator; diff --git a/core/trino-main/src/main/java/io/trino/operator/aggregation/AggregationMask.java b/core/trino-main/src/main/java/io/trino/operator/aggregation/AggregationMask.java index a6e993f0ed6c..a4a11fa9bdec 100644 --- a/core/trino-main/src/main/java/io/trino/operator/aggregation/AggregationMask.java +++ b/core/trino-main/src/main/java/io/trino/operator/aggregation/AggregationMask.java @@ -16,8 +16,7 @@ import io.trino.spi.Page; import io.trino.spi.block.Block; import io.trino.spi.block.RunLengthEncodedBlock; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Arrays; diff --git a/core/trino-main/src/main/java/io/trino/operator/aggregation/AggregationUtils.java b/core/trino-main/src/main/java/io/trino/operator/aggregation/AggregationUtils.java index 207940b8014e..eef1cc8d3165 100644 --- a/core/trino-main/src/main/java/io/trino/operator/aggregation/AggregationUtils.java +++ b/core/trino-main/src/main/java/io/trino/operator/aggregation/AggregationUtils.java @@ -18,8 +18,7 @@ import io.trino.spi.block.Block; import io.trino.spi.block.RunLengthEncodedBlock; import io.trino.sql.gen.CompilerOperations; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; public final class AggregationUtils { diff --git a/core/trino-main/src/main/java/io/trino/operator/aggregation/partial/SkipAggregationBuilder.java b/core/trino-main/src/main/java/io/trino/operator/aggregation/partial/SkipAggregationBuilder.java index 4d6cdc07f39f..39df5791c114 100644 --- a/core/trino-main/src/main/java/io/trino/operator/aggregation/partial/SkipAggregationBuilder.java +++ b/core/trino-main/src/main/java/io/trino/operator/aggregation/partial/SkipAggregationBuilder.java @@ -24,8 +24,7 @@ import io.trino.spi.Page; import io.trino.spi.block.Block; import io.trino.spi.block.BlockBuilder; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.List; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/operator/aggregation/state/LongDecimalWithOverflowAndLongStateFactory.java b/core/trino-main/src/main/java/io/trino/operator/aggregation/state/LongDecimalWithOverflowAndLongStateFactory.java index ba59e22c72e5..a703717b2e8d 100644 --- a/core/trino-main/src/main/java/io/trino/operator/aggregation/state/LongDecimalWithOverflowAndLongStateFactory.java +++ b/core/trino-main/src/main/java/io/trino/operator/aggregation/state/LongDecimalWithOverflowAndLongStateFactory.java @@ -16,8 +16,7 @@ import io.trino.array.LongBigArray; import io.trino.spi.function.AccumulatorState; import io.trino.spi.function.AccumulatorStateFactory; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import static io.airlift.slice.SizeOf.SIZE_OF_LONG; import static io.airlift.slice.SizeOf.instanceSize; diff --git a/core/trino-main/src/main/java/io/trino/operator/aggregation/state/LongDecimalWithOverflowStateFactory.java b/core/trino-main/src/main/java/io/trino/operator/aggregation/state/LongDecimalWithOverflowStateFactory.java index 69b59e00caff..351bfd8ddeb0 100644 --- a/core/trino-main/src/main/java/io/trino/operator/aggregation/state/LongDecimalWithOverflowStateFactory.java +++ b/core/trino-main/src/main/java/io/trino/operator/aggregation/state/LongDecimalWithOverflowStateFactory.java @@ -17,8 +17,7 @@ import io.trino.array.LongBigArray; import io.trino.spi.function.AccumulatorState; import io.trino.spi.function.AccumulatorStateFactory; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import static io.airlift.slice.SizeOf.SIZE_OF_BYTE; import static io.airlift.slice.SizeOf.SIZE_OF_LONG; diff --git a/core/trino-main/src/main/java/io/trino/operator/annotations/FunctionsParserHelper.java b/core/trino-main/src/main/java/io/trino/operator/annotations/FunctionsParserHelper.java index f4961ac15f55..2b262a42ec67 100644 --- a/core/trino-main/src/main/java/io/trino/operator/annotations/FunctionsParserHelper.java +++ b/core/trino-main/src/main/java/io/trino/operator/annotations/FunctionsParserHelper.java @@ -31,8 +31,7 @@ import io.trino.spi.type.TypeSignature; import io.trino.spi.type.TypeSignatureParameter; import io.trino.type.Constraint; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.lang.annotation.Annotation; import java.lang.reflect.AnnotatedElement; diff --git a/core/trino-main/src/main/java/io/trino/operator/exchange/LocalExchange.java b/core/trino-main/src/main/java/io/trino/operator/exchange/LocalExchange.java index 2e94a11f746f..6a6a18d365f7 100644 --- a/core/trino-main/src/main/java/io/trino/operator/exchange/LocalExchange.java +++ b/core/trino-main/src/main/java/io/trino/operator/exchange/LocalExchange.java @@ -16,6 +16,8 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableList; import com.google.common.primitives.Ints; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.slice.XxHash64; import io.airlift.units.DataSize; import io.trino.Session; @@ -34,9 +36,6 @@ import it.unimi.dsi.fastutil.longs.Long2LongMap; import it.unimi.dsi.fastutil.longs.Long2LongOpenHashMap; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.io.Closeable; import java.util.HashSet; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/operator/exchange/LocalExchangeMemoryManager.java b/core/trino-main/src/main/java/io/trino/operator/exchange/LocalExchangeMemoryManager.java index 31dc880f6974..3c2aa2cc0dc4 100644 --- a/core/trino-main/src/main/java/io/trino/operator/exchange/LocalExchangeMemoryManager.java +++ b/core/trino-main/src/main/java/io/trino/operator/exchange/LocalExchangeMemoryManager.java @@ -15,10 +15,9 @@ import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; +import jakarta.annotation.Nullable; import java.util.concurrent.atomic.AtomicLong; diff --git a/core/trino-main/src/main/java/io/trino/operator/exchange/LocalExchangeSource.java b/core/trino-main/src/main/java/io/trino/operator/exchange/LocalExchangeSource.java index d5738a930b4f..083daa8f8a5e 100644 --- a/core/trino-main/src/main/java/io/trino/operator/exchange/LocalExchangeSource.java +++ b/core/trino-main/src/main/java/io/trino/operator/exchange/LocalExchangeSource.java @@ -15,13 +15,12 @@ import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.trino.operator.WorkProcessor; import io.trino.operator.WorkProcessor.ProcessState; import io.trino.spi.Page; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; +import jakarta.annotation.Nullable; import java.util.ArrayDeque; import java.util.Queue; diff --git a/core/trino-main/src/main/java/io/trino/operator/exchange/ScaleWriterPartitioningExchanger.java b/core/trino-main/src/main/java/io/trino/operator/exchange/ScaleWriterPartitioningExchanger.java index e8d193661a5f..0532f4cd09c9 100644 --- a/core/trino-main/src/main/java/io/trino/operator/exchange/ScaleWriterPartitioningExchanger.java +++ b/core/trino-main/src/main/java/io/trino/operator/exchange/ScaleWriterPartitioningExchanger.java @@ -15,6 +15,7 @@ package io.trino.operator.exchange; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.trino.operator.PartitionFunction; import io.trino.spi.Page; import it.unimi.dsi.fastutil.ints.IntArrayList; @@ -23,8 +24,6 @@ import it.unimi.dsi.fastutil.longs.Long2LongMap; import it.unimi.dsi.fastutil.longs.Long2LongOpenHashMap; -import javax.annotation.concurrent.GuardedBy; - import java.util.List; import java.util.function.Consumer; import java.util.function.Function; diff --git a/core/trino-main/src/main/java/io/trino/operator/exchange/UniformPartitionRebalancer.java b/core/trino-main/src/main/java/io/trino/operator/exchange/UniformPartitionRebalancer.java index 13a35ae17920..2a0802f27b82 100644 --- a/core/trino-main/src/main/java/io/trino/operator/exchange/UniformPartitionRebalancer.java +++ b/core/trino-main/src/main/java/io/trino/operator/exchange/UniformPartitionRebalancer.java @@ -16,13 +16,12 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.log.Logger; import io.airlift.units.DataSize; import io.trino.execution.resourcegroups.IndexedPriorityQueue; import it.unimi.dsi.fastutil.longs.Long2LongMap; -import javax.annotation.concurrent.ThreadSafe; - import java.util.ArrayList; import java.util.HashSet; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/operator/index/IndexJoinLookupStats.java b/core/trino-main/src/main/java/io/trino/operator/index/IndexJoinLookupStats.java index 8e84f9261887..f1d928c813ab 100644 --- a/core/trino-main/src/main/java/io/trino/operator/index/IndexJoinLookupStats.java +++ b/core/trino-main/src/main/java/io/trino/operator/index/IndexJoinLookupStats.java @@ -13,12 +13,11 @@ */ package io.trino.operator.index; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.stats.CounterStat; import org.weakref.jmx.Managed; import org.weakref.jmx.Nested; -import javax.annotation.concurrent.ThreadSafe; - @ThreadSafe public class IndexJoinLookupStats { diff --git a/core/trino-main/src/main/java/io/trino/operator/index/IndexLoader.java b/core/trino-main/src/main/java/io/trino/operator/index/IndexLoader.java index 7324e1575bd8..6d50e83d64f9 100644 --- a/core/trino-main/src/main/java/io/trino/operator/index/IndexLoader.java +++ b/core/trino-main/src/main/java/io/trino/operator/index/IndexLoader.java @@ -1,4 +1,4 @@ -/* + /* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -16,6 +16,8 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.units.DataSize; import io.trino.annotation.NotThreadSafe; import io.trino.execution.ScheduledSplit; @@ -37,9 +39,6 @@ import io.trino.type.BlockTypeOperators; import io.trino.type.BlockTypeOperators.BlockPositionEqual; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.util.ArrayList; import java.util.List; import java.util.OptionalInt; diff --git a/core/trino-main/src/main/java/io/trino/operator/index/IndexSnapshot.java b/core/trino-main/src/main/java/io/trino/operator/index/IndexSnapshot.java index 59cf792cb8ce..2bbace6222f0 100644 --- a/core/trino-main/src/main/java/io/trino/operator/index/IndexSnapshot.java +++ b/core/trino-main/src/main/java/io/trino/operator/index/IndexSnapshot.java @@ -13,12 +13,11 @@ */ package io.trino.operator.index; +import com.google.errorprone.annotations.Immutable; import io.trino.operator.join.LookupSource; import io.trino.spi.Page; import io.trino.spi.PageBuilder; -import javax.annotation.concurrent.Immutable; - import static java.util.Objects.requireNonNull; @Immutable diff --git a/core/trino-main/src/main/java/io/trino/operator/index/PageBuffer.java b/core/trino-main/src/main/java/io/trino/operator/index/PageBuffer.java index bed279ef0825..6877d7321305 100644 --- a/core/trino-main/src/main/java/io/trino/operator/index/PageBuffer.java +++ b/core/trino-main/src/main/java/io/trino/operator/index/PageBuffer.java @@ -15,10 +15,9 @@ import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; +import com.google.errorprone.annotations.ThreadSafe; import io.trino.spi.Page; -import javax.annotation.concurrent.ThreadSafe; - import java.util.ArrayDeque; import java.util.Queue; diff --git a/core/trino-main/src/main/java/io/trino/operator/index/PagesIndexBuilderOperator.java b/core/trino-main/src/main/java/io/trino/operator/index/PagesIndexBuilderOperator.java index 591bb7d5d2a4..9d074c87b153 100644 --- a/core/trino-main/src/main/java/io/trino/operator/index/PagesIndexBuilderOperator.java +++ b/core/trino-main/src/main/java/io/trino/operator/index/PagesIndexBuilderOperator.java @@ -13,6 +13,7 @@ */ package io.trino.operator.index; +import com.google.errorprone.annotations.ThreadSafe; import io.trino.operator.DriverContext; import io.trino.operator.Operator; import io.trino.operator.OperatorContext; @@ -20,8 +21,6 @@ import io.trino.spi.Page; import io.trino.sql.planner.plan.PlanNodeId; -import javax.annotation.concurrent.ThreadSafe; - import static com.google.common.base.Preconditions.checkState; import static java.util.Objects.requireNonNull; diff --git a/core/trino-main/src/main/java/io/trino/operator/index/UpdateRequest.java b/core/trino-main/src/main/java/io/trino/operator/index/UpdateRequest.java index 8b4647b16078..aae348fd2f8b 100644 --- a/core/trino-main/src/main/java/io/trino/operator/index/UpdateRequest.java +++ b/core/trino-main/src/main/java/io/trino/operator/index/UpdateRequest.java @@ -14,11 +14,10 @@ package io.trino.operator.index; import com.google.common.util.concurrent.SettableFuture; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.concurrent.MoreFutures; import io.trino.spi.Page; -import javax.annotation.concurrent.ThreadSafe; - import static com.google.common.base.Preconditions.checkState; import static java.util.Objects.requireNonNull; diff --git a/core/trino-main/src/main/java/io/trino/operator/join/DefaultPageJoiner.java b/core/trino-main/src/main/java/io/trino/operator/join/DefaultPageJoiner.java index b2dc1d9fb216..d737b873feb5 100644 --- a/core/trino-main/src/main/java/io/trino/operator/join/DefaultPageJoiner.java +++ b/core/trino-main/src/main/java/io/trino/operator/join/DefaultPageJoiner.java @@ -28,8 +28,7 @@ import io.trino.spi.type.Type; import io.trino.spiller.PartitioningSpiller; import io.trino.spiller.PartitioningSpillerFactory; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.HashMap; import java.util.Iterator; diff --git a/core/trino-main/src/main/java/io/trino/operator/join/HashBuilderOperator.java b/core/trino-main/src/main/java/io/trino/operator/join/HashBuilderOperator.java index 2b75f876f036..958b650d1d5d 100644 --- a/core/trino-main/src/main/java/io/trino/operator/join/HashBuilderOperator.java +++ b/core/trino-main/src/main/java/io/trino/operator/join/HashBuilderOperator.java @@ -18,6 +18,7 @@ import com.google.common.io.Closer; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.log.Logger; import io.trino.memory.context.LocalMemoryContext; import io.trino.operator.DriverContext; @@ -31,9 +32,7 @@ import io.trino.spiller.SingleStreamSpillerFactory; import io.trino.sql.gen.JoinFilterFunctionCompiler.JoinFilterFunctionFactory; import io.trino.sql.planner.plan.PlanNodeId; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.ThreadSafe; +import jakarta.annotation.Nullable; import java.io.IOException; import java.util.ArrayDeque; diff --git a/core/trino-main/src/main/java/io/trino/operator/join/JoinHash.java b/core/trino-main/src/main/java/io/trino/operator/join/JoinHash.java index bf3f9e0f43d3..dec02813a47b 100644 --- a/core/trino-main/src/main/java/io/trino/operator/join/JoinHash.java +++ b/core/trino-main/src/main/java/io/trino/operator/join/JoinHash.java @@ -15,8 +15,7 @@ import io.trino.spi.Page; import io.trino.spi.PageBuilder; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/operator/join/JoinProbe.java b/core/trino-main/src/main/java/io/trino/operator/join/JoinProbe.java index 0fe47b280876..fc5f6e979fc2 100644 --- a/core/trino-main/src/main/java/io/trino/operator/join/JoinProbe.java +++ b/core/trino-main/src/main/java/io/trino/operator/join/JoinProbe.java @@ -16,8 +16,7 @@ import com.google.common.primitives.Ints; import io.trino.spi.Page; import io.trino.spi.block.Block; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.List; import java.util.OptionalInt; diff --git a/core/trino-main/src/main/java/io/trino/operator/join/OuterLookupSource.java b/core/trino-main/src/main/java/io/trino/operator/join/OuterLookupSource.java index f1b8f2647b38..5defc0b6eac4 100644 --- a/core/trino-main/src/main/java/io/trino/operator/join/OuterLookupSource.java +++ b/core/trino-main/src/main/java/io/trino/operator/join/OuterLookupSource.java @@ -13,13 +13,12 @@ */ package io.trino.operator.join; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.trino.annotation.NotThreadSafe; import io.trino.spi.Page; import io.trino.spi.PageBuilder; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.util.function.Supplier; import static com.google.common.base.Preconditions.checkArgument; diff --git a/core/trino-main/src/main/java/io/trino/operator/join/PartitionedConsumption.java b/core/trino-main/src/main/java/io/trino/operator/join/PartitionedConsumption.java index 4047d9095d16..c37045eeb211 100644 --- a/core/trino-main/src/main/java/io/trino/operator/join/PartitionedConsumption.java +++ b/core/trino-main/src/main/java/io/trino/operator/join/PartitionedConsumption.java @@ -18,10 +18,9 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; +import jakarta.annotation.Nullable; import java.util.ArrayDeque; import java.util.Iterator; diff --git a/core/trino-main/src/main/java/io/trino/operator/join/PartitionedLookupSource.java b/core/trino-main/src/main/java/io/trino/operator/join/PartitionedLookupSource.java index c5875699051e..da43d41735b9 100644 --- a/core/trino-main/src/main/java/io/trino/operator/join/PartitionedLookupSource.java +++ b/core/trino-main/src/main/java/io/trino/operator/join/PartitionedLookupSource.java @@ -14,6 +14,7 @@ package io.trino.operator.join; import com.google.common.io.Closer; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.trino.annotation.NotThreadSafe; import io.trino.operator.InterpretedHashGenerator; import io.trino.operator.exchange.LocalPartitionGenerator; @@ -21,9 +22,7 @@ import io.trino.spi.PageBuilder; import io.trino.spi.type.Type; import io.trino.type.BlockTypeOperators; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.GuardedBy; +import jakarta.annotation.Nullable; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/core/trino-main/src/main/java/io/trino/operator/join/PartitionedLookupSourceFactory.java b/core/trino-main/src/main/java/io/trino/operator/join/PartitionedLookupSourceFactory.java index 87b18ca03d0f..aa8086e40f11 100644 --- a/core/trino-main/src/main/java/io/trino/operator/join/PartitionedLookupSourceFactory.java +++ b/core/trino-main/src/main/java/io/trino/operator/join/PartitionedLookupSourceFactory.java @@ -17,6 +17,8 @@ import com.google.common.collect.ImmutableSet; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; +import com.google.errorprone.annotations.Immutable; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.trino.annotation.NotThreadSafe; import io.trino.operator.join.LookupSourceProvider.LookupSourceLease; import io.trino.spi.Page; @@ -24,9 +26,6 @@ import io.trino.spi.type.Type; import io.trino.type.BlockTypeOperators; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.Immutable; - import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; diff --git a/core/trino-main/src/main/java/io/trino/operator/join/SpilledLookupSourceHandle.java b/core/trino-main/src/main/java/io/trino/operator/join/SpilledLookupSourceHandle.java index 9a532d52fa50..cdf37fa57240 100644 --- a/core/trino-main/src/main/java/io/trino/operator/join/SpilledLookupSourceHandle.java +++ b/core/trino-main/src/main/java/io/trino/operator/join/SpilledLookupSourceHandle.java @@ -16,10 +16,9 @@ import com.google.common.collect.ImmutableList; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; +import jakarta.annotation.Nullable; import java.util.function.Supplier; diff --git a/core/trino-main/src/main/java/io/trino/operator/join/SpillingJoinProcessor.java b/core/trino-main/src/main/java/io/trino/operator/join/SpillingJoinProcessor.java index 8329c7d5279c..3d34924866b2 100644 --- a/core/trino-main/src/main/java/io/trino/operator/join/SpillingJoinProcessor.java +++ b/core/trino-main/src/main/java/io/trino/operator/join/SpillingJoinProcessor.java @@ -21,8 +21,7 @@ import io.trino.operator.join.PageJoiner.PageJoinerFactory; import io.trino.spi.Page; import io.trino.spiller.PartitioningSpillerFactory; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.IOException; import java.util.Iterator; diff --git a/core/trino-main/src/main/java/io/trino/operator/join/unspilled/HashBuilderOperator.java b/core/trino-main/src/main/java/io/trino/operator/join/unspilled/HashBuilderOperator.java index 7b66ffd6a115..7356c6dd830c 100644 --- a/core/trino-main/src/main/java/io/trino/operator/join/unspilled/HashBuilderOperator.java +++ b/core/trino-main/src/main/java/io/trino/operator/join/unspilled/HashBuilderOperator.java @@ -16,6 +16,7 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableList; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.ThreadSafe; import io.trino.memory.context.LocalMemoryContext; import io.trino.operator.DriverContext; import io.trino.operator.HashArraySizeSupplier; @@ -28,9 +29,7 @@ import io.trino.spi.Page; import io.trino.sql.gen.JoinFilterFunctionCompiler.JoinFilterFunctionFactory; import io.trino.sql.planner.plan.PlanNodeId; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.ThreadSafe; +import jakarta.annotation.Nullable; import java.util.List; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/operator/join/unspilled/JoinProbe.java b/core/trino-main/src/main/java/io/trino/operator/join/unspilled/JoinProbe.java index 443251e91ab1..b58a54b59adf 100644 --- a/core/trino-main/src/main/java/io/trino/operator/join/unspilled/JoinProbe.java +++ b/core/trino-main/src/main/java/io/trino/operator/join/unspilled/JoinProbe.java @@ -18,8 +18,7 @@ import io.trino.spi.Page; import io.trino.spi.block.Block; import io.trino.spi.block.RunLengthEncodedBlock; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Arrays; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/operator/join/unspilled/PageJoiner.java b/core/trino-main/src/main/java/io/trino/operator/join/unspilled/PageJoiner.java index fc0fdc7872c1..a2a334977d47 100644 --- a/core/trino-main/src/main/java/io/trino/operator/join/unspilled/PageJoiner.java +++ b/core/trino-main/src/main/java/io/trino/operator/join/unspilled/PageJoiner.java @@ -24,8 +24,7 @@ import io.trino.operator.join.unspilled.JoinProbe.JoinProbeFactory; import io.trino.spi.Page; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.Closeable; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/operator/join/unspilled/PartitionedLookupSource.java b/core/trino-main/src/main/java/io/trino/operator/join/unspilled/PartitionedLookupSource.java index 1cad82a3f3bb..fb4dfe38a086 100644 --- a/core/trino-main/src/main/java/io/trino/operator/join/unspilled/PartitionedLookupSource.java +++ b/core/trino-main/src/main/java/io/trino/operator/join/unspilled/PartitionedLookupSource.java @@ -14,6 +14,7 @@ package io.trino.operator.join.unspilled; import com.google.common.io.Closer; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.trino.annotation.NotThreadSafe; import io.trino.operator.InterpretedHashGenerator; import io.trino.operator.exchange.LocalPartitionGenerator; @@ -24,9 +25,7 @@ import io.trino.spi.PageBuilder; import io.trino.spi.type.Type; import io.trino.type.BlockTypeOperators; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.GuardedBy; +import jakarta.annotation.Nullable; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/core/trino-main/src/main/java/io/trino/operator/join/unspilled/PartitionedLookupSourceFactory.java b/core/trino-main/src/main/java/io/trino/operator/join/unspilled/PartitionedLookupSourceFactory.java index e170558d48d1..1a6af84dace5 100644 --- a/core/trino-main/src/main/java/io/trino/operator/join/unspilled/PartitionedLookupSourceFactory.java +++ b/core/trino-main/src/main/java/io/trino/operator/join/unspilled/PartitionedLookupSourceFactory.java @@ -16,6 +16,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.trino.operator.join.JoinBridge; import io.trino.operator.join.LookupSource; import io.trino.operator.join.OuterPositionIterator; @@ -23,8 +24,6 @@ import io.trino.spi.type.Type; import io.trino.type.BlockTypeOperators; -import javax.annotation.concurrent.GuardedBy; - import java.util.ArrayList; import java.util.Arrays; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/operator/output/PagePartitioner.java b/core/trino-main/src/main/java/io/trino/operator/output/PagePartitioner.java index 9449058ff58e..72be3d3e4277 100644 --- a/core/trino-main/src/main/java/io/trino/operator/output/PagePartitioner.java +++ b/core/trino-main/src/main/java/io/trino/operator/output/PagePartitioner.java @@ -33,8 +33,7 @@ import io.trino.util.Ciphers; import it.unimi.dsi.fastutil.ints.IntArrayList; import it.unimi.dsi.fastutil.ints.IntList; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.Closeable; import java.util.Arrays; diff --git a/core/trino-main/src/main/java/io/trino/operator/output/PagePartitionerPool.java b/core/trino-main/src/main/java/io/trino/operator/output/PagePartitionerPool.java index 94c3f997c3e5..2479f76a7941 100644 --- a/core/trino-main/src/main/java/io/trino/operator/output/PagePartitionerPool.java +++ b/core/trino-main/src/main/java/io/trino/operator/output/PagePartitionerPool.java @@ -15,8 +15,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.io.Closer; - -import javax.annotation.concurrent.GuardedBy; +import com.google.errorprone.annotations.concurrent.GuardedBy; import java.io.IOException; import java.util.ArrayDeque; diff --git a/core/trino-main/src/main/java/io/trino/operator/output/RleAwarePositionsAppender.java b/core/trino-main/src/main/java/io/trino/operator/output/RleAwarePositionsAppender.java index dbffe7983146..82480d7edce6 100644 --- a/core/trino-main/src/main/java/io/trino/operator/output/RleAwarePositionsAppender.java +++ b/core/trino-main/src/main/java/io/trino/operator/output/RleAwarePositionsAppender.java @@ -17,8 +17,7 @@ import io.trino.spi.block.RunLengthEncodedBlock; import io.trino.type.BlockTypeOperators.BlockPositionIsDistinctFrom; import it.unimi.dsi.fastutil.ints.IntArrayList; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import static com.google.common.base.Preconditions.checkArgument; import static io.airlift.slice.SizeOf.instanceSize; diff --git a/core/trino-main/src/main/java/io/trino/operator/output/SkewedPartitionRebalancer.java b/core/trino-main/src/main/java/io/trino/operator/output/SkewedPartitionRebalancer.java index deb78935393f..2fd12d002818 100644 --- a/core/trino-main/src/main/java/io/trino/operator/output/SkewedPartitionRebalancer.java +++ b/core/trino-main/src/main/java/io/trino/operator/output/SkewedPartitionRebalancer.java @@ -15,6 +15,8 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.log.Logger; import io.airlift.units.DataSize; import io.trino.Session; @@ -27,9 +29,6 @@ import io.trino.sql.planner.PartitioningScheme; import io.trino.sql.planner.SystemPartitioningHandle; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.util.ArrayList; import java.util.List; import java.util.Objects; diff --git a/core/trino-main/src/main/java/io/trino/operator/project/DictionaryAwarePageProjection.java b/core/trino-main/src/main/java/io/trino/operator/project/DictionaryAwarePageProjection.java index 987cc515368e..5b1439c37b41 100644 --- a/core/trino-main/src/main/java/io/trino/operator/project/DictionaryAwarePageProjection.java +++ b/core/trino-main/src/main/java/io/trino/operator/project/DictionaryAwarePageProjection.java @@ -24,8 +24,7 @@ import io.trino.spi.block.RunLengthEncodedBlock; import io.trino.spi.connector.ConnectorSession; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Optional; import java.util.function.Function; diff --git a/core/trino-main/src/main/java/io/trino/operator/scalar/UrlFunctions.java b/core/trino-main/src/main/java/io/trino/operator/scalar/UrlFunctions.java index 46a09c5cdd4d..6c84b6c42425 100644 --- a/core/trino-main/src/main/java/io/trino/operator/scalar/UrlFunctions.java +++ b/core/trino-main/src/main/java/io/trino/operator/scalar/UrlFunctions.java @@ -26,8 +26,7 @@ import io.trino.spi.function.SqlType; import io.trino.spi.type.StandardTypes; import io.trino.type.Constraint; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.UnsupportedEncodingException; import java.net.URI; diff --git a/core/trino-main/src/main/java/io/trino/operator/unnest/UnnestBlockBuilder.java b/core/trino-main/src/main/java/io/trino/operator/unnest/UnnestBlockBuilder.java index ddf7cd8b0070..63338b99be12 100644 --- a/core/trino-main/src/main/java/io/trino/operator/unnest/UnnestBlockBuilder.java +++ b/core/trino-main/src/main/java/io/trino/operator/unnest/UnnestBlockBuilder.java @@ -15,8 +15,7 @@ import io.trino.spi.block.Block; import io.trino.spi.block.DictionaryBlock; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import static com.google.common.base.Verify.verify; import static io.trino.operator.unnest.UnnestBlockBuilder.NullElementFinder.NULL_NOT_FOUND; diff --git a/core/trino-main/src/main/java/io/trino/security/AccessControlConfig.java b/core/trino-main/src/main/java/io/trino/security/AccessControlConfig.java index 09c3c322739b..6879ee330db3 100644 --- a/core/trino-main/src/main/java/io/trino/security/AccessControlConfig.java +++ b/core/trino-main/src/main/java/io/trino/security/AccessControlConfig.java @@ -17,8 +17,7 @@ import com.google.common.collect.ImmutableList; import io.airlift.configuration.Config; import io.airlift.configuration.validation.FileExists; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.io.File; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/server/BasicQueryInfo.java b/core/trino-main/src/main/java/io/trino/server/BasicQueryInfo.java index ca03b2b54392..c445a58b30b4 100644 --- a/core/trino-main/src/main/java/io/trino/server/BasicQueryInfo.java +++ b/core/trino-main/src/main/java/io/trino/server/BasicQueryInfo.java @@ -15,6 +15,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.errorprone.annotations.Immutable; import io.trino.SessionRepresentation; import io.trino.execution.QueryInfo; import io.trino.execution.QueryState; @@ -24,9 +25,7 @@ import io.trino.spi.QueryId; import io.trino.spi.resourcegroups.QueryType; import io.trino.spi.resourcegroups.ResourceGroupId; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.Immutable; +import jakarta.annotation.Nullable; import java.net.URI; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/server/BasicQueryStats.java b/core/trino-main/src/main/java/io/trino/server/BasicQueryStats.java index 3220161e4549..945db0d93f59 100644 --- a/core/trino-main/src/main/java/io/trino/server/BasicQueryStats.java +++ b/core/trino-main/src/main/java/io/trino/server/BasicQueryStats.java @@ -16,14 +16,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableSet; +import com.google.errorprone.annotations.Immutable; import io.airlift.units.DataSize; import io.airlift.units.Duration; import io.trino.execution.QueryStats; import io.trino.operator.BlockedReason; import org.joda.time.DateTime; -import javax.annotation.concurrent.Immutable; - import java.util.OptionalDouble; import java.util.Set; diff --git a/core/trino-main/src/main/java/io/trino/server/DynamicFilterService.java b/core/trino-main/src/main/java/io/trino/server/DynamicFilterService.java index ec4bad24cc03..c8d91598de9e 100644 --- a/core/trino-main/src/main/java/io/trino/server/DynamicFilterService.java +++ b/core/trino-main/src/main/java/io/trino/server/DynamicFilterService.java @@ -22,6 +22,8 @@ import com.google.common.collect.Multimap; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.airlift.units.DataSize; import io.airlift.units.Duration; @@ -55,9 +57,6 @@ import io.trino.sql.planner.plan.SemiJoinNode; import org.roaringbitmap.RoaringBitmap; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.util.ArrayList; import java.util.Collection; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/server/GracefulShutdownHandler.java b/core/trino-main/src/main/java/io/trino/server/GracefulShutdownHandler.java index 62aedf134b16..94ae49fcf044 100644 --- a/core/trino-main/src/main/java/io/trino/server/GracefulShutdownHandler.java +++ b/core/trino-main/src/main/java/io/trino/server/GracefulShutdownHandler.java @@ -13,6 +13,7 @@ */ package io.trino.server; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.airlift.bootstrap.LifeCycleManager; import io.airlift.log.Logger; @@ -20,8 +21,6 @@ import io.trino.execution.SqlTaskManager; import io.trino.execution.TaskInfo; -import javax.annotation.concurrent.GuardedBy; - import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutionException; diff --git a/core/trino-main/src/main/java/io/trino/server/InternalCommunicationConfig.java b/core/trino-main/src/main/java/io/trino/server/InternalCommunicationConfig.java index dd63efdc38e2..e067caedceb6 100644 --- a/core/trino-main/src/main/java/io/trino/server/InternalCommunicationConfig.java +++ b/core/trino-main/src/main/java/io/trino/server/InternalCommunicationConfig.java @@ -18,9 +18,8 @@ import io.airlift.configuration.ConfigSecuritySensitive; import io.airlift.configuration.DefunctConfig; import io.airlift.configuration.validation.FileExists; - -import javax.validation.constraints.AssertTrue; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.AssertTrue; +import jakarta.validation.constraints.NotNull; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/server/PluginManager.java b/core/trino-main/src/main/java/io/trino/server/PluginManager.java index f2d54a95043e..c3d7cd866f80 100644 --- a/core/trino-main/src/main/java/io/trino/server/PluginManager.java +++ b/core/trino-main/src/main/java/io/trino/server/PluginManager.java @@ -14,6 +14,7 @@ package io.trino.server; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.ThreadSafe; import com.google.inject.Inject; import io.airlift.log.Logger; import io.trino.connector.CatalogFactory; @@ -48,8 +49,6 @@ import io.trino.spi.type.ParametricType; import io.trino.spi.type.Type; -import javax.annotation.concurrent.ThreadSafe; - import java.net.URL; import java.util.List; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/server/ProtocolConfig.java b/core/trino-main/src/main/java/io/trino/server/ProtocolConfig.java index 7cab2d398426..329a86001c55 100644 --- a/core/trino-main/src/main/java/io/trino/server/ProtocolConfig.java +++ b/core/trino-main/src/main/java/io/trino/server/ProtocolConfig.java @@ -15,8 +15,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; - -import javax.validation.constraints.Pattern; +import jakarta.validation.constraints.Pattern; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/server/QuerySessionSupplier.java b/core/trino-main/src/main/java/io/trino/server/QuerySessionSupplier.java index a529900d6c01..21c063182c8e 100644 --- a/core/trino-main/src/main/java/io/trino/server/QuerySessionSupplier.java +++ b/core/trino-main/src/main/java/io/trino/server/QuerySessionSupplier.java @@ -13,6 +13,7 @@ */ package io.trino.server; +import com.google.errorprone.annotations.ThreadSafe; import com.google.inject.Inject; import io.opentelemetry.api.trace.Span; import io.trino.Session; @@ -25,8 +26,6 @@ import io.trino.sql.SqlEnvironmentConfig; import io.trino.sql.SqlPath; -import javax.annotation.concurrent.ThreadSafe; - import java.util.Locale; import java.util.Map; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/server/ResourceGroupInfo.java b/core/trino-main/src/main/java/io/trino/server/ResourceGroupInfo.java index 6e9bf6be8549..9e1b1fb4c65d 100644 --- a/core/trino-main/src/main/java/io/trino/server/ResourceGroupInfo.java +++ b/core/trino-main/src/main/java/io/trino/server/ResourceGroupInfo.java @@ -20,8 +20,7 @@ import io.trino.spi.resourcegroups.ResourceGroupId; import io.trino.spi.resourcegroups.ResourceGroupState; import io.trino.spi.resourcegroups.SchedulingPolicy; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.List; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/server/ServerConfig.java b/core/trino-main/src/main/java/io/trino/server/ServerConfig.java index 7f16d1a9c95c..7f9c3dff449d 100644 --- a/core/trino-main/src/main/java/io/trino/server/ServerConfig.java +++ b/core/trino-main/src/main/java/io/trino/server/ServerConfig.java @@ -16,8 +16,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; import io.airlift.units.Duration; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/server/protocol/Query.java b/core/trino-main/src/main/java/io/trino/server/protocol/Query.java index 72d025f58a5d..5f1b04a7164a 100644 --- a/core/trino-main/src/main/java/io/trino/server/protocol/Query.java +++ b/core/trino-main/src/main/java/io/trino/server/protocol/Query.java @@ -20,6 +20,8 @@ import com.google.common.util.concurrent.AbstractFuture; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.log.Logger; import io.airlift.slice.Slice; import io.airlift.units.DataSize; @@ -56,9 +58,6 @@ import jakarta.ws.rs.core.Response; import jakarta.ws.rs.core.UriInfo; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.net.URI; import java.util.List; import java.util.Map; diff --git a/core/trino-main/src/main/java/io/trino/server/protocol/QueryResultRows.java b/core/trino-main/src/main/java/io/trino/server/protocol/QueryResultRows.java index 9de1ffaa3c4c..2fcaab646aa2 100644 --- a/core/trino-main/src/main/java/io/trino/server/protocol/QueryResultRows.java +++ b/core/trino-main/src/main/java/io/trino/server/protocol/QueryResultRows.java @@ -37,8 +37,7 @@ import io.trino.spi.type.TimestampType; import io.trino.spi.type.TimestampWithTimeZoneType; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.ArrayDeque; import java.util.ArrayList; diff --git a/core/trino-main/src/main/java/io/trino/server/remotetask/Backoff.java b/core/trino-main/src/main/java/io/trino/server/remotetask/Backoff.java index e56faa687804..92981049b971 100644 --- a/core/trino-main/src/main/java/io/trino/server/remotetask/Backoff.java +++ b/core/trino-main/src/main/java/io/trino/server/remotetask/Backoff.java @@ -16,10 +16,9 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Ticker; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.units.Duration; -import javax.annotation.concurrent.ThreadSafe; - import java.util.List; import static com.google.common.base.Preconditions.checkArgument; diff --git a/core/trino-main/src/main/java/io/trino/server/remotetask/ContinuousTaskStatusFetcher.java b/core/trino-main/src/main/java/io/trino/server/remotetask/ContinuousTaskStatusFetcher.java index 6fbdee7ab376..0f44d41c442f 100644 --- a/core/trino-main/src/main/java/io/trino/server/remotetask/ContinuousTaskStatusFetcher.java +++ b/core/trino-main/src/main/java/io/trino/server/remotetask/ContinuousTaskStatusFetcher.java @@ -15,6 +15,7 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.concurrent.SetThreadName; import io.airlift.http.client.FullJsonResponseHandler; import io.airlift.http.client.HttpClient; @@ -29,8 +30,6 @@ import io.trino.spi.HostAddress; import io.trino.spi.TrinoException; -import javax.annotation.concurrent.GuardedBy; - import java.util.concurrent.Executor; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.atomic.AtomicBoolean; diff --git a/core/trino-main/src/main/java/io/trino/server/remotetask/DynamicFiltersFetcher.java b/core/trino-main/src/main/java/io/trino/server/remotetask/DynamicFiltersFetcher.java index 61712bf56359..940f4d448a8e 100644 --- a/core/trino-main/src/main/java/io/trino/server/remotetask/DynamicFiltersFetcher.java +++ b/core/trino-main/src/main/java/io/trino/server/remotetask/DynamicFiltersFetcher.java @@ -14,6 +14,7 @@ package io.trino.server.remotetask; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.concurrent.SetThreadName; import io.airlift.http.client.FullJsonResponseHandler.JsonResponse; import io.airlift.http.client.HttpClient; @@ -25,8 +26,6 @@ import io.trino.execution.TaskId; import io.trino.server.DynamicFilterService; -import javax.annotation.concurrent.GuardedBy; - import java.net.URI; import java.util.concurrent.Executor; import java.util.concurrent.ScheduledExecutorService; diff --git a/core/trino-main/src/main/java/io/trino/server/remotetask/HttpRemoteTask.java b/core/trino-main/src/main/java/io/trino/server/remotetask/HttpRemoteTask.java index 4e666b14b5e9..7e64667ec148 100644 --- a/core/trino-main/src/main/java/io/trino/server/remotetask/HttpRemoteTask.java +++ b/core/trino-main/src/main/java/io/trino/server/remotetask/HttpRemoteTask.java @@ -24,6 +24,7 @@ import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.concurrent.SetThreadName; import io.airlift.http.client.FullJsonResponseHandler.JsonResponse; import io.airlift.http.client.HttpClient; @@ -71,8 +72,6 @@ import io.trino.tracing.TrinoAttributes; import org.joda.time.DateTime; -import javax.annotation.concurrent.GuardedBy; - import java.net.URI; import java.util.Collection; import java.util.Comparator; diff --git a/core/trino-main/src/main/java/io/trino/server/remotetask/RemoteTaskStats.java b/core/trino-main/src/main/java/io/trino/server/remotetask/RemoteTaskStats.java index 11dc62f62293..b8694558bf2c 100644 --- a/core/trino-main/src/main/java/io/trino/server/remotetask/RemoteTaskStats.java +++ b/core/trino-main/src/main/java/io/trino/server/remotetask/RemoteTaskStats.java @@ -14,12 +14,11 @@ package io.trino.server.remotetask; import com.google.common.util.concurrent.AtomicDouble; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.stats.DistributionStat; import org.weakref.jmx.Managed; import org.weakref.jmx.Nested; -import javax.annotation.concurrent.ThreadSafe; - public class RemoteTaskStats { private final IncrementalAverage updateRoundTripMillis = new IncrementalAverage(); diff --git a/core/trino-main/src/main/java/io/trino/server/remotetask/RequestErrorTracker.java b/core/trino-main/src/main/java/io/trino/server/remotetask/RequestErrorTracker.java index d8cb573c3a94..4a287d097394 100644 --- a/core/trino-main/src/main/java/io/trino/server/remotetask/RequestErrorTracker.java +++ b/core/trino-main/src/main/java/io/trino/server/remotetask/RequestErrorTracker.java @@ -15,6 +15,7 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.event.client.ServiceUnavailableException; import io.airlift.log.Logger; import io.airlift.units.Duration; @@ -22,8 +23,6 @@ import io.trino.spi.TrinoException; import io.trino.spi.TrinoTransportException; -import javax.annotation.concurrent.ThreadSafe; - import java.io.EOFException; import java.net.SocketException; import java.net.SocketTimeoutException; diff --git a/core/trino-main/src/main/java/io/trino/server/remotetask/TaskInfoFetcher.java b/core/trino-main/src/main/java/io/trino/server/remotetask/TaskInfoFetcher.java index 7177bb9b0afd..2f71e1a61dc3 100644 --- a/core/trino-main/src/main/java/io/trino/server/remotetask/TaskInfoFetcher.java +++ b/core/trino-main/src/main/java/io/trino/server/remotetask/TaskInfoFetcher.java @@ -15,6 +15,7 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.concurrent.SetThreadName; import io.airlift.http.client.FullJsonResponseHandler; import io.airlift.http.client.HttpClient; @@ -33,8 +34,6 @@ import io.trino.execution.TaskStatus; import io.trino.execution.buffer.SpoolingOutputStats; -import javax.annotation.concurrent.GuardedBy; - import java.net.URI; import java.util.Optional; import java.util.concurrent.Executor; diff --git a/core/trino-main/src/main/java/io/trino/server/security/HeaderAuthenticatorConfig.java b/core/trino-main/src/main/java/io/trino/server/security/HeaderAuthenticatorConfig.java index d07284392d62..eb77187e683f 100644 --- a/core/trino-main/src/main/java/io/trino/server/security/HeaderAuthenticatorConfig.java +++ b/core/trino-main/src/main/java/io/trino/server/security/HeaderAuthenticatorConfig.java @@ -17,9 +17,8 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; import io.airlift.configuration.validation.FileExists; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; import java.io.File; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/server/security/KerberosConfig.java b/core/trino-main/src/main/java/io/trino/server/security/KerberosConfig.java index 1ccb0f942127..45a09ae1dc0c 100644 --- a/core/trino-main/src/main/java/io/trino/server/security/KerberosConfig.java +++ b/core/trino-main/src/main/java/io/trino/server/security/KerberosConfig.java @@ -16,8 +16,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.LegacyConfig; import io.airlift.configuration.validation.FileExists; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.io.File; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/server/security/PasswordAuthenticatorConfig.java b/core/trino-main/src/main/java/io/trino/server/security/PasswordAuthenticatorConfig.java index 6fb163eb1575..08632a23bc4f 100644 --- a/core/trino-main/src/main/java/io/trino/server/security/PasswordAuthenticatorConfig.java +++ b/core/trino-main/src/main/java/io/trino/server/security/PasswordAuthenticatorConfig.java @@ -18,9 +18,8 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; import io.airlift.configuration.validation.FileExists; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; import java.io.File; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/server/security/SecurityConfig.java b/core/trino-main/src/main/java/io/trino/server/security/SecurityConfig.java index d438e262a3f8..c547ebb78029 100644 --- a/core/trino-main/src/main/java/io/trino/server/security/SecurityConfig.java +++ b/core/trino-main/src/main/java/io/trino/server/security/SecurityConfig.java @@ -18,9 +18,8 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; import io.airlift.configuration.DefunctConfig; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; import java.util.List; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/server/security/jwt/JwtAuthenticatorConfig.java b/core/trino-main/src/main/java/io/trino/server/security/jwt/JwtAuthenticatorConfig.java index 71cf93f186a5..ddd32366bae4 100644 --- a/core/trino-main/src/main/java/io/trino/server/security/jwt/JwtAuthenticatorConfig.java +++ b/core/trino-main/src/main/java/io/trino/server/security/jwt/JwtAuthenticatorConfig.java @@ -16,8 +16,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.LegacyConfig; import io.airlift.configuration.validation.FileExists; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.io.File; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/server/security/oauth2/OAuth2Config.java b/core/trino-main/src/main/java/io/trino/server/security/oauth2/OAuth2Config.java index c5a88f798194..7f42fc9e1001 100644 --- a/core/trino-main/src/main/java/io/trino/server/security/oauth2/OAuth2Config.java +++ b/core/trino-main/src/main/java/io/trino/server/security/oauth2/OAuth2Config.java @@ -23,8 +23,7 @@ import io.airlift.configuration.validation.FileExists; import io.airlift.units.Duration; import io.airlift.units.MinDuration; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.io.File; import java.util.Collections; diff --git a/core/trino-main/src/main/java/io/trino/server/security/oauth2/OidcDiscoveryConfig.java b/core/trino-main/src/main/java/io/trino/server/security/oauth2/OidcDiscoveryConfig.java index 8ea0ab96d617..ac343f842a42 100644 --- a/core/trino-main/src/main/java/io/trino/server/security/oauth2/OidcDiscoveryConfig.java +++ b/core/trino-main/src/main/java/io/trino/server/security/oauth2/OidcDiscoveryConfig.java @@ -16,8 +16,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; import io.airlift.units.Duration; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/server/security/oauth2/RefreshTokensConfig.java b/core/trino-main/src/main/java/io/trino/server/security/oauth2/RefreshTokensConfig.java index 692b2f4becb1..10cc82d11c4c 100644 --- a/core/trino-main/src/main/java/io/trino/server/security/oauth2/RefreshTokensConfig.java +++ b/core/trino-main/src/main/java/io/trino/server/security/oauth2/RefreshTokensConfig.java @@ -17,10 +17,10 @@ import io.airlift.configuration.ConfigDescription; import io.airlift.configuration.ConfigSecuritySensitive; import io.airlift.units.Duration; +import jakarta.validation.constraints.NotEmpty; import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec; -import javax.validation.constraints.NotEmpty; import java.util.Base64; diff --git a/core/trino-main/src/main/java/io/trino/server/security/oauth2/StaticOAuth2ServerConfiguration.java b/core/trino-main/src/main/java/io/trino/server/security/oauth2/StaticOAuth2ServerConfiguration.java index 46e5e07c83c9..f5606ac387ca 100644 --- a/core/trino-main/src/main/java/io/trino/server/security/oauth2/StaticOAuth2ServerConfiguration.java +++ b/core/trino-main/src/main/java/io/trino/server/security/oauth2/StaticOAuth2ServerConfiguration.java @@ -15,8 +15,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/server/security/oauth2/TokenPairSerializer.java b/core/trino-main/src/main/java/io/trino/server/security/oauth2/TokenPairSerializer.java index cb6dcfd23054..9f8307eb562d 100644 --- a/core/trino-main/src/main/java/io/trino/server/security/oauth2/TokenPairSerializer.java +++ b/core/trino-main/src/main/java/io/trino/server/security/oauth2/TokenPairSerializer.java @@ -15,8 +15,7 @@ package io.trino.server.security.oauth2; import io.trino.server.security.oauth2.OAuth2Client.Response; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Date; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/server/testing/TestingTrinoServer.java b/core/trino-main/src/main/java/io/trino/server/testing/TestingTrinoServer.java index 504271913d15..cb89737dc147 100644 --- a/core/trino-main/src/main/java/io/trino/server/testing/TestingTrinoServer.java +++ b/core/trino-main/src/main/java/io/trino/server/testing/TestingTrinoServer.java @@ -17,6 +17,7 @@ import com.google.common.collect.ImmutableMap; import com.google.common.io.Closer; import com.google.common.net.HostAndPort; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Injector; import com.google.inject.Key; import com.google.inject.Module; @@ -104,7 +105,6 @@ import io.trino.transaction.TransactionManagerModule; import org.weakref.jmx.guice.MBeanModule; -import javax.annotation.concurrent.GuardedBy; import javax.management.MBeanServer; import java.io.Closeable; diff --git a/core/trino-main/src/main/java/io/trino/server/ui/ClusterResource.java b/core/trino-main/src/main/java/io/trino/server/ui/ClusterResource.java index 5124a7ff9e2f..4056dfe42484 100644 --- a/core/trino-main/src/main/java/io/trino/server/ui/ClusterResource.java +++ b/core/trino-main/src/main/java/io/trino/server/ui/ClusterResource.java @@ -14,6 +14,7 @@ package io.trino.server.ui; import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.errorprone.annotations.Immutable; import com.google.inject.Inject; import io.airlift.node.NodeInfo; import io.airlift.units.Duration; @@ -23,8 +24,6 @@ import jakarta.ws.rs.Path; import jakarta.ws.rs.Produces; -import javax.annotation.concurrent.Immutable; - import static io.airlift.units.Duration.nanosSince; import static io.trino.server.security.ResourceSecurity.AccessType.WEB_UI; import static jakarta.ws.rs.core.MediaType.APPLICATION_JSON; diff --git a/core/trino-main/src/main/java/io/trino/server/ui/FixedUserWebUiConfig.java b/core/trino-main/src/main/java/io/trino/server/ui/FixedUserWebUiConfig.java index 861578b20ad1..0fb008b4d76e 100644 --- a/core/trino-main/src/main/java/io/trino/server/ui/FixedUserWebUiConfig.java +++ b/core/trino-main/src/main/java/io/trino/server/ui/FixedUserWebUiConfig.java @@ -14,8 +14,7 @@ package io.trino.server.ui; import io.airlift.configuration.Config; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class FixedUserWebUiConfig { diff --git a/core/trino-main/src/main/java/io/trino/server/ui/FormWebUiConfig.java b/core/trino-main/src/main/java/io/trino/server/ui/FormWebUiConfig.java index 20180d8d80f9..3107653cbfe0 100644 --- a/core/trino-main/src/main/java/io/trino/server/ui/FormWebUiConfig.java +++ b/core/trino-main/src/main/java/io/trino/server/ui/FormWebUiConfig.java @@ -15,8 +15,7 @@ import io.airlift.configuration.Config; import io.airlift.units.Duration; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/server/ui/TrimmedBasicQueryInfo.java b/core/trino-main/src/main/java/io/trino/server/ui/TrimmedBasicQueryInfo.java index f33036675318..5de9fcc587d6 100644 --- a/core/trino-main/src/main/java/io/trino/server/ui/TrimmedBasicQueryInfo.java +++ b/core/trino-main/src/main/java/io/trino/server/ui/TrimmedBasicQueryInfo.java @@ -14,6 +14,7 @@ package io.trino.server.ui; import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.errorprone.annotations.Immutable; import io.trino.execution.QueryState; import io.trino.operator.RetryPolicy; import io.trino.server.BasicQueryInfo; @@ -24,8 +25,6 @@ import io.trino.spi.resourcegroups.QueryType; import io.trino.spi.resourcegroups.ResourceGroupId; -import javax.annotation.concurrent.Immutable; - import java.net.URI; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/spiller/FileHolder.java b/core/trino-main/src/main/java/io/trino/spiller/FileHolder.java index 629a08df50fa..06771b60e32a 100644 --- a/core/trino-main/src/main/java/io/trino/spiller/FileHolder.java +++ b/core/trino-main/src/main/java/io/trino/spiller/FileHolder.java @@ -13,8 +13,8 @@ */ package io.trino.spiller; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import java.io.Closeable; import java.io.IOException; diff --git a/core/trino-main/src/main/java/io/trino/spiller/GenericPartitioningSpiller.java b/core/trino-main/src/main/java/io/trino/spiller/GenericPartitioningSpiller.java index b0bc9fc7d22e..2d19dc6bc13c 100644 --- a/core/trino-main/src/main/java/io/trino/spiller/GenericPartitioningSpiller.java +++ b/core/trino-main/src/main/java/io/trino/spiller/GenericPartitioningSpiller.java @@ -18,6 +18,7 @@ import com.google.common.io.Closer; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.ThreadSafe; import io.trino.memory.context.AggregatedMemoryContext; import io.trino.operator.PartitionFunction; import io.trino.operator.SpillContext; @@ -26,8 +27,6 @@ import io.trino.spi.type.Type; import it.unimi.dsi.fastutil.ints.IntArrayList; -import javax.annotation.concurrent.ThreadSafe; - import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; diff --git a/core/trino-main/src/main/java/io/trino/spiller/LocalSpillContext.java b/core/trino-main/src/main/java/io/trino/spiller/LocalSpillContext.java index 115799c3ed3a..72d7781d97cb 100644 --- a/core/trino-main/src/main/java/io/trino/spiller/LocalSpillContext.java +++ b/core/trino-main/src/main/java/io/trino/spiller/LocalSpillContext.java @@ -13,10 +13,9 @@ */ package io.trino.spiller; +import com.google.errorprone.annotations.ThreadSafe; import io.trino.operator.SpillContext; -import javax.annotation.concurrent.ThreadSafe; - import static com.google.common.base.Preconditions.checkState; @ThreadSafe diff --git a/core/trino-main/src/main/java/io/trino/spiller/NodeSpillConfig.java b/core/trino-main/src/main/java/io/trino/spiller/NodeSpillConfig.java index 09643ea1f1e6..c46f8c97f23f 100644 --- a/core/trino-main/src/main/java/io/trino/spiller/NodeSpillConfig.java +++ b/core/trino-main/src/main/java/io/trino/spiller/NodeSpillConfig.java @@ -16,8 +16,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.LegacyConfig; import io.airlift.units.DataSize; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class NodeSpillConfig { diff --git a/core/trino-main/src/main/java/io/trino/spiller/SpillSpaceTracker.java b/core/trino-main/src/main/java/io/trino/spiller/SpillSpaceTracker.java index 4979cbaa47d6..8ffaceaec685 100644 --- a/core/trino-main/src/main/java/io/trino/spiller/SpillSpaceTracker.java +++ b/core/trino-main/src/main/java/io/trino/spiller/SpillSpaceTracker.java @@ -14,12 +14,11 @@ package io.trino.spiller; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.units.DataSize; import org.weakref.jmx.Managed; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import static com.google.common.base.MoreObjects.toStringHelper; import static com.google.common.base.Preconditions.checkArgument; import static io.airlift.units.DataSize.succinctBytes; diff --git a/core/trino-main/src/main/java/io/trino/split/SampledSplitSource.java b/core/trino-main/src/main/java/io/trino/split/SampledSplitSource.java index f23920903618..b7b575135807 100644 --- a/core/trino-main/src/main/java/io/trino/split/SampledSplitSource.java +++ b/core/trino-main/src/main/java/io/trino/split/SampledSplitSource.java @@ -16,8 +16,7 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import io.trino.spi.connector.CatalogHandle; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.List; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/sql/SqlEnvironmentConfig.java b/core/trino-main/src/main/java/io/trino/sql/SqlEnvironmentConfig.java index 382d2263c445..ab2a6dfb41b4 100644 --- a/core/trino-main/src/main/java/io/trino/sql/SqlEnvironmentConfig.java +++ b/core/trino-main/src/main/java/io/trino/sql/SqlEnvironmentConfig.java @@ -16,9 +16,8 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; import io.trino.spi.type.TimeZoneKey; - -import javax.annotation.Nullable; -import javax.validation.constraints.NotNull; +import jakarta.annotation.Nullable; +import jakarta.validation.constraints.NotNull; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/sql/SqlFormatterUtil.java b/core/trino-main/src/main/java/io/trino/sql/SqlFormatterUtil.java index 488b3ba6dd34..a97274f172bd 100644 --- a/core/trino-main/src/main/java/io/trino/sql/SqlFormatterUtil.java +++ b/core/trino-main/src/main/java/io/trino/sql/SqlFormatterUtil.java @@ -18,8 +18,7 @@ import io.trino.sql.parser.ParsingOptions; import io.trino.sql.parser.SqlParser; import io.trino.sql.tree.Statement; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import static io.trino.spi.StandardErrorCode.GENERIC_INTERNAL_ERROR; import static io.trino.sql.parser.ParsingOptions.DecimalLiteralTreatment.REJECT; diff --git a/core/trino-main/src/main/java/io/trino/sql/analyzer/AggregationAnalyzer.java b/core/trino-main/src/main/java/io/trino/sql/analyzer/AggregationAnalyzer.java index d37e5a93dd7e..ffb0202857bd 100644 --- a/core/trino-main/src/main/java/io/trino/sql/analyzer/AggregationAnalyzer.java +++ b/core/trino-main/src/main/java/io/trino/sql/analyzer/AggregationAnalyzer.java @@ -76,8 +76,7 @@ import io.trino.sql.tree.WindowOperation; import io.trino.sql.tree.WindowReference; import io.trino.sql.tree.WindowSpecification; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.List; import java.util.Map; diff --git a/core/trino-main/src/main/java/io/trino/sql/analyzer/Analysis.java b/core/trino-main/src/main/java/io/trino/sql/analyzer/Analysis.java index af3fcb0a6d2b..ae373edf3a25 100644 --- a/core/trino-main/src/main/java/io/trino/sql/analyzer/Analysis.java +++ b/core/trino-main/src/main/java/io/trino/sql/analyzer/Analysis.java @@ -24,6 +24,7 @@ import com.google.common.collect.Multiset; import com.google.common.collect.Streams; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.errorprone.annotations.Immutable; import io.trino.metadata.AnalyzeMetadata; import io.trino.metadata.QualifiedObjectName; import io.trino.metadata.ResolvedFunction; @@ -84,9 +85,7 @@ import io.trino.sql.tree.WindowFrame; import io.trino.sql.tree.WindowOperation; import io.trino.transaction.TransactionId; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.Immutable; +import jakarta.annotation.Nullable; import java.util.ArrayDeque; import java.util.ArrayList; diff --git a/core/trino-main/src/main/java/io/trino/sql/analyzer/ExpressionAnalyzer.java b/core/trino-main/src/main/java/io/trino/sql/analyzer/ExpressionAnalyzer.java index 2715c2877dc4..9cb535691f76 100644 --- a/core/trino-main/src/main/java/io/trino/sql/analyzer/ExpressionAnalyzer.java +++ b/core/trino-main/src/main/java/io/trino/sql/analyzer/ExpressionAnalyzer.java @@ -148,8 +148,7 @@ import io.trino.type.JsonPath2016Type; import io.trino.type.TypeCoercion; import io.trino.type.UnknownType; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.ArrayList; import java.util.Collection; diff --git a/core/trino-main/src/main/java/io/trino/sql/analyzer/Output.java b/core/trino-main/src/main/java/io/trino/sql/analyzer/Output.java index 049d24e26027..513badadde18 100644 --- a/core/trino-main/src/main/java/io/trino/sql/analyzer/Output.java +++ b/core/trino-main/src/main/java/io/trino/sql/analyzer/Output.java @@ -16,10 +16,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.Immutable; import io.trino.spi.connector.CatalogHandle.CatalogVersion; -import javax.annotation.concurrent.Immutable; - import java.util.List; import java.util.Objects; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/sql/analyzer/OutputColumn.java b/core/trino-main/src/main/java/io/trino/sql/analyzer/OutputColumn.java index 7682e79be713..c3fd926be3b3 100644 --- a/core/trino-main/src/main/java/io/trino/sql/analyzer/OutputColumn.java +++ b/core/trino-main/src/main/java/io/trino/sql/analyzer/OutputColumn.java @@ -16,11 +16,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableSet; +import com.google.errorprone.annotations.Immutable; import io.trino.execution.Column; import io.trino.sql.analyzer.Analysis.SourceColumn; -import javax.annotation.concurrent.Immutable; - import java.util.Objects; import java.util.Set; diff --git a/core/trino-main/src/main/java/io/trino/sql/analyzer/RelationType.java b/core/trino-main/src/main/java/io/trino/sql/analyzer/RelationType.java index ab67909c6bb8..633a0ef06f6b 100644 --- a/core/trino-main/src/main/java/io/trino/sql/analyzer/RelationType.java +++ b/core/trino-main/src/main/java/io/trino/sql/analyzer/RelationType.java @@ -16,10 +16,9 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.tree.QualifiedName; -import javax.annotation.concurrent.Immutable; - import java.util.Collection; import java.util.List; import java.util.Map; diff --git a/core/trino-main/src/main/java/io/trino/sql/analyzer/ResolvedField.java b/core/trino-main/src/main/java/io/trino/sql/analyzer/ResolvedField.java index 72f7621b2891..c211e82a7309 100644 --- a/core/trino-main/src/main/java/io/trino/sql/analyzer/ResolvedField.java +++ b/core/trino-main/src/main/java/io/trino/sql/analyzer/ResolvedField.java @@ -13,10 +13,9 @@ */ package io.trino.sql.analyzer; +import com.google.errorprone.annotations.Immutable; import io.trino.spi.type.Type; -import javax.annotation.concurrent.Immutable; - import static java.util.Objects.requireNonNull; @Immutable diff --git a/core/trino-main/src/main/java/io/trino/sql/analyzer/Scope.java b/core/trino-main/src/main/java/io/trino/sql/analyzer/Scope.java index 138299100875..1abee9ad37b5 100644 --- a/core/trino-main/src/main/java/io/trino/sql/analyzer/Scope.java +++ b/core/trino-main/src/main/java/io/trino/sql/analyzer/Scope.java @@ -14,14 +14,13 @@ package io.trino.sql.analyzer; import com.google.common.collect.ImmutableMap; +import com.google.errorprone.annotations.Immutable; import io.trino.spi.type.RowType; import io.trino.sql.tree.AllColumns; import io.trino.sql.tree.Expression; import io.trino.sql.tree.QualifiedName; import io.trino.sql.tree.WithQuery; -import javax.annotation.concurrent.Immutable; - import java.util.HashMap; import java.util.List; import java.util.Map; diff --git a/core/trino-main/src/main/java/io/trino/sql/gen/CompilerOperations.java b/core/trino-main/src/main/java/io/trino/sql/gen/CompilerOperations.java index bdadded203aa..730a34279310 100644 --- a/core/trino-main/src/main/java/io/trino/sql/gen/CompilerOperations.java +++ b/core/trino-main/src/main/java/io/trino/sql/gen/CompilerOperations.java @@ -14,8 +14,7 @@ package io.trino.sql.gen; import io.trino.spi.block.Block; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.List; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/sql/gen/PageFunctionCompiler.java b/core/trino-main/src/main/java/io/trino/sql/gen/PageFunctionCompiler.java index 012263600cd9..5e1a826ba6f6 100644 --- a/core/trino-main/src/main/java/io/trino/sql/gen/PageFunctionCompiler.java +++ b/core/trino-main/src/main/java/io/trino/sql/gen/PageFunctionCompiler.java @@ -56,12 +56,11 @@ import io.trino.sql.relational.LambdaDefinitionExpression; import io.trino.sql.relational.RowExpression; import io.trino.sql.relational.RowExpressionVisitor; +import jakarta.annotation.Nullable; import org.objectweb.asm.MethodTooLargeException; import org.weakref.jmx.Managed; import org.weakref.jmx.Nested; -import javax.annotation.Nullable; - import java.lang.invoke.MethodHandle; import java.util.List; import java.util.Map; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/CompilerConfig.java b/core/trino-main/src/main/java/io/trino/sql/planner/CompilerConfig.java index 1ec2a07db8ea..43cde586607a 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/CompilerConfig.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/CompilerConfig.java @@ -16,8 +16,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; import io.airlift.configuration.DefunctConfig; - -import javax.validation.constraints.Min; +import jakarta.validation.constraints.Min; @DefunctConfig("compiler.interpreter-enabled") public class CompilerConfig diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/DomainTranslator.java b/core/trino-main/src/main/java/io/trino/sql/planner/DomainTranslator.java index 5a7e0f05db03..524053345d8a 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/DomainTranslator.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/DomainTranslator.java @@ -72,8 +72,7 @@ import io.trino.type.LikeFunctions; import io.trino.type.LikePatternType; import io.trino.type.TypeCoercion; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.lang.invoke.MethodHandle; import java.time.LocalDate; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/LiteralEncoder.java b/core/trino-main/src/main/java/io/trino/sql/planner/LiteralEncoder.java index 93fee9061883..4bb28f8d1933 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/LiteralEncoder.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/LiteralEncoder.java @@ -50,8 +50,7 @@ import io.trino.sql.tree.QualifiedName; import io.trino.sql.tree.StringLiteral; import io.trino.sql.tree.TimestampLiteral; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/LocalDynamicFilterConsumer.java b/core/trino-main/src/main/java/io/trino/sql/planner/LocalDynamicFilterConsumer.java index 4867ef87a2f1..aacc1691608c 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/LocalDynamicFilterConsumer.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/LocalDynamicFilterConsumer.java @@ -15,6 +15,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.units.DataSize; import io.trino.spi.predicate.Domain; import io.trino.spi.predicate.TupleDomain; @@ -23,8 +24,6 @@ import io.trino.sql.planner.plan.JoinNode; import io.trino.sql.planner.plan.PlanNode; -import javax.annotation.concurrent.GuardedBy; - import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/LocalDynamicFiltersCollector.java b/core/trino-main/src/main/java/io/trino/sql/planner/LocalDynamicFiltersCollector.java index 8c76813f780d..296f2b1f702c 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/LocalDynamicFiltersCollector.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/LocalDynamicFiltersCollector.java @@ -18,6 +18,8 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.trino.Session; import io.trino.spi.connector.ColumnHandle; import io.trino.spi.connector.DynamicFilter; @@ -27,9 +29,6 @@ import io.trino.sql.PlannerContext; import io.trino.sql.planner.plan.DynamicFilterId; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.util.HashMap; import java.util.List; import java.util.Map; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/LogicalPlanner.java b/core/trino-main/src/main/java/io/trino/sql/planner/LogicalPlanner.java index 7b9fe1549a76..e784579effef 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/LogicalPlanner.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/LogicalPlanner.java @@ -108,8 +108,7 @@ import io.trino.tracing.TrinoAttributes; import io.trino.type.TypeCoercion; import io.trino.type.UnknownType; - -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; import java.util.AbstractMap.SimpleImmutableEntry; import java.util.ArrayList; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/OptimizerConfig.java b/core/trino-main/src/main/java/io/trino/sql/planner/OptimizerConfig.java index 52aa09da8ce5..65a62435361f 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/OptimizerConfig.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/OptimizerConfig.java @@ -19,11 +19,10 @@ import io.airlift.configuration.LegacyConfig; import io.airlift.units.DataSize; import io.airlift.units.Duration; - -import javax.annotation.Nullable; -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.annotation.Nullable; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import static io.airlift.units.DataSize.Unit.GIGABYTE; import static io.airlift.units.DataSize.Unit.MEGABYTE; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/OptimizerStatsMBeanExporter.java b/core/trino-main/src/main/java/io/trino/sql/planner/OptimizerStatsMBeanExporter.java index 866bfda9d494..e1bd37e2891c 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/OptimizerStatsMBeanExporter.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/OptimizerStatsMBeanExporter.java @@ -14,6 +14,7 @@ package io.trino.sql.planner; import com.google.common.collect.ImmutableMap; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.trino.sql.planner.iterative.IterativeOptimizer; import io.trino.sql.planner.iterative.RuleStats; @@ -25,8 +26,6 @@ import org.weakref.jmx.MBeanExporter; import org.weakref.jmx.ObjectNames; -import javax.annotation.concurrent.GuardedBy; - import java.util.ArrayList; import java.util.List; import java.util.Map; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/Partitioning.java b/core/trino-main/src/main/java/io/trino/sql/planner/Partitioning.java index 593b48fc7204..44bf49249a69 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/Partitioning.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/Partitioning.java @@ -17,14 +17,13 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; +import com.google.errorprone.annotations.Immutable; import io.trino.Session; import io.trino.metadata.Metadata; import io.trino.spi.predicate.NullableValue; import io.trino.sql.tree.Expression; import io.trino.sql.tree.SymbolReference; -import javax.annotation.concurrent.Immutable; - import java.util.Collection; import java.util.HashSet; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/PlanFragment.java b/core/trino-main/src/main/java/io/trino/sql/planner/PlanFragment.java index da1c27ac7e39..6de375d802e9 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/PlanFragment.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/PlanFragment.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; +import com.google.errorprone.annotations.Immutable; import io.trino.connector.CatalogProperties; import io.trino.cost.StatsAndCosts; import io.trino.spi.type.Type; @@ -25,8 +26,6 @@ import io.trino.sql.planner.plan.PlanNodeId; import io.trino.sql.planner.plan.RemoteSourceNode; -import javax.annotation.concurrent.Immutable; - import java.util.List; import java.util.Map; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/SubPlan.java b/core/trino-main/src/main/java/io/trino/sql/planner/SubPlan.java index f095e1037d3e..1ed90fcf2658 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/SubPlan.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/SubPlan.java @@ -15,11 +15,10 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.Multiset; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.planner.plan.PlanFragmentId; import io.trino.sql.planner.plan.RemoteSourceNode; -import javax.annotation.concurrent.Immutable; - import java.util.List; import static com.google.common.base.Preconditions.checkState; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/SymbolAllocator.java b/core/trino-main/src/main/java/io/trino/sql/planner/SymbolAllocator.java index daf0e7dd7d78..176986b3d162 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/SymbolAllocator.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/SymbolAllocator.java @@ -23,8 +23,7 @@ import io.trino.sql.tree.GroupingOperation; import io.trino.sql.tree.Identifier; import io.trino.sql.tree.SymbolReference; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.HashMap; import java.util.Map; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/iterative/Memo.java b/core/trino-main/src/main/java/io/trino/sql/planner/iterative/Memo.java index bef93d2ca804..1668db71692b 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/iterative/Memo.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/iterative/Memo.java @@ -19,8 +19,7 @@ import io.trino.cost.PlanNodeStatsEstimate; import io.trino.sql.planner.PlanNodeIdAllocator; import io.trino.sql.planner.plan.PlanNode; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.HashMap; import java.util.HashSet; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/TransformCorrelatedInPredicateToJoin.java b/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/TransformCorrelatedInPredicateToJoin.java index b50e444fa25b..3b1ce7b5b36d 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/TransformCorrelatedInPredicateToJoin.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/TransformCorrelatedInPredicateToJoin.java @@ -50,8 +50,7 @@ import io.trino.sql.tree.SymbolReference; import io.trino.sql.tree.WhenClause; import io.trino.sql.util.AstUtils; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.List; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/optimizations/ActualProperties.java b/core/trino-main/src/main/java/io/trino/sql/planner/optimizations/ActualProperties.java index bdbac9204602..6ffac525a390 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/optimizations/ActualProperties.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/optimizations/ActualProperties.java @@ -16,6 +16,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; +import com.google.errorprone.annotations.Immutable; import io.trino.Session; import io.trino.metadata.Metadata; import io.trino.spi.connector.ConstantProperty; @@ -26,8 +27,6 @@ import io.trino.sql.planner.Symbol; import io.trino.sql.tree.Expression; -import javax.annotation.concurrent.Immutable; - import java.util.Collection; import java.util.HashMap; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/optimizations/PreferredProperties.java b/core/trino-main/src/main/java/io/trino/sql/planner/optimizations/PreferredProperties.java index 24ed690025b9..5c2126d5a165 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/optimizations/PreferredProperties.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/optimizations/PreferredProperties.java @@ -16,12 +16,11 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Sets; +import com.google.errorprone.annotations.Immutable; import io.trino.spi.connector.LocalProperty; import io.trino.sql.planner.Partitioning; import io.trino.sql.planner.Symbol; -import javax.annotation.concurrent.Immutable; - import java.util.List; import java.util.Objects; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/optimizations/StreamPropertyDerivations.java b/core/trino-main/src/main/java/io/trino/sql/planner/optimizations/StreamPropertyDerivations.java index 779a69482310..0d0430bc6a33 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/optimizations/StreamPropertyDerivations.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/optimizations/StreamPropertyDerivations.java @@ -19,6 +19,7 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; import com.google.common.collect.Sets; +import com.google.errorprone.annotations.Immutable; import io.trino.Session; import io.trino.metadata.Metadata; import io.trino.metadata.TableProperties; @@ -76,8 +77,6 @@ import io.trino.sql.tree.Expression; import io.trino.sql.tree.SymbolReference; -import javax.annotation.concurrent.Immutable; - import java.util.HashMap; import java.util.HashSet; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/AggregationNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/AggregationNode.java index e44376f09753..348115750c2f 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/AggregationNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/AggregationNode.java @@ -19,6 +19,7 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; +import com.google.errorprone.annotations.Immutable; import io.trino.Session; import io.trino.metadata.Metadata; import io.trino.metadata.ResolvedFunction; @@ -30,8 +31,6 @@ import io.trino.sql.tree.SymbolReference; import io.trino.type.FunctionType; -import javax.annotation.concurrent.Immutable; - import java.util.HashSet; import java.util.List; import java.util.Map; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/ApplyNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/ApplyNode.java index 91ef62bf7083..e019b0857629 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/ApplyNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/ApplyNode.java @@ -16,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.planner.Symbol; import io.trino.sql.tree.ExistsPredicate; import io.trino.sql.tree.Expression; @@ -23,8 +24,6 @@ import io.trino.sql.tree.Node; import io.trino.sql.tree.QuantifiedComparisonExpression; -import javax.annotation.concurrent.Immutable; - import java.util.List; import static com.google.common.base.Preconditions.checkArgument; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/CorrelatedJoinNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/CorrelatedJoinNode.java index 60441272eacf..57b023b66dba 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/CorrelatedJoinNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/CorrelatedJoinNode.java @@ -16,14 +16,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.planner.Symbol; import io.trino.sql.tree.Expression; import io.trino.sql.tree.Join; import io.trino.sql.tree.Node; import io.trino.sql.tree.NullLiteral; -import javax.annotation.concurrent.Immutable; - import java.util.List; import static com.google.common.base.Preconditions.checkArgument; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/DataOrganizationSpecification.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/DataOrganizationSpecification.java index 588a83c96967..6bd7b9d953c1 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/DataOrganizationSpecification.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/DataOrganizationSpecification.java @@ -16,11 +16,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.planner.OrderingScheme; import io.trino.sql.planner.Symbol; -import javax.annotation.concurrent.Immutable; - import java.util.List; import java.util.Objects; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/DistinctLimitNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/DistinctLimitNode.java index d434b1fd5f82..5b2e56dfe94b 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/DistinctLimitNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/DistinctLimitNode.java @@ -17,10 +17,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.planner.Symbol; -import javax.annotation.concurrent.Immutable; - import java.util.List; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/DynamicFilterId.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/DynamicFilterId.java index 973171a070be..e0e0fd2c1c59 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/DynamicFilterId.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/DynamicFilterId.java @@ -15,8 +15,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; - -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; import static io.airlift.slice.SizeOf.estimatedSizeOf; import static io.airlift.slice.SizeOf.instanceSize; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/DynamicFilterSourceNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/DynamicFilterSourceNode.java index 27e126169d28..c3f82c284acd 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/DynamicFilterSourceNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/DynamicFilterSourceNode.java @@ -18,10 +18,9 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.planner.Symbol; -import javax.annotation.concurrent.Immutable; - import java.util.List; import java.util.Map; import java.util.Set; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/EnforceSingleRowNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/EnforceSingleRowNode.java index f27c3c412832..82f469c070e7 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/EnforceSingleRowNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/EnforceSingleRowNode.java @@ -17,10 +17,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.planner.Symbol; -import javax.annotation.concurrent.Immutable; - import java.util.List; import static java.util.Objects.requireNonNull; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/ExceptNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/ExceptNode.java index 2876eb90fbb5..b9cd2ed2b9e4 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/ExceptNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/ExceptNode.java @@ -15,10 +15,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ListMultimap; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.planner.Symbol; -import javax.annotation.concurrent.Immutable; - import java.util.List; @Immutable diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/ExchangeNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/ExchangeNode.java index 52f7e10432b8..a08eee2ef27f 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/ExchangeNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/ExchangeNode.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.planner.OrderingScheme; import io.trino.sql.planner.Partitioning; import io.trino.sql.planner.Partitioning.ArgumentBinding; @@ -24,8 +25,6 @@ import io.trino.sql.planner.PartitioningScheme; import io.trino.sql.planner.Symbol; -import javax.annotation.concurrent.Immutable; - import java.util.List; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/ExplainAnalyzeNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/ExplainAnalyzeNode.java index 8e821758ba49..5f2e9c0289e5 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/ExplainAnalyzeNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/ExplainAnalyzeNode.java @@ -18,10 +18,9 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.planner.Symbol; -import javax.annotation.concurrent.Immutable; - import java.util.List; import static com.google.common.base.Preconditions.checkArgument; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/FilterNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/FilterNode.java index e7e8d935829d..7390ea1837c8 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/FilterNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/FilterNode.java @@ -17,12 +17,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.planner.Symbol; import io.trino.sql.tree.Expression; import io.trino.sql.tree.NullLiteral; -import javax.annotation.concurrent.Immutable; - import java.util.List; import static com.google.common.base.Preconditions.checkArgument; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/GroupIdNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/GroupIdNode.java index ea11a57121ad..1a9fc391aa57 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/GroupIdNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/GroupIdNode.java @@ -20,10 +20,9 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; import com.google.common.collect.Sets; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.planner.Symbol; -import javax.annotation.concurrent.Immutable; - import java.util.Collection; import java.util.HashSet; import java.util.List; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/IndexJoinNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/IndexJoinNode.java index 67c1452c622b..100f9eae6d96 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/IndexJoinNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/IndexJoinNode.java @@ -16,10 +16,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.planner.Symbol; -import javax.annotation.concurrent.Immutable; - import java.util.List; import java.util.Objects; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/IntersectNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/IntersectNode.java index 099b5fd9a904..d2fe0b76408a 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/IntersectNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/IntersectNode.java @@ -16,10 +16,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ListMultimap; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.planner.Symbol; -import javax.annotation.concurrent.Immutable; - import java.util.List; @Immutable diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/JoinNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/JoinNode.java index 04ff4db45ad2..261798349794 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/JoinNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/JoinNode.java @@ -18,6 +18,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; +import com.google.errorprone.annotations.Immutable; import io.trino.cost.PlanNodeStatsAndCostSummary; import io.trino.sql.planner.Symbol; import io.trino.sql.tree.ComparisonExpression; @@ -25,8 +26,6 @@ import io.trino.sql.tree.Join; import io.trino.sql.tree.NullLiteral; -import javax.annotation.concurrent.Immutable; - import java.util.List; import java.util.Map; import java.util.Objects; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/LimitNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/LimitNode.java index 009e919cbc30..e984e15f4919 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/LimitNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/LimitNode.java @@ -17,11 +17,10 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.planner.OrderingScheme; import io.trino.sql.planner.Symbol; -import javax.annotation.concurrent.Immutable; - import java.util.List; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/MarkDistinctNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/MarkDistinctNode.java index 8f95656b9477..4ed269785508 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/MarkDistinctNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/MarkDistinctNode.java @@ -17,10 +17,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.planner.Symbol; -import javax.annotation.concurrent.Immutable; - import java.util.List; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/MergeWriterNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/MergeWriterNode.java index 2c82e469e109..0d9f89654e84 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/MergeWriterNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/MergeWriterNode.java @@ -17,12 +17,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.planner.PartitioningScheme; import io.trino.sql.planner.Symbol; import io.trino.sql.planner.plan.TableWriterNode.MergeTarget; -import javax.annotation.concurrent.Immutable; - import java.util.List; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/OffsetNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/OffsetNode.java index 1579d8727e26..a3aa8fe711fd 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/OffsetNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/OffsetNode.java @@ -17,10 +17,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.planner.Symbol; -import javax.annotation.concurrent.Immutable; - import java.util.List; import static com.google.common.base.Preconditions.checkArgument; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/OutputNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/OutputNode.java index 84fd345a8418..013e830d2311 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/OutputNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/OutputNode.java @@ -17,10 +17,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.planner.Symbol; -import javax.annotation.concurrent.Immutable; - import java.util.List; import static com.google.common.base.Preconditions.checkArgument; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/PatternRecognitionNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/PatternRecognitionNode.java index d3994564efc9..424a72c7b3ad 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/PatternRecognitionNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/PatternRecognitionNode.java @@ -19,6 +19,7 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; +import com.google.errorprone.annotations.Immutable; import io.trino.spi.type.Type; import io.trino.sql.planner.OrderingScheme; import io.trino.sql.planner.Symbol; @@ -29,8 +30,6 @@ import io.trino.sql.tree.PatternRecognitionRelation.RowsPerMatch; import io.trino.sql.tree.SkipTo.Position; -import javax.annotation.concurrent.Immutable; - import java.util.List; import java.util.Map; import java.util.Objects; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/PlanFragmentId.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/PlanFragmentId.java index 645d2b556e02..c5722046bf0d 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/PlanFragmentId.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/PlanFragmentId.java @@ -15,8 +15,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; - -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; import static java.util.Objects.requireNonNull; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/PlanNodeId.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/PlanNodeId.java index 2e3c97497360..97fa2138aa6f 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/PlanNodeId.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/PlanNodeId.java @@ -15,8 +15,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; - -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; import static io.airlift.slice.SizeOf.estimatedSizeOf; import static io.airlift.slice.SizeOf.instanceSize; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/ProjectNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/ProjectNode.java index 47c7e839f7d5..853a5cf53abd 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/ProjectNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/ProjectNode.java @@ -17,10 +17,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.planner.Symbol; -import javax.annotation.concurrent.Immutable; - import java.util.List; import static java.util.Objects.requireNonNull; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/RefreshMaterializedViewNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/RefreshMaterializedViewNode.java index 2ff6049ebdba..75e7c080066f 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/RefreshMaterializedViewNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/RefreshMaterializedViewNode.java @@ -16,11 +16,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.Immutable; import io.trino.metadata.QualifiedObjectName; import io.trino.sql.planner.Symbol; -import javax.annotation.concurrent.Immutable; - import java.util.List; import static com.google.common.base.Preconditions.checkArgument; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/RemoteSourceNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/RemoteSourceNode.java index 46cf21dff1a4..07f89cb8ef5e 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/RemoteSourceNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/RemoteSourceNode.java @@ -16,12 +16,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.Immutable; import io.trino.operator.RetryPolicy; import io.trino.sql.planner.OrderingScheme; import io.trino.sql.planner.Symbol; -import javax.annotation.concurrent.Immutable; - import java.util.List; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/RowNumberNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/RowNumberNode.java index f586a4d67757..4d84f1254210 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/RowNumberNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/RowNumberNode.java @@ -17,10 +17,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.planner.Symbol; -import javax.annotation.concurrent.Immutable; - import java.util.List; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/SampleNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/SampleNode.java index 8be856dc727f..01bfb64bb730 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/SampleNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/SampleNode.java @@ -17,11 +17,10 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.planner.Symbol; import io.trino.sql.tree.SampledRelation; -import javax.annotation.concurrent.Immutable; - import java.util.List; import static com.google.common.base.Preconditions.checkArgument; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/SemiJoinNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/SemiJoinNode.java index 6aa1828b5e88..45f2fe33a925 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/SemiJoinNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/SemiJoinNode.java @@ -16,10 +16,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.planner.Symbol; -import javax.annotation.concurrent.Immutable; - import java.util.List; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/SetOperationNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/SetOperationNode.java index 35e84a195201..3312e3a43312 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/SetOperationNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/SetOperationNode.java @@ -24,11 +24,10 @@ import com.google.common.collect.ListMultimap; import com.google.common.collect.Multimap; import com.google.common.collect.Multimaps; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.planner.Symbol; import io.trino.sql.tree.SymbolReference; -import javax.annotation.concurrent.Immutable; - import java.util.Collection; import java.util.List; import java.util.Map; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/SpatialJoinNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/SpatialJoinNode.java index f944f9d1ad87..c3c4055b2f1d 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/SpatialJoinNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/SpatialJoinNode.java @@ -17,11 +17,10 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.planner.Symbol; import io.trino.sql.tree.Expression; -import javax.annotation.concurrent.Immutable; - import java.util.List; import java.util.Optional; import java.util.Set; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/TableDeleteNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/TableDeleteNode.java index 8a8c8992835b..f0ac34b3455a 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/TableDeleteNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/TableDeleteNode.java @@ -16,11 +16,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.Immutable; import io.trino.metadata.TableHandle; import io.trino.sql.planner.Symbol; -import javax.annotation.concurrent.Immutable; - import java.util.List; import static com.google.common.base.Preconditions.checkArgument; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/TableExecuteNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/TableExecuteNode.java index babf15a22414..1902bf2d7852 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/TableExecuteNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/TableExecuteNode.java @@ -17,12 +17,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.planner.PartitioningScheme; import io.trino.sql.planner.Symbol; import io.trino.sql.planner.plan.TableWriterNode.TableExecuteTarget; -import javax.annotation.concurrent.Immutable; - import java.util.List; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/TableFinishNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/TableFinishNode.java index 6b987cdcae5a..6a9017af8e3d 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/TableFinishNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/TableFinishNode.java @@ -17,10 +17,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.planner.Symbol; -import javax.annotation.concurrent.Immutable; - import java.util.List; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/TableFunctionNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/TableFunctionNode.java index 45998e07a873..4f5b37d13995 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/TableFunctionNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/TableFunctionNode.java @@ -17,13 +17,12 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import com.google.errorprone.annotations.Immutable; import io.trino.metadata.TableFunctionHandle; import io.trino.spi.connector.CatalogHandle; import io.trino.spi.function.table.Argument; import io.trino.sql.planner.Symbol; -import javax.annotation.concurrent.Immutable; - import java.util.Collection; import java.util.List; import java.util.Map; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/TableScanNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/TableScanNode.java index cc6436e69140..87a38d472869 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/TableScanNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/TableScanNode.java @@ -19,15 +19,14 @@ import com.google.common.base.VerifyException; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import com.google.errorprone.annotations.Immutable; import io.trino.cost.PlanNodeStatsEstimate; import io.trino.metadata.TableHandle; import io.trino.spi.connector.ColumnHandle; import io.trino.spi.predicate.Domain; import io.trino.spi.predicate.TupleDomain; import io.trino.sql.planner.Symbol; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.Immutable; +import jakarta.annotation.Nullable; import java.util.List; import java.util.Map; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/TableWriterNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/TableWriterNode.java index 6f3d1793063d..f881464f36cb 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/TableWriterNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/TableWriterNode.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; +import com.google.errorprone.annotations.Immutable; import io.trino.Session; import io.trino.metadata.InsertTableHandle; import io.trino.metadata.MergeHandle; @@ -37,8 +38,6 @@ import io.trino.sql.planner.PartitioningScheme; import io.trino.sql.planner.Symbol; -import javax.annotation.concurrent.Immutable; - import java.util.List; import java.util.Optional; import java.util.OptionalInt; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/TopNNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/TopNNode.java index caeec47c73f6..61f334985487 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/TopNNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/TopNNode.java @@ -17,11 +17,10 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.planner.OrderingScheme; import io.trino.sql.planner.Symbol; -import javax.annotation.concurrent.Immutable; - import java.util.List; import static com.google.common.base.Preconditions.checkArgument; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/TopNRankingNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/TopNRankingNode.java index 6183b44a9038..ab00c50436c2 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/TopNRankingNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/TopNRankingNode.java @@ -17,11 +17,10 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.planner.OrderingScheme; import io.trino.sql.planner.Symbol; -import javax.annotation.concurrent.Immutable; - import java.util.List; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/UnionNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/UnionNode.java index e56a011d42ab..8cc9212045bb 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/UnionNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/UnionNode.java @@ -16,10 +16,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ListMultimap; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.planner.Symbol; -import javax.annotation.concurrent.Immutable; - import java.util.List; @Immutable diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/UnnestNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/UnnestNode.java index 70a77ae74b81..c67916ed2bb9 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/UnnestNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/UnnestNode.java @@ -18,13 +18,12 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.planner.Symbol; import io.trino.sql.planner.SymbolsExtractor; import io.trino.sql.planner.plan.JoinNode.Type; import io.trino.sql.tree.Expression; -import javax.annotation.concurrent.Immutable; - import java.util.Collection; import java.util.List; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/ValuesNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/ValuesNode.java index a00ac5a97489..7425d29a768f 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/ValuesNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/ValuesNode.java @@ -16,12 +16,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.planner.Symbol; import io.trino.sql.tree.Expression; import io.trino.sql.tree.Row; -import javax.annotation.concurrent.Immutable; - import java.util.List; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/WindowNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/WindowNode.java index 7b4bd5ee9fbe..78594a3948dd 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/WindowNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/WindowNode.java @@ -19,6 +19,7 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; +import com.google.errorprone.annotations.Immutable; import io.trino.metadata.ResolvedFunction; import io.trino.sql.planner.OrderingScheme; import io.trino.sql.planner.Symbol; @@ -26,8 +27,6 @@ import io.trino.sql.tree.FrameBound; import io.trino.sql.tree.WindowFrame; -import javax.annotation.concurrent.Immutable; - import java.util.List; import java.util.Map; import java.util.Objects; diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/rowpattern/ir/IrRowPatternVisitor.java b/core/trino-main/src/main/java/io/trino/sql/planner/rowpattern/ir/IrRowPatternVisitor.java index 02c7fbbe882a..a5d37254d7ef 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/rowpattern/ir/IrRowPatternVisitor.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/rowpattern/ir/IrRowPatternVisitor.java @@ -13,7 +13,7 @@ */ package io.trino.sql.planner.rowpattern.ir; -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; public abstract class IrRowPatternVisitor { diff --git a/core/trino-main/src/main/java/io/trino/testing/TestingWarningCollector.java b/core/trino-main/src/main/java/io/trino/testing/TestingWarningCollector.java index 1e8535dd5453..32af75b16494 100644 --- a/core/trino-main/src/main/java/io/trino/testing/TestingWarningCollector.java +++ b/core/trino-main/src/main/java/io/trino/testing/TestingWarningCollector.java @@ -15,14 +15,13 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.trino.execution.warnings.WarningCollector; import io.trino.execution.warnings.WarningCollectorConfig; import io.trino.spi.TrinoWarning; import io.trino.spi.WarningCode; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.util.LinkedHashMap; import java.util.List; import java.util.Map; diff --git a/core/trino-main/src/main/java/io/trino/transaction/InMemoryTransactionManager.java b/core/trino-main/src/main/java/io/trino/transaction/InMemoryTransactionManager.java index fff97d145aa9..b83df6d6212d 100644 --- a/core/trino-main/src/main/java/io/trino/transaction/InMemoryTransactionManager.java +++ b/core/trino-main/src/main/java/io/trino/transaction/InMemoryTransactionManager.java @@ -16,6 +16,8 @@ import com.google.common.collect.ImmutableSet; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.concurrent.BoundedExecutor; import io.airlift.log.Logger; import io.airlift.units.Duration; @@ -30,9 +32,6 @@ import io.trino.spi.transaction.IsolationLevel; import org.joda.time.DateTime; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.util.Iterator; import java.util.List; import java.util.Map; diff --git a/core/trino-main/src/main/java/io/trino/transaction/TransactionManagerConfig.java b/core/trino-main/src/main/java/io/trino/transaction/TransactionManagerConfig.java index fa6556b1cd2e..8091da8ea244 100644 --- a/core/trino-main/src/main/java/io/trino/transaction/TransactionManagerConfig.java +++ b/core/trino-main/src/main/java/io/trino/transaction/TransactionManagerConfig.java @@ -17,9 +17,8 @@ import io.airlift.configuration.ConfigDescription; import io.airlift.units.Duration; import io.airlift.units.MinDuration; - -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import java.util.concurrent.TimeUnit; diff --git a/core/trino-main/src/main/java/io/trino/type/BlockTypeOperators.java b/core/trino-main/src/main/java/io/trino/type/BlockTypeOperators.java index 44d32a8071ab..ea4fcd0d640f 100644 --- a/core/trino-main/src/main/java/io/trino/type/BlockTypeOperators.java +++ b/core/trino-main/src/main/java/io/trino/type/BlockTypeOperators.java @@ -15,6 +15,7 @@ import com.google.common.cache.CacheBuilder; import com.google.common.util.concurrent.UncheckedExecutionException; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.trino.cache.NonKeyEvictableCache; import io.trino.spi.block.Block; @@ -24,8 +25,6 @@ import io.trino.spi.type.TypeOperators; import org.weakref.jmx.Managed; -import javax.annotation.concurrent.GuardedBy; - import java.lang.invoke.MethodHandle; import java.util.Objects; import java.util.Optional; diff --git a/core/trino-main/src/main/java/io/trino/util/Failures.java b/core/trino-main/src/main/java/io/trino/util/Failures.java index 43a86fba0c5c..99a330c78b51 100644 --- a/core/trino-main/src/main/java/io/trino/util/Failures.java +++ b/core/trino-main/src/main/java/io/trino/util/Failures.java @@ -24,8 +24,7 @@ import io.trino.spi.TrinoException; import io.trino.spi.TrinoTransportException; import io.trino.sql.parser.ParsingException; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Arrays; import java.util.Collection; diff --git a/core/trino-main/src/main/java/io/trino/util/FastutilSetHelper.java b/core/trino-main/src/main/java/io/trino/util/FastutilSetHelper.java index 5e6dd5c10d4b..c6a9803a042e 100644 --- a/core/trino-main/src/main/java/io/trino/util/FastutilSetHelper.java +++ b/core/trino-main/src/main/java/io/trino/util/FastutilSetHelper.java @@ -15,6 +15,7 @@ import com.google.common.cache.CacheBuilder; import com.google.common.util.concurrent.UncheckedExecutionException; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.trino.cache.NonEvictableCache; import io.trino.spi.type.Type; import it.unimi.dsi.fastutil.Hash; @@ -25,8 +26,6 @@ import it.unimi.dsi.fastutil.longs.LongOpenCustomHashSet; import it.unimi.dsi.fastutil.objects.ObjectOpenCustomHashSet; -import javax.annotation.concurrent.GuardedBy; - import java.lang.invoke.MethodHandle; import java.util.Collection; import java.util.Objects; diff --git a/core/trino-main/src/main/java/io/trino/util/FinalizerService.java b/core/trino-main/src/main/java/io/trino/util/FinalizerService.java index 00b779e08eb0..1428f137d6b6 100644 --- a/core/trino-main/src/main/java/io/trino/util/FinalizerService.java +++ b/core/trino-main/src/main/java/io/trino/util/FinalizerService.java @@ -14,13 +14,12 @@ package io.trino.util; import com.google.common.collect.Sets; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.log.Logger; import jakarta.annotation.PostConstruct; import jakarta.annotation.PreDestroy; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.lang.ref.PhantomReference; import java.lang.ref.ReferenceQueue; import java.util.Set; diff --git a/core/trino-main/src/main/java/io/trino/util/PowerOfTwo.java b/core/trino-main/src/main/java/io/trino/util/PowerOfTwo.java index 738ac173164d..b2f81d233f26 100644 --- a/core/trino-main/src/main/java/io/trino/util/PowerOfTwo.java +++ b/core/trino-main/src/main/java/io/trino/util/PowerOfTwo.java @@ -13,8 +13,8 @@ */ package io.trino.util; -import javax.validation.Constraint; -import javax.validation.Payload; +import jakarta.validation.Constraint; +import jakarta.validation.Payload; import java.lang.annotation.Documented; import java.lang.annotation.Retention; diff --git a/core/trino-main/src/main/java/io/trino/util/PowerOfTwoValidator.java b/core/trino-main/src/main/java/io/trino/util/PowerOfTwoValidator.java index 0db5bc65ce26..44559702dade 100644 --- a/core/trino-main/src/main/java/io/trino/util/PowerOfTwoValidator.java +++ b/core/trino-main/src/main/java/io/trino/util/PowerOfTwoValidator.java @@ -13,8 +13,8 @@ */ package io.trino.util; -import javax.validation.ConstraintValidator; -import javax.validation.ConstraintValidatorContext; +import jakarta.validation.ConstraintValidator; +import jakarta.validation.ConstraintValidatorContext; public class PowerOfTwoValidator implements ConstraintValidator diff --git a/core/trino-main/src/test/java/io/trino/execution/MockRemoteTaskFactory.java b/core/trino-main/src/test/java/io/trino/execution/MockRemoteTaskFactory.java index 2855d4f34e37..609caea6faff 100644 --- a/core/trino-main/src/test/java/io/trino/execution/MockRemoteTaskFactory.java +++ b/core/trino-main/src/test/java/io/trino/execution/MockRemoteTaskFactory.java @@ -21,6 +21,7 @@ import com.google.common.collect.Multimap; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.stats.TestingGcMonitor; import io.airlift.units.DataSize; import io.airlift.units.Duration; @@ -54,8 +55,6 @@ import io.trino.testing.TestingMetadata.TestingColumnHandle; import org.joda.time.DateTime; -import javax.annotation.concurrent.GuardedBy; - import java.net.URI; import java.util.ArrayList; import java.util.HashSet; diff --git a/core/trino-main/src/test/java/io/trino/execution/TestSqlTaskManager.java b/core/trino-main/src/test/java/io/trino/execution/TestSqlTaskManager.java index b59a2f120e81..6015e4eb3ed3 100644 --- a/core/trino-main/src/test/java/io/trino/execution/TestSqlTaskManager.java +++ b/core/trino-main/src/test/java/io/trino/execution/TestSqlTaskManager.java @@ -19,6 +19,7 @@ import com.google.common.collect.ImmutableSet; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.node.NodeInfo; import io.airlift.stats.TestingGcMonitor; import io.airlift.testing.TestingTicker; @@ -56,8 +57,6 @@ import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; -import javax.annotation.concurrent.GuardedBy; - import java.net.URI; import java.util.List; import java.util.Optional; diff --git a/core/trino-main/src/test/java/io/trino/execution/TestingRemoteTaskFactory.java b/core/trino-main/src/test/java/io/trino/execution/TestingRemoteTaskFactory.java index 5448645b2475..a497c84e1786 100644 --- a/core/trino-main/src/test/java/io/trino/execution/TestingRemoteTaskFactory.java +++ b/core/trino-main/src/test/java/io/trino/execution/TestingRemoteTaskFactory.java @@ -20,6 +20,7 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Multimap; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.stats.TDigest; import io.airlift.units.DataSize; import io.airlift.units.Duration; @@ -41,8 +42,6 @@ import io.trino.sql.planner.plan.PlanNodeId; import org.joda.time.DateTime; -import javax.annotation.concurrent.GuardedBy; - import java.net.URI; import java.util.HashMap; import java.util.List; diff --git a/core/trino-main/src/test/java/io/trino/execution/buffer/TestClientBuffer.java b/core/trino-main/src/test/java/io/trino/execution/buffer/TestClientBuffer.java index c93dd792c2f2..d65655ba77fd 100644 --- a/core/trino-main/src/test/java/io/trino/execution/buffer/TestClientBuffer.java +++ b/core/trino-main/src/test/java/io/trino/execution/buffer/TestClientBuffer.java @@ -15,6 +15,8 @@ import com.google.common.collect.ImmutableList; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.units.DataSize; import io.airlift.units.Duration; import io.trino.execution.buffer.ClientBuffer.PagesSupplier; @@ -24,9 +26,6 @@ import io.trino.spi.type.BigintType; import org.testng.annotations.Test; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Deque; diff --git a/core/trino-main/src/test/java/io/trino/execution/scheduler/TestEventDrivenTaskSource.java b/core/trino-main/src/test/java/io/trino/execution/scheduler/TestEventDrivenTaskSource.java index a5320299276d..f93595f50f50 100644 --- a/core/trino-main/src/test/java/io/trino/execution/scheduler/TestEventDrivenTaskSource.java +++ b/core/trino-main/src/test/java/io/trino/execution/scheduler/TestEventDrivenTaskSource.java @@ -25,6 +25,7 @@ import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListeningScheduledExecutorService; import com.google.common.util.concurrent.SettableFuture; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.trino.exchange.SpoolingExchangeInput; import io.trino.execution.TableExecuteContextManager; import io.trino.execution.scheduler.SplitAssigner.AssignmentResult; @@ -46,8 +47,6 @@ import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; -import javax.annotation.concurrent.GuardedBy; - import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; diff --git a/core/trino-main/src/test/java/io/trino/metadata/TestDiscoveryNodeManager.java b/core/trino-main/src/test/java/io/trino/metadata/TestDiscoveryNodeManager.java index 5a29fa90b86d..28113fd19478 100644 --- a/core/trino-main/src/test/java/io/trino/metadata/TestDiscoveryNodeManager.java +++ b/core/trino-main/src/test/java/io/trino/metadata/TestDiscoveryNodeManager.java @@ -18,6 +18,7 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.discovery.client.ServiceDescriptor; import io.airlift.discovery.client.ServiceSelector; import io.airlift.http.client.HttpClient; @@ -34,8 +35,6 @@ import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; -import javax.annotation.concurrent.GuardedBy; - import java.net.URI; import java.util.List; import java.util.Set; diff --git a/core/trino-main/src/test/java/io/trino/operator/output/TestPositionsAppender.java b/core/trino-main/src/test/java/io/trino/operator/output/TestPositionsAppender.java index f74877be330c..9998d8471a8e 100644 --- a/core/trino-main/src/test/java/io/trino/operator/output/TestPositionsAppender.java +++ b/core/trino-main/src/test/java/io/trino/operator/output/TestPositionsAppender.java @@ -43,11 +43,10 @@ import io.trino.type.BlockTypeOperators; import io.trino.type.UnknownType; import it.unimi.dsi.fastutil.ints.IntArrayList; +import jakarta.annotation.Nullable; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; -import javax.annotation.Nullable; - import java.util.Arrays; import java.util.List; import java.util.Optional; diff --git a/core/trino-main/src/test/java/io/trino/operator/scalar/TestScalarValidation.java b/core/trino-main/src/test/java/io/trino/operator/scalar/TestScalarValidation.java index 10cf45706ec3..3e4927d96387 100644 --- a/core/trino-main/src/test/java/io/trino/operator/scalar/TestScalarValidation.java +++ b/core/trino-main/src/test/java/io/trino/operator/scalar/TestScalarValidation.java @@ -23,10 +23,9 @@ import io.trino.spi.function.TypeParameter; import io.trino.spi.type.StandardTypes; import io.trino.spi.type.Type; +import jakarta.annotation.Nullable; import org.testng.annotations.Test; -import javax.annotation.Nullable; - @SuppressWarnings("UtilityClassWithoutPrivateConstructor") public class TestScalarValidation { diff --git a/core/trino-main/src/test/java/io/trino/server/ui/TestWebUi.java b/core/trino-main/src/test/java/io/trino/server/ui/TestWebUi.java index 9771497c2999..24c7c6b10eb5 100644 --- a/core/trino-main/src/test/java/io/trino/server/ui/TestWebUi.java +++ b/core/trino-main/src/test/java/io/trino/server/ui/TestWebUi.java @@ -18,6 +18,7 @@ import com.google.common.hash.Hashing; import com.google.common.io.BaseEncoding; import com.google.common.io.Resources; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import com.google.inject.Key; import io.airlift.http.server.HttpServerConfig; @@ -59,7 +60,6 @@ import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; -import javax.annotation.concurrent.GuardedBy; import javax.crypto.SecretKey; import java.io.File; diff --git a/core/trino-parser/pom.xml b/core/trino-parser/pom.xml index 7a0ace4b2181..a7fedd2ac33b 100644 --- a/core/trino-parser/pom.xml +++ b/core/trino-parser/pom.xml @@ -18,12 +18,6 @@ - - com.google.code.findbugs - jsr305 - true - - com.google.errorprone error_prone_annotations @@ -35,6 +29,11 @@ guava + + jakarta.annotation + jakarta.annotation-api + + org.antlr antlr4-runtime diff --git a/core/trino-parser/src/main/java/io/trino/sql/jsonpath/tree/JsonPathTreeVisitor.java b/core/trino-parser/src/main/java/io/trino/sql/jsonpath/tree/JsonPathTreeVisitor.java index 7055897c738d..0249c0b050e1 100644 --- a/core/trino-parser/src/main/java/io/trino/sql/jsonpath/tree/JsonPathTreeVisitor.java +++ b/core/trino-parser/src/main/java/io/trino/sql/jsonpath/tree/JsonPathTreeVisitor.java @@ -13,7 +13,7 @@ */ package io.trino.sql.jsonpath.tree; -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; public abstract class JsonPathTreeVisitor { diff --git a/core/trino-parser/src/main/java/io/trino/sql/parser/RefreshableSqlBaseParserInitializer.java b/core/trino-parser/src/main/java/io/trino/sql/parser/RefreshableSqlBaseParserInitializer.java index 4347afa740e6..ca1d118b1c64 100644 --- a/core/trino-parser/src/main/java/io/trino/sql/parser/RefreshableSqlBaseParserInitializer.java +++ b/core/trino-parser/src/main/java/io/trino/sql/parser/RefreshableSqlBaseParserInitializer.java @@ -14,7 +14,7 @@ package io.trino.sql.parser; -import javax.annotation.concurrent.ThreadSafe; +import com.google.errorprone.annotations.ThreadSafe; import java.util.concurrent.atomic.AtomicReference; import java.util.function.BiConsumer; diff --git a/core/trino-parser/src/main/java/io/trino/sql/testing/TreeAssertions.java b/core/trino-parser/src/main/java/io/trino/sql/testing/TreeAssertions.java index f57151532aac..b68dedfeae8e 100644 --- a/core/trino-parser/src/main/java/io/trino/sql/testing/TreeAssertions.java +++ b/core/trino-parser/src/main/java/io/trino/sql/testing/TreeAssertions.java @@ -21,8 +21,7 @@ import io.trino.sql.tree.DefaultTraversalVisitor; import io.trino.sql.tree.Node; import io.trino.sql.tree.Statement; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.List; diff --git a/core/trino-parser/src/main/java/io/trino/sql/tree/AstVisitor.java b/core/trino-parser/src/main/java/io/trino/sql/tree/AstVisitor.java index b45fd5a941c1..fb47eb92bd78 100644 --- a/core/trino-parser/src/main/java/io/trino/sql/tree/AstVisitor.java +++ b/core/trino-parser/src/main/java/io/trino/sql/tree/AstVisitor.java @@ -13,7 +13,7 @@ */ package io.trino.sql.tree; -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; public abstract class AstVisitor { diff --git a/core/trino-parser/src/main/java/io/trino/sql/tree/Expression.java b/core/trino-parser/src/main/java/io/trino/sql/tree/Expression.java index 30e8fc555032..b97770bc4a39 100644 --- a/core/trino-parser/src/main/java/io/trino/sql/tree/Expression.java +++ b/core/trino-parser/src/main/java/io/trino/sql/tree/Expression.java @@ -13,10 +13,12 @@ */ package io.trino.sql.tree; +import com.google.errorprone.annotations.Immutable; import io.trino.sql.ExpressionFormatter; import java.util.Optional; +@Immutable public abstract class Expression extends Node { diff --git a/core/trino-parser/src/main/java/io/trino/sql/tree/Extract.java b/core/trino-parser/src/main/java/io/trino/sql/tree/Extract.java index a242276b7300..18d801563459 100644 --- a/core/trino-parser/src/main/java/io/trino/sql/tree/Extract.java +++ b/core/trino-parser/src/main/java/io/trino/sql/tree/Extract.java @@ -14,8 +14,7 @@ package io.trino.sql.tree; import com.google.common.collect.ImmutableList; - -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; import java.util.List; import java.util.Objects; diff --git a/core/trino-spi/pom.xml b/core/trino-spi/pom.xml index d024c53be1ff..a65e6f42911f 100644 --- a/core/trino-spi/pom.xml +++ b/core/trino-spi/pom.xml @@ -26,8 +26,8 @@ - com.google.code.findbugs - jsr305 + com.google.errorprone + error_prone_annotations true @@ -41,6 +41,12 @@ opentelemetry-api + + jakarta.annotation + jakarta.annotation-api + true + + io.opentelemetry opentelemetry-context @@ -463,6 +469,302 @@ @javax.annotation.concurrent.NotThreadSafe Removal of javax.annotation.concurrent usage + + true + java.annotation.removed + method boolean[] io.trino.spi.block.AbstractArrayBlock::getValueIsNull() + method boolean[] io.trino.spi.block.AbstractArrayBlock::getValueIsNull() + @javax.annotation.Nullable + Migration to jakarta namespace + + + true + java.annotation.removed + method boolean[] io.trino.spi.block.AbstractMapBlock::getMapIsNull() + method boolean[] io.trino.spi.block.AbstractMapBlock::getMapIsNull() + @javax.annotation.Nullable + Migration to jakarta namespace + + + true + java.annotation.removed + method int[] io.trino.spi.block.AbstractRowBlock::getFieldBlockOffsets() + method int[] io.trino.spi.block.AbstractRowBlock::getFieldBlockOffsets() + @javax.annotation.Nullable + Migration to jakarta namespace + + + true + java.annotation.removed + method boolean[] io.trino.spi.block.AbstractRowBlock::getRowIsNull() + method boolean[] io.trino.spi.block.AbstractRowBlock::getRowIsNull() + @javax.annotation.Nullable + Migration to jakarta namespace + + + true + java.annotation.removed + method boolean[] io.trino.spi.block.ArrayBlock::getValueIsNull() + method boolean[] io.trino.spi.block.ArrayBlock::getValueIsNull() + @javax.annotation.Nullable + Migration to jakarta namespace + + + true + java.annotation.removed + method boolean[] io.trino.spi.block.ArrayBlockBuilder::getValueIsNull() + method boolean[] io.trino.spi.block.ArrayBlockBuilder::getValueIsNull() + @javax.annotation.Nullable + Migration to jakarta namespace + + + true + java.annotation.removed + parameter void io.trino.spi.block.ByteArrayBlockBuilder::<init>(===io.trino.spi.block.BlockBuilderStatus===, int) + parameter void io.trino.spi.block.ByteArrayBlockBuilder::<init>(===io.trino.spi.block.BlockBuilderStatus===, int) + @javax.annotation.Nullable + Migration to jakarta namespace + + + true + java.annotation.removed + parameter void io.trino.spi.block.Fixed12BlockBuilder::<init>(===io.trino.spi.block.BlockBuilderStatus===, int) + parameter void io.trino.spi.block.Fixed12BlockBuilder::<init>(===io.trino.spi.block.BlockBuilderStatus===, int) + @javax.annotation.Nullable + Migration to jakarta namespace + + + true + java.annotation.removed + parameter void io.trino.spi.block.Int128ArrayBlockBuilder::<init>(===io.trino.spi.block.BlockBuilderStatus===, int) + parameter void io.trino.spi.block.Int128ArrayBlockBuilder::<init>(===io.trino.spi.block.BlockBuilderStatus===, int) + @javax.annotation.Nullable + Migration to jakarta namespace + + + true + java.annotation.removed + parameter void io.trino.spi.block.IntArrayBlockBuilder::<init>(===io.trino.spi.block.BlockBuilderStatus===, int) + parameter void io.trino.spi.block.IntArrayBlockBuilder::<init>(===io.trino.spi.block.BlockBuilderStatus===, int) + @javax.annotation.Nullable + Migration to jakarta namespace + + + true + java.annotation.removed + class io.trino.spi.block.LazyBlock + class io.trino.spi.block.LazyBlock + @javax.annotation.concurrent.NotThreadSafe + Migration to jakarta namespace + + + true + java.annotation.removed + parameter void io.trino.spi.block.LongArrayBlockBuilder::<init>(===io.trino.spi.block.BlockBuilderStatus===, int) + parameter void io.trino.spi.block.LongArrayBlockBuilder::<init>(===io.trino.spi.block.BlockBuilderStatus===, int) + @javax.annotation.Nullable + Migration to jakarta namespace + + + true + java.annotation.removed + method boolean[] io.trino.spi.block.MapBlock::getMapIsNull() + method boolean[] io.trino.spi.block.MapBlock::getMapIsNull() + @javax.annotation.Nullable + Migration to jakarta namespace + + + true + java.annotation.removed + method boolean[] io.trino.spi.block.MapBlockBuilder::getMapIsNull() + method boolean[] io.trino.spi.block.MapBlockBuilder::getMapIsNull() + @javax.annotation.Nullable + Migration to jakarta namespace + + + true + java.annotation.removed + class io.trino.spi.block.MapHashTables + class io.trino.spi.block.MapHashTables + @javax.annotation.concurrent.ThreadSafe + Migration to jakarta namespace + + + true + java.annotation.removed + method int[] io.trino.spi.block.RowBlock::getFieldBlockOffsets() + method int[] io.trino.spi.block.RowBlock::getFieldBlockOffsets() + @javax.annotation.Nullable + Migration to jakarta namespace + + + true + java.annotation.removed + method boolean[] io.trino.spi.block.RowBlock::getRowIsNull() + method boolean[] io.trino.spi.block.RowBlock::getRowIsNull() + @javax.annotation.Nullable + Migration to jakarta namespace + + + true + java.annotation.removed + method int[] io.trino.spi.block.RowBlockBuilder::getFieldBlockOffsets() + method int[] io.trino.spi.block.RowBlockBuilder::getFieldBlockOffsets() + @javax.annotation.Nullable + Migration to jakarta namespace + + + true + java.annotation.removed + method boolean[] io.trino.spi.block.RowBlockBuilder::getRowIsNull() + method boolean[] io.trino.spi.block.RowBlockBuilder::getRowIsNull() + @javax.annotation.Nullable + Migration to jakarta namespace + + + true + java.annotation.removed + parameter long io.trino.spi.block.RunLengthEncodedBlock::getPositionsSizeInBytes(===boolean[]===, int) + parameter long io.trino.spi.block.RunLengthEncodedBlock::getPositionsSizeInBytes(===boolean[]===, int) + @javax.annotation.Nullable + Migration to jakarta namespace + + + true + java.annotation.removed + parameter void io.trino.spi.block.ShortArrayBlockBuilder::<init>(===io.trino.spi.block.BlockBuilderStatus===, int) + parameter void io.trino.spi.block.ShortArrayBlockBuilder::<init>(===io.trino.spi.block.BlockBuilderStatus===, int) + @javax.annotation.Nullable + Migration to jakarta namespace + + + true + java.annotation.removed + parameter void io.trino.spi.block.VariableWidthBlockBuilder::<init>(===io.trino.spi.block.BlockBuilderStatus===, int, int) + parameter void io.trino.spi.block.VariableWidthBlockBuilder::<init>(===io.trino.spi.block.BlockBuilderStatus===, int, int) + @javax.annotation.Nullable + Migration to jakarta namespace + + + true + java.annotation.removed + method java.lang.String io.trino.spi.connector.ColumnMetadata::getComment() + method java.lang.String io.trino.spi.connector.ColumnMetadata::getComment() + @javax.annotation.Nullable + Migration to jakarta namespace + + + true + java.annotation.removed + method java.lang.String io.trino.spi.connector.ColumnMetadata::getExtraInfo() + method java.lang.String io.trino.spi.connector.ColumnMetadata::getExtraInfo() + @javax.annotation.Nullable + Migration to jakarta namespace + + + true + java.annotation.removed + method io.trino.spi.connector.ConnectorTableHandle io.trino.spi.connector.ConnectorMetadata::getTableHandle(io.trino.spi.connector.ConnectorSession, io.trino.spi.connector.SchemaTableName) + method io.trino.spi.connector.ConnectorTableHandle io.trino.spi.connector.ConnectorMetadata::getTableHandle(io.trino.spi.connector.ConnectorSession, io.trino.spi.connector.SchemaTableName) + @javax.annotation.Nullable + Migration to jakarta namespace + + + true + java.annotation.removed + method io.trino.spi.connector.ConnectorTableHandle io.trino.spi.connector.ConnectorMetadata::getTableHandle(io.trino.spi.connector.ConnectorSession, io.trino.spi.connector.SchemaTableName, java.util.Optional<io.trino.spi.connector.ConnectorTableVersion>, java.util.Optional<io.trino.spi.connector.ConnectorTableVersion>) + method io.trino.spi.connector.ConnectorTableHandle io.trino.spi.connector.ConnectorMetadata::getTableHandle(io.trino.spi.connector.ConnectorSession, io.trino.spi.connector.SchemaTableName, java.util.Optional<io.trino.spi.connector.ConnectorTableVersion>, java.util.Optional<io.trino.spi.connector.ConnectorTableVersion>) + @javax.annotation.Nullable + Migration to jakarta namespace + + + true + java.annotation.removed + parameter void io.trino.spi.expression.Constant::<init>(===java.lang.Object===, io.trino.spi.type.Type) + parameter void io.trino.spi.expression.Constant::<init>(===java.lang.Object===, io.trino.spi.type.Type) + @javax.annotation.Nullable + Migration to jakarta namespace + + + true + java.annotation.removed + method java.lang.Object io.trino.spi.expression.Constant::getValue() + method java.lang.Object io.trino.spi.expression.Constant::getValue() + @javax.annotation.Nullable + Migration to jakarta namespace + + + true + java.annotation.removed + parameter io.trino.spi.block.Block io.trino.spi.predicate.Utils::nativeValueToBlock(io.trino.spi.type.Type, ===java.lang.Object===) + parameter io.trino.spi.block.Block io.trino.spi.predicate.Utils::nativeValueToBlock(io.trino.spi.type.Type, ===java.lang.Object===) + @javax.annotation.Nullable + Migration to jakarta namespace + + + true + java.annotation.removed + parameter void io.trino.spi.procedure.Procedure.Argument::<init>(java.lang.String, boolean, io.trino.spi.type.Type, boolean, ===java.lang.Object===) + parameter void io.trino.spi.procedure.Procedure.Argument::<init>(java.lang.String, boolean, io.trino.spi.type.Type, boolean, ===java.lang.Object===) + @javax.annotation.Nullable + Migration to jakarta namespace + + + true + java.annotation.removed + parameter void io.trino.spi.procedure.Procedure.Argument::<init>(java.lang.String, io.trino.spi.type.Type, boolean, ===java.lang.Object===) + parameter void io.trino.spi.procedure.Procedure.Argument::<init>(java.lang.String, io.trino.spi.type.Type, boolean, ===java.lang.Object===) + @javax.annotation.Nullable + Migration to jakarta namespace + + + true + java.annotation.removed + class io.trino.spi.type.NamedTypeSignature + class io.trino.spi.type.NamedTypeSignature + @javax.annotation.concurrent.Immutable + Migration to jakarta namespace + + + true + java.annotation.removed + class io.trino.spi.type.RowFieldName + class io.trino.spi.type.RowFieldName + @javax.annotation.concurrent.Immutable + Migration to jakarta namespace + + + true + java.annotation.removed + class io.trino.spi.type.TypeSignature + class io.trino.spi.type.TypeSignature + @javax.annotation.concurrent.Immutable + Migration to jakarta namespace + + + true + java.annotation.removed + class io.trino.spi.Location + class io.trino.spi.Location + @javax.annotation.concurrent.Immutable + Migration to jakarta namespace + + + true + java.annotation.removed + class io.trino.spi.type.TypeSignatureParameter + class io.trino.spi.type.TypeSignatureParameter + @javax.annotation.concurrent.Immutable + Migration to jakarta namespace + + + true + java.annotation.removed + parameter void io.trino.spi.type.TypeUtils::writeNativeValue(io.trino.spi.type.Type, io.trino.spi.block.BlockBuilder, ===java.lang.Object===) + parameter void io.trino.spi.type.TypeUtils::writeNativeValue(io.trino.spi.type.Type, io.trino.spi.block.BlockBuilder, ===java.lang.Object===) + @javax.annotation.Nullable + Migration to jakarta namespace + diff --git a/core/trino-spi/src/main/java/io/trino/spi/Location.java b/core/trino-spi/src/main/java/io/trino/spi/Location.java index 33b361f6d548..9a20b7757957 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/Location.java +++ b/core/trino-spi/src/main/java/io/trino/spi/Location.java @@ -13,7 +13,7 @@ */ package io.trino.spi; -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; @Immutable public class Location diff --git a/core/trino-spi/src/main/java/io/trino/spi/block/AbstractArrayBlock.java b/core/trino-spi/src/main/java/io/trino/spi/block/AbstractArrayBlock.java index f12e296a6cf5..3c9fb3154400 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/block/AbstractArrayBlock.java +++ b/core/trino-spi/src/main/java/io/trino/spi/block/AbstractArrayBlock.java @@ -13,7 +13,7 @@ */ package io.trino.spi.block; -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.List; import java.util.OptionalInt; diff --git a/core/trino-spi/src/main/java/io/trino/spi/block/AbstractMapBlock.java b/core/trino-spi/src/main/java/io/trino/spi/block/AbstractMapBlock.java index 0a9da03669ea..435d3ce1e832 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/block/AbstractMapBlock.java +++ b/core/trino-spi/src/main/java/io/trino/spi/block/AbstractMapBlock.java @@ -15,8 +15,7 @@ package io.trino.spi.block; import io.trino.spi.type.MapType; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Arrays; import java.util.List; diff --git a/core/trino-spi/src/main/java/io/trino/spi/block/AbstractRowBlock.java b/core/trino-spi/src/main/java/io/trino/spi/block/AbstractRowBlock.java index 6017bb29a8ed..ad3c6f773470 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/block/AbstractRowBlock.java +++ b/core/trino-spi/src/main/java/io/trino/spi/block/AbstractRowBlock.java @@ -13,7 +13,7 @@ */ package io.trino.spi.block; -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.List; import java.util.OptionalInt; diff --git a/core/trino-spi/src/main/java/io/trino/spi/block/ArrayBlock.java b/core/trino-spi/src/main/java/io/trino/spi/block/ArrayBlock.java index d4bdbe3a0bdb..c617bd96fdca 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/block/ArrayBlock.java +++ b/core/trino-spi/src/main/java/io/trino/spi/block/ArrayBlock.java @@ -13,7 +13,7 @@ */ package io.trino.spi.block; -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Optional; import java.util.function.ObjLongConsumer; diff --git a/core/trino-spi/src/main/java/io/trino/spi/block/ArrayBlockBuilder.java b/core/trino-spi/src/main/java/io/trino/spi/block/ArrayBlockBuilder.java index d660e6035465..31e793dcb300 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/block/ArrayBlockBuilder.java +++ b/core/trino-spi/src/main/java/io/trino/spi/block/ArrayBlockBuilder.java @@ -14,8 +14,7 @@ package io.trino.spi.block; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Arrays; import java.util.function.ObjLongConsumer; diff --git a/core/trino-spi/src/main/java/io/trino/spi/block/BlockUtil.java b/core/trino-spi/src/main/java/io/trino/spi/block/BlockUtil.java index 0a460061124d..69dd522d696c 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/block/BlockUtil.java +++ b/core/trino-spi/src/main/java/io/trino/spi/block/BlockUtil.java @@ -15,8 +15,7 @@ import io.airlift.slice.Slice; import io.airlift.slice.Slices; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Arrays; diff --git a/core/trino-spi/src/main/java/io/trino/spi/block/ByteArrayBlock.java b/core/trino-spi/src/main/java/io/trino/spi/block/ByteArrayBlock.java index b781c0cf3069..da643b1aa370 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/block/ByteArrayBlock.java +++ b/core/trino-spi/src/main/java/io/trino/spi/block/ByteArrayBlock.java @@ -15,8 +15,7 @@ import io.airlift.slice.Slice; import io.airlift.slice.Slices; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Optional; import java.util.OptionalInt; diff --git a/core/trino-spi/src/main/java/io/trino/spi/block/ByteArrayBlockBuilder.java b/core/trino-spi/src/main/java/io/trino/spi/block/ByteArrayBlockBuilder.java index acbd7cd8beff..3a056d6cf4cb 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/block/ByteArrayBlockBuilder.java +++ b/core/trino-spi/src/main/java/io/trino/spi/block/ByteArrayBlockBuilder.java @@ -15,8 +15,7 @@ import io.airlift.slice.Slice; import io.airlift.slice.Slices; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Arrays; import java.util.OptionalInt; diff --git a/core/trino-spi/src/main/java/io/trino/spi/block/ColumnarRow.java b/core/trino-spi/src/main/java/io/trino/spi/block/ColumnarRow.java index f7685f1e09cd..6eb174484b8c 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/block/ColumnarRow.java +++ b/core/trino-spi/src/main/java/io/trino/spi/block/ColumnarRow.java @@ -13,7 +13,7 @@ */ package io.trino.spi.block; -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import static java.util.Objects.requireNonNull; diff --git a/core/trino-spi/src/main/java/io/trino/spi/block/EncoderUtil.java b/core/trino-spi/src/main/java/io/trino/spi/block/EncoderUtil.java index 5161ff32be8c..5f415a25e5c5 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/block/EncoderUtil.java +++ b/core/trino-spi/src/main/java/io/trino/spi/block/EncoderUtil.java @@ -15,8 +15,7 @@ import io.airlift.slice.SliceInput; import io.airlift.slice.SliceOutput; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/core/trino-spi/src/main/java/io/trino/spi/block/Fixed12Block.java b/core/trino-spi/src/main/java/io/trino/spi/block/Fixed12Block.java index f6076e6a470b..a90717db3b18 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/block/Fixed12Block.java +++ b/core/trino-spi/src/main/java/io/trino/spi/block/Fixed12Block.java @@ -15,8 +15,7 @@ import io.airlift.slice.Slice; import io.airlift.slice.Slices; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Optional; import java.util.OptionalInt; diff --git a/core/trino-spi/src/main/java/io/trino/spi/block/Fixed12BlockBuilder.java b/core/trino-spi/src/main/java/io/trino/spi/block/Fixed12BlockBuilder.java index 38b9c5f20bfc..4a8f28dacc74 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/block/Fixed12BlockBuilder.java +++ b/core/trino-spi/src/main/java/io/trino/spi/block/Fixed12BlockBuilder.java @@ -15,8 +15,7 @@ import io.airlift.slice.Slice; import io.airlift.slice.Slices; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Arrays; import java.util.OptionalInt; diff --git a/core/trino-spi/src/main/java/io/trino/spi/block/Int128ArrayBlock.java b/core/trino-spi/src/main/java/io/trino/spi/block/Int128ArrayBlock.java index c8e4a5ef3aaa..ec33888f4c12 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/block/Int128ArrayBlock.java +++ b/core/trino-spi/src/main/java/io/trino/spi/block/Int128ArrayBlock.java @@ -15,8 +15,7 @@ import io.airlift.slice.Slice; import io.airlift.slice.Slices; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Optional; import java.util.OptionalInt; diff --git a/core/trino-spi/src/main/java/io/trino/spi/block/Int128ArrayBlockBuilder.java b/core/trino-spi/src/main/java/io/trino/spi/block/Int128ArrayBlockBuilder.java index 692e48610ce2..29608d8f0c95 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/block/Int128ArrayBlockBuilder.java +++ b/core/trino-spi/src/main/java/io/trino/spi/block/Int128ArrayBlockBuilder.java @@ -15,8 +15,7 @@ import io.airlift.slice.Slice; import io.airlift.slice.Slices; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Arrays; import java.util.OptionalInt; diff --git a/core/trino-spi/src/main/java/io/trino/spi/block/IntArrayBlock.java b/core/trino-spi/src/main/java/io/trino/spi/block/IntArrayBlock.java index 34bf08c7ba9a..9ab78927e464 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/block/IntArrayBlock.java +++ b/core/trino-spi/src/main/java/io/trino/spi/block/IntArrayBlock.java @@ -16,8 +16,7 @@ import io.airlift.slice.Slice; import io.airlift.slice.Slices; import io.trino.spi.Experimental; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Optional; import java.util.OptionalInt; diff --git a/core/trino-spi/src/main/java/io/trino/spi/block/IntArrayBlockBuilder.java b/core/trino-spi/src/main/java/io/trino/spi/block/IntArrayBlockBuilder.java index 3d5f1125d49a..6686af86ac95 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/block/IntArrayBlockBuilder.java +++ b/core/trino-spi/src/main/java/io/trino/spi/block/IntArrayBlockBuilder.java @@ -15,8 +15,7 @@ import io.airlift.slice.Slice; import io.airlift.slice.Slices; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Arrays; import java.util.OptionalInt; diff --git a/core/trino-spi/src/main/java/io/trino/spi/block/LazyBlock.java b/core/trino-spi/src/main/java/io/trino/spi/block/LazyBlock.java index 3c85d9d2b692..dc6fb5f00ddb 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/block/LazyBlock.java +++ b/core/trino-spi/src/main/java/io/trino/spi/block/LazyBlock.java @@ -15,8 +15,7 @@ import io.airlift.slice.Slice; import io.airlift.slice.SliceOutput; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.ArrayList; import java.util.List; diff --git a/core/trino-spi/src/main/java/io/trino/spi/block/LongArrayBlock.java b/core/trino-spi/src/main/java/io/trino/spi/block/LongArrayBlock.java index 7c7431979405..687f7e4b0bfd 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/block/LongArrayBlock.java +++ b/core/trino-spi/src/main/java/io/trino/spi/block/LongArrayBlock.java @@ -15,8 +15,7 @@ import io.airlift.slice.Slice; import io.airlift.slice.Slices; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Optional; import java.util.OptionalInt; diff --git a/core/trino-spi/src/main/java/io/trino/spi/block/LongArrayBlockBuilder.java b/core/trino-spi/src/main/java/io/trino/spi/block/LongArrayBlockBuilder.java index 9a36b0a5ddfd..6f5158bef8d4 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/block/LongArrayBlockBuilder.java +++ b/core/trino-spi/src/main/java/io/trino/spi/block/LongArrayBlockBuilder.java @@ -15,8 +15,7 @@ import io.airlift.slice.Slice; import io.airlift.slice.Slices; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Arrays; import java.util.OptionalInt; diff --git a/core/trino-spi/src/main/java/io/trino/spi/block/MapBlock.java b/core/trino-spi/src/main/java/io/trino/spi/block/MapBlock.java index b19ea6ea125b..b37cf990186d 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/block/MapBlock.java +++ b/core/trino-spi/src/main/java/io/trino/spi/block/MapBlock.java @@ -15,8 +15,7 @@ package io.trino.spi.block; import io.trino.spi.type.MapType; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Optional; import java.util.function.ObjLongConsumer; diff --git a/core/trino-spi/src/main/java/io/trino/spi/block/MapBlockBuilder.java b/core/trino-spi/src/main/java/io/trino/spi/block/MapBlockBuilder.java index c64276b4e1ab..c5b1b68f7876 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/block/MapBlockBuilder.java +++ b/core/trino-spi/src/main/java/io/trino/spi/block/MapBlockBuilder.java @@ -15,8 +15,7 @@ package io.trino.spi.block; import io.trino.spi.type.MapType; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Arrays; import java.util.Optional; diff --git a/core/trino-spi/src/main/java/io/trino/spi/block/MapHashTables.java b/core/trino-spi/src/main/java/io/trino/spi/block/MapHashTables.java index 7eb79a3cc470..3c297f0350f6 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/block/MapHashTables.java +++ b/core/trino-spi/src/main/java/io/trino/spi/block/MapHashTables.java @@ -13,12 +13,11 @@ */ package io.trino.spi.block; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.trino.spi.TrinoException; import io.trino.spi.type.MapType; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; +import jakarta.annotation.Nullable; import java.util.Arrays; import java.util.Optional; diff --git a/core/trino-spi/src/main/java/io/trino/spi/block/RowBlock.java b/core/trino-spi/src/main/java/io/trino/spi/block/RowBlock.java index e12440f18be2..fe01877938af 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/block/RowBlock.java +++ b/core/trino-spi/src/main/java/io/trino/spi/block/RowBlock.java @@ -13,7 +13,7 @@ */ package io.trino.spi.block; -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Optional; import java.util.function.ObjLongConsumer; diff --git a/core/trino-spi/src/main/java/io/trino/spi/block/RowBlockBuilder.java b/core/trino-spi/src/main/java/io/trino/spi/block/RowBlockBuilder.java index 7cf82a1541b8..69b2c2ac5822 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/block/RowBlockBuilder.java +++ b/core/trino-spi/src/main/java/io/trino/spi/block/RowBlockBuilder.java @@ -15,8 +15,7 @@ package io.trino.spi.block; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Arrays; import java.util.List; diff --git a/core/trino-spi/src/main/java/io/trino/spi/block/RunLengthEncodedBlock.java b/core/trino-spi/src/main/java/io/trino/spi/block/RunLengthEncodedBlock.java index 5da98c60a087..996d35398c87 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/block/RunLengthEncodedBlock.java +++ b/core/trino-spi/src/main/java/io/trino/spi/block/RunLengthEncodedBlock.java @@ -17,8 +17,7 @@ import io.airlift.slice.SliceOutput; import io.trino.spi.predicate.Utils; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.List; import java.util.OptionalInt; diff --git a/core/trino-spi/src/main/java/io/trino/spi/block/ShortArrayBlock.java b/core/trino-spi/src/main/java/io/trino/spi/block/ShortArrayBlock.java index ca1d5a9dd131..7e285fdc1c78 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/block/ShortArrayBlock.java +++ b/core/trino-spi/src/main/java/io/trino/spi/block/ShortArrayBlock.java @@ -15,8 +15,7 @@ import io.airlift.slice.Slice; import io.airlift.slice.Slices; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Optional; import java.util.OptionalInt; diff --git a/core/trino-spi/src/main/java/io/trino/spi/block/ShortArrayBlockBuilder.java b/core/trino-spi/src/main/java/io/trino/spi/block/ShortArrayBlockBuilder.java index f99193068382..a11a67953a59 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/block/ShortArrayBlockBuilder.java +++ b/core/trino-spi/src/main/java/io/trino/spi/block/ShortArrayBlockBuilder.java @@ -15,8 +15,7 @@ import io.airlift.slice.Slice; import io.airlift.slice.Slices; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Arrays; import java.util.OptionalInt; diff --git a/core/trino-spi/src/main/java/io/trino/spi/block/VariableWidthBlock.java b/core/trino-spi/src/main/java/io/trino/spi/block/VariableWidthBlock.java index 2b94422c1eb6..f66655efebf0 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/block/VariableWidthBlock.java +++ b/core/trino-spi/src/main/java/io/trino/spi/block/VariableWidthBlock.java @@ -16,8 +16,7 @@ import io.airlift.slice.Slice; import io.airlift.slice.SliceOutput; import io.airlift.slice.Slices; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Optional; import java.util.OptionalInt; diff --git a/core/trino-spi/src/main/java/io/trino/spi/block/VariableWidthBlockBuilder.java b/core/trino-spi/src/main/java/io/trino/spi/block/VariableWidthBlockBuilder.java index 7d53dd3027ee..7becbf38e070 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/block/VariableWidthBlockBuilder.java +++ b/core/trino-spi/src/main/java/io/trino/spi/block/VariableWidthBlockBuilder.java @@ -17,8 +17,7 @@ import io.airlift.slice.Slice; import io.airlift.slice.SliceOutput; import io.airlift.slice.Slices; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Arrays; import java.util.OptionalInt; diff --git a/core/trino-spi/src/main/java/io/trino/spi/connector/ColumnMetadata.java b/core/trino-spi/src/main/java/io/trino/spi/connector/ColumnMetadata.java index 1198edf79d41..f54fe7e67873 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/connector/ColumnMetadata.java +++ b/core/trino-spi/src/main/java/io/trino/spi/connector/ColumnMetadata.java @@ -14,8 +14,7 @@ package io.trino.spi.connector; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.LinkedHashMap; import java.util.Map; diff --git a/core/trino-spi/src/main/java/io/trino/spi/connector/ConnectorMetadata.java b/core/trino-spi/src/main/java/io/trino/spi/connector/ConnectorMetadata.java index 40ca581b37b0..433a6254294a 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/connector/ConnectorMetadata.java +++ b/core/trino-spi/src/main/java/io/trino/spi/connector/ConnectorMetadata.java @@ -36,8 +36,7 @@ import io.trino.spi.statistics.TableStatistics; import io.trino.spi.statistics.TableStatisticsMetadata; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.ArrayList; import java.util.Collection; diff --git a/core/trino-spi/src/main/java/io/trino/spi/exchange/Exchange.java b/core/trino-spi/src/main/java/io/trino/spi/exchange/Exchange.java index 2eade75d3004..ad266d75bc25 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/exchange/Exchange.java +++ b/core/trino-spi/src/main/java/io/trino/spi/exchange/Exchange.java @@ -13,10 +13,9 @@ */ package io.trino.spi.exchange; +import com.google.errorprone.annotations.ThreadSafe; import io.trino.spi.Experimental; -import javax.annotation.concurrent.ThreadSafe; - import java.io.Closeable; import java.util.concurrent.CompletableFuture; diff --git a/core/trino-spi/src/main/java/io/trino/spi/exchange/ExchangeManager.java b/core/trino-spi/src/main/java/io/trino/spi/exchange/ExchangeManager.java index 487b2200c5a7..431904072539 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/exchange/ExchangeManager.java +++ b/core/trino-spi/src/main/java/io/trino/spi/exchange/ExchangeManager.java @@ -13,11 +13,10 @@ */ package io.trino.spi.exchange; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.slice.Slice; import io.trino.spi.Experimental; -import javax.annotation.concurrent.ThreadSafe; - /** * Service provider interface for an external exchange *

diff --git a/core/trino-spi/src/main/java/io/trino/spi/exchange/ExchangeSink.java b/core/trino-spi/src/main/java/io/trino/spi/exchange/ExchangeSink.java index efda659db6cc..6cf893baafcb 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/exchange/ExchangeSink.java +++ b/core/trino-spi/src/main/java/io/trino/spi/exchange/ExchangeSink.java @@ -13,11 +13,10 @@ */ package io.trino.spi.exchange; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.slice.Slice; import io.trino.spi.Experimental; -import javax.annotation.concurrent.ThreadSafe; - import java.util.concurrent.CompletableFuture; @ThreadSafe diff --git a/core/trino-spi/src/main/java/io/trino/spi/exchange/ExchangeSource.java b/core/trino-spi/src/main/java/io/trino/spi/exchange/ExchangeSource.java index 96b2e5afcf39..039788af0216 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/exchange/ExchangeSource.java +++ b/core/trino-spi/src/main/java/io/trino/spi/exchange/ExchangeSource.java @@ -13,11 +13,10 @@ */ package io.trino.spi.exchange; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.slice.Slice; import io.trino.spi.Experimental; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.ThreadSafe; +import jakarta.annotation.Nullable; import java.io.Closeable; import java.util.List; diff --git a/core/trino-spi/src/main/java/io/trino/spi/expression/Constant.java b/core/trino-spi/src/main/java/io/trino/spi/expression/Constant.java index aad723864288..f950aae04901 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/expression/Constant.java +++ b/core/trino-spi/src/main/java/io/trino/spi/expression/Constant.java @@ -16,8 +16,7 @@ import io.airlift.slice.Slice; import io.trino.spi.type.BooleanType; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.List; import java.util.Objects; diff --git a/core/trino-spi/src/main/java/io/trino/spi/function/table/ArgumentSpecification.java b/core/trino-spi/src/main/java/io/trino/spi/function/table/ArgumentSpecification.java index 48e9ab483078..ff8fa9583b5c 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/function/table/ArgumentSpecification.java +++ b/core/trino-spi/src/main/java/io/trino/spi/function/table/ArgumentSpecification.java @@ -14,8 +14,7 @@ package io.trino.spi.function.table; import io.trino.spi.Experimental; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import static io.trino.spi.function.table.Preconditions.checkArgument; import static io.trino.spi.function.table.Preconditions.checkNotNullOrEmpty; diff --git a/core/trino-spi/src/main/java/io/trino/spi/function/table/ScalarArgument.java b/core/trino-spi/src/main/java/io/trino/spi/function/table/ScalarArgument.java index 481ae76fb118..c059f1fcbca9 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/function/table/ScalarArgument.java +++ b/core/trino-spi/src/main/java/io/trino/spi/function/table/ScalarArgument.java @@ -19,8 +19,7 @@ import io.trino.spi.expression.ConnectorExpression; import io.trino.spi.predicate.NullableValue; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import static java.util.Objects.requireNonNull; diff --git a/core/trino-spi/src/main/java/io/trino/spi/function/table/TableFunctionProcessorState.java b/core/trino-spi/src/main/java/io/trino/spi/function/table/TableFunctionProcessorState.java index 0149adadf149..8b235210e57d 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/function/table/TableFunctionProcessorState.java +++ b/core/trino-spi/src/main/java/io/trino/spi/function/table/TableFunctionProcessorState.java @@ -15,8 +15,7 @@ import io.trino.spi.Experimental; import io.trino.spi.Page; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.concurrent.CompletableFuture; diff --git a/core/trino-spi/src/main/java/io/trino/spi/predicate/Utils.java b/core/trino-spi/src/main/java/io/trino/spi/predicate/Utils.java index 8e1965005ffc..578d54deaafa 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/predicate/Utils.java +++ b/core/trino-spi/src/main/java/io/trino/spi/predicate/Utils.java @@ -17,8 +17,7 @@ import io.trino.spi.block.BlockBuilder; import io.trino.spi.type.Type; import io.trino.spi.type.TypeOperators; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import static io.trino.spi.type.TypeUtils.readNativeValue; import static io.trino.spi.type.TypeUtils.writeNativeValue; diff --git a/core/trino-spi/src/main/java/io/trino/spi/procedure/Procedure.java b/core/trino-spi/src/main/java/io/trino/spi/procedure/Procedure.java index 5751f13ddefe..ce6cf97c36a5 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/procedure/Procedure.java +++ b/core/trino-spi/src/main/java/io/trino/spi/procedure/Procedure.java @@ -16,8 +16,7 @@ import io.trino.spi.connector.ConnectorAccessControl; import io.trino.spi.connector.ConnectorSession; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.lang.invoke.MethodHandle; import java.util.HashSet; diff --git a/core/trino-spi/src/main/java/io/trino/spi/type/NamedTypeSignature.java b/core/trino-spi/src/main/java/io/trino/spi/type/NamedTypeSignature.java index 90309c2d3460..f0f3ac4382bf 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/type/NamedTypeSignature.java +++ b/core/trino-spi/src/main/java/io/trino/spi/type/NamedTypeSignature.java @@ -13,7 +13,7 @@ */ package io.trino.spi.type; -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; import java.util.Objects; import java.util.Optional; diff --git a/core/trino-spi/src/main/java/io/trino/spi/type/RowFieldName.java b/core/trino-spi/src/main/java/io/trino/spi/type/RowFieldName.java index add8fccb7df0..9ff4c28c5bca 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/type/RowFieldName.java +++ b/core/trino-spi/src/main/java/io/trino/spi/type/RowFieldName.java @@ -13,7 +13,7 @@ */ package io.trino.spi.type; -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; import java.util.Objects; diff --git a/core/trino-spi/src/main/java/io/trino/spi/type/TypeSignature.java b/core/trino-spi/src/main/java/io/trino/spi/type/TypeSignature.java index bbc69cf6b8ec..3beba11937ba 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/type/TypeSignature.java +++ b/core/trino-spi/src/main/java/io/trino/spi/type/TypeSignature.java @@ -14,8 +14,7 @@ package io.trino.spi.type; import com.fasterxml.jackson.annotation.JsonValue; - -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; import java.util.ArrayList; import java.util.Arrays; diff --git a/core/trino-spi/src/main/java/io/trino/spi/type/TypeSignatureParameter.java b/core/trino-spi/src/main/java/io/trino/spi/type/TypeSignatureParameter.java index 0e0086dcff12..3f6a03de7388 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/type/TypeSignatureParameter.java +++ b/core/trino-spi/src/main/java/io/trino/spi/type/TypeSignatureParameter.java @@ -13,7 +13,7 @@ */ package io.trino.spi.type; -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; import java.util.Objects; import java.util.Optional; diff --git a/core/trino-spi/src/main/java/io/trino/spi/type/TypeUtils.java b/core/trino-spi/src/main/java/io/trino/spi/type/TypeUtils.java index 7f435105ccad..94ef3eefd395 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/type/TypeUtils.java +++ b/core/trino-spi/src/main/java/io/trino/spi/type/TypeUtils.java @@ -18,8 +18,7 @@ import io.trino.spi.TrinoException; import io.trino.spi.block.Block; import io.trino.spi.block.BlockBuilder; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import static io.trino.spi.StandardErrorCode.NOT_SUPPORTED; import static io.trino.spi.type.DoubleType.DOUBLE; diff --git a/lib/trino-cache/pom.xml b/lib/trino-cache/pom.xml index 43cf2bab5bee..0febcc1083c8 100644 --- a/lib/trino-cache/pom.xml +++ b/lib/trino-cache/pom.xml @@ -17,11 +17,6 @@ - - com.google.code.findbugs - jsr305 - - com.google.errorprone error_prone_annotations @@ -32,6 +27,11 @@ guava + + jakarta.annotation + jakarta.annotation-api + + org.gaul modernizer-maven-annotations diff --git a/lib/trino-cache/src/main/java/io/trino/cache/ElementTypesAreNonnullByDefault.java b/lib/trino-cache/src/main/java/io/trino/cache/ElementTypesAreNonnullByDefault.java index 95a43aed87ab..f1900465c540 100644 --- a/lib/trino-cache/src/main/java/io/trino/cache/ElementTypesAreNonnullByDefault.java +++ b/lib/trino-cache/src/main/java/io/trino/cache/ElementTypesAreNonnullByDefault.java @@ -13,15 +13,11 @@ */ package io.trino.cache; -import javax.annotation.Nonnull; -import javax.annotation.meta.TypeQualifierDefault; +import jakarta.annotation.Nonnull; import java.lang.annotation.Retention; import java.lang.annotation.Target; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.PARAMETER; import static java.lang.annotation.ElementType.TYPE; import static java.lang.annotation.RetentionPolicy.SOURCE; @@ -31,6 +27,5 @@ */ @Retention(SOURCE) @Target(TYPE) -@TypeQualifierDefault({FIELD, METHOD, PARAMETER}) @Nonnull @interface ElementTypesAreNonnullByDefault {} diff --git a/lib/trino-cache/src/main/java/io/trino/cache/EmptyCache.java b/lib/trino-cache/src/main/java/io/trino/cache/EmptyCache.java index d545a722e29a..73e587c5fe0d 100644 --- a/lib/trino-cache/src/main/java/io/trino/cache/EmptyCache.java +++ b/lib/trino-cache/src/main/java/io/trino/cache/EmptyCache.java @@ -20,9 +20,7 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.util.concurrent.UncheckedExecutionException; - -import javax.annotation.CheckForNull; -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Collection; import java.util.Map; @@ -46,7 +44,6 @@ class EmptyCache this.statsCounter = recordStats ? new SimpleStatsCounter() : new NoopStatsCounter(); } - @CheckForNull @Override public V getIfPresent(Object key) { diff --git a/lib/trino-cache/src/main/java/io/trino/cache/EvictableCache.java b/lib/trino-cache/src/main/java/io/trino/cache/EvictableCache.java index 54ab01b74f7a..c8bdb0784069 100644 --- a/lib/trino-cache/src/main/java/io/trino/cache/EvictableCache.java +++ b/lib/trino-cache/src/main/java/io/trino/cache/EvictableCache.java @@ -24,11 +24,9 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.util.concurrent.ListenableFuture; +import jakarta.annotation.Nullable; import org.gaul.modernizer_maven_annotations.SuppressModernizer; -import javax.annotation.CheckForNull; -import javax.annotation.Nullable; - import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; @@ -92,7 +90,6 @@ private static LoadingCache buildUnsafeCache(CacheBuilder - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/lib/trino-filesystem-azure/src/main/java/io/trino/filesystem/azure/AzureAuthAccessKeyConfig.java b/lib/trino-filesystem-azure/src/main/java/io/trino/filesystem/azure/AzureAuthAccessKeyConfig.java index 5d93d6c59aaa..e848f4ff1164 100644 --- a/lib/trino-filesystem-azure/src/main/java/io/trino/filesystem/azure/AzureAuthAccessKeyConfig.java +++ b/lib/trino-filesystem-azure/src/main/java/io/trino/filesystem/azure/AzureAuthAccessKeyConfig.java @@ -15,8 +15,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigSecuritySensitive; - -import javax.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotEmpty; public class AzureAuthAccessKeyConfig { diff --git a/lib/trino-filesystem-azure/src/main/java/io/trino/filesystem/azure/AzureAuthOAuthConfig.java b/lib/trino-filesystem-azure/src/main/java/io/trino/filesystem/azure/AzureAuthOAuthConfig.java index c2b4b232c29e..31187efe1836 100644 --- a/lib/trino-filesystem-azure/src/main/java/io/trino/filesystem/azure/AzureAuthOAuthConfig.java +++ b/lib/trino-filesystem-azure/src/main/java/io/trino/filesystem/azure/AzureAuthOAuthConfig.java @@ -15,8 +15,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigSecuritySensitive; - -import javax.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotEmpty; public class AzureAuthOAuthConfig { diff --git a/lib/trino-filesystem-azure/src/main/java/io/trino/filesystem/azure/AzureFileSystemConfig.java b/lib/trino-filesystem-azure/src/main/java/io/trino/filesystem/azure/AzureFileSystemConfig.java index cce572498ed1..a753f52bba33 100644 --- a/lib/trino-filesystem-azure/src/main/java/io/trino/filesystem/azure/AzureFileSystemConfig.java +++ b/lib/trino-filesystem-azure/src/main/java/io/trino/filesystem/azure/AzureFileSystemConfig.java @@ -16,8 +16,7 @@ import io.airlift.configuration.Config; import io.airlift.units.DataSize; import io.airlift.units.DataSize.Unit; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class AzureFileSystemConfig { diff --git a/lib/trino-filesystem-s3/pom.xml b/lib/trino-filesystem-s3/pom.xml index 57e7967c9d3b..700f385a37e6 100644 --- a/lib/trino-filesystem-s3/pom.xml +++ b/lib/trino-filesystem-s3/pom.xml @@ -58,8 +58,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/lib/trino-filesystem-s3/src/main/java/io/trino/filesystem/s3/S3FileSystemConfig.java b/lib/trino-filesystem-s3/src/main/java/io/trino/filesystem/s3/S3FileSystemConfig.java index 95003b08adc1..616e79e7c54b 100644 --- a/lib/trino-filesystem-s3/src/main/java/io/trino/filesystem/s3/S3FileSystemConfig.java +++ b/lib/trino-filesystem-s3/src/main/java/io/trino/filesystem/s3/S3FileSystemConfig.java @@ -20,9 +20,8 @@ import io.airlift.units.DataSize; import io.airlift.units.MaxDataSize; import io.airlift.units.MinDataSize; - -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import static io.airlift.units.DataSize.Unit.MEGABYTE; diff --git a/lib/trino-filesystem/pom.xml b/lib/trino-filesystem/pom.xml index e56596932961..038cbdc009b8 100644 --- a/lib/trino-filesystem/pom.xml +++ b/lib/trino-filesystem/pom.xml @@ -59,8 +59,8 @@ - com.google.code.findbugs - jsr305 + com.google.errorprone + error_prone_annotations runtime diff --git a/lib/trino-filesystem/src/test/java/io/trino/filesystem/TrackingFileSystemFactory.java b/lib/trino-filesystem/src/test/java/io/trino/filesystem/TrackingFileSystemFactory.java index ebe7af333ce5..6732b3186ff9 100644 --- a/lib/trino-filesystem/src/test/java/io/trino/filesystem/TrackingFileSystemFactory.java +++ b/lib/trino-filesystem/src/test/java/io/trino/filesystem/TrackingFileSystemFactory.java @@ -14,11 +14,10 @@ package io.trino.filesystem; import com.google.common.collect.ImmutableMap; +import com.google.errorprone.annotations.Immutable; import io.trino.memory.context.AggregatedMemoryContext; import io.trino.spi.security.ConnectorIdentity; -import javax.annotation.concurrent.Immutable; - import java.io.IOException; import java.io.OutputStream; import java.time.Instant; diff --git a/lib/trino-geospatial-toolkit/pom.xml b/lib/trino-geospatial-toolkit/pom.xml index d0356388065e..20b89b164489 100644 --- a/lib/trino-geospatial-toolkit/pom.xml +++ b/lib/trino-geospatial-toolkit/pom.xml @@ -36,12 +36,6 @@ jackson-databind - - com.google.code.findbugs - jsr305 - true - - com.google.guava guava @@ -62,6 +56,12 @@ trino-spi + + jakarta.annotation + jakarta.annotation-api + true + + org.locationtech.jts jts-core diff --git a/lib/trino-geospatial-toolkit/src/main/java/io/trino/geospatial/serde/GeometrySerde.java b/lib/trino-geospatial-toolkit/src/main/java/io/trino/geospatial/serde/GeometrySerde.java index 329344c301d8..2b3dba0a911b 100644 --- a/lib/trino-geospatial-toolkit/src/main/java/io/trino/geospatial/serde/GeometrySerde.java +++ b/lib/trino-geospatial-toolkit/src/main/java/io/trino/geospatial/serde/GeometrySerde.java @@ -35,8 +35,7 @@ import io.airlift.slice.Slice; import io.airlift.slice.SliceInput; import io.trino.geospatial.GeometryType; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.nio.ByteBuffer; import java.util.ArrayList; diff --git a/lib/trino-hdfs/pom.xml b/lib/trino-hdfs/pom.xml index 6144ba880f7b..95e0f01ed41d 100644 --- a/lib/trino-hdfs/pom.xml +++ b/lib/trino-hdfs/pom.xml @@ -52,8 +52,8 @@ - com.google.code.findbugs - jsr305 + com.google.errorprone + error_prone_annotations true @@ -158,8 +158,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/lib/trino-hdfs/src/main/java/io/trino/hdfs/HdfsConfig.java b/lib/trino-hdfs/src/main/java/io/trino/hdfs/HdfsConfig.java index f9376de756ac..801f19ead198 100644 --- a/lib/trino-hdfs/src/main/java/io/trino/hdfs/HdfsConfig.java +++ b/lib/trino-hdfs/src/main/java/io/trino/hdfs/HdfsConfig.java @@ -22,12 +22,11 @@ import io.airlift.configuration.validation.FileExists; import io.airlift.units.Duration; import io.airlift.units.MinDuration; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Pattern; import org.apache.hadoop.fs.permission.FsPermission; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; - import java.io.File; import java.util.List; import java.util.Optional; diff --git a/lib/trino-hdfs/src/main/java/io/trino/hdfs/authentication/CachingKerberosHadoopAuthentication.java b/lib/trino-hdfs/src/main/java/io/trino/hdfs/authentication/CachingKerberosHadoopAuthentication.java index 64697cc29482..f2731dccde6f 100644 --- a/lib/trino-hdfs/src/main/java/io/trino/hdfs/authentication/CachingKerberosHadoopAuthentication.java +++ b/lib/trino-hdfs/src/main/java/io/trino/hdfs/authentication/CachingKerberosHadoopAuthentication.java @@ -13,9 +13,9 @@ */ package io.trino.hdfs.authentication; +import com.google.errorprone.annotations.concurrent.GuardedBy; import org.apache.hadoop.security.UserGroupInformation; -import javax.annotation.concurrent.GuardedBy; import javax.security.auth.Subject; import javax.security.auth.kerberos.KerberosTicket; diff --git a/lib/trino-hdfs/src/main/java/io/trino/hdfs/authentication/HdfsAuthenticationConfig.java b/lib/trino-hdfs/src/main/java/io/trino/hdfs/authentication/HdfsAuthenticationConfig.java index 1955c29927d5..1f0762584952 100644 --- a/lib/trino-hdfs/src/main/java/io/trino/hdfs/authentication/HdfsAuthenticationConfig.java +++ b/lib/trino-hdfs/src/main/java/io/trino/hdfs/authentication/HdfsAuthenticationConfig.java @@ -15,8 +15,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class HdfsAuthenticationConfig { diff --git a/lib/trino-hdfs/src/main/java/io/trino/hdfs/authentication/HdfsKerberosConfig.java b/lib/trino-hdfs/src/main/java/io/trino/hdfs/authentication/HdfsKerberosConfig.java index a068f6e73fda..3d6df90030ad 100644 --- a/lib/trino-hdfs/src/main/java/io/trino/hdfs/authentication/HdfsKerberosConfig.java +++ b/lib/trino-hdfs/src/main/java/io/trino/hdfs/authentication/HdfsKerberosConfig.java @@ -17,9 +17,8 @@ import io.airlift.configuration.ConfigDescription; import io.airlift.configuration.LegacyConfig; import io.airlift.configuration.validation.FileExists; - -import javax.validation.constraints.AssertTrue; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.AssertTrue; +import jakarta.validation.constraints.NotNull; import java.util.Optional; diff --git a/lib/trino-hdfs/src/main/java/io/trino/hdfs/gcs/HiveGcsConfig.java b/lib/trino-hdfs/src/main/java/io/trino/hdfs/gcs/HiveGcsConfig.java index a7dade77048d..cda101a55f1c 100644 --- a/lib/trino-hdfs/src/main/java/io/trino/hdfs/gcs/HiveGcsConfig.java +++ b/lib/trino-hdfs/src/main/java/io/trino/hdfs/gcs/HiveGcsConfig.java @@ -17,8 +17,7 @@ import io.airlift.configuration.ConfigDescription; import io.airlift.configuration.ConfigSecuritySensitive; import io.airlift.configuration.validation.FileExists; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import static com.google.common.base.Preconditions.checkState; diff --git a/lib/trino-hdfs/src/main/java/io/trino/hdfs/rubix/RubixConfig.java b/lib/trino-hdfs/src/main/java/io/trino/hdfs/rubix/RubixConfig.java index dc1518e1e06b..9973f8a4efcd 100644 --- a/lib/trino-hdfs/src/main/java/io/trino/hdfs/rubix/RubixConfig.java +++ b/lib/trino-hdfs/src/main/java/io/trino/hdfs/rubix/RubixConfig.java @@ -18,10 +18,9 @@ import io.airlift.configuration.ConfigDescription; import io.airlift.units.Duration; import io.airlift.units.MinDuration; - -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import java.util.Optional; diff --git a/lib/trino-hdfs/src/main/java/io/trino/hdfs/rubix/RubixInitializer.java b/lib/trino-hdfs/src/main/java/io/trino/hdfs/rubix/RubixInitializer.java index bcdfb371f097..59e2c5001954 100644 --- a/lib/trino-hdfs/src/main/java/io/trino/hdfs/rubix/RubixInitializer.java +++ b/lib/trino-hdfs/src/main/java/io/trino/hdfs/rubix/RubixInitializer.java @@ -38,11 +38,10 @@ import io.trino.spi.Node; import io.trino.spi.NodeManager; import io.trino.spi.TrinoException; +import jakarta.annotation.Nullable; import jakarta.annotation.PreDestroy; import org.apache.hadoop.conf.Configuration; -import javax.annotation.Nullable; - import java.io.IOException; import java.time.Duration; import java.util.Optional; diff --git a/lib/trino-hdfs/src/main/java/io/trino/hdfs/s3/AwsSdkClientCoreStats.java b/lib/trino-hdfs/src/main/java/io/trino/hdfs/s3/AwsSdkClientCoreStats.java index 2edc3cc1b5e5..88c27e50ca34 100644 --- a/lib/trino-hdfs/src/main/java/io/trino/hdfs/s3/AwsSdkClientCoreStats.java +++ b/lib/trino-hdfs/src/main/java/io/trino/hdfs/s3/AwsSdkClientCoreStats.java @@ -18,13 +18,12 @@ import com.amazonaws.metrics.RequestMetricCollector; import com.amazonaws.util.AWSRequestMetrics; import com.amazonaws.util.TimingInfo; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.stats.CounterStat; import io.airlift.stats.TimeStat; import org.weakref.jmx.Managed; import org.weakref.jmx.Nested; -import javax.annotation.concurrent.ThreadSafe; - import java.util.List; import java.util.concurrent.atomic.AtomicLong; diff --git a/lib/trino-hdfs/src/main/java/io/trino/hdfs/s3/HiveS3Config.java b/lib/trino-hdfs/src/main/java/io/trino/hdfs/s3/HiveS3Config.java index 9c3c224731b1..9a261ee0508e 100644 --- a/lib/trino-hdfs/src/main/java/io/trino/hdfs/s3/HiveS3Config.java +++ b/lib/trino-hdfs/src/main/java/io/trino/hdfs/s3/HiveS3Config.java @@ -25,9 +25,8 @@ import io.airlift.units.MaxDataSize; import io.airlift.units.MinDataSize; import io.airlift.units.MinDuration; - -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import java.io.File; import java.util.List; diff --git a/lib/trino-hdfs/src/main/java/io/trino/hdfs/s3/HiveS3TypeConfig.java b/lib/trino-hdfs/src/main/java/io/trino/hdfs/s3/HiveS3TypeConfig.java index 660bc1fc31ec..db43dde957d8 100644 --- a/lib/trino-hdfs/src/main/java/io/trino/hdfs/s3/HiveS3TypeConfig.java +++ b/lib/trino-hdfs/src/main/java/io/trino/hdfs/s3/HiveS3TypeConfig.java @@ -14,8 +14,7 @@ package io.trino.hdfs.s3; import io.airlift.configuration.Config; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class HiveS3TypeConfig { diff --git a/lib/trino-hdfs/src/main/java/io/trino/hdfs/s3/S3SecurityMappingConfig.java b/lib/trino-hdfs/src/main/java/io/trino/hdfs/s3/S3SecurityMappingConfig.java index 8e379ce1a921..6ec715ff5140 100644 --- a/lib/trino-hdfs/src/main/java/io/trino/hdfs/s3/S3SecurityMappingConfig.java +++ b/lib/trino-hdfs/src/main/java/io/trino/hdfs/s3/S3SecurityMappingConfig.java @@ -16,8 +16,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; import io.airlift.units.Duration; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.util.Optional; diff --git a/lib/trino-hdfs/src/test/java/io/trino/hdfs/authentication/TestHdfsKerberosConfig.java b/lib/trino-hdfs/src/test/java/io/trino/hdfs/authentication/TestHdfsKerberosConfig.java index 18648d8939e6..641bf04e5e47 100644 --- a/lib/trino-hdfs/src/test/java/io/trino/hdfs/authentication/TestHdfsKerberosConfig.java +++ b/lib/trino-hdfs/src/test/java/io/trino/hdfs/authentication/TestHdfsKerberosConfig.java @@ -15,10 +15,9 @@ import com.google.common.collect.ImmutableMap; import io.airlift.configuration.ConfigurationFactory; +import jakarta.validation.constraints.AssertTrue; import org.testng.annotations.Test; -import javax.validation.constraints.AssertTrue; - import java.nio.file.Files; import java.nio.file.Path; import java.util.Map; diff --git a/lib/trino-hdfs/src/test/java/io/trino/hdfs/rubix/TestRubixConfig.java b/lib/trino-hdfs/src/test/java/io/trino/hdfs/rubix/TestRubixConfig.java index 2ff5aa621c05..f964e4e992f8 100644 --- a/lib/trino-hdfs/src/test/java/io/trino/hdfs/rubix/TestRubixConfig.java +++ b/lib/trino-hdfs/src/test/java/io/trino/hdfs/rubix/TestRubixConfig.java @@ -16,12 +16,11 @@ import com.google.common.collect.ImmutableMap; import com.qubole.rubix.spi.CacheConfig; import io.airlift.units.Duration; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import org.testng.annotations.Test; -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; - import java.util.Map; import static io.airlift.configuration.testing.ConfigAssertions.assertFullMapping; @@ -100,7 +99,7 @@ public void testValidation() new RubixConfig() .setCacheTtl(null), "cacheTtl", - "may not be null", + "must not be null", NotNull.class); } } diff --git a/lib/trino-hive-formats/pom.xml b/lib/trino-hive-formats/pom.xml index bcac0500c6bb..3170cfa69cf3 100644 --- a/lib/trino-hive-formats/pom.xml +++ b/lib/trino-hive-formats/pom.xml @@ -28,12 +28,6 @@ jackson-databind - - com.google.code.findbugs - jsr305 - true - - com.google.errorprone error_prone_annotations @@ -86,6 +80,11 @@ trino-spi + + jakarta.annotation + jakarta.annotation-api + + joda-time joda-time diff --git a/lib/trino-hive-formats/src/main/java/io/trino/hive/formats/rcfile/RcFileWriter.java b/lib/trino-hive-formats/src/main/java/io/trino/hive/formats/rcfile/RcFileWriter.java index 3546b831838a..b6ad13a25710 100644 --- a/lib/trino-hive-formats/src/main/java/io/trino/hive/formats/rcfile/RcFileWriter.java +++ b/lib/trino-hive-formats/src/main/java/io/trino/hive/formats/rcfile/RcFileWriter.java @@ -31,8 +31,7 @@ import io.trino.spi.Page; import io.trino.spi.block.Block; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.Closeable; import java.io.IOException; diff --git a/lib/trino-memory-context/pom.xml b/lib/trino-memory-context/pom.xml index 67521c2f4419..a9edcfbf4afa 100644 --- a/lib/trino-memory-context/pom.xml +++ b/lib/trino-memory-context/pom.xml @@ -19,8 +19,8 @@ - com.google.code.findbugs - jsr305 + com.google.errorprone + error_prone_annotations true diff --git a/lib/trino-memory-context/src/main/java/io/trino/memory/context/AbstractAggregatedMemoryContext.java b/lib/trino-memory-context/src/main/java/io/trino/memory/context/AbstractAggregatedMemoryContext.java index cdfbafe3bafe..a9c6df073ac2 100644 --- a/lib/trino-memory-context/src/main/java/io/trino/memory/context/AbstractAggregatedMemoryContext.java +++ b/lib/trino-memory-context/src/main/java/io/trino/memory/context/AbstractAggregatedMemoryContext.java @@ -14,9 +14,8 @@ package io.trino.memory.context; import com.google.common.util.concurrent.ListenableFuture; - -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import static com.google.common.base.MoreObjects.toStringHelper; import static com.google.common.util.concurrent.Futures.immediateVoidFuture; diff --git a/lib/trino-memory-context/src/main/java/io/trino/memory/context/MemoryTrackingContext.java b/lib/trino-memory-context/src/main/java/io/trino/memory/context/MemoryTrackingContext.java index fe43d98099de..ac9a19c656cd 100644 --- a/lib/trino-memory-context/src/main/java/io/trino/memory/context/MemoryTrackingContext.java +++ b/lib/trino-memory-context/src/main/java/io/trino/memory/context/MemoryTrackingContext.java @@ -14,8 +14,7 @@ package io.trino.memory.context; import com.google.common.io.Closer; - -import javax.annotation.concurrent.ThreadSafe; +import com.google.errorprone.annotations.ThreadSafe; import java.io.IOException; diff --git a/lib/trino-memory-context/src/main/java/io/trino/memory/context/SimpleLocalMemoryContext.java b/lib/trino-memory-context/src/main/java/io/trino/memory/context/SimpleLocalMemoryContext.java index fd3438a6fd12..be5b20688727 100644 --- a/lib/trino-memory-context/src/main/java/io/trino/memory/context/SimpleLocalMemoryContext.java +++ b/lib/trino-memory-context/src/main/java/io/trino/memory/context/SimpleLocalMemoryContext.java @@ -14,9 +14,8 @@ package io.trino.memory.context; import com.google.common.util.concurrent.ListenableFuture; - -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import static com.google.common.base.MoreObjects.toStringHelper; import static com.google.common.base.Preconditions.checkArgument; diff --git a/lib/trino-orc/pom.xml b/lib/trino-orc/pom.xml index 8247303752cf..6b9791340cc8 100644 --- a/lib/trino-orc/pom.xml +++ b/lib/trino-orc/pom.xml @@ -82,6 +82,11 @@ fastutil + + jakarta.annotation + jakarta.annotation-api + + joda-time joda-time @@ -92,13 +97,6 @@ jmxutils - - com.google.code.findbugs - jsr305 - provided - true - - org.jetbrains annotations diff --git a/lib/trino-orc/src/main/java/io/trino/orc/OrcOutputBuffer.java b/lib/trino-orc/src/main/java/io/trino/orc/OrcOutputBuffer.java index fe0d36464d2f..a8c6600187ea 100644 --- a/lib/trino-orc/src/main/java/io/trino/orc/OrcOutputBuffer.java +++ b/lib/trino-orc/src/main/java/io/trino/orc/OrcOutputBuffer.java @@ -24,8 +24,7 @@ import io.trino.orc.checkpoint.InputStreamCheckpoint; import io.trino.orc.metadata.CompressionKind; import io.trino.plugin.base.io.ChunkedSliceOutput; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.IOException; import java.io.InputStream; diff --git a/lib/trino-orc/src/main/java/io/trino/orc/OrcWriter.java b/lib/trino-orc/src/main/java/io/trino/orc/OrcWriter.java index b3a3886d3da0..1900e19cdad4 100644 --- a/lib/trino-orc/src/main/java/io/trino/orc/OrcWriter.java +++ b/lib/trino-orc/src/main/java/io/trino/orc/OrcWriter.java @@ -44,8 +44,7 @@ import io.trino.orc.writer.SliceDictionaryColumnWriter; import io.trino.spi.Page; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.Closeable; import java.io.IOException; diff --git a/lib/trino-orc/src/main/java/io/trino/orc/metadata/statistics/StringStatistics.java b/lib/trino-orc/src/main/java/io/trino/orc/metadata/statistics/StringStatistics.java index 7f9e067aff43..ae87182858bf 100644 --- a/lib/trino-orc/src/main/java/io/trino/orc/metadata/statistics/StringStatistics.java +++ b/lib/trino-orc/src/main/java/io/trino/orc/metadata/statistics/StringStatistics.java @@ -15,8 +15,7 @@ import io.airlift.slice.Slice; import io.trino.orc.metadata.statistics.StatisticsHasher.Hashable; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Objects; diff --git a/lib/trino-orc/src/main/java/io/trino/orc/reader/BooleanColumnReader.java b/lib/trino-orc/src/main/java/io/trino/orc/reader/BooleanColumnReader.java index 14ba6cc6abb3..af396c2838f4 100644 --- a/lib/trino-orc/src/main/java/io/trino/orc/reader/BooleanColumnReader.java +++ b/lib/trino-orc/src/main/java/io/trino/orc/reader/BooleanColumnReader.java @@ -26,8 +26,7 @@ import io.trino.spi.block.RunLengthEncodedBlock; import io.trino.spi.type.BooleanType; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.IOException; import java.time.ZoneId; diff --git a/lib/trino-orc/src/main/java/io/trino/orc/reader/ByteColumnReader.java b/lib/trino-orc/src/main/java/io/trino/orc/reader/ByteColumnReader.java index ae2160d36c5b..052b8ecf440c 100644 --- a/lib/trino-orc/src/main/java/io/trino/orc/reader/ByteColumnReader.java +++ b/lib/trino-orc/src/main/java/io/trino/orc/reader/ByteColumnReader.java @@ -27,8 +27,7 @@ import io.trino.spi.block.IntArrayBlock; import io.trino.spi.block.RunLengthEncodedBlock; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.IOException; import java.time.ZoneId; diff --git a/lib/trino-orc/src/main/java/io/trino/orc/reader/DecimalColumnReader.java b/lib/trino-orc/src/main/java/io/trino/orc/reader/DecimalColumnReader.java index 82a0630d1fea..4f3d8cde5403 100644 --- a/lib/trino-orc/src/main/java/io/trino/orc/reader/DecimalColumnReader.java +++ b/lib/trino-orc/src/main/java/io/trino/orc/reader/DecimalColumnReader.java @@ -31,8 +31,7 @@ import io.trino.spi.type.Decimals; import io.trino.spi.type.Int128Math; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.IOException; import java.time.ZoneId; diff --git a/lib/trino-orc/src/main/java/io/trino/orc/reader/DoubleColumnReader.java b/lib/trino-orc/src/main/java/io/trino/orc/reader/DoubleColumnReader.java index e03f09ce7a1c..cdae9c2bb4eb 100644 --- a/lib/trino-orc/src/main/java/io/trino/orc/reader/DoubleColumnReader.java +++ b/lib/trino-orc/src/main/java/io/trino/orc/reader/DoubleColumnReader.java @@ -27,8 +27,7 @@ import io.trino.spi.block.RunLengthEncodedBlock; import io.trino.spi.type.DoubleType; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.IOException; import java.time.ZoneId; diff --git a/lib/trino-orc/src/main/java/io/trino/orc/reader/FloatColumnReader.java b/lib/trino-orc/src/main/java/io/trino/orc/reader/FloatColumnReader.java index 5e3de784dc11..2371a5cd6d49 100644 --- a/lib/trino-orc/src/main/java/io/trino/orc/reader/FloatColumnReader.java +++ b/lib/trino-orc/src/main/java/io/trino/orc/reader/FloatColumnReader.java @@ -27,8 +27,7 @@ import io.trino.spi.block.LongArrayBlock; import io.trino.spi.block.RunLengthEncodedBlock; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.IOException; import java.time.ZoneId; diff --git a/lib/trino-orc/src/main/java/io/trino/orc/reader/ListColumnReader.java b/lib/trino-orc/src/main/java/io/trino/orc/reader/ListColumnReader.java index c190e3fbcbe4..0448bdb72eb2 100644 --- a/lib/trino-orc/src/main/java/io/trino/orc/reader/ListColumnReader.java +++ b/lib/trino-orc/src/main/java/io/trino/orc/reader/ListColumnReader.java @@ -29,8 +29,7 @@ import io.trino.spi.block.Block; import io.trino.spi.type.ArrayType; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/lib/trino-orc/src/main/java/io/trino/orc/reader/LongColumnReader.java b/lib/trino-orc/src/main/java/io/trino/orc/reader/LongColumnReader.java index 3564af17ab96..2e95693e36fd 100644 --- a/lib/trino-orc/src/main/java/io/trino/orc/reader/LongColumnReader.java +++ b/lib/trino-orc/src/main/java/io/trino/orc/reader/LongColumnReader.java @@ -33,8 +33,7 @@ import io.trino.spi.type.SmallintType; import io.trino.spi.type.TimeType; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.IOException; import java.time.ZoneId; diff --git a/lib/trino-orc/src/main/java/io/trino/orc/reader/MapColumnReader.java b/lib/trino-orc/src/main/java/io/trino/orc/reader/MapColumnReader.java index 2cdc1348d3b1..e9663a3bd8dd 100644 --- a/lib/trino-orc/src/main/java/io/trino/orc/reader/MapColumnReader.java +++ b/lib/trino-orc/src/main/java/io/trino/orc/reader/MapColumnReader.java @@ -29,9 +29,8 @@ import io.trino.spi.type.MapType; import io.trino.spi.type.Type; import it.unimi.dsi.fastutil.ints.IntArrayList; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/lib/trino-orc/src/main/java/io/trino/orc/reader/SliceDictionaryColumnReader.java b/lib/trino-orc/src/main/java/io/trino/orc/reader/SliceDictionaryColumnReader.java index 88ef25c53142..b9859eb79336 100644 --- a/lib/trino-orc/src/main/java/io/trino/orc/reader/SliceDictionaryColumnReader.java +++ b/lib/trino-orc/src/main/java/io/trino/orc/reader/SliceDictionaryColumnReader.java @@ -28,8 +28,7 @@ import io.trino.spi.block.DictionaryBlock; import io.trino.spi.block.RunLengthEncodedBlock; import io.trino.spi.block.VariableWidthBlock; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.IOException; import java.time.ZoneId; diff --git a/lib/trino-orc/src/main/java/io/trino/orc/reader/SliceDirectColumnReader.java b/lib/trino-orc/src/main/java/io/trino/orc/reader/SliceDirectColumnReader.java index 6974cadbda07..cda63c3a9b3a 100644 --- a/lib/trino-orc/src/main/java/io/trino/orc/reader/SliceDirectColumnReader.java +++ b/lib/trino-orc/src/main/java/io/trino/orc/reader/SliceDirectColumnReader.java @@ -29,8 +29,7 @@ import io.trino.spi.block.Block; import io.trino.spi.block.RunLengthEncodedBlock; import io.trino.spi.block.VariableWidthBlock; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.IOException; import java.time.ZoneId; diff --git a/lib/trino-orc/src/main/java/io/trino/orc/reader/StructColumnReader.java b/lib/trino-orc/src/main/java/io/trino/orc/reader/StructColumnReader.java index dadd0d39a650..16238b7a0a1b 100644 --- a/lib/trino-orc/src/main/java/io/trino/orc/reader/StructColumnReader.java +++ b/lib/trino-orc/src/main/java/io/trino/orc/reader/StructColumnReader.java @@ -34,8 +34,7 @@ import io.trino.spi.type.RowType; import io.trino.spi.type.RowType.Field; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/lib/trino-orc/src/main/java/io/trino/orc/reader/TimestampColumnReader.java b/lib/trino-orc/src/main/java/io/trino/orc/reader/TimestampColumnReader.java index 357fbcf9af2d..0a30c3695973 100644 --- a/lib/trino-orc/src/main/java/io/trino/orc/reader/TimestampColumnReader.java +++ b/lib/trino-orc/src/main/java/io/trino/orc/reader/TimestampColumnReader.java @@ -30,10 +30,9 @@ import io.trino.spi.block.RunLengthEncodedBlock; import io.trino.spi.type.TimeZoneKey; import io.trino.spi.type.Type; +import jakarta.annotation.Nullable; import org.joda.time.DateTimeZone; -import javax.annotation.Nullable; - import java.io.IOException; import java.time.LocalDateTime; import java.time.ZoneId; diff --git a/lib/trino-orc/src/main/java/io/trino/orc/reader/UnionColumnReader.java b/lib/trino-orc/src/main/java/io/trino/orc/reader/UnionColumnReader.java index 6d6d35031675..ec54b814fdf7 100644 --- a/lib/trino-orc/src/main/java/io/trino/orc/reader/UnionColumnReader.java +++ b/lib/trino-orc/src/main/java/io/trino/orc/reader/UnionColumnReader.java @@ -35,8 +35,7 @@ import io.trino.spi.block.RunLengthEncodedBlock; import io.trino.spi.type.RowType; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/lib/trino-orc/src/main/java/io/trino/orc/reader/UuidColumnReader.java b/lib/trino-orc/src/main/java/io/trino/orc/reader/UuidColumnReader.java index 9119be6a3561..ce46c7ae87d7 100644 --- a/lib/trino-orc/src/main/java/io/trino/orc/reader/UuidColumnReader.java +++ b/lib/trino-orc/src/main/java/io/trino/orc/reader/UuidColumnReader.java @@ -26,8 +26,7 @@ import io.trino.spi.block.Block; import io.trino.spi.block.Int128ArrayBlock; import io.trino.spi.block.RunLengthEncodedBlock; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.IOException; import java.lang.invoke.MethodHandles; diff --git a/lib/trino-orc/src/main/java/io/trino/orc/stream/AbstractDiskOrcDataReader.java b/lib/trino-orc/src/main/java/io/trino/orc/stream/AbstractDiskOrcDataReader.java index c9a86b440bef..af20fe49af1f 100644 --- a/lib/trino-orc/src/main/java/io/trino/orc/stream/AbstractDiskOrcDataReader.java +++ b/lib/trino-orc/src/main/java/io/trino/orc/stream/AbstractDiskOrcDataReader.java @@ -17,8 +17,7 @@ import io.airlift.slice.Slice; import io.airlift.slice.Slices; import io.trino.orc.OrcDataSourceId; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.IOException; diff --git a/lib/trino-orc/src/main/java/io/trino/orc/stream/CheckpointInputStreamSource.java b/lib/trino-orc/src/main/java/io/trino/orc/stream/CheckpointInputStreamSource.java index 18fa8cef40ac..57fdf8c0b8b9 100644 --- a/lib/trino-orc/src/main/java/io/trino/orc/stream/CheckpointInputStreamSource.java +++ b/lib/trino-orc/src/main/java/io/trino/orc/stream/CheckpointInputStreamSource.java @@ -14,8 +14,7 @@ package io.trino.orc.stream; import io.trino.orc.checkpoint.StreamCheckpoint; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.IOException; diff --git a/lib/trino-orc/src/main/java/io/trino/orc/stream/InputStreamSource.java b/lib/trino-orc/src/main/java/io/trino/orc/stream/InputStreamSource.java index 0ce6918242b5..544043bc6d34 100644 --- a/lib/trino-orc/src/main/java/io/trino/orc/stream/InputStreamSource.java +++ b/lib/trino-orc/src/main/java/io/trino/orc/stream/InputStreamSource.java @@ -13,7 +13,7 @@ */ package io.trino.orc.stream; -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.IOException; diff --git a/lib/trino-orc/src/main/java/io/trino/orc/stream/MissingInputStreamSource.java b/lib/trino-orc/src/main/java/io/trino/orc/stream/MissingInputStreamSource.java index 6f4360aedc78..4a9c2a2d589b 100644 --- a/lib/trino-orc/src/main/java/io/trino/orc/stream/MissingInputStreamSource.java +++ b/lib/trino-orc/src/main/java/io/trino/orc/stream/MissingInputStreamSource.java @@ -13,7 +13,7 @@ */ package io.trino.orc.stream; -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; public class MissingInputStreamSource> implements InputStreamSource diff --git a/lib/trino-orc/src/main/java/io/trino/orc/stream/OrcInputStream.java b/lib/trino-orc/src/main/java/io/trino/orc/stream/OrcInputStream.java index dfb5a76a1951..939a23fd9e0c 100644 --- a/lib/trino-orc/src/main/java/io/trino/orc/stream/OrcInputStream.java +++ b/lib/trino-orc/src/main/java/io/trino/orc/stream/OrcInputStream.java @@ -17,8 +17,7 @@ import io.airlift.slice.Slice; import io.trino.orc.OrcCorruptionException; import io.trino.orc.OrcDataSourceId; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.IOException; import java.io.InputStream; diff --git a/lib/trino-orc/src/main/java/io/trino/orc/stream/PresentOutputStream.java b/lib/trino-orc/src/main/java/io/trino/orc/stream/PresentOutputStream.java index a2ca97569168..18dee5087f83 100644 --- a/lib/trino-orc/src/main/java/io/trino/orc/stream/PresentOutputStream.java +++ b/lib/trino-orc/src/main/java/io/trino/orc/stream/PresentOutputStream.java @@ -18,8 +18,7 @@ import io.trino.orc.metadata.CompressionKind; import io.trino.orc.metadata.OrcColumnId; import io.trino.orc.metadata.Stream; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.ArrayList; import java.util.List; diff --git a/lib/trino-orc/src/main/java/io/trino/orc/stream/ValueInputStreamSource.java b/lib/trino-orc/src/main/java/io/trino/orc/stream/ValueInputStreamSource.java index 3c902d4f8581..b89de8c32985 100644 --- a/lib/trino-orc/src/main/java/io/trino/orc/stream/ValueInputStreamSource.java +++ b/lib/trino-orc/src/main/java/io/trino/orc/stream/ValueInputStreamSource.java @@ -13,7 +13,7 @@ */ package io.trino.orc.stream; -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import static com.google.common.base.MoreObjects.toStringHelper; import static java.util.Objects.requireNonNull; diff --git a/lib/trino-parquet/pom.xml b/lib/trino-parquet/pom.xml index 81f3e47bcaac..8057e3c1243d 100644 --- a/lib/trino-parquet/pom.xml +++ b/lib/trino-parquet/pom.xml @@ -17,12 +17,6 @@ - - com.google.code.findbugs - jsr305 - true - - com.google.guava guava @@ -68,6 +62,11 @@ fastutil + + jakarta.annotation + jakarta.annotation-api + + joda-time joda-time diff --git a/lib/trino-parquet/src/main/java/io/trino/parquet/ParquetTypeUtils.java b/lib/trino-parquet/src/main/java/io/trino/parquet/ParquetTypeUtils.java index 443c6c0211c4..7312f694ac02 100644 --- a/lib/trino-parquet/src/main/java/io/trino/parquet/ParquetTypeUtils.java +++ b/lib/trino-parquet/src/main/java/io/trino/parquet/ParquetTypeUtils.java @@ -20,6 +20,7 @@ import io.trino.spi.type.MapType; import io.trino.spi.type.RowType; import io.trino.spi.type.Type; +import jakarta.annotation.Nullable; import org.apache.parquet.column.ColumnDescriptor; import org.apache.parquet.column.Encoding; import org.apache.parquet.io.ColumnIO; @@ -32,8 +33,6 @@ import org.apache.parquet.schema.LogicalTypeAnnotation.DecimalLogicalTypeAnnotation; import org.apache.parquet.schema.MessageType; -import javax.annotation.Nullable; - import java.math.BigInteger; import java.util.Arrays; import java.util.HashMap; diff --git a/lib/trino-parquet/src/main/java/io/trino/parquet/reader/AbstractColumnReader.java b/lib/trino-parquet/src/main/java/io/trino/parquet/reader/AbstractColumnReader.java index 0c84d2d11e03..599fcf394bd7 100644 --- a/lib/trino-parquet/src/main/java/io/trino/parquet/reader/AbstractColumnReader.java +++ b/lib/trino-parquet/src/main/java/io/trino/parquet/reader/AbstractColumnReader.java @@ -25,10 +25,9 @@ import io.trino.spi.block.Block; import io.trino.spi.block.DictionaryBlock; import io.trino.spi.type.AbstractVariableWidthType; +import jakarta.annotation.Nullable; import org.apache.parquet.io.ParquetDecodingException; -import javax.annotation.Nullable; - import java.util.Optional; import java.util.OptionalLong; diff --git a/lib/trino-parquet/src/main/java/io/trino/parquet/reader/PageReader.java b/lib/trino-parquet/src/main/java/io/trino/parquet/reader/PageReader.java index 6a4c296ff407..1c19115cffdd 100644 --- a/lib/trino-parquet/src/main/java/io/trino/parquet/reader/PageReader.java +++ b/lib/trino-parquet/src/main/java/io/trino/parquet/reader/PageReader.java @@ -21,14 +21,13 @@ import io.trino.parquet.DataPageV2; import io.trino.parquet.DictionaryPage; import io.trino.parquet.Page; +import jakarta.annotation.Nullable; import org.apache.parquet.column.ColumnDescriptor; import org.apache.parquet.column.statistics.Statistics; import org.apache.parquet.format.CompressionCodec; import org.apache.parquet.hadoop.metadata.ColumnChunkMetaData; import org.apache.parquet.internal.column.columnindex.OffsetIndex; -import javax.annotation.Nullable; - import java.io.IOException; import java.util.Iterator; import java.util.Optional; diff --git a/lib/trino-parquet/src/main/java/io/trino/parquet/reader/ParquetColumnChunkIterator.java b/lib/trino-parquet/src/main/java/io/trino/parquet/reader/ParquetColumnChunkIterator.java index e7a9d3bc1f71..1a14d579bc59 100644 --- a/lib/trino-parquet/src/main/java/io/trino/parquet/reader/ParquetColumnChunkIterator.java +++ b/lib/trino-parquet/src/main/java/io/trino/parquet/reader/ParquetColumnChunkIterator.java @@ -18,6 +18,7 @@ import io.trino.parquet.DictionaryPage; import io.trino.parquet.Page; import io.trino.parquet.ParquetCorruptionException; +import jakarta.annotation.Nullable; import org.apache.parquet.column.ColumnDescriptor; import org.apache.parquet.column.Encoding; import org.apache.parquet.format.DataPageHeader; @@ -28,8 +29,6 @@ import org.apache.parquet.hadoop.metadata.ColumnChunkMetaData; import org.apache.parquet.internal.column.columnindex.OffsetIndex; -import javax.annotation.Nullable; - import java.io.IOException; import java.util.Iterator; import java.util.Optional; diff --git a/lib/trino-parquet/src/main/java/io/trino/parquet/reader/ParquetReader.java b/lib/trino-parquet/src/main/java/io/trino/parquet/reader/ParquetReader.java index 414c41de54c1..d8c25025e0e3 100644 --- a/lib/trino-parquet/src/main/java/io/trino/parquet/reader/ParquetReader.java +++ b/lib/trino-parquet/src/main/java/io/trino/parquet/reader/ParquetReader.java @@ -43,6 +43,7 @@ import io.trino.spi.type.RowType; import io.trino.spi.type.Type; import io.trino.spi.type.TypeSignatureParameter; +import jakarta.annotation.Nullable; import org.apache.parquet.column.ColumnDescriptor; import org.apache.parquet.filter2.compat.FilterCompat; import org.apache.parquet.filter2.predicate.FilterPredicate; @@ -54,8 +55,6 @@ import org.apache.parquet.internal.filter2.columnindex.ColumnIndexStore; import org.joda.time.DateTimeZone; -import javax.annotation.Nullable; - import java.io.Closeable; import java.io.IOException; import java.util.HashMap; diff --git a/lib/trino-parquet/src/main/java/io/trino/parquet/reader/PrimitiveColumnReader.java b/lib/trino-parquet/src/main/java/io/trino/parquet/reader/PrimitiveColumnReader.java index 1dc845b9116b..4695f140e1f2 100644 --- a/lib/trino-parquet/src/main/java/io/trino/parquet/reader/PrimitiveColumnReader.java +++ b/lib/trino-parquet/src/main/java/io/trino/parquet/reader/PrimitiveColumnReader.java @@ -26,14 +26,13 @@ import io.trino.spi.type.Type; import it.unimi.dsi.fastutil.ints.IntArrayList; import it.unimi.dsi.fastutil.ints.IntList; +import jakarta.annotation.Nullable; import org.apache.parquet.bytes.ByteBufferInputStream; import org.apache.parquet.bytes.BytesUtils; import org.apache.parquet.column.values.ValuesReader; import org.apache.parquet.column.values.rle.RunLengthBitPackingHybridDecoder; import org.apache.parquet.io.ParquetDecodingException; -import javax.annotation.Nullable; - import java.io.IOException; import java.util.Optional; import java.util.OptionalLong; diff --git a/lib/trino-parquet/src/main/java/io/trino/parquet/reader/TrinoColumnIndexStore.java b/lib/trino-parquet/src/main/java/io/trino/parquet/reader/TrinoColumnIndexStore.java index 413f65646007..041c4e1250ae 100644 --- a/lib/trino-parquet/src/main/java/io/trino/parquet/reader/TrinoColumnIndexStore.java +++ b/lib/trino-parquet/src/main/java/io/trino/parquet/reader/TrinoColumnIndexStore.java @@ -18,6 +18,7 @@ import com.google.common.collect.ListMultimap; import io.trino.parquet.DiskRange; import io.trino.parquet.ParquetDataSource; +import jakarta.annotation.Nullable; import org.apache.parquet.format.Util; import org.apache.parquet.format.converter.ParquetMetadataConverter; import org.apache.parquet.hadoop.metadata.BlockMetaData; @@ -29,8 +30,6 @@ import org.apache.parquet.internal.hadoop.metadata.IndexReference; import org.apache.parquet.schema.PrimitiveType; -import javax.annotation.Nullable; - import java.io.IOException; import java.io.InputStream; import java.util.List; diff --git a/lib/trino-parquet/src/main/java/io/trino/parquet/reader/flat/DictionaryDecoder.java b/lib/trino-parquet/src/main/java/io/trino/parquet/reader/flat/DictionaryDecoder.java index e9d035bae3e8..53f7e251b8d0 100644 --- a/lib/trino-parquet/src/main/java/io/trino/parquet/reader/flat/DictionaryDecoder.java +++ b/lib/trino-parquet/src/main/java/io/trino/parquet/reader/flat/DictionaryDecoder.java @@ -18,8 +18,7 @@ import io.trino.parquet.reader.decoders.RleBitPackingHybridDecoder; import io.trino.parquet.reader.decoders.ValueDecoder; import io.trino.spi.block.Block; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import static java.util.Objects.requireNonNull; diff --git a/lib/trino-parquet/src/main/java/io/trino/parquet/writer/PrimitiveColumnWriter.java b/lib/trino-parquet/src/main/java/io/trino/parquet/writer/PrimitiveColumnWriter.java index 70544ebbaa19..331a9082fcf6 100644 --- a/lib/trino-parquet/src/main/java/io/trino/parquet/writer/PrimitiveColumnWriter.java +++ b/lib/trino-parquet/src/main/java/io/trino/parquet/writer/PrimitiveColumnWriter.java @@ -20,6 +20,7 @@ import io.trino.parquet.writer.repdef.RepLevelWriterProvider; import io.trino.parquet.writer.repdef.RepLevelWriterProviders; import io.trino.parquet.writer.valuewriter.PrimitiveValueWriter; +import jakarta.annotation.Nullable; import org.apache.parquet.bytes.BytesInput; import org.apache.parquet.column.ColumnDescriptor; import org.apache.parquet.column.Encoding; @@ -32,8 +33,6 @@ import org.apache.parquet.format.PageType; import org.apache.parquet.format.converter.ParquetMetadataConverter; -import javax.annotation.Nullable; - import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.ArrayList; diff --git a/lib/trino-parquet/src/test/java/io/trino/parquet/reader/AbstractColumnReaderTest.java b/lib/trino-parquet/src/test/java/io/trino/parquet/reader/AbstractColumnReaderTest.java index 8987cd111b49..f90c4f920374 100644 --- a/lib/trino-parquet/src/test/java/io/trino/parquet/reader/AbstractColumnReaderTest.java +++ b/lib/trino-parquet/src/test/java/io/trino/parquet/reader/AbstractColumnReaderTest.java @@ -32,6 +32,7 @@ import io.trino.spi.block.DictionaryBlock; import io.trino.spi.block.RunLengthEncodedBlock; import io.trino.spi.type.AbstractVariableWidthType; +import jakarta.annotation.Nullable; import org.apache.parquet.bytes.HeapByteBufferAllocator; import org.apache.parquet.column.ColumnDescriptor; import org.apache.parquet.column.values.ValuesWriter; @@ -43,8 +44,6 @@ import org.apache.parquet.schema.Types.PrimitiveBuilder; import org.testng.annotations.Test; -import javax.annotation.Nullable; - import java.io.IOException; import java.util.List; import java.util.Optional; diff --git a/lib/trino-parquet/src/test/java/io/trino/parquet/reader/TestingChunkReader.java b/lib/trino-parquet/src/test/java/io/trino/parquet/reader/TestingChunkReader.java index 464860716f79..b9fc499b8b9b 100644 --- a/lib/trino-parquet/src/test/java/io/trino/parquet/reader/TestingChunkReader.java +++ b/lib/trino-parquet/src/test/java/io/trino/parquet/reader/TestingChunkReader.java @@ -15,8 +15,7 @@ import io.airlift.slice.Slice; import io.trino.parquet.ChunkReader; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import static java.util.Objects.requireNonNull; diff --git a/lib/trino-parquet/src/test/java/io/trino/parquet/reader/TestingColumnReader.java b/lib/trino-parquet/src/test/java/io/trino/parquet/reader/TestingColumnReader.java index 148833cca4f1..c0d817975acb 100644 --- a/lib/trino-parquet/src/test/java/io/trino/parquet/reader/TestingColumnReader.java +++ b/lib/trino-parquet/src/test/java/io/trino/parquet/reader/TestingColumnReader.java @@ -41,6 +41,7 @@ import io.trino.spi.type.TimeZoneKey; import io.trino.spi.type.Timestamps; import io.trino.spi.type.Type; +import jakarta.annotation.Nullable; import org.apache.parquet.bytes.HeapByteBufferAllocator; import org.apache.parquet.column.Encoding; import org.apache.parquet.column.values.ValuesWriter; @@ -59,8 +60,6 @@ import org.apache.parquet.schema.PrimitiveType.PrimitiveTypeName; import org.testng.annotations.DataProvider; -import javax.annotation.Nullable; - import java.io.IOException; import java.io.UncheckedIOException; import java.math.BigInteger; diff --git a/lib/trino-parquet/src/test/java/io/trino/parquet/reader/decoders/AbstractValueDecodersTest.java b/lib/trino-parquet/src/test/java/io/trino/parquet/reader/decoders/AbstractValueDecodersTest.java index 9b464f2b9084..240350d5451a 100644 --- a/lib/trino-parquet/src/test/java/io/trino/parquet/reader/decoders/AbstractValueDecodersTest.java +++ b/lib/trino-parquet/src/test/java/io/trino/parquet/reader/decoders/AbstractValueDecodersTest.java @@ -25,6 +25,7 @@ import io.trino.parquet.reader.flat.DictionaryDecoder; import io.trino.spi.type.DecimalType; import io.trino.spi.type.Type; +import jakarta.annotation.Nullable; import org.apache.parquet.bytes.ByteBufferInputStream; import org.apache.parquet.bytes.HeapByteBufferAllocator; import org.apache.parquet.column.ColumnDescriptor; @@ -46,8 +47,6 @@ import org.testng.annotations.DataProvider; import org.testng.annotations.Test; -import javax.annotation.Nullable; - import java.io.IOException; import java.io.UncheckedIOException; import java.nio.ByteBuffer; diff --git a/lib/trino-plugin-toolkit/pom.xml b/lib/trino-plugin-toolkit/pom.xml index 97fab12487d1..fb80d23fc8f8 100644 --- a/lib/trino-plugin-toolkit/pom.xml +++ b/lib/trino-plugin-toolkit/pom.xml @@ -33,12 +33,6 @@ jackson-databind - - com.google.code.findbugs - jsr305 - true - - com.google.errorprone error_prone_annotations @@ -105,8 +99,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/lib/trino-plugin-toolkit/src/main/java/io/trino/plugin/base/authentication/CachingKerberosAuthentication.java b/lib/trino-plugin-toolkit/src/main/java/io/trino/plugin/base/authentication/CachingKerberosAuthentication.java index c448a566d4ca..d1b524903871 100644 --- a/lib/trino-plugin-toolkit/src/main/java/io/trino/plugin/base/authentication/CachingKerberosAuthentication.java +++ b/lib/trino-plugin-toolkit/src/main/java/io/trino/plugin/base/authentication/CachingKerberosAuthentication.java @@ -13,7 +13,8 @@ */ package io.trino.plugin.base.authentication; -import javax.annotation.concurrent.GuardedBy; +import com.google.errorprone.annotations.concurrent.GuardedBy; + import javax.security.auth.Subject; import javax.security.auth.kerberos.KerberosTicket; diff --git a/lib/trino-plugin-toolkit/src/main/java/io/trino/plugin/base/jmx/RebindSafeMBeanServer.java b/lib/trino-plugin-toolkit/src/main/java/io/trino/plugin/base/jmx/RebindSafeMBeanServer.java index a3f095a74a1e..85e6f1f73a24 100644 --- a/lib/trino-plugin-toolkit/src/main/java/io/trino/plugin/base/jmx/RebindSafeMBeanServer.java +++ b/lib/trino-plugin-toolkit/src/main/java/io/trino/plugin/base/jmx/RebindSafeMBeanServer.java @@ -13,9 +13,9 @@ */ package io.trino.plugin.base.jmx; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.log.Logger; -import javax.annotation.concurrent.ThreadSafe; import javax.management.Attribute; import javax.management.AttributeList; import javax.management.AttributeNotFoundException; diff --git a/lib/trino-plugin-toolkit/src/main/java/io/trino/plugin/base/ldap/LdapClientConfig.java b/lib/trino-plugin-toolkit/src/main/java/io/trino/plugin/base/ldap/LdapClientConfig.java index 9d1b51823b61..4f9c1e0d6324 100644 --- a/lib/trino-plugin-toolkit/src/main/java/io/trino/plugin/base/ldap/LdapClientConfig.java +++ b/lib/trino-plugin-toolkit/src/main/java/io/trino/plugin/base/ldap/LdapClientConfig.java @@ -19,10 +19,9 @@ import io.airlift.configuration.LegacyConfig; import io.airlift.configuration.validation.FileExists; import io.airlift.units.Duration; - -import javax.validation.constraints.AssertTrue; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; +import jakarta.validation.constraints.AssertTrue; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Pattern; import java.io.File; import java.util.Optional; diff --git a/lib/trino-plugin-toolkit/src/main/java/io/trino/plugin/base/security/FileBasedAccessControlConfig.java b/lib/trino-plugin-toolkit/src/main/java/io/trino/plugin/base/security/FileBasedAccessControlConfig.java index e608b90e9544..b6498db87831 100644 --- a/lib/trino-plugin-toolkit/src/main/java/io/trino/plugin/base/security/FileBasedAccessControlConfig.java +++ b/lib/trino-plugin-toolkit/src/main/java/io/trino/plugin/base/security/FileBasedAccessControlConfig.java @@ -17,9 +17,8 @@ import io.airlift.configuration.ConfigDescription; import io.airlift.units.Duration; import io.airlift.units.MinDuration; - -import javax.validation.constraints.AssertTrue; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.AssertTrue; +import jakarta.validation.constraints.NotNull; import java.io.File; diff --git a/lib/trino-plugin-toolkit/src/test/java/io/trino/plugin/base/ldap/TestLdapConfig.java b/lib/trino-plugin-toolkit/src/test/java/io/trino/plugin/base/ldap/TestLdapConfig.java index eb799d29d155..89874bae7b1c 100644 --- a/lib/trino-plugin-toolkit/src/test/java/io/trino/plugin/base/ldap/TestLdapConfig.java +++ b/lib/trino-plugin-toolkit/src/test/java/io/trino/plugin/base/ldap/TestLdapConfig.java @@ -16,12 +16,11 @@ import com.google.common.collect.ImmutableMap; import io.airlift.units.Duration; +import jakarta.validation.constraints.AssertTrue; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Pattern; import org.testng.annotations.Test; -import javax.validation.constraints.AssertTrue; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; - import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; @@ -105,6 +104,6 @@ public void testValidation() assertFailsValidation(new LdapClientConfig().setLdapUrl("localhost"), "ldapUrl", "Invalid LDAP server URL. Expected ldap:// or ldaps://", Pattern.class); assertFailsValidation(new LdapClientConfig().setLdapUrl("ldaps:/localhost"), "ldapUrl", "Invalid LDAP server URL. Expected ldap:// or ldaps://", Pattern.class); - assertFailsValidation(new LdapClientConfig(), "ldapUrl", "may not be null", NotNull.class); + assertFailsValidation(new LdapClientConfig(), "ldapUrl", "must not be null", NotNull.class); } } diff --git a/lib/trino-plugin-toolkit/src/test/java/io/trino/plugin/base/security/TestFileBasedAccessControlConfig.java b/lib/trino-plugin-toolkit/src/test/java/io/trino/plugin/base/security/TestFileBasedAccessControlConfig.java index b218d2672270..7e79e656c65d 100644 --- a/lib/trino-plugin-toolkit/src/test/java/io/trino/plugin/base/security/TestFileBasedAccessControlConfig.java +++ b/lib/trino-plugin-toolkit/src/test/java/io/trino/plugin/base/security/TestFileBasedAccessControlConfig.java @@ -16,11 +16,10 @@ import com.google.common.collect.ImmutableMap; import io.airlift.units.Duration; import io.airlift.units.MinDuration; +import jakarta.validation.constraints.AssertTrue; +import jakarta.validation.constraints.NotNull; import org.testng.annotations.Test; -import javax.validation.constraints.AssertTrue; -import javax.validation.constraints.NotNull; - import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; @@ -94,7 +93,7 @@ public void testValidationWithLocalFile() new FileBasedAccessControlConfig() .setRefreshPeriod(Duration.valueOf("1ms")), "configFile", - "may not be null", + "must not be null", NotNull.class); assertFailsValidation( @@ -132,7 +131,7 @@ public void testValidationWithUrl() new FileBasedAccessControlConfig() .setRefreshPeriod(Duration.valueOf("1ms")), "configFile", - "may not be null", + "must not be null", NotNull.class); assertFailsValidation( @@ -148,7 +147,7 @@ public void testValidationWithUrl() .setConfigFile(securityConfigUrl) .setJsonPointer(null), "jsonPointer", - "may not be null", + "must not be null", NotNull.class); assertValidates( diff --git a/lib/trino-record-decoder/pom.xml b/lib/trino-record-decoder/pom.xml index fdb77c52e68e..49938d5f0de4 100644 --- a/lib/trino-record-decoder/pom.xml +++ b/lib/trino-record-decoder/pom.xml @@ -28,12 +28,6 @@ jackson-databind - - com.google.code.findbugs - jsr305 - true - - com.google.guava guava @@ -80,6 +74,11 @@ trino-spi + + jakarta.annotation + jakarta.annotation-api + + joda-time joda-time diff --git a/lib/trino-record-decoder/src/main/java/io/trino/decoder/protobuf/ProtobufColumnDecoder.java b/lib/trino-record-decoder/src/main/java/io/trino/decoder/protobuf/ProtobufColumnDecoder.java index 609fd5cb00df..ad6478a18701 100644 --- a/lib/trino-record-decoder/src/main/java/io/trino/decoder/protobuf/ProtobufColumnDecoder.java +++ b/lib/trino-record-decoder/src/main/java/io/trino/decoder/protobuf/ProtobufColumnDecoder.java @@ -47,8 +47,7 @@ import io.trino.spi.type.TypeSignature; import io.trino.spi.type.VarbinaryType; import io.trino.spi.type.VarcharType; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.List; import java.util.Map; diff --git a/lib/trino-record-decoder/src/main/java/io/trino/decoder/protobuf/ProtobufValueProvider.java b/lib/trino-record-decoder/src/main/java/io/trino/decoder/protobuf/ProtobufValueProvider.java index bafffabf27f1..a92ed3ce0fec 100644 --- a/lib/trino-record-decoder/src/main/java/io/trino/decoder/protobuf/ProtobufValueProvider.java +++ b/lib/trino-record-decoder/src/main/java/io/trino/decoder/protobuf/ProtobufValueProvider.java @@ -42,8 +42,7 @@ import io.trino.spi.type.TypeSignature; import io.trino.spi.type.VarbinaryType; import io.trino.spi.type.VarcharType; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Collection; import java.util.List; diff --git a/plugin/trino-accumulo/pom.xml b/plugin/trino-accumulo/pom.xml index 3a9aa1eac545..2ad42a6d85dc 100644 --- a/plugin/trino-accumulo/pom.xml +++ b/plugin/trino-accumulo/pom.xml @@ -102,8 +102,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-accumulo/src/main/java/io/trino/plugin/accumulo/conf/AccumuloConfig.java b/plugin/trino-accumulo/src/main/java/io/trino/plugin/accumulo/conf/AccumuloConfig.java index 1fb2b5ddf438..b509ddd801a9 100644 --- a/plugin/trino-accumulo/src/main/java/io/trino/plugin/accumulo/conf/AccumuloConfig.java +++ b/plugin/trino-accumulo/src/main/java/io/trino/plugin/accumulo/conf/AccumuloConfig.java @@ -17,9 +17,8 @@ import io.airlift.configuration.ConfigDescription; import io.airlift.configuration.ConfigSecuritySensitive; import io.airlift.units.Duration; - -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import java.util.concurrent.TimeUnit; diff --git a/plugin/trino-atop/pom.xml b/plugin/trino-atop/pom.xml index 489e27804ddb..2d8e93bad65f 100644 --- a/plugin/trino-atop/pom.xml +++ b/plugin/trino-atop/pom.xml @@ -19,12 +19,6 @@ - - com.google.code.findbugs - jsr305 - true - - com.google.guava guava @@ -71,8 +65,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopConnectorConfig.java b/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopConnectorConfig.java index 558a6cbafd33..4970619c5856 100644 --- a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopConnectorConfig.java +++ b/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopConnectorConfig.java @@ -18,9 +18,8 @@ import io.airlift.configuration.validation.FileExists; import io.airlift.units.Duration; import io.airlift.units.MinDuration; - -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import java.time.ZoneId; diff --git a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopPageSource.java b/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopPageSource.java index fd0bb77b814b..776cf1111006 100644 --- a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopPageSource.java +++ b/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopPageSource.java @@ -22,8 +22,7 @@ import io.trino.spi.connector.ConnectorPageSource; import io.trino.spi.connector.ConnectorSession; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.time.ZonedDateTime; import java.util.List; diff --git a/plugin/trino-base-jdbc/pom.xml b/plugin/trino-base-jdbc/pom.xml index 3dc93e70ef09..739fa8af993a 100644 --- a/plugin/trino-base-jdbc/pom.xml +++ b/plugin/trino-base-jdbc/pom.xml @@ -24,8 +24,8 @@ - com.google.code.findbugs - jsr305 + com.google.errorprone + error_prone_annotations true @@ -105,8 +105,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/BaseJdbcClient.java b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/BaseJdbcClient.java index 6703811a8d3d..c8f4cdf77262 100644 --- a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/BaseJdbcClient.java +++ b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/BaseJdbcClient.java @@ -43,8 +43,7 @@ import io.trino.spi.type.CharType; import io.trino.spi.type.Type; import io.trino.spi.type.VarcharType; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.IOException; import java.sql.CallableStatement; diff --git a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/BaseJdbcConfig.java b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/BaseJdbcConfig.java index be6474a37c7d..be5106dcf54a 100644 --- a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/BaseJdbcConfig.java +++ b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/BaseJdbcConfig.java @@ -19,18 +19,17 @@ import io.airlift.configuration.ConfigDescription; import io.airlift.units.Duration; import io.airlift.units.MinDuration; - -import javax.validation.constraints.AssertTrue; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; +import jakarta.validation.constraints.AssertTrue; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Pattern; import java.util.Optional; import java.util.Set; import static com.google.common.base.Strings.nullToEmpty; +import static jakarta.validation.constraints.Pattern.Flag.CASE_INSENSITIVE; import static java.util.concurrent.TimeUnit.MILLISECONDS; -import static javax.validation.constraints.Pattern.Flag.CASE_INSENSITIVE; public class BaseJdbcConfig { diff --git a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/DecimalConfig.java b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/DecimalConfig.java index 115873879f00..bd40864a1014 100644 --- a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/DecimalConfig.java +++ b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/DecimalConfig.java @@ -15,10 +15,9 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; - -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import java.math.RoundingMode; diff --git a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcDynamicFilteringConfig.java b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcDynamicFilteringConfig.java index 7d1189437bb4..2791158eee7d 100644 --- a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcDynamicFilteringConfig.java +++ b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcDynamicFilteringConfig.java @@ -16,8 +16,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; import io.airlift.units.Duration; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import static java.util.concurrent.TimeUnit.SECONDS; diff --git a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcDynamicFilteringSplitManager.java b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcDynamicFilteringSplitManager.java index 39e514bd2f80..de6a556c71af 100644 --- a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcDynamicFilteringSplitManager.java +++ b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcDynamicFilteringSplitManager.java @@ -14,6 +14,7 @@ package io.trino.plugin.jdbc; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.airlift.log.Logger; import io.airlift.units.Duration; @@ -25,8 +26,6 @@ import io.trino.spi.connector.Constraint; import io.trino.spi.connector.DynamicFilter; -import javax.annotation.concurrent.GuardedBy; - import java.util.Optional; import java.util.concurrent.CompletableFuture; diff --git a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcMetadataConfig.java b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcMetadataConfig.java index ad55614e4f53..039195481a86 100644 --- a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcMetadataConfig.java +++ b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcMetadataConfig.java @@ -17,8 +17,7 @@ import io.airlift.configuration.ConfigDescription; import io.airlift.configuration.DefunctConfig; import io.airlift.configuration.LegacyConfig; - -import javax.validation.constraints.Min; +import jakarta.validation.constraints.Min; @DefunctConfig("allow-drop-table") public class JdbcMetadataConfig diff --git a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcOutputTableHandle.java b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcOutputTableHandle.java index 4f82100f2168..91c9f5b0eb05 100644 --- a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcOutputTableHandle.java +++ b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcOutputTableHandle.java @@ -19,8 +19,7 @@ import io.trino.spi.connector.ConnectorInsertTableHandle; import io.trino.spi.connector.ConnectorOutputTableHandle; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.List; import java.util.Objects; diff --git a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcRecordCursor.java b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcRecordCursor.java index a785cbedf3c0..e67553c0af40 100644 --- a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcRecordCursor.java +++ b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcRecordCursor.java @@ -20,8 +20,7 @@ import io.trino.spi.connector.ConnectorSession; import io.trino.spi.connector.RecordCursor; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcSortItem.java b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcSortItem.java index 6ce11f1b0c4e..2fcf1addfb0e 100644 --- a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcSortItem.java +++ b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcSortItem.java @@ -15,10 +15,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.errorprone.annotations.Immutable; import io.trino.spi.connector.SortOrder; -import javax.annotation.concurrent.Immutable; - import java.util.Objects; import static java.util.Objects.requireNonNull; diff --git a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcWriteConfig.java b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcWriteConfig.java index 1a08c572e7f4..4e086d1deae7 100644 --- a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcWriteConfig.java +++ b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcWriteConfig.java @@ -15,9 +15,8 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; - -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; public class JdbcWriteConfig { diff --git a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/LazyConnectionFactory.java b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/LazyConnectionFactory.java index 33ec98687b55..f056e07c7b95 100644 --- a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/LazyConnectionFactory.java +++ b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/LazyConnectionFactory.java @@ -13,12 +13,11 @@ */ package io.trino.plugin.jdbc; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.trino.spi.connector.ConnectorSession; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; +import jakarta.annotation.Nullable; import java.sql.Connection; import java.sql.SQLException; diff --git a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/ReusableConnectionFactory.java b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/ReusableConnectionFactory.java index be432db801a7..1250c1aa5bed 100644 --- a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/ReusableConnectionFactory.java +++ b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/ReusableConnectionFactory.java @@ -16,14 +16,13 @@ import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; import com.google.common.cache.RemovalNotification; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.trino.spi.TrinoException; import io.trino.spi.connector.ConnectorSession; import org.gaul.modernizer_maven_annotations.SuppressModernizer; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.sql.Connection; import java.sql.SQLException; import java.time.Duration; diff --git a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/TypeHandlingJdbcConfig.java b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/TypeHandlingJdbcConfig.java index 853b94faddd1..6ae730fee3db 100644 --- a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/TypeHandlingJdbcConfig.java +++ b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/TypeHandlingJdbcConfig.java @@ -16,8 +16,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; import io.airlift.configuration.LegacyConfig; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class TypeHandlingJdbcConfig { diff --git a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/credential/CredentialProviderTypeConfig.java b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/credential/CredentialProviderTypeConfig.java index df0ae78e1728..8886ed1a2108 100644 --- a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/credential/CredentialProviderTypeConfig.java +++ b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/credential/CredentialProviderTypeConfig.java @@ -14,8 +14,7 @@ package io.trino.plugin.jdbc.credential; import io.airlift.configuration.Config; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import static io.trino.plugin.jdbc.credential.CredentialProviderType.INLINE; import static java.util.Objects.requireNonNull; diff --git a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/credential/file/ConfigFileBasedCredentialProviderConfig.java b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/credential/file/ConfigFileBasedCredentialProviderConfig.java index bd3c9424ce0d..48659f54fff7 100644 --- a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/credential/file/ConfigFileBasedCredentialProviderConfig.java +++ b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/credential/file/ConfigFileBasedCredentialProviderConfig.java @@ -16,8 +16,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; import io.airlift.configuration.validation.FileExists; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class ConfigFileBasedCredentialProviderConfig { diff --git a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/credential/keystore/KeyStoreBasedCredentialProviderConfig.java b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/credential/keystore/KeyStoreBasedCredentialProviderConfig.java index 7f7e95f8cd7a..c32f943e2189 100644 --- a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/credential/keystore/KeyStoreBasedCredentialProviderConfig.java +++ b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/credential/keystore/KeyStoreBasedCredentialProviderConfig.java @@ -16,8 +16,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigSecuritySensitive; import io.airlift.configuration.validation.FileExists; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class KeyStoreBasedCredentialProviderConfig { diff --git a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/expression/ExpressionPatternBuilder.java b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/expression/ExpressionPatternBuilder.java index 81cac94ae034..2a5ef7a06550 100644 --- a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/expression/ExpressionPatternBuilder.java +++ b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/expression/ExpressionPatternBuilder.java @@ -14,10 +14,9 @@ package io.trino.plugin.jdbc.expression; import com.google.common.collect.ImmutableMap; +import jakarta.annotation.Nullable; import org.antlr.v4.runtime.ParserRuleContext; -import javax.annotation.Nullable; - import java.util.List; import java.util.Map; import java.util.Optional; diff --git a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/jmx/JdbcApiStats.java b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/jmx/JdbcApiStats.java index 876684714db3..76f646604f18 100644 --- a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/jmx/JdbcApiStats.java +++ b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/jmx/JdbcApiStats.java @@ -13,13 +13,12 @@ */ package io.trino.plugin.jdbc.jmx; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.stats.CounterStat; import io.airlift.stats.TimeStat; import org.weakref.jmx.Managed; import org.weakref.jmx.Nested; -import javax.annotation.concurrent.ThreadSafe; - import static java.util.concurrent.TimeUnit.MILLISECONDS; @ThreadSafe diff --git a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/logging/FormatBasedRemoteQueryModifierConfig.java b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/logging/FormatBasedRemoteQueryModifierConfig.java index 231f1bb833a5..a699b99b6ab4 100644 --- a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/logging/FormatBasedRemoteQueryModifierConfig.java +++ b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/logging/FormatBasedRemoteQueryModifierConfig.java @@ -16,8 +16,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; import io.trino.plugin.base.logging.SessionInterpolatedValues; - -import javax.validation.constraints.AssertTrue; +import jakarta.validation.constraints.AssertTrue; import static io.trino.plugin.base.logging.FormatInterpolator.hasValidPlaceholders; diff --git a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/mapping/CachingIdentifierMapping.java b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/mapping/CachingIdentifierMapping.java index c2e489722006..14b4516ff0e4 100644 --- a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/mapping/CachingIdentifierMapping.java +++ b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/mapping/CachingIdentifierMapping.java @@ -25,8 +25,7 @@ import io.trino.plugin.jdbc.mapping.IdentifierMappingModule.ForCachingIdentifierMapping; import io.trino.spi.TrinoException; import io.trino.spi.security.ConnectorIdentity; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.sql.Connection; import java.sql.ResultSet; diff --git a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/mapping/MappingConfig.java b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/mapping/MappingConfig.java index 4264b564c755..d936b88d0067 100644 --- a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/mapping/MappingConfig.java +++ b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/mapping/MappingConfig.java @@ -17,8 +17,7 @@ import io.airlift.configuration.validation.FileExists; import io.airlift.units.Duration; import io.airlift.units.MinDuration; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.util.Optional; diff --git a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestBaseJdbcConfig.java b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestBaseJdbcConfig.java index 2cf7fb057906..e8cefe57e535 100644 --- a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestBaseJdbcConfig.java +++ b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestBaseJdbcConfig.java @@ -16,10 +16,9 @@ import com.google.common.collect.ImmutableMap; import io.airlift.configuration.ConfigurationFactory; import io.airlift.units.Duration; +import jakarta.validation.constraints.AssertTrue; import org.testng.annotations.Test; -import javax.validation.constraints.AssertTrue; - import java.util.Map; import static io.airlift.configuration.testing.ConfigAssertions.assertFullMapping; @@ -80,9 +79,9 @@ public void testExplicitPropertyMappings() public void testConnectionUrlIsValid() { assertThatThrownBy(() -> buildConfig(ImmutableMap.of("connection-url", "jdbc:"))) - .hasMessageContaining("must match the following regular expression: ^jdbc:[a-z0-9]+:(?s:.*)$"); + .hasMessageContaining("must match \"^jdbc:[a-z0-9]+:(?s:.*)$\""); assertThatThrownBy(() -> buildConfig(ImmutableMap.of("connection-url", "jdbc:protocol"))) - .hasMessageContaining("must match the following regular expression: ^jdbc:[a-z0-9]+:(?s:.*)$"); + .hasMessageContaining("must match \"^jdbc:[a-z0-9]+:(?s:.*)$\""); buildConfig(ImmutableMap.of("connection-url", "jdbc:protocol:uri")); buildConfig(ImmutableMap.of("connection-url", "jdbc:protocol:")); } diff --git a/plugin/trino-bigquery/pom.xml b/plugin/trino-bigquery/pom.xml index ebf70598039c..d798f2d1739b 100644 --- a/plugin/trino-bigquery/pom.xml +++ b/plugin/trino-bigquery/pom.xml @@ -174,11 +174,6 @@ google-cloud-core-http - - com.google.code.findbugs - jsr305 - - com.google.guava guava @@ -277,8 +272,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryConfig.java b/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryConfig.java index 2adc47bc3199..2adfe99b09d4 100644 --- a/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryConfig.java +++ b/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryConfig.java @@ -21,11 +21,10 @@ import io.airlift.units.MinDuration; import io.trino.plugin.base.logging.SessionInterpolatedValues; import jakarta.annotation.PostConstruct; - -import javax.validation.constraints.AssertTrue; -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.AssertTrue; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import java.util.Optional; diff --git a/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryMetadata.java b/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryMetadata.java index 31ef5d1cdbe7..addf2c13258e 100644 --- a/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryMetadata.java +++ b/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryMetadata.java @@ -75,8 +75,7 @@ import io.trino.spi.type.BigintType; import io.trino.spi.type.Type; import io.trino.spi.type.VarcharType; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.IOException; import java.util.Collection; diff --git a/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryProxyConfig.java b/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryProxyConfig.java index e8be0724e3aa..fa84553a8553 100644 --- a/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryProxyConfig.java +++ b/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryProxyConfig.java @@ -22,8 +22,7 @@ import io.airlift.configuration.ConfigSecuritySensitive; import io.airlift.configuration.validation.FileExists; import jakarta.annotation.PostConstruct; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.io.File; import java.net.URI; diff --git a/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryRpcConfig.java b/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryRpcConfig.java index c9224b283204..3cc24e7698d0 100644 --- a/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryRpcConfig.java +++ b/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryRpcConfig.java @@ -18,11 +18,10 @@ import io.airlift.units.Duration; import io.airlift.units.MaxDuration; import io.airlift.units.MinDuration; - -import javax.validation.constraints.DecimalMax; -import javax.validation.constraints.DecimalMin; -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; +import jakarta.validation.constraints.DecimalMax; +import jakarta.validation.constraints.DecimalMin; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; public class BigQueryRpcConfig { diff --git a/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryType.java b/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryType.java index 3f831329201f..de2e04cc56fc 100644 --- a/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryType.java +++ b/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryType.java @@ -39,8 +39,7 @@ import io.trino.spi.type.Type; import io.trino.spi.type.VarbinaryType; import io.trino.spi.type.VarcharType; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.time.Instant; import java.time.LocalDate; diff --git a/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryTypeUtils.java b/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryTypeUtils.java index d73b68aa81d5..ee75deaee3ca 100644 --- a/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryTypeUtils.java +++ b/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryTypeUtils.java @@ -21,8 +21,7 @@ import io.trino.spi.type.RowType; import io.trino.spi.type.Type; import io.trino.spi.type.VarcharType; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.time.LocalDate; import java.time.format.DateTimeFormatter; diff --git a/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/StaticCredentialsConfig.java b/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/StaticCredentialsConfig.java index e36243435009..462e5b00b1ae 100644 --- a/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/StaticCredentialsConfig.java +++ b/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/StaticCredentialsConfig.java @@ -17,8 +17,7 @@ import io.airlift.configuration.ConfigDescription; import io.airlift.configuration.ConfigSecuritySensitive; import io.airlift.configuration.validation.FileExists; - -import javax.validation.constraints.AssertTrue; +import jakarta.validation.constraints.AssertTrue; import java.util.Optional; diff --git a/plugin/trino-cassandra/pom.xml b/plugin/trino-cassandra/pom.xml index 8752a7f2e09f..a9d0b0700e3e 100644 --- a/plugin/trino-cassandra/pom.xml +++ b/plugin/trino-cassandra/pom.xml @@ -52,12 +52,6 @@ jackson-databind - - com.google.code.findbugs - jsr305 - true - - com.google.guava guava @@ -99,8 +93,14 @@ - javax.validation - validation-api + jakarta.annotation + jakarta.annotation-api + true + + + + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-cassandra/src/main/java/io/trino/plugin/cassandra/CassandraClientConfig.java b/plugin/trino-cassandra/src/main/java/io/trino/plugin/cassandra/CassandraClientConfig.java index cb60b962c53b..46de506aff0d 100644 --- a/plugin/trino-cassandra/src/main/java/io/trino/plugin/cassandra/CassandraClientConfig.java +++ b/plugin/trino-cassandra/src/main/java/io/trino/plugin/cassandra/CassandraClientConfig.java @@ -27,11 +27,10 @@ import io.airlift.units.Duration; import io.airlift.units.MaxDuration; import io.airlift.units.MinDuration; - -import javax.annotation.Nullable; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.annotation.Nullable; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import java.io.File; import java.util.Arrays; diff --git a/plugin/trino-clickhouse/pom.xml b/plugin/trino-clickhouse/pom.xml index 1a75aad0a650..309c97b3a07b 100644 --- a/plugin/trino-clickhouse/pom.xml +++ b/plugin/trino-clickhouse/pom.xml @@ -24,11 +24,6 @@ all - - com.google.code.findbugs - jsr305 - - com.google.guava guava diff --git a/plugin/trino-clickhouse/src/main/java/io/trino/plugin/clickhouse/ClickHouseClient.java b/plugin/trino-clickhouse/src/main/java/io/trino/plugin/clickhouse/ClickHouseClient.java index 63b98da269ee..63b3db01663e 100644 --- a/plugin/trino-clickhouse/src/main/java/io/trino/plugin/clickhouse/ClickHouseClient.java +++ b/plugin/trino-clickhouse/src/main/java/io/trino/plugin/clickhouse/ClickHouseClient.java @@ -69,8 +69,7 @@ import io.trino.spi.type.TypeSignature; import io.trino.spi.type.VarbinaryType; import io.trino.spi.type.VarcharType; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.UncheckedIOException; import java.math.BigDecimal; diff --git a/plugin/trino-delta-lake/pom.xml b/plugin/trino-delta-lake/pom.xml index 1d3a1791c6aa..afd84e8208dd 100644 --- a/plugin/trino-delta-lake/pom.xml +++ b/plugin/trino-delta-lake/pom.xml @@ -54,8 +54,8 @@ - com.google.code.findbugs - jsr305 + com.google.errorprone + error_prone_annotations true @@ -165,8 +165,13 @@ - javax.validation - validation-api + jakarta.annotation + jakarta.annotation-api + + + + jakarta.validation + jakarta.validation-api @@ -225,12 +230,6 @@ provided - - com.google.errorprone - error_prone_annotations - runtime - - io.airlift log-manager diff --git a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeConfig.java b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeConfig.java index d9109d5e7143..3ca2af6a8e7a 100644 --- a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeConfig.java +++ b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeConfig.java @@ -21,13 +21,12 @@ import io.airlift.units.DataSize; import io.airlift.units.Duration; import io.trino.plugin.hive.HiveCompressionCodec; +import jakarta.validation.constraints.DecimalMax; +import jakarta.validation.constraints.DecimalMin; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import org.joda.time.DateTimeZone; -import javax.validation.constraints.DecimalMax; -import javax.validation.constraints.DecimalMin; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; - import java.util.Optional; import java.util.TimeZone; import java.util.concurrent.TimeUnit; diff --git a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeMergeSink.java b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeMergeSink.java index 7f63b9e861dc..968ddb77c34b 100644 --- a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeMergeSink.java +++ b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeMergeSink.java @@ -41,13 +41,12 @@ import io.trino.spi.predicate.TupleDomain; import io.trino.spi.type.Type; import io.trino.spi.type.TypeOperators; +import jakarta.annotation.Nullable; import org.apache.parquet.format.CompressionCodec; import org.joda.time.DateTimeZone; import org.roaringbitmap.longlong.LongBitmapDataProvider; import org.roaringbitmap.longlong.Roaring64Bitmap; -import javax.annotation.Nullable; - import java.io.Closeable; import java.io.IOException; import java.util.ArrayList; diff --git a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeMetadata.java b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeMetadata.java index c63687406ba3..ad3081d2b6ea 100644 --- a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeMetadata.java +++ b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeMetadata.java @@ -132,8 +132,7 @@ import io.trino.spi.type.Type; import io.trino.spi.type.TypeManager; import io.trino.spi.type.VarcharType; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.IOException; import java.net.URI; diff --git a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeSecurityConfig.java b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeSecurityConfig.java index abcc2b258625..3e48dee8bf69 100644 --- a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeSecurityConfig.java +++ b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeSecurityConfig.java @@ -15,8 +15,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import static io.trino.plugin.deltalake.DeltaLakeSecurityModule.ALLOW_ALL; diff --git a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeTransactionManager.java b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeTransactionManager.java index 4078b1ffbd62..fa65cd3d8d31 100644 --- a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeTransactionManager.java +++ b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeTransactionManager.java @@ -13,13 +13,12 @@ */ package io.trino.plugin.deltalake; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.trino.spi.classloader.ThreadContextClassLoader; import io.trino.spi.connector.ConnectorTransactionHandle; import io.trino.spi.security.ConnectorIdentity; -import javax.annotation.concurrent.GuardedBy; - import java.util.Map; import java.util.Optional; import java.util.concurrent.ConcurrentHashMap; diff --git a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/expression/SparkExpressionTreeVisitor.java b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/expression/SparkExpressionTreeVisitor.java index ac56463987b8..b10c1f6f5246 100644 --- a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/expression/SparkExpressionTreeVisitor.java +++ b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/expression/SparkExpressionTreeVisitor.java @@ -13,7 +13,7 @@ */ package io.trino.plugin.deltalake.expression; -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; public abstract class SparkExpressionTreeVisitor { diff --git a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/AddFileEntry.java b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/AddFileEntry.java index 1cb4475067fb..5387ee021790 100644 --- a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/AddFileEntry.java +++ b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/AddFileEntry.java @@ -22,8 +22,7 @@ import io.trino.plugin.deltalake.transactionlog.statistics.DeltaLakeFileStatistics; import io.trino.plugin.deltalake.transactionlog.statistics.DeltaLakeJsonFileStatistics; import io.trino.plugin.deltalake.transactionlog.statistics.DeltaLakeParquetFileStatistics; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Map; import java.util.Objects; diff --git a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/DeltaLakeDataFileCacheEntry.java b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/DeltaLakeDataFileCacheEntry.java index 72dbacae6b55..bc5f2f9d56f9 100644 --- a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/DeltaLakeDataFileCacheEntry.java +++ b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/DeltaLakeDataFileCacheEntry.java @@ -14,8 +14,7 @@ package io.trino.plugin.deltalake.transactionlog; import com.google.common.collect.ImmutableList; - -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; import java.util.HashSet; import java.util.LinkedHashMap; diff --git a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/DeltaLakeParquetStatisticsUtils.java b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/DeltaLakeParquetStatisticsUtils.java index 7d0f8d3fff2b..573c99f32ff7 100644 --- a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/DeltaLakeParquetStatisticsUtils.java +++ b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/DeltaLakeParquetStatisticsUtils.java @@ -29,6 +29,7 @@ import io.trino.spi.type.TimestampWithTimeZoneType; import io.trino.spi.type.Type; import io.trino.spi.type.VarcharType; +import jakarta.annotation.Nullable; import org.apache.parquet.column.statistics.BinaryStatistics; import org.apache.parquet.column.statistics.DoubleStatistics; import org.apache.parquet.column.statistics.FloatStatistics; @@ -38,8 +39,6 @@ import org.apache.parquet.hadoop.metadata.ColumnChunkMetaData; import org.apache.parquet.schema.LogicalTypeAnnotation; -import javax.annotation.Nullable; - import java.math.BigDecimal; import java.math.BigInteger; import java.time.Instant; diff --git a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/DeltaLakeSchemaSupport.java b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/DeltaLakeSchemaSupport.java index ef703c9dd130..020b60e51f47 100644 --- a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/DeltaLakeSchemaSupport.java +++ b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/DeltaLakeSchemaSupport.java @@ -41,8 +41,7 @@ import io.trino.spi.type.TypeSignature; import io.trino.spi.type.TypeSignatureParameter; import io.trino.spi.type.VarcharType; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.AbstractMap; import java.util.List; diff --git a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/DeltaLakeTransactionLogEntry.java b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/DeltaLakeTransactionLogEntry.java index 91c992403fdb..3ddc2eff488c 100644 --- a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/DeltaLakeTransactionLogEntry.java +++ b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/DeltaLakeTransactionLogEntry.java @@ -15,8 +15,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import static java.util.Objects.requireNonNull; diff --git a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/TransactionLogParser.java b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/TransactionLogParser.java index 65b9fd6c5487..9f0f0da312cf 100644 --- a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/TransactionLogParser.java +++ b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/TransactionLogParser.java @@ -30,8 +30,7 @@ import io.trino.spi.type.DecimalType; import io.trino.spi.type.Decimals; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.IOException; import java.io.InputStream; diff --git a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/checkpoint/CheckpointBuilder.java b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/checkpoint/CheckpointBuilder.java index 0ec87c4119c8..e96925f6be21 100644 --- a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/checkpoint/CheckpointBuilder.java +++ b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/checkpoint/CheckpointBuilder.java @@ -20,8 +20,7 @@ import io.trino.plugin.deltalake.transactionlog.ProtocolEntry; import io.trino.plugin.deltalake.transactionlog.RemoveFileEntry; import io.trino.plugin.deltalake.transactionlog.TransactionEntry; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.HashMap; import java.util.Map; diff --git a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/checkpoint/CheckpointEntryIterator.java b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/checkpoint/CheckpointEntryIterator.java index c5dc7d593b6c..fac5b185267e 100644 --- a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/checkpoint/CheckpointEntryIterator.java +++ b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/checkpoint/CheckpointEntryIterator.java @@ -47,10 +47,9 @@ import io.trino.spi.type.TypeManager; import io.trino.spi.type.TypeSignature; import io.trino.spi.type.VarcharType; +import jakarta.annotation.Nullable; import org.joda.time.DateTimeZone; -import javax.annotation.Nullable; - import java.io.IOException; import java.io.UncheckedIOException; import java.util.ArrayDeque; diff --git a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/checkpoint/CheckpointWriter.java b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/checkpoint/CheckpointWriter.java index 570c6dab0e0f..edbb691b178e 100644 --- a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/checkpoint/CheckpointWriter.java +++ b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/checkpoint/CheckpointWriter.java @@ -42,11 +42,10 @@ import io.trino.spi.type.TimestampType; import io.trino.spi.type.Type; import io.trino.spi.type.TypeManager; +import jakarta.annotation.Nullable; import org.apache.parquet.format.CompressionCodec; import org.joda.time.DateTimeZone; -import javax.annotation.Nullable; - import java.io.IOException; import java.util.List; import java.util.Map; diff --git a/plugin/trino-elasticsearch/pom.xml b/plugin/trino-elasticsearch/pom.xml index bc5aa63f685c..586ace4d6984 100644 --- a/plugin/trino-elasticsearch/pom.xml +++ b/plugin/trino-elasticsearch/pom.xml @@ -108,8 +108,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-elasticsearch/src/main/java/io/trino/plugin/elasticsearch/AwsSecurityConfig.java b/plugin/trino-elasticsearch/src/main/java/io/trino/plugin/elasticsearch/AwsSecurityConfig.java index e9d885ba5b73..8baf2b7b5485 100644 --- a/plugin/trino-elasticsearch/src/main/java/io/trino/plugin/elasticsearch/AwsSecurityConfig.java +++ b/plugin/trino-elasticsearch/src/main/java/io/trino/plugin/elasticsearch/AwsSecurityConfig.java @@ -17,8 +17,7 @@ import io.airlift.configuration.ConfigDescription; import io.airlift.configuration.ConfigSecuritySensitive; import io.airlift.configuration.DefunctConfig; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.util.Optional; diff --git a/plugin/trino-elasticsearch/src/main/java/io/trino/plugin/elasticsearch/ElasticsearchConfig.java b/plugin/trino-elasticsearch/src/main/java/io/trino/plugin/elasticsearch/ElasticsearchConfig.java index ea3e7cb8f755..339dd233e6af 100644 --- a/plugin/trino-elasticsearch/src/main/java/io/trino/plugin/elasticsearch/ElasticsearchConfig.java +++ b/plugin/trino-elasticsearch/src/main/java/io/trino/plugin/elasticsearch/ElasticsearchConfig.java @@ -20,9 +20,8 @@ import io.airlift.configuration.validation.FileExists; import io.airlift.units.Duration; import io.airlift.units.MinDuration; - -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import java.io.File; import java.util.List; diff --git a/plugin/trino-elasticsearch/src/main/java/io/trino/plugin/elasticsearch/PasswordConfig.java b/plugin/trino-elasticsearch/src/main/java/io/trino/plugin/elasticsearch/PasswordConfig.java index 74af4c987379..2271e1da6b5f 100644 --- a/plugin/trino-elasticsearch/src/main/java/io/trino/plugin/elasticsearch/PasswordConfig.java +++ b/plugin/trino-elasticsearch/src/main/java/io/trino/plugin/elasticsearch/PasswordConfig.java @@ -15,8 +15,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigSecuritySensitive; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class PasswordConfig { diff --git a/plugin/trino-example-http/pom.xml b/plugin/trino-example-http/pom.xml index 7fc9d8cfa1ac..5a4af5581bc7 100644 --- a/plugin/trino-example-http/pom.xml +++ b/plugin/trino-example-http/pom.xml @@ -48,8 +48,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-example-http/src/main/java/io/trino/plugin/example/ExampleConfig.java b/plugin/trino-example-http/src/main/java/io/trino/plugin/example/ExampleConfig.java index 79ccbdce90b1..e8ee8c7714ca 100644 --- a/plugin/trino-example-http/src/main/java/io/trino/plugin/example/ExampleConfig.java +++ b/plugin/trino-example-http/src/main/java/io/trino/plugin/example/ExampleConfig.java @@ -14,8 +14,7 @@ package io.trino.plugin.example; import io.airlift.configuration.Config; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.net.URI; diff --git a/plugin/trino-exchange-filesystem/pom.xml b/plugin/trino-exchange-filesystem/pom.xml index 3b11e406336c..8b33405baab0 100644 --- a/plugin/trino-exchange-filesystem/pom.xml +++ b/plugin/trino-exchange-filesystem/pom.xml @@ -155,8 +155,9 @@ - com.google.code.findbugs - jsr305 + com.google.errorprone + error_prone_annotations + true @@ -216,8 +217,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/ExchangeSourceFile.java b/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/ExchangeSourceFile.java index 3c240e1ab7da..038fd37f1635 100644 --- a/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/ExchangeSourceFile.java +++ b/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/ExchangeSourceFile.java @@ -13,10 +13,9 @@ */ package io.trino.plugin.exchange.filesystem; +import com.google.errorprone.annotations.Immutable; import io.trino.spi.exchange.ExchangeId; -import javax.annotation.concurrent.Immutable; - import java.net.URI; import static java.util.Objects.requireNonNull; diff --git a/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/ExchangeStorageReader.java b/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/ExchangeStorageReader.java index fbc1ca40f28c..2aefe57c400b 100644 --- a/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/ExchangeStorageReader.java +++ b/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/ExchangeStorageReader.java @@ -14,10 +14,9 @@ package io.trino.plugin.exchange.filesystem; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.slice.Slice; -import javax.annotation.concurrent.ThreadSafe; - import java.io.Closeable; import java.io.IOException; diff --git a/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/FileStatus.java b/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/FileStatus.java index e1bdb6abdc63..ed02069f08e1 100644 --- a/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/FileStatus.java +++ b/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/FileStatus.java @@ -15,8 +15,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; import java.util.Objects; diff --git a/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/FileSystemExchange.java b/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/FileSystemExchange.java index 639c0f0883d9..77eeeb251d64 100644 --- a/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/FileSystemExchange.java +++ b/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/FileSystemExchange.java @@ -20,6 +20,7 @@ import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.trino.plugin.exchange.filesystem.FileSystemExchangeSourceHandle.SourceFile; import io.trino.spi.exchange.Exchange; import io.trino.spi.exchange.ExchangeContext; @@ -29,8 +30,6 @@ import io.trino.spi.exchange.ExchangeSourceHandle; import io.trino.spi.exchange.ExchangeSourceHandleSource; -import javax.annotation.concurrent.GuardedBy; - import java.io.File; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/FileSystemExchangeConfig.java b/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/FileSystemExchangeConfig.java index c2c3b8461ed8..05108e973fd0 100644 --- a/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/FileSystemExchangeConfig.java +++ b/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/FileSystemExchangeConfig.java @@ -19,10 +19,9 @@ import io.airlift.configuration.DefunctConfig; import io.airlift.configuration.LegacyConfig; import io.airlift.units.DataSize; - -import javax.validation.constraints.Min; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; import java.net.URI; import java.util.List; diff --git a/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/FileSystemExchangeSink.java b/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/FileSystemExchangeSink.java index a28fedfe2ea5..b28871414df9 100644 --- a/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/FileSystemExchangeSink.java +++ b/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/FileSystemExchangeSink.java @@ -17,6 +17,8 @@ import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.slice.SizeOf; import io.airlift.slice.Slice; import io.airlift.slice.SliceOutput; @@ -25,9 +27,6 @@ import io.trino.spi.exchange.ExchangeSink; import io.trino.spi.exchange.ExchangeSinkInstanceHandle; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.net.URI; import java.util.ArrayDeque; import java.util.ArrayList; diff --git a/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/FileSystemExchangeSource.java b/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/FileSystemExchangeSource.java index 086eca64b399..dacfc2252f09 100644 --- a/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/FileSystemExchangeSource.java +++ b/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/FileSystemExchangeSource.java @@ -19,13 +19,12 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.slice.Slice; import io.trino.spi.exchange.ExchangeSource; import io.trino.spi.exchange.ExchangeSourceHandle; import io.trino.spi.exchange.ExchangeSourceOutputSelector; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.GuardedBy; +import jakarta.annotation.Nullable; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/azure/AzureBlobFileSystemExchangeStorage.java b/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/azure/AzureBlobFileSystemExchangeStorage.java index 912f12b07e99..a72761317ade 100644 --- a/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/azure/AzureBlobFileSystemExchangeStorage.java +++ b/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/azure/AzureBlobFileSystemExchangeStorage.java @@ -36,6 +36,8 @@ import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.airlift.slice.SizeOf; import io.airlift.slice.Slice; @@ -50,9 +52,6 @@ import jakarta.annotation.PreDestroy; import reactor.core.publisher.Flux; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; diff --git a/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/azure/ExchangeAzureConfig.java b/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/azure/ExchangeAzureConfig.java index 1117ef34f404..6aa60fe211fb 100644 --- a/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/azure/ExchangeAzureConfig.java +++ b/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/azure/ExchangeAzureConfig.java @@ -19,9 +19,8 @@ import io.airlift.units.DataSize; import io.airlift.units.MaxDataSize; import io.airlift.units.MinDataSize; - -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import java.util.Optional; diff --git a/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/local/LocalFileSystemExchangeStorage.java b/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/local/LocalFileSystemExchangeStorage.java index 85e2613033c7..62ae3485d393 100644 --- a/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/local/LocalFileSystemExchangeStorage.java +++ b/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/local/LocalFileSystemExchangeStorage.java @@ -16,6 +16,8 @@ import com.google.common.collect.ImmutableList; import com.google.common.io.MoreFiles; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.slice.InputStreamSliceInput; import io.airlift.slice.Slice; import io.airlift.units.DataSize; @@ -26,9 +28,6 @@ import io.trino.plugin.exchange.filesystem.FileStatus; import io.trino.plugin.exchange.filesystem.FileSystemExchangeStorage; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; diff --git a/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/s3/ExchangeS3Config.java b/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/s3/ExchangeS3Config.java index a65d32c9ab7c..326414b022fa 100644 --- a/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/s3/ExchangeS3Config.java +++ b/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/s3/ExchangeS3Config.java @@ -21,14 +21,13 @@ import io.airlift.units.Duration; import io.airlift.units.MaxDataSize; import io.airlift.units.MinDataSize; +import jakarta.validation.constraints.AssertTrue; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import software.amazon.awssdk.core.retry.RetryMode; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.s3.model.StorageClass; -import javax.validation.constraints.AssertTrue; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; - import java.util.Optional; import static io.airlift.units.DataSize.Unit.MEGABYTE; diff --git a/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/s3/S3FileSystemExchangeStorage.java b/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/s3/S3FileSystemExchangeStorage.java index 2c47f0253596..39a7c666d88c 100644 --- a/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/s3/S3FileSystemExchangeStorage.java +++ b/plugin/trino-exchange-filesystem/src/main/java/io/trino/plugin/exchange/filesystem/s3/S3FileSystemExchangeStorage.java @@ -29,6 +29,8 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListeningExecutorService; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.airlift.log.Logger; import io.airlift.slice.Slice; @@ -80,9 +82,6 @@ import software.amazon.awssdk.services.sts.auth.StsAssumeRoleCredentialsProvider; import software.amazon.awssdk.services.sts.model.AssumeRoleRequest; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.io.ByteArrayInputStream; import java.io.FileInputStream; import java.io.IOException; diff --git a/plugin/trino-exchange-hdfs/pom.xml b/plugin/trino-exchange-hdfs/pom.xml index 9fade82497eb..bd57ee82a1a6 100644 --- a/plugin/trino-exchange-hdfs/pom.xml +++ b/plugin/trino-exchange-hdfs/pom.xml @@ -18,8 +18,9 @@ - com.google.code.findbugs - jsr305 + com.google.errorprone + error_prone_annotations + true @@ -68,8 +69,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-exchange-hdfs/src/main/java/io/trino/plugin/exchange/hdfs/ExchangeHdfsConfig.java b/plugin/trino-exchange-hdfs/src/main/java/io/trino/plugin/exchange/hdfs/ExchangeHdfsConfig.java index a236cadc46c3..ab3e59ee6c87 100644 --- a/plugin/trino-exchange-hdfs/src/main/java/io/trino/plugin/exchange/hdfs/ExchangeHdfsConfig.java +++ b/plugin/trino-exchange-hdfs/src/main/java/io/trino/plugin/exchange/hdfs/ExchangeHdfsConfig.java @@ -21,8 +21,7 @@ import io.airlift.units.DataSize; import io.airlift.units.MaxDataSize; import io.airlift.units.MinDataSize; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.io.File; import java.util.List; diff --git a/plugin/trino-exchange-hdfs/src/main/java/io/trino/plugin/exchange/hdfs/HadoopFileSystemExchangeStorage.java b/plugin/trino-exchange-hdfs/src/main/java/io/trino/plugin/exchange/hdfs/HadoopFileSystemExchangeStorage.java index a41a489dea74..19608c00573d 100644 --- a/plugin/trino-exchange-hdfs/src/main/java/io/trino/plugin/exchange/hdfs/HadoopFileSystemExchangeStorage.java +++ b/plugin/trino-exchange-hdfs/src/main/java/io/trino/plugin/exchange/hdfs/HadoopFileSystemExchangeStorage.java @@ -15,6 +15,8 @@ import com.google.common.collect.ImmutableList; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.airlift.slice.InputStreamSliceInput; import io.airlift.slice.Slice; @@ -30,9 +32,6 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.RemoteIterator; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.io.File; import java.io.IOException; import java.io.OutputStream; diff --git a/plugin/trino-google-sheets/pom.xml b/plugin/trino-google-sheets/pom.xml index 969295c899bc..c8b160fbeb9c 100644 --- a/plugin/trino-google-sheets/pom.xml +++ b/plugin/trino-google-sheets/pom.xml @@ -109,8 +109,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-google-sheets/src/main/java/io/trino/plugin/google/sheets/SheetsConfig.java b/plugin/trino-google-sheets/src/main/java/io/trino/plugin/google/sheets/SheetsConfig.java index 9f845ca70300..497c38c8e960 100644 --- a/plugin/trino-google-sheets/src/main/java/io/trino/plugin/google/sheets/SheetsConfig.java +++ b/plugin/trino-google-sheets/src/main/java/io/trino/plugin/google/sheets/SheetsConfig.java @@ -20,10 +20,9 @@ import io.airlift.configuration.validation.FileExists; import io.airlift.units.Duration; import io.airlift.units.MinDuration; - -import javax.validation.constraints.AssertTrue; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.AssertTrue; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import java.util.Optional; import java.util.concurrent.TimeUnit; diff --git a/plugin/trino-google-sheets/src/test/java/io/trino/plugin/google/sheets/TestSheetsConfig.java b/plugin/trino-google-sheets/src/test/java/io/trino/plugin/google/sheets/TestSheetsConfig.java index ca297ebf36e1..ec463cb3ef2e 100644 --- a/plugin/trino-google-sheets/src/test/java/io/trino/plugin/google/sheets/TestSheetsConfig.java +++ b/plugin/trino-google-sheets/src/test/java/io/trino/plugin/google/sheets/TestSheetsConfig.java @@ -16,10 +16,9 @@ import com.google.common.collect.ImmutableMap; import io.airlift.configuration.ConfigurationFactory; import io.airlift.units.Duration; +import jakarta.validation.constraints.AssertTrue; import org.testng.annotations.Test; -import javax.validation.constraints.AssertTrue; - import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; diff --git a/plugin/trino-hive/pom.xml b/plugin/trino-hive/pom.xml index 52bd1c3e5d60..f7b45f0bfde0 100644 --- a/plugin/trino-hive/pom.xml +++ b/plugin/trino-hive/pom.xml @@ -57,12 +57,6 @@ jackson-databind - - com.google.code.findbugs - jsr305 - true - - com.google.errorprone error_prone_annotations @@ -235,8 +229,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/ConcurrentLazyQueue.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/ConcurrentLazyQueue.java index d499b31e521e..5bc361f6e8bc 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/ConcurrentLazyQueue.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/ConcurrentLazyQueue.java @@ -13,7 +13,7 @@ */ package io.trino.plugin.hive; -import javax.annotation.concurrent.GuardedBy; +import com.google.errorprone.annotations.concurrent.GuardedBy; import java.util.Iterator; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveBasicStatistics.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveBasicStatistics.java index 58705a490d85..bbf1c17844e6 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveBasicStatistics.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveBasicStatistics.java @@ -15,8 +15,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; import java.util.Objects; import java.util.OptionalLong; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveConfig.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveConfig.java index 9c355eba9809..626cfadde197 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveConfig.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveConfig.java @@ -25,15 +25,14 @@ import io.airlift.units.MaxDataSize; import io.airlift.units.MinDataSize; import io.trino.plugin.hive.HiveSessionProperties.InsertExistingPartitionsBehavior; +import jakarta.annotation.Nullable; +import jakarta.validation.constraints.AssertTrue; +import jakarta.validation.constraints.DecimalMax; +import jakarta.validation.constraints.DecimalMin; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import org.joda.time.DateTimeZone; -import javax.annotation.Nullable; -import javax.validation.constraints.AssertTrue; -import javax.validation.constraints.DecimalMax; -import javax.validation.constraints.DecimalMin; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; - import java.util.List; import java.util.Optional; import java.util.Set; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HivePageSource.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HivePageSource.java index 0300c6d9b2a8..9db5bb99dc41 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HivePageSource.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HivePageSource.java @@ -56,8 +56,7 @@ import io.trino.spi.type.TypeManager; import io.trino.spi.type.VarcharType; import it.unimi.dsi.fastutil.ints.IntArrayList; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveSplitManager.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveSplitManager.java index 7e77c167e9ee..077e5a52540d 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveSplitManager.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveSplitManager.java @@ -45,11 +45,10 @@ import io.trino.spi.connector.SchemaTableName; import io.trino.spi.connector.TableNotFoundException; import io.trino.spi.type.TypeManager; +import jakarta.annotation.Nullable; import org.weakref.jmx.Managed; import org.weakref.jmx.Nested; -import javax.annotation.Nullable; - import java.util.Collection; import java.util.Iterator; import java.util.List; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveTransactionManager.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveTransactionManager.java index d27e67c624da..2525487b0d50 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveTransactionManager.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveTransactionManager.java @@ -13,13 +13,12 @@ */ package io.trino.plugin.hive; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.trino.spi.classloader.ThreadContextClassLoader; import io.trino.spi.connector.ConnectorTransactionHandle; import io.trino.spi.security.ConnectorIdentity; -import javax.annotation.concurrent.GuardedBy; - import java.util.Map; import java.util.Optional; import java.util.concurrent.ConcurrentHashMap; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/PartitionStatistics.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/PartitionStatistics.java index d061e0039d53..40511ee31181 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/PartitionStatistics.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/PartitionStatistics.java @@ -17,10 +17,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableMap; +import com.google.errorprone.annotations.Immutable; import io.trino.plugin.hive.metastore.HiveColumnStatistics; -import javax.annotation.concurrent.Immutable; - import java.util.Map; import java.util.Objects; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/ReaderProjectionsAdapter.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/ReaderProjectionsAdapter.java index 224cb016b4f1..2bf1108afc88 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/ReaderProjectionsAdapter.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/ReaderProjectionsAdapter.java @@ -23,8 +23,7 @@ import io.trino.spi.block.LazyBlockLoader; import io.trino.spi.connector.ColumnHandle; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.List; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/RecordingMetastoreConfig.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/RecordingMetastoreConfig.java index bc4413151c89..14e0cc8dcd05 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/RecordingMetastoreConfig.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/RecordingMetastoreConfig.java @@ -15,8 +15,7 @@ import io.airlift.configuration.Config; import io.airlift.units.Duration; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import static java.util.concurrent.TimeUnit.MINUTES; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/SortingFileWriterConfig.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/SortingFileWriterConfig.java index e6f6608c34ea..189f36bd9ece 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/SortingFileWriterConfig.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/SortingFileWriterConfig.java @@ -18,9 +18,8 @@ import io.airlift.units.DataSize; import io.airlift.units.MaxDataSize; import io.airlift.units.MinDataSize; - -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; import static io.airlift.units.DataSize.Unit.MEGABYTE; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/WriteCompletedEvent.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/WriteCompletedEvent.java index 784a475f2b66..1c3d7df15494 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/WriteCompletedEvent.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/WriteCompletedEvent.java @@ -13,12 +13,11 @@ */ package io.trino.plugin.hive; +import com.google.errorprone.annotations.Immutable; import io.airlift.event.client.EventField; import io.airlift.event.client.EventField.EventFieldMapping; import io.airlift.event.client.EventType; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.Immutable; +import jakarta.annotation.Nullable; import java.time.Instant; import java.util.Map; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/aws/AwsApiCallStats.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/aws/AwsApiCallStats.java index a1b2d1456c85..ff650da566cb 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/aws/AwsApiCallStats.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/aws/AwsApiCallStats.java @@ -13,13 +13,12 @@ */ package io.trino.plugin.hive.aws; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.stats.CounterStat; import io.airlift.stats.TimeStat; import org.weakref.jmx.Managed; import org.weakref.jmx.Nested; -import javax.annotation.concurrent.ThreadSafe; - import java.util.concurrent.Callable; import static java.util.concurrent.TimeUnit.MILLISECONDS; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/aws/AwsSdkClientCoreStats.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/aws/AwsSdkClientCoreStats.java index f77df3a512fe..0fb4d6aa918e 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/aws/AwsSdkClientCoreStats.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/aws/AwsSdkClientCoreStats.java @@ -18,13 +18,12 @@ import com.amazonaws.metrics.RequestMetricCollector; import com.amazonaws.util.AWSRequestMetrics; import com.amazonaws.util.TimingInfo; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.stats.CounterStat; import io.airlift.stats.TimeStat; import org.weakref.jmx.Managed; import org.weakref.jmx.Nested; -import javax.annotation.concurrent.ThreadSafe; - import java.util.List; import java.util.concurrent.atomic.AtomicLong; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/fs/BlockLocation.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/fs/BlockLocation.java index 4e0200a58a4f..405743eaac74 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/fs/BlockLocation.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/fs/BlockLocation.java @@ -17,8 +17,7 @@ import com.google.common.collect.Interner; import com.google.common.collect.Interners; import io.trino.filesystem.FileEntry.Block; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/fs/DirectoryListingFilter.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/fs/DirectoryListingFilter.java index 534b0758cce8..54dab7d98429 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/fs/DirectoryListingFilter.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/fs/DirectoryListingFilter.java @@ -14,8 +14,7 @@ package io.trino.plugin.hive.fs; import io.trino.filesystem.Location; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.IOException; import java.util.NoSuchElementException; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/fs/TransactionScopeCachingDirectoryLister.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/fs/TransactionScopeCachingDirectoryLister.java index 3dd7ba700aef..1f83b0ada254 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/fs/TransactionScopeCachingDirectoryLister.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/fs/TransactionScopeCachingDirectoryLister.java @@ -16,14 +16,13 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.cache.Cache; import com.google.common.util.concurrent.UncheckedExecutionException; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.trino.filesystem.Location; import io.trino.filesystem.TrinoFileSystem; import io.trino.plugin.hive.metastore.Partition; import io.trino.plugin.hive.metastore.Storage; import io.trino.plugin.hive.metastore.Table; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.GuardedBy; +import jakarta.annotation.Nullable; import java.io.IOException; import java.util.ArrayList; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/BooleanStatistics.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/BooleanStatistics.java index 89fbe9e72dea..c82544b21d7e 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/BooleanStatistics.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/BooleanStatistics.java @@ -15,8 +15,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; import java.util.Objects; import java.util.OptionalLong; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/Column.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/Column.java index 6ada463d6c57..f1c5be3b0b3b 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/Column.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/Column.java @@ -15,10 +15,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.errorprone.annotations.Immutable; import io.trino.plugin.hive.HiveType; -import javax.annotation.concurrent.Immutable; - import java.util.Objects; import java.util.Optional; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/Database.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/Database.java index e959d5bf1f49..00c1a657a28e 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/Database.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/Database.java @@ -16,10 +16,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableMap; +import com.google.errorprone.annotations.Immutable; import io.trino.spi.security.PrincipalType; -import javax.annotation.concurrent.Immutable; - import java.util.LinkedHashMap; import java.util.Map; import java.util.Objects; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/DateStatistics.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/DateStatistics.java index af9bdb6d482c..995fab93470c 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/DateStatistics.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/DateStatistics.java @@ -15,8 +15,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; import java.time.LocalDate; import java.util.Objects; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/DecimalStatistics.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/DecimalStatistics.java index 3b64b9f6e4dd..1a30f7df2f33 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/DecimalStatistics.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/DecimalStatistics.java @@ -15,8 +15,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; import java.math.BigDecimal; import java.util.Objects; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/DoubleStatistics.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/DoubleStatistics.java index 62ec21118848..3027056032e0 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/DoubleStatistics.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/DoubleStatistics.java @@ -15,8 +15,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; import java.util.Objects; import java.util.OptionalDouble; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/HiveColumnStatistics.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/HiveColumnStatistics.java index ae3dd1dfcfcc..c68c19f17413 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/HiveColumnStatistics.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/HiveColumnStatistics.java @@ -15,8 +15,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; import java.math.BigDecimal; import java.time.LocalDate; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/HivePartitionName.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/HivePartitionName.java index 1d5222d687ba..abf394ff1d69 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/HivePartitionName.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/HivePartitionName.java @@ -16,8 +16,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; - -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; import java.util.List; import java.util.Objects; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/HivePrivilegeInfo.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/HivePrivilegeInfo.java index 25b6fc2ed852..41ce4a5d1ba0 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/HivePrivilegeInfo.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/HivePrivilegeInfo.java @@ -16,11 +16,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableSet; +import com.google.errorprone.annotations.Immutable; import io.trino.spi.security.Privilege; import io.trino.spi.security.PrivilegeInfo; -import javax.annotation.concurrent.Immutable; - import java.util.Objects; import java.util.Set; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/HiveTableName.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/HiveTableName.java index 82a43289964a..dde5609a0bac 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/HiveTableName.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/HiveTableName.java @@ -15,8 +15,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; import java.util.Objects; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/IntegerStatistics.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/IntegerStatistics.java index 3bf0ef4cf591..9b0a6d308871 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/IntegerStatistics.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/IntegerStatistics.java @@ -15,8 +15,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; import java.util.Objects; import java.util.OptionalLong; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/MetastoreTypeConfig.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/MetastoreTypeConfig.java index 5c7f4ca51246..088e5b7b9602 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/MetastoreTypeConfig.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/MetastoreTypeConfig.java @@ -14,8 +14,7 @@ package io.trino.plugin.hive.metastore; import io.airlift.configuration.Config; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class MetastoreTypeConfig { diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/Partition.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/Partition.java index 6e509b9759e1..5d6667d481c7 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/Partition.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/Partition.java @@ -18,10 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import com.google.errorprone.annotations.Immutable; import io.trino.spi.connector.SchemaTableName; -import javax.annotation.concurrent.Immutable; - import java.util.List; import java.util.Map; import java.util.Objects; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/PartitionFilter.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/PartitionFilter.java index e0f5418e4d4c..883b9a1641c2 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/PartitionFilter.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/PartitionFilter.java @@ -16,10 +16,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.Immutable; import io.trino.spi.predicate.TupleDomain; -import javax.annotation.concurrent.Immutable; - import java.util.List; import java.util.Objects; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/SemiTransactionalHiveMetastore.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/SemiTransactionalHiveMetastore.java index 3e453c80d738..5774c72ec977 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/SemiTransactionalHiveMetastore.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/SemiTransactionalHiveMetastore.java @@ -22,6 +22,7 @@ import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import com.google.errorprone.annotations.FormatMethod; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.log.Logger; import io.airlift.units.Duration; import io.trino.filesystem.Location; @@ -61,8 +62,6 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.RemoteIterator; -import javax.annotation.concurrent.GuardedBy; - import java.io.FileNotFoundException; import java.io.IOException; import java.util.ArrayList; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/SortingColumn.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/SortingColumn.java index ce27bc094dfa..350475c15055 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/SortingColumn.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/SortingColumn.java @@ -15,11 +15,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.errorprone.annotations.Immutable; import io.trino.spi.TrinoException; import io.trino.spi.connector.SortOrder; -import javax.annotation.concurrent.Immutable; - import java.util.Locale; import java.util.Objects; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/Storage.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/Storage.java index 8e42a3689048..824bc13ec766 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/Storage.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/Storage.java @@ -16,10 +16,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableMap; +import com.google.errorprone.annotations.Immutable; import io.trino.plugin.hive.HiveBucketProperty; -import javax.annotation.concurrent.Immutable; - import java.util.Map; import java.util.Objects; import java.util.Optional; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/StorageFormat.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/StorageFormat.java index d87f0ddf9d0d..dc6834a04458 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/StorageFormat.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/StorageFormat.java @@ -15,11 +15,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.errorprone.annotations.Immutable; import io.trino.plugin.hive.HiveStorageFormat; import io.trino.spi.TrinoException; -import javax.annotation.concurrent.Immutable; - import java.util.Objects; import static com.google.common.base.MoreObjects.toStringHelper; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/Table.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/Table.java index 601846b56b1c..6ffb133d479c 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/Table.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/Table.java @@ -19,10 +19,9 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; +import com.google.errorprone.annotations.Immutable; import io.trino.spi.connector.SchemaTableName; -import javax.annotation.concurrent.Immutable; - import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/TablesWithParameterCacheKey.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/TablesWithParameterCacheKey.java index e400473a5877..b7459209a706 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/TablesWithParameterCacheKey.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/TablesWithParameterCacheKey.java @@ -15,8 +15,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; import java.util.Objects; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/UserDatabaseKey.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/UserDatabaseKey.java index 534ed1e12b90..d25645aa5e0f 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/UserDatabaseKey.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/UserDatabaseKey.java @@ -15,8 +15,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; import java.util.Objects; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/UserTableKey.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/UserTableKey.java index 8176f0b8bb9d..09210d39647f 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/UserTableKey.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/UserTableKey.java @@ -15,8 +15,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.annotation.concurrent.Immutable; +import com.google.errorprone.annotations.Immutable; import java.util.Objects; import java.util.Optional; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/alluxio/ProtoUtils.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/alluxio/ProtoUtils.java index de3397f019b0..a07b3aad1d9c 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/alluxio/ProtoUtils.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/alluxio/ProtoUtils.java @@ -40,8 +40,7 @@ import io.trino.plugin.hive.metastore.Table; import io.trino.plugin.hive.util.HiveBucketing; import io.trino.spi.TrinoException; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.math.BigDecimal; import java.math.BigInteger; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/cache/CachingHiveMetastore.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/cache/CachingHiveMetastore.java index dce5f56286e0..29bbe003bbdf 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/cache/CachingHiveMetastore.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/cache/CachingHiveMetastore.java @@ -23,6 +23,8 @@ import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.UncheckedExecutionException; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import com.google.errorprone.annotations.Immutable; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.jmx.CacheStatsMBean; import io.airlift.units.Duration; import io.trino.cache.EvictableCacheBuilder; @@ -59,9 +61,6 @@ import org.weakref.jmx.Managed; import org.weakref.jmx.Nested; -import javax.annotation.concurrent.Immutable; -import javax.annotation.concurrent.ThreadSafe; - import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/cache/CachingHiveMetastoreConfig.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/cache/CachingHiveMetastoreConfig.java index 95539c272663..eaae97eed9b5 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/cache/CachingHiveMetastoreConfig.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/cache/CachingHiveMetastoreConfig.java @@ -16,9 +16,8 @@ import io.airlift.configuration.Config; import io.airlift.units.Duration; import io.airlift.units.MinDuration; - -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import java.util.Optional; import java.util.concurrent.TimeUnit; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/cache/ImpersonationCachingConfig.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/cache/ImpersonationCachingConfig.java index 7a375f12bee2..15eb31787d94 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/cache/ImpersonationCachingConfig.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/cache/ImpersonationCachingConfig.java @@ -15,9 +15,8 @@ import io.airlift.configuration.Config; import io.airlift.units.Duration; - -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import java.util.concurrent.TimeUnit; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/file/FileHiveMetastore.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/file/FileHiveMetastore.java index 47d13b15b606..eb97b84e6859 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/file/FileHiveMetastore.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/file/FileHiveMetastore.java @@ -21,6 +21,8 @@ import com.google.common.collect.ImmutableSet.Builder; import com.google.common.collect.Sets; import com.google.common.io.ByteStreams; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.json.JsonCodec; import io.trino.cache.EvictableCacheBuilder; import io.trino.hdfs.HdfsContext; @@ -62,9 +64,6 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.io.IOException; import java.io.OutputStream; import java.util.ArrayDeque; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/file/FileHiveMetastoreConfig.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/file/FileHiveMetastoreConfig.java index 510a1125db08..75c1baec81ca 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/file/FileHiveMetastoreConfig.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/file/FileHiveMetastoreConfig.java @@ -16,8 +16,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; import io.airlift.configuration.DefunctConfig; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import static io.trino.plugin.hive.metastore.file.FileHiveMetastoreConfig.VersionCompatibility.NOT_SUPPORTED; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/glue/GlueHiveMetastore.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/glue/GlueHiveMetastore.java index 41b8cec11b12..da3744caa9e1 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/glue/GlueHiveMetastore.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/glue/GlueHiveMetastore.java @@ -109,12 +109,11 @@ import io.trino.spi.security.ConnectorIdentity; import io.trino.spi.security.RoleGrant; import io.trino.spi.type.Type; +import jakarta.annotation.Nullable; import org.apache.hadoop.fs.Path; import org.weakref.jmx.Flatten; import org.weakref.jmx.Managed; -import javax.annotation.Nullable; - import java.time.Duration; import java.util.AbstractMap.SimpleEntry; import java.util.ArrayList; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/glue/GlueHiveMetastoreConfig.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/glue/GlueHiveMetastoreConfig.java index 07bfe7cacfa2..9d7873f73087 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/glue/GlueHiveMetastoreConfig.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/glue/GlueHiveMetastoreConfig.java @@ -18,9 +18,8 @@ import io.airlift.configuration.ConfigSecuritySensitive; import io.airlift.configuration.DefunctConfig; import jakarta.annotation.PostConstruct; - -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; import java.util.Optional; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/glue/converter/GlueToTrinoConverter.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/glue/converter/GlueToTrinoConverter.java index d880b9483335..dd641772ec7e 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/glue/converter/GlueToTrinoConverter.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/glue/converter/GlueToTrinoConverter.java @@ -33,10 +33,9 @@ import io.trino.spi.TrinoException; import io.trino.spi.connector.SchemaTableName; import io.trino.spi.security.PrincipalType; +import jakarta.annotation.Nullable; import org.gaul.modernizer_maven_annotations.SuppressModernizer; -import javax.annotation.Nullable; - import java.util.List; import java.util.Locale; import java.util.Map; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/recording/HiveMetastoreRecording.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/recording/HiveMetastoreRecording.java index 304e06628bd4..fd53961a01b2 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/recording/HiveMetastoreRecording.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/recording/HiveMetastoreRecording.java @@ -18,6 +18,7 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; +import com.google.errorprone.annotations.Immutable; import com.google.inject.Inject; import io.airlift.json.JsonCodec; import io.airlift.units.Duration; @@ -39,8 +40,6 @@ import io.trino.spi.security.RoleGrant; import org.weakref.jmx.Managed; -import javax.annotation.concurrent.Immutable; - import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/CoalescingCounter.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/CoalescingCounter.java index 03648dbfb5da..0e842c8e3634 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/CoalescingCounter.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/CoalescingCounter.java @@ -14,11 +14,10 @@ package io.trino.plugin.hive.metastore.thrift; import com.google.common.annotations.VisibleForTesting; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.units.Duration; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.time.Clock; import static java.util.Objects.requireNonNull; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/MetastoreKerberosConfig.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/MetastoreKerberosConfig.java index 1aa1ae1eb971..5fe8a20b6bce 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/MetastoreKerberosConfig.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/MetastoreKerberosConfig.java @@ -16,9 +16,8 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; import io.airlift.configuration.validation.FileExists; - -import javax.validation.constraints.AssertTrue; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.AssertTrue; +import jakarta.validation.constraints.NotNull; import java.util.Optional; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/MetastoreSupportsDateStatistics.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/MetastoreSupportsDateStatistics.java index 53687a49b9d4..4459f349fbce 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/MetastoreSupportsDateStatistics.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/MetastoreSupportsDateStatistics.java @@ -13,10 +13,9 @@ */ package io.trino.plugin.hive.metastore.thrift; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.units.Duration; -import javax.annotation.concurrent.ThreadSafe; - import java.util.concurrent.atomic.AtomicReference; import static io.trino.plugin.hive.metastore.thrift.MetastoreSupportsDateStatistics.DateStatisticsSupport.NOT_SUPPORTED; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/StaticMetastoreConfig.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/StaticMetastoreConfig.java index 1fb56bdf6fa4..6c89bb104935 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/StaticMetastoreConfig.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/StaticMetastoreConfig.java @@ -16,8 +16,7 @@ import com.google.common.base.Splitter; import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.net.URI; import java.util.List; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/StaticTokenAwareMetastoreClientFactory.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/StaticTokenAwareMetastoreClientFactory.java index a160ecf8a6ca..bd881a37080c 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/StaticTokenAwareMetastoreClientFactory.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/StaticTokenAwareMetastoreClientFactory.java @@ -20,10 +20,9 @@ import io.airlift.units.Duration; import io.trino.plugin.hive.metastore.thrift.FailureAwareThriftMetastoreClient.Callback; import io.trino.plugin.hive.metastore.thrift.ThriftMetastoreAuthenticationConfig.ThriftMetastoreAuthenticationType; +import jakarta.annotation.Nullable; import org.apache.thrift.TException; -import javax.annotation.Nullable; - import java.net.URI; import java.util.Comparator; import java.util.List; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/ThriftHiveMetastore.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/ThriftHiveMetastore.java index 00353c545930..87d93747d41d 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/ThriftHiveMetastore.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/ThriftHiveMetastore.java @@ -18,6 +18,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.concurrent.MoreFutures; import io.airlift.log.Logger; import io.airlift.units.Duration; @@ -83,8 +84,6 @@ import org.apache.hadoop.fs.Path; import org.apache.thrift.TException; -import javax.annotation.concurrent.ThreadSafe; - import java.io.IOException; import java.net.InetAddress; import java.net.UnknownHostException; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/ThriftMetastoreApiStats.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/ThriftMetastoreApiStats.java index b6ecc2ee5d68..90ea6c428b15 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/ThriftMetastoreApiStats.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/ThriftMetastoreApiStats.java @@ -13,6 +13,7 @@ */ package io.trino.plugin.hive.metastore.thrift; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.stats.CounterStat; import io.airlift.stats.TimeStat; import io.trino.hive.thrift.metastore.MetaException; @@ -21,8 +22,6 @@ import org.weakref.jmx.Managed; import org.weakref.jmx.Nested; -import javax.annotation.concurrent.ThreadSafe; - import java.util.concurrent.Callable; import static java.util.concurrent.TimeUnit.MILLISECONDS; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/ThriftMetastoreAuthenticationConfig.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/ThriftMetastoreAuthenticationConfig.java index 895fdaefd8d2..0573bafb7c03 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/ThriftMetastoreAuthenticationConfig.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/ThriftMetastoreAuthenticationConfig.java @@ -15,8 +15,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import static io.trino.plugin.hive.metastore.thrift.ThriftMetastoreAuthenticationConfig.ThriftMetastoreAuthenticationType.NONE; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/ThriftMetastoreConfig.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/ThriftMetastoreConfig.java index c930163e2f75..c53a59c04032 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/ThriftMetastoreConfig.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/ThriftMetastoreConfig.java @@ -21,10 +21,9 @@ import io.airlift.units.Duration; import io.airlift.units.MinDuration; import io.trino.plugin.hive.util.RetryDriver; - -import javax.validation.constraints.AssertTrue; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.AssertTrue; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import java.io.File; import java.util.concurrent.TimeUnit; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/ThriftMetastoreParameterParserUtils.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/ThriftMetastoreParameterParserUtils.java index f6c35e8b9d66..eff79827f3cb 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/ThriftMetastoreParameterParserUtils.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/ThriftMetastoreParameterParserUtils.java @@ -15,8 +15,7 @@ import com.google.common.primitives.Doubles; import com.google.common.primitives.Longs; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.math.BigDecimal; import java.time.DateTimeException; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/ThriftMetastoreUtil.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/ThriftMetastoreUtil.java index 6b73c3ae1f0d..5b02a1adb863 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/ThriftMetastoreUtil.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/ThriftMetastoreUtil.java @@ -66,8 +66,7 @@ import io.trino.spi.type.TimestampType; import io.trino.spi.type.Type; import io.trino.spi.type.VarcharType; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.math.BigDecimal; import java.math.BigInteger; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/orc/OrcDeletedRows.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/orc/OrcDeletedRows.java index 7c8a81201134..a7204bab872d 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/orc/OrcDeletedRows.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/orc/OrcDeletedRows.java @@ -31,8 +31,7 @@ import io.trino.spi.connector.ConnectorPageSource; import io.trino.spi.connector.EmptyPageSource; import io.trino.spi.security.ConnectorIdentity; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.IOException; import java.util.Iterator; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/orc/OrcReaderConfig.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/orc/OrcReaderConfig.java index a70f553875a7..695c0592c21d 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/orc/OrcReaderConfig.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/orc/OrcReaderConfig.java @@ -17,8 +17,7 @@ import io.airlift.configuration.ConfigDescription; import io.airlift.units.DataSize; import io.trino.orc.OrcReaderOptions; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class OrcReaderConfig { diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/orc/OrcWriterConfig.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/orc/OrcWriterConfig.java index 46c2ebc41dfc..8ac8eb91670d 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/orc/OrcWriterConfig.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/orc/OrcWriterConfig.java @@ -21,10 +21,9 @@ import io.trino.orc.OrcWriteValidation.OrcWriteValidationMode; import io.trino.orc.OrcWriterOptions; import io.trino.orc.OrcWriterOptions.WriterIdentification; - -import javax.validation.constraints.DecimalMax; -import javax.validation.constraints.DecimalMin; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.DecimalMax; +import jakarta.validation.constraints.DecimalMin; +import jakarta.validation.constraints.NotNull; @DefunctConfig("hive.orc.optimized-writer.enabled") @SuppressWarnings("unused") diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/parquet/ParquetReaderConfig.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/parquet/ParquetReaderConfig.java index 0c239bcfd756..187b1790846f 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/parquet/ParquetReaderConfig.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/parquet/ParquetReaderConfig.java @@ -20,10 +20,9 @@ import io.airlift.units.DataSize; import io.airlift.units.MinDataSize; import io.trino.parquet.ParquetReaderOptions; - -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; @DefunctConfig({ "hive.parquet.fail-on-corrupted-statistics", diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/parquet/ParquetWriterConfig.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/parquet/ParquetWriterConfig.java index 128481d3386f..3d3fb064453a 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/parquet/ParquetWriterConfig.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/parquet/ParquetWriterConfig.java @@ -20,11 +20,10 @@ import io.airlift.units.MaxDataSize; import io.airlift.units.MinDataSize; import io.trino.parquet.writer.ParquetWriterOptions; +import jakarta.validation.constraints.DecimalMax; +import jakarta.validation.constraints.DecimalMin; import org.apache.parquet.hadoop.ParquetWriter; -import javax.validation.constraints.DecimalMax; -import javax.validation.constraints.DecimalMin; - public class ParquetWriterConfig { public static final String PARQUET_WRITER_MAX_BLOCK_SIZE = "2GB"; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/s3select/S3SelectLineRecordReader.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/s3select/S3SelectLineRecordReader.java index 902f1259fcc8..ec74e14a7759 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/s3select/S3SelectLineRecordReader.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/s3select/S3SelectLineRecordReader.java @@ -22,6 +22,7 @@ import com.amazonaws.services.s3.model.SelectObjectContentRequest; import com.google.common.annotations.VisibleForTesting; import com.google.common.io.Closer; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.units.Duration; import io.trino.hdfs.s3.HiveS3Config; import io.trino.hdfs.s3.TrinoS3FileSystem; @@ -37,8 +38,6 @@ import org.apache.hadoop.mapred.RecordReader; import org.apache.hadoop.util.LineReader; -import javax.annotation.concurrent.ThreadSafe; - import java.io.IOException; import java.io.InputStream; import java.io.InterruptedIOException; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/s3select/TrinoS3ClientFactory.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/s3select/TrinoS3ClientFactory.java index db605683bfc2..9a016c8e41ec 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/s3select/TrinoS3ClientFactory.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/s3select/TrinoS3ClientFactory.java @@ -28,6 +28,7 @@ import com.amazonaws.services.s3.AmazonS3Builder; import com.amazonaws.services.s3.AmazonS3Client; import com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClientBuilder; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.airlift.log.Logger; import io.airlift.units.Duration; @@ -36,8 +37,6 @@ import io.trino.plugin.hive.HiveConfig; import org.apache.hadoop.conf.Configuration; -import javax.annotation.concurrent.GuardedBy; - import java.net.URI; import java.util.Optional; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/security/SecurityConfig.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/security/SecurityConfig.java index e48131d43ecb..79ea80dcfe9b 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/security/SecurityConfig.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/security/SecurityConfig.java @@ -14,8 +14,7 @@ package io.trino.plugin.hive.security; import io.airlift.configuration.Config; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import static io.trino.plugin.hive.security.HiveSecurityModule.LEGACY; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/util/AsyncQueue.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/util/AsyncQueue.java index ea0ca28c8f6b..42e81670ddac 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/util/AsyncQueue.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/util/AsyncQueue.java @@ -17,9 +17,8 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; - -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import java.util.ArrayDeque; import java.util.ArrayList; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/util/HiveTypeTranslator.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/util/HiveTypeTranslator.java index 4cb1e870632e..236cf0260202 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/util/HiveTypeTranslator.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/util/HiveTypeTranslator.java @@ -37,8 +37,7 @@ import io.trino.spi.type.TypeSignature; import io.trino.spi.type.TypeSignatureParameter; import io.trino.spi.type.VarcharType; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.List; import java.util.Locale; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/util/HiveUtil.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/util/HiveUtil.java index 346366ee71ea..eba4839b8f43 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/util/HiveUtil.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/util/HiveUtil.java @@ -54,6 +54,7 @@ import io.trino.spi.type.TypeManager; import io.trino.spi.type.VarbinaryType; import io.trino.spi.type.VarcharType; +import jakarta.annotation.Nullable; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; @@ -84,8 +85,6 @@ import org.joda.time.format.DateTimeParser; import org.joda.time.format.DateTimePrinter; -import javax.annotation.Nullable; - import java.io.IOException; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/util/PartitionMatchSupplier.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/util/PartitionMatchSupplier.java index 411d5c9bc704..bba535de1df7 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/util/PartitionMatchSupplier.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/util/PartitionMatchSupplier.java @@ -19,8 +19,7 @@ import io.trino.spi.connector.ColumnHandle; import io.trino.spi.connector.DynamicFilter; import io.trino.spi.predicate.TupleDomain; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.List; import java.util.function.BooleanSupplier; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/util/ThrottledAsyncQueue.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/util/ThrottledAsyncQueue.java index 105e46fe8b19..d182e5ca7608 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/util/ThrottledAsyncQueue.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/util/ThrottledAsyncQueue.java @@ -16,8 +16,7 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.RateLimiter; - -import javax.annotation.concurrent.ThreadSafe; +import com.google.errorprone.annotations.ThreadSafe; import java.util.List; import java.util.concurrent.Executor; diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/CountingAccessHiveMetastore.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/CountingAccessHiveMetastore.java index 71f968518318..5f4a7cd914d9 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/CountingAccessHiveMetastore.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/CountingAccessHiveMetastore.java @@ -16,6 +16,7 @@ import com.google.common.collect.ConcurrentHashMultiset; import com.google.common.collect.ImmutableMultiset; import com.google.common.collect.Multiset; +import com.google.errorprone.annotations.ThreadSafe; import io.trino.plugin.hive.HiveColumnStatisticType; import io.trino.plugin.hive.HiveType; import io.trino.plugin.hive.PartitionStatistics; @@ -26,8 +27,6 @@ import io.trino.spi.security.RoleGrant; import io.trino.spi.type.Type; -import javax.annotation.concurrent.ThreadSafe; - import java.util.List; import java.util.Map; import java.util.Optional; diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/thrift/InMemoryThriftMetastore.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/thrift/InMemoryThriftMetastore.java index 0c84ae7c865d..cfb678985521 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/thrift/InMemoryThriftMetastore.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/thrift/InMemoryThriftMetastore.java @@ -16,6 +16,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.trino.hive.thrift.metastore.Database; import io.trino.hive.thrift.metastore.FieldSchema; import io.trino.hive.thrift.metastore.Partition; @@ -41,8 +42,6 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.hive.metastore.TableType; -import javax.annotation.concurrent.GuardedBy; - import java.io.File; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/thrift/TestMetastoreKerberosConfig.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/thrift/TestMetastoreKerberosConfig.java index e4ecb48cfd4c..30f614410aac 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/thrift/TestMetastoreKerberosConfig.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/thrift/TestMetastoreKerberosConfig.java @@ -15,10 +15,9 @@ import com.google.common.collect.ImmutableMap; import io.airlift.configuration.ConfigurationFactory; +import jakarta.validation.constraints.AssertTrue; import org.testng.annotations.Test; -import javax.validation.constraints.AssertTrue; - import java.nio.file.Files; import java.nio.file.Path; import java.util.Map; diff --git a/plugin/trino-http-event-listener/pom.xml b/plugin/trino-http-event-listener/pom.xml index 4c186da90f3e..8944978360b2 100644 --- a/plugin/trino-http-event-listener/pom.xml +++ b/plugin/trino-http-event-listener/pom.xml @@ -69,8 +69,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-http-event-listener/src/main/java/io/trino/plugin/httpquery/HttpEventListenerConfig.java b/plugin/trino-http-event-listener/src/main/java/io/trino/plugin/httpquery/HttpEventListenerConfig.java index aceffb70740f..eb14dae7a6d8 100644 --- a/plugin/trino-http-event-listener/src/main/java/io/trino/plugin/httpquery/HttpEventListenerConfig.java +++ b/plugin/trino-http-event-listener/src/main/java/io/trino/plugin/httpquery/HttpEventListenerConfig.java @@ -17,9 +17,8 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; import io.airlift.units.Duration; - -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import java.net.URISyntaxException; import java.util.EnumSet; diff --git a/plugin/trino-hudi/pom.xml b/plugin/trino-hudi/pom.xml index b07b24cef859..b31645c2e6e6 100644 --- a/plugin/trino-hudi/pom.xml +++ b/plugin/trino-hudi/pom.xml @@ -25,8 +25,8 @@ - com.google.code.findbugs - jsr305 + com.google.errorprone + error_prone_annotations true @@ -121,8 +121,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-hudi/src/main/java/io/trino/plugin/hudi/HudiConfig.java b/plugin/trino-hudi/src/main/java/io/trino/plugin/hudi/HudiConfig.java index 80dcdfa43fec..0fb2653c28c2 100644 --- a/plugin/trino-hudi/src/main/java/io/trino/plugin/hudi/HudiConfig.java +++ b/plugin/trino-hudi/src/main/java/io/trino/plugin/hudi/HudiConfig.java @@ -19,11 +19,10 @@ import io.airlift.configuration.ConfigDescription; import io.airlift.configuration.DefunctConfig; import io.airlift.units.DataSize; - -import javax.validation.constraints.DecimalMax; -import javax.validation.constraints.DecimalMin; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.DecimalMax; +import jakarta.validation.constraints.DecimalMin; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import java.util.List; diff --git a/plugin/trino-hudi/src/main/java/io/trino/plugin/hudi/HudiTransactionManager.java b/plugin/trino-hudi/src/main/java/io/trino/plugin/hudi/HudiTransactionManager.java index be8d84694150..5a66a91951b8 100644 --- a/plugin/trino-hudi/src/main/java/io/trino/plugin/hudi/HudiTransactionManager.java +++ b/plugin/trino-hudi/src/main/java/io/trino/plugin/hudi/HudiTransactionManager.java @@ -13,13 +13,12 @@ */ package io.trino.plugin.hudi; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.trino.spi.classloader.ThreadContextClassLoader; import io.trino.spi.connector.ConnectorTransactionHandle; import io.trino.spi.security.ConnectorIdentity; -import javax.annotation.concurrent.GuardedBy; - import java.util.Map; import java.util.concurrent.ConcurrentHashMap; diff --git a/plugin/trino-iceberg/pom.xml b/plugin/trino-iceberg/pom.xml index 575c3534972b..fe4974a3a49a 100644 --- a/plugin/trino-iceberg/pom.xml +++ b/plugin/trino-iceberg/pom.xml @@ -50,8 +50,8 @@ - com.google.code.findbugs - jsr305 + com.google.errorprone + error_prone_annotations true @@ -182,8 +182,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/FilesTable.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/FilesTable.java index 7c4f317e4ce0..c70f79f74840 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/FilesTable.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/FilesTable.java @@ -31,6 +31,7 @@ import io.trino.spi.type.ArrayType; import io.trino.spi.type.MapType; import io.trino.spi.type.TypeManager; +import jakarta.annotation.Nullable; import org.apache.iceberg.DataFile; import org.apache.iceberg.FileScanTask; import org.apache.iceberg.Schema; @@ -44,8 +45,6 @@ import org.apache.iceberg.types.Type; import org.apache.iceberg.types.Types; -import javax.annotation.Nullable; - import java.io.IOException; import java.io.UncheckedIOException; import java.nio.ByteBuffer; diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergAvroDataConversion.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergAvroDataConversion.java index d2ab5e7eb263..2a2ffd04d343 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergAvroDataConversion.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergAvroDataConversion.java @@ -31,13 +31,12 @@ import io.trino.spi.type.Type; import io.trino.spi.type.VarbinaryType; import io.trino.spi.type.VarcharType; +import jakarta.annotation.Nullable; import org.apache.iceberg.Schema; import org.apache.iceberg.data.GenericRecord; import org.apache.iceberg.data.Record; import org.apache.iceberg.types.Types; -import javax.annotation.Nullable; - import java.math.BigDecimal; import java.math.BigInteger; import java.nio.ByteBuffer; diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergConfig.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergConfig.java index 633198630a91..1db7bdc28a94 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergConfig.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergConfig.java @@ -20,12 +20,11 @@ import io.airlift.units.DataSize; import io.airlift.units.Duration; import io.trino.plugin.hive.HiveCompressionCodec; - -import javax.validation.constraints.DecimalMax; -import javax.validation.constraints.DecimalMin; -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.DecimalMax; +import jakarta.validation.constraints.DecimalMin; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import java.util.Optional; diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergSecurityConfig.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergSecurityConfig.java index a327a25b9826..a8cab0c847b2 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergSecurityConfig.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergSecurityConfig.java @@ -14,8 +14,7 @@ package io.trino.plugin.iceberg; import io.airlift.configuration.Config; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class IcebergSecurityConfig { diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergSplitSource.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergSplitSource.java index 1f4b07578989..0efebcf1a471 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergSplitSource.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergSplitSource.java @@ -39,6 +39,7 @@ import io.trino.spi.predicate.TupleDomain; import io.trino.spi.predicate.ValueSet; import io.trino.spi.type.TypeManager; +import jakarta.annotation.Nullable; import org.apache.iceberg.FileScanTask; import org.apache.iceberg.PartitionSpecParser; import org.apache.iceberg.Schema; @@ -48,8 +49,6 @@ import org.apache.iceberg.io.CloseableIterator; import org.apache.iceberg.types.Type; -import javax.annotation.Nullable; - import java.io.IOException; import java.io.UncheckedIOException; import java.nio.ByteBuffer; diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergStatistics.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergStatistics.java index 235ab8490101..8b3c80053da5 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergStatistics.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergStatistics.java @@ -15,17 +15,16 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import com.google.errorprone.annotations.Immutable; import io.trino.spi.TrinoException; import io.trino.spi.type.TypeManager; +import jakarta.annotation.Nullable; import org.apache.iceberg.DataFile; import org.apache.iceberg.PartitionField; import org.apache.iceberg.PartitionSpec; import org.apache.iceberg.types.Conversions; import org.apache.iceberg.types.Types; -import javax.annotation.Nullable; -import javax.annotation.concurrent.Immutable; - import java.lang.invoke.MethodHandle; import java.util.HashMap; import java.util.List; diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergTransactionManager.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergTransactionManager.java index c21aad57bc44..ead052e18865 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergTransactionManager.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergTransactionManager.java @@ -13,13 +13,12 @@ */ package io.trino.plugin.iceberg; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.trino.spi.classloader.ThreadContextClassLoader; import io.trino.spi.connector.ConnectorTransactionHandle; import io.trino.spi.security.ConnectorIdentity; -import javax.annotation.concurrent.GuardedBy; - import java.util.Optional; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/PartitionTransforms.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/PartitionTransforms.java index 32dd7af15e46..f22c64aebe2d 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/PartitionTransforms.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/PartitionTransforms.java @@ -26,12 +26,11 @@ import io.trino.spi.type.LongTimestampWithTimeZone; import io.trino.spi.type.Type; import io.trino.spi.type.VarcharType; +import jakarta.annotation.Nullable; import org.apache.iceberg.PartitionField; import org.joda.time.DateTimeField; import org.joda.time.chrono.ISOChronology; -import javax.annotation.Nullable; - import java.math.BigDecimal; import java.math.BigInteger; import java.util.function.Function; diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/TableStatisticsReader.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/TableStatisticsReader.java index f70f5f057c5e..3907748e6c02 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/TableStatisticsReader.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/TableStatisticsReader.java @@ -28,6 +28,7 @@ import io.trino.spi.statistics.TableStatistics; import io.trino.spi.type.FixedWidthType; import io.trino.spi.type.TypeManager; +import jakarta.annotation.Nullable; import org.apache.iceberg.BlobMetadata; import org.apache.iceberg.FileScanTask; import org.apache.iceberg.Schema; @@ -40,8 +41,6 @@ import org.apache.iceberg.types.Type; import org.apache.iceberg.types.Types; -import javax.annotation.Nullable; - import java.io.IOException; import java.io.UncheckedIOException; import java.util.HashSet; diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/aggregation/IcebergThetaSketchForStats.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/aggregation/IcebergThetaSketchForStats.java index e7d4bf6b39f9..1180e9c2b582 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/aggregation/IcebergThetaSketchForStats.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/aggregation/IcebergThetaSketchForStats.java @@ -26,6 +26,7 @@ import io.trino.spi.function.TypeParameter; import io.trino.spi.type.StandardTypes; import io.trino.spi.type.Type; +import jakarta.annotation.Nullable; import org.apache.datasketches.Family; import org.apache.datasketches.theta.SetOperation; import org.apache.datasketches.theta.Sketch; @@ -33,8 +34,6 @@ import org.apache.datasketches.theta.UpdateSketch; import org.apache.iceberg.types.Conversions; -import javax.annotation.Nullable; - import java.nio.ByteBuffer; import java.util.concurrent.atomic.AtomicInteger; diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/AbstractIcebergTableOperations.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/AbstractIcebergTableOperations.java index d0bf71442aed..1b7be6a32f94 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/AbstractIcebergTableOperations.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/AbstractIcebergTableOperations.java @@ -22,6 +22,7 @@ import io.trino.spi.TrinoException; import io.trino.spi.connector.ConnectorSession; import io.trino.spi.connector.SchemaTableName; +import jakarta.annotation.Nullable; import org.apache.iceberg.TableMetadata; import org.apache.iceberg.TableMetadataParser; import org.apache.iceberg.exceptions.CommitFailedException; @@ -31,8 +32,6 @@ import org.apache.iceberg.io.OutputFile; import org.apache.iceberg.types.Types.NestedField; -import javax.annotation.Nullable; - import java.io.FileNotFoundException; import java.time.Duration; import java.util.List; diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/glue/GlueIcebergTableOperations.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/glue/GlueIcebergTableOperations.java index 254442cbb9b6..907a238fa0d0 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/glue/GlueIcebergTableOperations.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/glue/GlueIcebergTableOperations.java @@ -31,13 +31,12 @@ import io.trino.spi.TrinoException; import io.trino.spi.connector.ConnectorSession; import io.trino.spi.connector.TableNotFoundException; +import jakarta.annotation.Nullable; import org.apache.iceberg.TableMetadata; import org.apache.iceberg.exceptions.CommitFailedException; import org.apache.iceberg.exceptions.CommitStateUnknownException; import org.apache.iceberg.io.FileIO; -import javax.annotation.Nullable; - import java.util.Map; import java.util.Optional; diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/glue/GlueIcebergUtil.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/glue/GlueIcebergUtil.java index bd2b047c90ee..06a9b0c97f00 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/glue/GlueIcebergUtil.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/glue/GlueIcebergUtil.java @@ -15,8 +15,7 @@ import com.amazonaws.services.glue.model.TableInput; import com.google.common.collect.ImmutableMap; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Map; import java.util.Optional; diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/jdbc/IcebergJdbcCatalogConfig.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/jdbc/IcebergJdbcCatalogConfig.java index 52d4934d018b..24d36063917a 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/jdbc/IcebergJdbcCatalogConfig.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/jdbc/IcebergJdbcCatalogConfig.java @@ -16,9 +16,8 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; import io.airlift.configuration.ConfigSecuritySensitive; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; import java.util.Optional; diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/nessie/IcebergNessieCatalogConfig.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/nessie/IcebergNessieCatalogConfig.java index dff42a527442..492d0b3fa289 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/nessie/IcebergNessieCatalogConfig.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/nessie/IcebergNessieCatalogConfig.java @@ -15,9 +15,8 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; import java.net.URI; diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/rest/IcebergRestCatalogConfig.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/rest/IcebergRestCatalogConfig.java index 0ba540c1c242..af8e3a5fe0b4 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/rest/IcebergRestCatalogConfig.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/rest/IcebergRestCatalogConfig.java @@ -15,8 +15,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.net.URI; import java.util.Optional; diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/rest/OAuth2SecurityConfig.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/rest/OAuth2SecurityConfig.java index e585fdeefd67..20a9920430a4 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/rest/OAuth2SecurityConfig.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/rest/OAuth2SecurityConfig.java @@ -16,8 +16,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; import io.airlift.configuration.ConfigSecuritySensitive; - -import javax.validation.constraints.AssertTrue; +import jakarta.validation.constraints.AssertTrue; import java.util.Optional; diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/rest/TrinoIcebergRestCatalogFactory.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/rest/TrinoIcebergRestCatalogFactory.java index 911af202fdcf..e883cc3beb4b 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/rest/TrinoIcebergRestCatalogFactory.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/rest/TrinoIcebergRestCatalogFactory.java @@ -14,6 +14,7 @@ package io.trino.plugin.iceberg.catalog.rest; import com.google.common.collect.ImmutableMap; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.trino.filesystem.TrinoFileSystemFactory; import io.trino.plugin.base.CatalogName; @@ -28,8 +29,6 @@ import org.apache.iceberg.rest.HTTPClient; import org.apache.iceberg.rest.RESTSessionCatalog; -import javax.annotation.concurrent.GuardedBy; - import java.net.URI; import java.util.Optional; diff --git a/plugin/trino-ignite/pom.xml b/plugin/trino-ignite/pom.xml index 5130cf760d61..0f814a06974d 100644 --- a/plugin/trino-ignite/pom.xml +++ b/plugin/trino-ignite/pom.xml @@ -19,11 +19,6 @@ - - com.google.code.findbugs - jsr305 - - com.google.guava guava @@ -55,8 +50,14 @@ - javax.validation - validation-api + jakarta.annotation + jakarta.annotation-api + true + + + + jakarta.validation + jakarta.validation-api @@ -108,6 +109,13 @@ provided + + com.google.errorprone + error_prone_annotations + runtime + true + + io.airlift log diff --git a/plugin/trino-ignite/src/main/java/io/trino/plugin/ignite/IgniteClient.java b/plugin/trino-ignite/src/main/java/io/trino/plugin/ignite/IgniteClient.java index e433948b8cac..2da0608cada5 100644 --- a/plugin/trino-ignite/src/main/java/io/trino/plugin/ignite/IgniteClient.java +++ b/plugin/trino-ignite/src/main/java/io/trino/plugin/ignite/IgniteClient.java @@ -66,8 +66,7 @@ import io.trino.spi.type.Type; import io.trino.spi.type.VarbinaryType; import io.trino.spi.type.VarcharType; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.sql.Connection; import java.sql.DatabaseMetaData; diff --git a/plugin/trino-ignite/src/main/java/io/trino/plugin/ignite/IgniteJdbcConfig.java b/plugin/trino-ignite/src/main/java/io/trino/plugin/ignite/IgniteJdbcConfig.java index 927197a42594..88c6b02ece60 100644 --- a/plugin/trino-ignite/src/main/java/io/trino/plugin/ignite/IgniteJdbcConfig.java +++ b/plugin/trino-ignite/src/main/java/io/trino/plugin/ignite/IgniteJdbcConfig.java @@ -14,10 +14,9 @@ package io.trino.plugin.ignite; import io.trino.plugin.jdbc.BaseJdbcConfig; +import jakarta.validation.constraints.AssertTrue; import org.apache.ignite.IgniteJdbcThinDriver; -import javax.validation.constraints.AssertTrue; - import java.sql.SQLException; import static org.apache.ignite.IgniteJdbcDriver.URL_PREFIX; diff --git a/plugin/trino-ignite/src/main/java/io/trino/plugin/ignite/IgniteOutputTableHandle.java b/plugin/trino-ignite/src/main/java/io/trino/plugin/ignite/IgniteOutputTableHandle.java index 285e2faa05e3..185231c1351d 100644 --- a/plugin/trino-ignite/src/main/java/io/trino/plugin/ignite/IgniteOutputTableHandle.java +++ b/plugin/trino-ignite/src/main/java/io/trino/plugin/ignite/IgniteOutputTableHandle.java @@ -18,8 +18,7 @@ import io.trino.plugin.jdbc.JdbcOutputTableHandle; import io.trino.plugin.jdbc.JdbcTypeHandle; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.List; import java.util.Optional; diff --git a/plugin/trino-ignite/src/test/java/io/trino/plugin/ignite/TestIgniteJdbcConfig.java b/plugin/trino-ignite/src/test/java/io/trino/plugin/ignite/TestIgniteJdbcConfig.java index de7e5d5deb23..5351f9ffed8a 100644 --- a/plugin/trino-ignite/src/test/java/io/trino/plugin/ignite/TestIgniteJdbcConfig.java +++ b/plugin/trino-ignite/src/test/java/io/trino/plugin/ignite/TestIgniteJdbcConfig.java @@ -13,10 +13,9 @@ */ package io.trino.plugin.ignite; +import jakarta.validation.constraints.AssertTrue; import org.testng.annotations.Test; -import javax.validation.constraints.AssertTrue; - import static io.airlift.testing.ValidationAssertions.assertFailsValidation; import static io.airlift.testing.ValidationAssertions.assertValidates; import static org.apache.ignite.IgniteJdbcDriver.URL_PREFIX; diff --git a/plugin/trino-ignite/src/test/java/io/trino/plugin/ignite/TestingIgniteServer.java b/plugin/trino-ignite/src/test/java/io/trino/plugin/ignite/TestingIgniteServer.java index 66581b7ca81b..14e5fca0cb48 100644 --- a/plugin/trino-ignite/src/test/java/io/trino/plugin/ignite/TestingIgniteServer.java +++ b/plugin/trino-ignite/src/test/java/io/trino/plugin/ignite/TestingIgniteServer.java @@ -13,11 +13,10 @@ */ package io.trino.plugin.ignite; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.trino.testing.ResourcePresence; import io.trino.testing.SharedResource; -import javax.annotation.concurrent.GuardedBy; - import java.sql.Connection; import java.sql.DriverManager; import java.sql.Statement; diff --git a/plugin/trino-jmx/pom.xml b/plugin/trino-jmx/pom.xml index 49b4f406ba7b..d353b7e4094e 100644 --- a/plugin/trino-jmx/pom.xml +++ b/plugin/trino-jmx/pom.xml @@ -63,8 +63,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-jmx/src/main/java/io/trino/plugin/jmx/JmxConnectorConfig.java b/plugin/trino-jmx/src/main/java/io/trino/plugin/jmx/JmxConnectorConfig.java index c33bf50584dc..d26fb3bcf921 100644 --- a/plugin/trino-jmx/src/main/java/io/trino/plugin/jmx/JmxConnectorConfig.java +++ b/plugin/trino-jmx/src/main/java/io/trino/plugin/jmx/JmxConnectorConfig.java @@ -19,9 +19,8 @@ import io.airlift.configuration.Config; import io.airlift.units.Duration; import io.airlift.units.MinDuration; - -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import java.util.Set; import java.util.regex.Pattern; diff --git a/plugin/trino-kafka/pom.xml b/plugin/trino-kafka/pom.xml index 3127bda5fbea..58aed660aa04 100644 --- a/plugin/trino-kafka/pom.xml +++ b/plugin/trino-kafka/pom.xml @@ -99,8 +99,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-kafka/src/main/java/io/trino/plugin/kafka/KafkaConfig.java b/plugin/trino-kafka/src/main/java/io/trino/plugin/kafka/KafkaConfig.java index a1292f4c8055..d75cd380b86c 100644 --- a/plugin/trino-kafka/src/main/java/io/trino/plugin/kafka/KafkaConfig.java +++ b/plugin/trino-kafka/src/main/java/io/trino/plugin/kafka/KafkaConfig.java @@ -24,11 +24,10 @@ import io.airlift.units.DataSize.Unit; import io.trino.plugin.kafka.schema.file.FileTableDescriptionSupplier; import io.trino.spi.HostAddress; - -import javax.validation.constraints.Min; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import java.io.File; import java.util.List; diff --git a/plugin/trino-kafka/src/main/java/io/trino/plugin/kafka/schema/confluent/ConfluentSchemaRegistryConfig.java b/plugin/trino-kafka/src/main/java/io/trino/plugin/kafka/schema/confluent/ConfluentSchemaRegistryConfig.java index dbaa26ab3a19..5599664b1159 100644 --- a/plugin/trino-kafka/src/main/java/io/trino/plugin/kafka/schema/confluent/ConfluentSchemaRegistryConfig.java +++ b/plugin/trino-kafka/src/main/java/io/trino/plugin/kafka/schema/confluent/ConfluentSchemaRegistryConfig.java @@ -22,10 +22,9 @@ import io.airlift.units.MinDuration; import io.trino.plugin.kafka.schema.confluent.AvroSchemaConverter.EmptyFieldStrategy; import io.trino.spi.HostAddress; - -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.Size; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.Size; import java.util.Set; diff --git a/plugin/trino-kafka/src/main/java/io/trino/plugin/kafka/schema/file/FileTableDescriptionSupplierConfig.java b/plugin/trino-kafka/src/main/java/io/trino/plugin/kafka/schema/file/FileTableDescriptionSupplierConfig.java index df6b37e107ab..4f1b68bd23ce 100644 --- a/plugin/trino-kafka/src/main/java/io/trino/plugin/kafka/schema/file/FileTableDescriptionSupplierConfig.java +++ b/plugin/trino-kafka/src/main/java/io/trino/plugin/kafka/schema/file/FileTableDescriptionSupplierConfig.java @@ -17,8 +17,7 @@ import com.google.common.collect.ImmutableSet; import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.io.File; import java.util.Set; diff --git a/plugin/trino-kinesis/pom.xml b/plugin/trino-kinesis/pom.xml index c6fb9aaac73e..e6784117e581 100644 --- a/plugin/trino-kinesis/pom.xml +++ b/plugin/trino-kinesis/pom.xml @@ -63,11 +63,6 @@ - - com.google.code.findbugs - jsr305 - - com.google.guava guava @@ -119,8 +114,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-kinesis/src/main/java/io/trino/plugin/kinesis/KinesisColumnHandle.java b/plugin/trino-kinesis/src/main/java/io/trino/plugin/kinesis/KinesisColumnHandle.java index 34a541cf7eb4..7080a9081e1f 100644 --- a/plugin/trino-kinesis/src/main/java/io/trino/plugin/kinesis/KinesisColumnHandle.java +++ b/plugin/trino-kinesis/src/main/java/io/trino/plugin/kinesis/KinesisColumnHandle.java @@ -18,8 +18,7 @@ import io.trino.decoder.DecoderColumnHandle; import io.trino.spi.connector.ColumnMetadata; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Objects; diff --git a/plugin/trino-kinesis/src/main/java/io/trino/plugin/kinesis/KinesisConfig.java b/plugin/trino-kinesis/src/main/java/io/trino/plugin/kinesis/KinesisConfig.java index 36aed9e4def4..b757ddbd34f5 100644 --- a/plugin/trino-kinesis/src/main/java/io/trino/plugin/kinesis/KinesisConfig.java +++ b/plugin/trino-kinesis/src/main/java/io/trino/plugin/kinesis/KinesisConfig.java @@ -18,10 +18,9 @@ import io.airlift.configuration.DefunctConfig; import io.airlift.units.Duration; import io.airlift.units.MinDuration; - -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import java.util.concurrent.TimeUnit; diff --git a/plugin/trino-kudu/pom.xml b/plugin/trino-kudu/pom.xml index 514e75739ce2..6a83c6e54ea4 100644 --- a/plugin/trino-kudu/pom.xml +++ b/plugin/trino-kudu/pom.xml @@ -74,8 +74,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-kudu/src/main/java/io/trino/plugin/kudu/KuduClientConfig.java b/plugin/trino-kudu/src/main/java/io/trino/plugin/kudu/KuduClientConfig.java index 1f8254cf77c4..87ceea01af11 100755 --- a/plugin/trino-kudu/src/main/java/io/trino/plugin/kudu/KuduClientConfig.java +++ b/plugin/trino-kudu/src/main/java/io/trino/plugin/kudu/KuduClientConfig.java @@ -21,9 +21,8 @@ import io.airlift.units.Duration; import io.airlift.units.MaxDuration; import io.airlift.units.MinDuration; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import java.util.List; import java.util.concurrent.TimeUnit; diff --git a/plugin/trino-kudu/src/main/java/io/trino/plugin/kudu/KuduKerberosConfig.java b/plugin/trino-kudu/src/main/java/io/trino/plugin/kudu/KuduKerberosConfig.java index 150ddeccefa1..2c35dbfa9792 100644 --- a/plugin/trino-kudu/src/main/java/io/trino/plugin/kudu/KuduKerberosConfig.java +++ b/plugin/trino-kudu/src/main/java/io/trino/plugin/kudu/KuduKerberosConfig.java @@ -16,8 +16,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; import io.airlift.configuration.validation.FileExists; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.io.File; import java.util.Optional; diff --git a/plugin/trino-mariadb/pom.xml b/plugin/trino-mariadb/pom.xml index cb29bfcc0503..0b1d38720ffe 100644 --- a/plugin/trino-mariadb/pom.xml +++ b/plugin/trino-mariadb/pom.xml @@ -44,8 +44,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-mariadb/src/main/java/io/trino/plugin/mariadb/MariaDbJdbcConfig.java b/plugin/trino-mariadb/src/main/java/io/trino/plugin/mariadb/MariaDbJdbcConfig.java index 42dba88495f2..0ab5b4956ef3 100644 --- a/plugin/trino-mariadb/src/main/java/io/trino/plugin/mariadb/MariaDbJdbcConfig.java +++ b/plugin/trino-mariadb/src/main/java/io/trino/plugin/mariadb/MariaDbJdbcConfig.java @@ -14,11 +14,10 @@ package io.trino.plugin.mariadb; import io.trino.plugin.jdbc.BaseJdbcConfig; +import jakarta.validation.constraints.AssertTrue; import org.mariadb.jdbc.Configuration; import org.mariadb.jdbc.Driver; -import javax.validation.constraints.AssertTrue; - import java.sql.SQLException; public class MariaDbJdbcConfig diff --git a/plugin/trino-memory/pom.xml b/plugin/trino-memory/pom.xml index 5e7298b12ee2..048496e83af9 100644 --- a/plugin/trino-memory/pom.xml +++ b/plugin/trino-memory/pom.xml @@ -19,8 +19,8 @@ - com.google.code.findbugs - jsr305 + com.google.errorprone + error_prone_annotations true @@ -60,8 +60,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-memory/src/main/java/io/trino/plugin/memory/MemoryConfig.java b/plugin/trino-memory/src/main/java/io/trino/plugin/memory/MemoryConfig.java index cf8158f3b9ef..3251809fb2c6 100644 --- a/plugin/trino-memory/src/main/java/io/trino/plugin/memory/MemoryConfig.java +++ b/plugin/trino-memory/src/main/java/io/trino/plugin/memory/MemoryConfig.java @@ -15,8 +15,7 @@ import io.airlift.configuration.Config; import io.airlift.units.DataSize; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class MemoryConfig { diff --git a/plugin/trino-memory/src/main/java/io/trino/plugin/memory/MemoryMetadata.java b/plugin/trino-memory/src/main/java/io/trino/plugin/memory/MemoryMetadata.java index 9e2f3e5eea61..70e931347fa2 100644 --- a/plugin/trino-memory/src/main/java/io/trino/plugin/memory/MemoryMetadata.java +++ b/plugin/trino-memory/src/main/java/io/trino/plugin/memory/MemoryMetadata.java @@ -17,6 +17,7 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Maps; +import com.google.errorprone.annotations.ThreadSafe; import com.google.inject.Inject; import io.airlift.slice.Slice; import io.trino.spi.HostAddress; @@ -48,8 +49,6 @@ import io.trino.spi.statistics.Estimate; import io.trino.spi.statistics.TableStatistics; -import javax.annotation.concurrent.ThreadSafe; - import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; diff --git a/plugin/trino-memory/src/main/java/io/trino/plugin/memory/MemoryPagesStore.java b/plugin/trino-memory/src/main/java/io/trino/plugin/memory/MemoryPagesStore.java index b1cef4d388fd..4cb7b73d5136 100644 --- a/plugin/trino-memory/src/main/java/io/trino/plugin/memory/MemoryPagesStore.java +++ b/plugin/trino-memory/src/main/java/io/trino/plugin/memory/MemoryPagesStore.java @@ -14,14 +14,13 @@ package io.trino.plugin.memory; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.trino.spi.Page; import io.trino.spi.TrinoException; import io.trino.spi.block.Block; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; diff --git a/plugin/trino-mongodb/pom.xml b/plugin/trino-mongodb/pom.xml index 6849e349a671..b73e02bc0e98 100644 --- a/plugin/trino-mongodb/pom.xml +++ b/plugin/trino-mongodb/pom.xml @@ -59,8 +59,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-mongodb/src/main/java/io/trino/plugin/mongodb/MongoClientConfig.java b/plugin/trino-mongodb/src/main/java/io/trino/plugin/mongodb/MongoClientConfig.java index 9a76138cdbe1..fa1e82640a52 100644 --- a/plugin/trino-mongodb/src/main/java/io/trino/plugin/mongodb/MongoClientConfig.java +++ b/plugin/trino-mongodb/src/main/java/io/trino/plugin/mongodb/MongoClientConfig.java @@ -18,10 +18,9 @@ import io.airlift.configuration.ConfigSecuritySensitive; import io.airlift.configuration.DefunctConfig; import io.airlift.configuration.LegacyConfig; - -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Pattern; @DefunctConfig({"mongodb.connection-per-host", "mongodb.socket-keep-alive", "mongodb.seeds", "mongodb.credentials"}) public class MongoClientConfig diff --git a/plugin/trino-mysql-event-listener/pom.xml b/plugin/trino-mysql-event-listener/pom.xml index a9205bcf8791..2863bb3b4350 100644 --- a/plugin/trino-mysql-event-listener/pom.xml +++ b/plugin/trino-mysql-event-listener/pom.xml @@ -54,8 +54,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-mysql-event-listener/src/main/java/io/trino/plugin/eventlistener/mysql/MysqlEventListenerConfig.java b/plugin/trino-mysql-event-listener/src/main/java/io/trino/plugin/eventlistener/mysql/MysqlEventListenerConfig.java index 960e71a96511..0173fd833d8f 100644 --- a/plugin/trino-mysql-event-listener/src/main/java/io/trino/plugin/eventlistener/mysql/MysqlEventListenerConfig.java +++ b/plugin/trino-mysql-event-listener/src/main/java/io/trino/plugin/eventlistener/mysql/MysqlEventListenerConfig.java @@ -14,8 +14,7 @@ package io.trino.plugin.eventlistener.mysql; import io.airlift.configuration.Config; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class MysqlEventListenerConfig { diff --git a/plugin/trino-mysql/pom.xml b/plugin/trino-mysql/pom.xml index 2190a768666b..f67af77da93f 100644 --- a/plugin/trino-mysql/pom.xml +++ b/plugin/trino-mysql/pom.xml @@ -59,8 +59,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-mysql/src/main/java/io/trino/plugin/mysql/MySqlConfig.java b/plugin/trino-mysql/src/main/java/io/trino/plugin/mysql/MySqlConfig.java index 23d0c928c364..4b32070c7b2c 100644 --- a/plugin/trino-mysql/src/main/java/io/trino/plugin/mysql/MySqlConfig.java +++ b/plugin/trino-mysql/src/main/java/io/trino/plugin/mysql/MySqlConfig.java @@ -16,8 +16,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; import io.airlift.units.Duration; - -import javax.validation.constraints.Min; +import jakarta.validation.constraints.Min; import java.util.concurrent.TimeUnit; diff --git a/plugin/trino-mysql/src/main/java/io/trino/plugin/mysql/MySqlJdbcConfig.java b/plugin/trino-mysql/src/main/java/io/trino/plugin/mysql/MySqlJdbcConfig.java index ecd13f188938..489fc593be7f 100644 --- a/plugin/trino-mysql/src/main/java/io/trino/plugin/mysql/MySqlJdbcConfig.java +++ b/plugin/trino-mysql/src/main/java/io/trino/plugin/mysql/MySqlJdbcConfig.java @@ -17,8 +17,7 @@ import com.mysql.cj.exceptions.CJException; import com.mysql.cj.jdbc.Driver; import io.trino.plugin.jdbc.BaseJdbcConfig; - -import javax.validation.constraints.AssertTrue; +import jakarta.validation.constraints.AssertTrue; import java.sql.SQLException; diff --git a/plugin/trino-oracle/pom.xml b/plugin/trino-oracle/pom.xml index 7021a19be650..4832b15f0dbf 100644 --- a/plugin/trino-oracle/pom.xml +++ b/plugin/trino-oracle/pom.xml @@ -61,8 +61,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-oracle/src/main/java/io/trino/plugin/oracle/OracleConfig.java b/plugin/trino-oracle/src/main/java/io/trino/plugin/oracle/OracleConfig.java index 151c4a9631a9..6df60f371979 100644 --- a/plugin/trino-oracle/src/main/java/io/trino/plugin/oracle/OracleConfig.java +++ b/plugin/trino-oracle/src/main/java/io/trino/plugin/oracle/OracleConfig.java @@ -17,11 +17,10 @@ import io.airlift.configuration.ConfigDescription; import io.airlift.configuration.DefunctConfig; import io.airlift.units.Duration; - -import javax.validation.constraints.AssertTrue; -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.AssertTrue; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import java.math.RoundingMode; import java.util.Optional; diff --git a/plugin/trino-oracle/src/test/java/io/trino/plugin/oracle/TestOracleConfig.java b/plugin/trino-oracle/src/test/java/io/trino/plugin/oracle/TestOracleConfig.java index 340b2881b1c0..204937256537 100644 --- a/plugin/trino-oracle/src/test/java/io/trino/plugin/oracle/TestOracleConfig.java +++ b/plugin/trino-oracle/src/test/java/io/trino/plugin/oracle/TestOracleConfig.java @@ -15,11 +15,10 @@ import com.google.common.collect.ImmutableMap; import io.airlift.units.Duration; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; import org.testng.annotations.Test; -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; - import java.math.RoundingMode; import java.util.Map; diff --git a/plugin/trino-password-authenticators/pom.xml b/plugin/trino-password-authenticators/pom.xml index 7ce3b592dfa9..bd2345487450 100644 --- a/plugin/trino-password-authenticators/pom.xml +++ b/plugin/trino-password-authenticators/pom.xml @@ -70,8 +70,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-password-authenticators/src/main/java/io/trino/plugin/password/file/FileConfig.java b/plugin/trino-password-authenticators/src/main/java/io/trino/plugin/password/file/FileConfig.java index 277466edbaf4..4caf8829f084 100644 --- a/plugin/trino-password-authenticators/src/main/java/io/trino/plugin/password/file/FileConfig.java +++ b/plugin/trino-password-authenticators/src/main/java/io/trino/plugin/password/file/FileConfig.java @@ -18,8 +18,7 @@ import io.airlift.configuration.validation.FileExists; import io.airlift.units.Duration; import io.airlift.units.MinDuration; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.io.File; diff --git a/plugin/trino-password-authenticators/src/main/java/io/trino/plugin/password/file/FileGroupConfig.java b/plugin/trino-password-authenticators/src/main/java/io/trino/plugin/password/file/FileGroupConfig.java index bcbbf8c60f51..8ec8c390340b 100644 --- a/plugin/trino-password-authenticators/src/main/java/io/trino/plugin/password/file/FileGroupConfig.java +++ b/plugin/trino-password-authenticators/src/main/java/io/trino/plugin/password/file/FileGroupConfig.java @@ -18,8 +18,7 @@ import io.airlift.configuration.validation.FileExists; import io.airlift.units.Duration; import io.airlift.units.MinDuration; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.io.File; diff --git a/plugin/trino-password-authenticators/src/main/java/io/trino/plugin/password/ldap/LdapAuthenticatorConfig.java b/plugin/trino-password-authenticators/src/main/java/io/trino/plugin/password/ldap/LdapAuthenticatorConfig.java index fa1750ff3171..afa45f7cfca4 100644 --- a/plugin/trino-password-authenticators/src/main/java/io/trino/plugin/password/ldap/LdapAuthenticatorConfig.java +++ b/plugin/trino-password-authenticators/src/main/java/io/trino/plugin/password/ldap/LdapAuthenticatorConfig.java @@ -19,8 +19,7 @@ import io.airlift.configuration.ConfigDescription; import io.airlift.configuration.ConfigSecuritySensitive; import io.airlift.units.Duration; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.util.List; import java.util.concurrent.TimeUnit; diff --git a/plugin/trino-password-authenticators/src/main/java/io/trino/plugin/password/salesforce/SalesforceConfig.java b/plugin/trino-password-authenticators/src/main/java/io/trino/plugin/password/salesforce/SalesforceConfig.java index e39b9ca027d7..9080a101818e 100644 --- a/plugin/trino-password-authenticators/src/main/java/io/trino/plugin/password/salesforce/SalesforceConfig.java +++ b/plugin/trino-password-authenticators/src/main/java/io/trino/plugin/password/salesforce/SalesforceConfig.java @@ -17,8 +17,7 @@ import io.airlift.configuration.ConfigDescription; import io.airlift.units.Duration; import io.airlift.units.MaxDuration; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.util.HashSet; import java.util.Locale; diff --git a/plugin/trino-phoenix5/pom.xml b/plugin/trino-phoenix5/pom.xml index 68ce7ef137ea..1443d87d817f 100644 --- a/plugin/trino-phoenix5/pom.xml +++ b/plugin/trino-phoenix5/pom.xml @@ -22,11 +22,6 @@ - - com.google.code.findbugs - jsr305 - - com.google.guava guava @@ -85,8 +80,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api @@ -156,6 +151,13 @@ runtime + + com.google.errorprone + error_prone_annotations + runtime + true + + io.airlift log-manager diff --git a/plugin/trino-phoenix5/src/main/java/io/trino/plugin/phoenix5/MetadataUtil.java b/plugin/trino-phoenix5/src/main/java/io/trino/plugin/phoenix5/MetadataUtil.java index 6d15216cdda8..072b14605149 100644 --- a/plugin/trino-phoenix5/src/main/java/io/trino/plugin/phoenix5/MetadataUtil.java +++ b/plugin/trino-phoenix5/src/main/java/io/trino/plugin/phoenix5/MetadataUtil.java @@ -13,10 +13,9 @@ */ package io.trino.plugin.phoenix5; +import jakarta.annotation.Nullable; import org.apache.phoenix.util.SchemaUtil; -import javax.annotation.Nullable; - import static io.trino.plugin.phoenix5.PhoenixMetadata.DEFAULT_SCHEMA; public final class MetadataUtil diff --git a/plugin/trino-phoenix5/src/main/java/io/trino/plugin/phoenix5/PhoenixConfig.java b/plugin/trino-phoenix5/src/main/java/io/trino/plugin/phoenix5/PhoenixConfig.java index 4de57340e0b3..92b64baf2558 100644 --- a/plugin/trino-phoenix5/src/main/java/io/trino/plugin/phoenix5/PhoenixConfig.java +++ b/plugin/trino-phoenix5/src/main/java/io/trino/plugin/phoenix5/PhoenixConfig.java @@ -18,10 +18,9 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; import io.airlift.configuration.validation.FileExists; - -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import java.util.List; diff --git a/plugin/trino-phoenix5/src/main/java/io/trino/plugin/phoenix5/PhoenixOutputTableHandle.java b/plugin/trino-phoenix5/src/main/java/io/trino/plugin/phoenix5/PhoenixOutputTableHandle.java index ecbfaf9c5432..e43f95b9cb1c 100644 --- a/plugin/trino-phoenix5/src/main/java/io/trino/plugin/phoenix5/PhoenixOutputTableHandle.java +++ b/plugin/trino-phoenix5/src/main/java/io/trino/plugin/phoenix5/PhoenixOutputTableHandle.java @@ -18,8 +18,7 @@ import io.trino.plugin.jdbc.JdbcOutputTableHandle; import io.trino.plugin.jdbc.JdbcTypeHandle; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.List; import java.util.Optional; diff --git a/plugin/trino-phoenix5/src/test/java/io/trino/plugin/phoenix5/TestingPhoenixServer.java b/plugin/trino-phoenix5/src/test/java/io/trino/plugin/phoenix5/TestingPhoenixServer.java index 446a089e4ab9..593124b3c6c0 100644 --- a/plugin/trino-phoenix5/src/test/java/io/trino/plugin/phoenix5/TestingPhoenixServer.java +++ b/plugin/trino-phoenix5/src/test/java/io/trino/plugin/phoenix5/TestingPhoenixServer.java @@ -13,6 +13,7 @@ */ package io.trino.plugin.phoenix5; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.log.Logger; import io.trino.testing.ResourcePresence; import io.trino.testing.SharedResource; @@ -22,8 +23,6 @@ import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster; -import javax.annotation.concurrent.GuardedBy; - import java.io.IOException; import java.io.UncheckedIOException; import java.util.logging.Level; diff --git a/plugin/trino-pinot/pom.xml b/plugin/trino-pinot/pom.xml index aa17c2a3dc6c..205fbc0ea9ef 100755 --- a/plugin/trino-pinot/pom.xml +++ b/plugin/trino-pinot/pom.xml @@ -123,8 +123,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/PinotConfig.java b/plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/PinotConfig.java index 8b3fdd93a52f..a0d4f0d10364 100755 --- a/plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/PinotConfig.java +++ b/plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/PinotConfig.java @@ -22,10 +22,9 @@ import io.airlift.units.Duration; import io.airlift.units.MinDuration; import jakarta.annotation.PostConstruct; - -import javax.validation.constraints.AssertTrue; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.AssertTrue; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; import java.net.URI; import java.util.List; diff --git a/plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/auth/PinotAuthenticationTypeConfig.java b/plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/auth/PinotAuthenticationTypeConfig.java index 8827ddece888..835dac2edf5e 100644 --- a/plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/auth/PinotAuthenticationTypeConfig.java +++ b/plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/auth/PinotAuthenticationTypeConfig.java @@ -14,8 +14,7 @@ package io.trino.plugin.pinot.auth; import io.airlift.configuration.Config; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class PinotAuthenticationTypeConfig { diff --git a/plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/auth/password/inline/PinotPasswordBrokerAuthenticationConfig.java b/plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/auth/password/inline/PinotPasswordBrokerAuthenticationConfig.java index f2124c06dc9b..4a817759e74f 100755 --- a/plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/auth/password/inline/PinotPasswordBrokerAuthenticationConfig.java +++ b/plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/auth/password/inline/PinotPasswordBrokerAuthenticationConfig.java @@ -15,8 +15,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigSecuritySensitive; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class PinotPasswordBrokerAuthenticationConfig { diff --git a/plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/auth/password/inline/PinotPasswordControllerAuthenticationConfig.java b/plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/auth/password/inline/PinotPasswordControllerAuthenticationConfig.java index 05054437bf53..aa654dc9e235 100755 --- a/plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/auth/password/inline/PinotPasswordControllerAuthenticationConfig.java +++ b/plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/auth/password/inline/PinotPasswordControllerAuthenticationConfig.java @@ -15,8 +15,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigSecuritySensitive; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class PinotPasswordControllerAuthenticationConfig { diff --git a/plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/client/PinotGrpcServerQueryClientTlsConfig.java b/plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/client/PinotGrpcServerQueryClientTlsConfig.java index 82bd937c1ea0..448eaf2e394f 100644 --- a/plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/client/PinotGrpcServerQueryClientTlsConfig.java +++ b/plugin/trino-pinot/src/main/java/io/trino/plugin/pinot/client/PinotGrpcServerQueryClientTlsConfig.java @@ -20,8 +20,7 @@ import io.airlift.configuration.ConfigSecuritySensitive; import io.airlift.configuration.validation.FileExists; import jakarta.annotation.PostConstruct; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.io.File; import java.util.Optional; diff --git a/plugin/trino-postgresql/pom.xml b/plugin/trino-postgresql/pom.xml index d24ef6f6e112..c7e68d503d46 100644 --- a/plugin/trino-postgresql/pom.xml +++ b/plugin/trino-postgresql/pom.xml @@ -49,8 +49,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-postgresql/src/main/java/io/trino/plugin/postgresql/PostgreSqlConfig.java b/plugin/trino-postgresql/src/main/java/io/trino/plugin/postgresql/PostgreSqlConfig.java index d8ef16828593..f7b0ca32f962 100644 --- a/plugin/trino-postgresql/src/main/java/io/trino/plugin/postgresql/PostgreSqlConfig.java +++ b/plugin/trino-postgresql/src/main/java/io/trino/plugin/postgresql/PostgreSqlConfig.java @@ -16,8 +16,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.DefunctConfig; import io.airlift.configuration.LegacyConfig; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; @DefunctConfig("postgresql.disable-automatic-fetch-size") public class PostgreSqlConfig diff --git a/plugin/trino-prometheus/pom.xml b/plugin/trino-prometheus/pom.xml index afdae3905acf..e4cccce04248 100644 --- a/plugin/trino-prometheus/pom.xml +++ b/plugin/trino-prometheus/pom.xml @@ -32,11 +32,6 @@ jackson-datatype-jsr310 - - com.google.code.findbugs - jsr305 - - com.google.guava guava @@ -93,8 +88,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-prometheus/src/main/java/io/trino/plugin/prometheus/PrometheusClient.java b/plugin/trino-prometheus/src/main/java/io/trino/plugin/prometheus/PrometheusClient.java index 3fc2a93af828..d49d3abd43ba 100644 --- a/plugin/trino-prometheus/src/main/java/io/trino/plugin/prometheus/PrometheusClient.java +++ b/plugin/trino-prometheus/src/main/java/io/trino/plugin/prometheus/PrometheusClient.java @@ -23,6 +23,7 @@ import io.trino.spi.type.DoubleType; import io.trino.spi.type.Type; import io.trino.spi.type.TypeManager; +import jakarta.annotation.Nullable; import okhttp3.Credentials; import okhttp3.Interceptor; import okhttp3.OkHttpClient; @@ -30,8 +31,6 @@ import okhttp3.Request; import okhttp3.Response; -import javax.annotation.Nullable; - import java.io.File; import java.io.IOException; import java.net.URI; diff --git a/plugin/trino-prometheus/src/main/java/io/trino/plugin/prometheus/PrometheusConnectorConfig.java b/plugin/trino-prometheus/src/main/java/io/trino/plugin/prometheus/PrometheusConnectorConfig.java index a9054c240998..5c09de2d3560 100644 --- a/plugin/trino-prometheus/src/main/java/io/trino/plugin/prometheus/PrometheusConnectorConfig.java +++ b/plugin/trino-prometheus/src/main/java/io/trino/plugin/prometheus/PrometheusConnectorConfig.java @@ -22,8 +22,7 @@ import io.airlift.units.Duration; import io.airlift.units.MinDuration; import jakarta.annotation.PostConstruct; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.io.File; import java.net.URI; diff --git a/plugin/trino-raptor-legacy/pom.xml b/plugin/trino-raptor-legacy/pom.xml index 608559d5be33..0fdd51c548f8 100644 --- a/plugin/trino-raptor-legacy/pom.xml +++ b/plugin/trino-raptor-legacy/pom.xml @@ -19,8 +19,8 @@ - com.google.code.findbugs - jsr305 + com.google.errorprone + error_prone_annotations true @@ -110,8 +110,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/RaptorConnector.java b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/RaptorConnector.java index e248f916e2b0..8e362eca5fa0 100644 --- a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/RaptorConnector.java +++ b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/RaptorConnector.java @@ -15,6 +15,7 @@ import com.google.common.collect.HashMultimap; import com.google.common.collect.SetMultimap; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.airlift.bootstrap.LifeCycleManager; import io.airlift.log.Logger; @@ -36,8 +37,6 @@ import jakarta.annotation.PostConstruct; import org.jdbi.v3.core.Jdbi; -import javax.annotation.concurrent.GuardedBy; - import java.util.List; import java.util.Optional; import java.util.Set; diff --git a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/RaptorSplitManager.java b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/RaptorSplitManager.java index 15663bfecf4f..0bf045b23bac 100644 --- a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/RaptorSplitManager.java +++ b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/RaptorSplitManager.java @@ -14,6 +14,7 @@ package io.trino.plugin.raptor.legacy; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.trino.plugin.base.CatalogName; import io.trino.plugin.raptor.legacy.backup.BackupService; @@ -36,8 +37,6 @@ import jakarta.annotation.PreDestroy; import org.jdbi.v3.core.result.ResultIterator; -import javax.annotation.concurrent.GuardedBy; - import java.util.List; import java.util.Map; import java.util.Optional; diff --git a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/backup/BackupConfig.java b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/backup/BackupConfig.java index 509d79a587d4..b081961f8f4e 100644 --- a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/backup/BackupConfig.java +++ b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/backup/BackupConfig.java @@ -18,10 +18,9 @@ import io.airlift.units.Duration; import io.airlift.units.MaxDuration; import io.airlift.units.MinDuration; - -import javax.annotation.Nullable; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.annotation.Nullable; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import static java.util.concurrent.TimeUnit.MINUTES; diff --git a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/backup/BackupModule.java b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/backup/BackupModule.java index f83dc06771bf..c556232528c7 100644 --- a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/backup/BackupModule.java +++ b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/backup/BackupModule.java @@ -24,10 +24,9 @@ import io.airlift.configuration.AbstractConfigurationAwareModule; import io.airlift.configuration.ConfigurationAwareModule; import io.trino.plugin.base.CatalogName; +import jakarta.annotation.Nullable; import org.weakref.jmx.MBeanExporter; -import javax.annotation.Nullable; - import java.util.Map; import java.util.Optional; diff --git a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/backup/FileBackupConfig.java b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/backup/FileBackupConfig.java index f1ee6d48ae0a..7f54dc56ce44 100644 --- a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/backup/FileBackupConfig.java +++ b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/backup/FileBackupConfig.java @@ -15,8 +15,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.io.File; diff --git a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/backup/HttpBackupConfig.java b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/backup/HttpBackupConfig.java index 83b538e7a7ef..2dfceae6015a 100644 --- a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/backup/HttpBackupConfig.java +++ b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/backup/HttpBackupConfig.java @@ -15,8 +15,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.net.URI; diff --git a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/metadata/AssignmentLimiter.java b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/metadata/AssignmentLimiter.java index 6d4a747ed04b..fedc32a774c2 100644 --- a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/metadata/AssignmentLimiter.java +++ b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/metadata/AssignmentLimiter.java @@ -14,6 +14,7 @@ package io.trino.plugin.raptor.legacy.metadata; import com.google.common.base.Ticker; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.airlift.log.Logger; import io.airlift.units.Duration; @@ -23,8 +24,6 @@ import jakarta.annotation.PostConstruct; import jakarta.annotation.PreDestroy; -import javax.annotation.concurrent.GuardedBy; - import java.util.HashMap; import java.util.HashSet; import java.util.Map; diff --git a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/metadata/ColumnStats.java b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/metadata/ColumnStats.java index e9c169d73fba..77b63ffbfe4d 100644 --- a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/metadata/ColumnStats.java +++ b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/metadata/ColumnStats.java @@ -15,8 +15,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import static com.google.common.base.MoreObjects.toStringHelper; diff --git a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/metadata/DatabaseConfig.java b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/metadata/DatabaseConfig.java index 3c9648eccb96..26befd10a601 100644 --- a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/metadata/DatabaseConfig.java +++ b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/metadata/DatabaseConfig.java @@ -15,8 +15,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class DatabaseConfig { diff --git a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/metadata/H2DatabaseConfig.java b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/metadata/H2DatabaseConfig.java index a99fc3b88505..e00ef7eea310 100644 --- a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/metadata/H2DatabaseConfig.java +++ b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/metadata/H2DatabaseConfig.java @@ -14,8 +14,7 @@ package io.trino.plugin.raptor.legacy.metadata; import io.airlift.configuration.Config; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class H2DatabaseConfig { diff --git a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/metadata/JdbcDatabaseConfig.java b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/metadata/JdbcDatabaseConfig.java index f0d56c5207a3..0ff540f8631b 100644 --- a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/metadata/JdbcDatabaseConfig.java +++ b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/metadata/JdbcDatabaseConfig.java @@ -14,8 +14,7 @@ package io.trino.plugin.raptor.legacy.metadata; import io.airlift.configuration.Config; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class JdbcDatabaseConfig { diff --git a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/metadata/MetadataConfig.java b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/metadata/MetadataConfig.java index da8db17caa5c..55a1dca3e251 100644 --- a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/metadata/MetadataConfig.java +++ b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/metadata/MetadataConfig.java @@ -16,8 +16,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; import io.airlift.units.Duration; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import static java.util.concurrent.TimeUnit.MINUTES; diff --git a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/metadata/ShardCleaner.java b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/metadata/ShardCleaner.java index aa76a46acbab..6fa8169e00cc 100644 --- a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/metadata/ShardCleaner.java +++ b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/metadata/ShardCleaner.java @@ -17,6 +17,7 @@ import com.google.common.base.Ticker; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Sets; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.airlift.log.Logger; import io.airlift.stats.CounterStat; @@ -30,8 +31,6 @@ import org.weakref.jmx.Managed; import org.weakref.jmx.Nested; -import javax.annotation.concurrent.GuardedBy; - import java.io.File; import java.sql.Timestamp; import java.util.ArrayList; diff --git a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/metadata/ShardCleanerConfig.java b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/metadata/ShardCleanerConfig.java index 63161d3c06ab..9c112b2773df 100644 --- a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/metadata/ShardCleanerConfig.java +++ b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/metadata/ShardCleanerConfig.java @@ -18,9 +18,8 @@ import io.airlift.units.Duration; import io.airlift.units.MaxDuration; import io.airlift.units.MinDuration; - -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import static java.util.concurrent.TimeUnit.DAYS; import static java.util.concurrent.TimeUnit.HOURS; diff --git a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/security/RaptorSecurityConfig.java b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/security/RaptorSecurityConfig.java index 76a8a9f5be7a..f62552835047 100644 --- a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/security/RaptorSecurityConfig.java +++ b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/security/RaptorSecurityConfig.java @@ -14,8 +14,7 @@ package io.trino.plugin.raptor.legacy.security; import io.airlift.configuration.Config; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class RaptorSecurityConfig { diff --git a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/storage/BackupStats.java b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/storage/BackupStats.java index d4419453d9ca..8d6c25f19621 100644 --- a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/storage/BackupStats.java +++ b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/storage/BackupStats.java @@ -13,6 +13,7 @@ */ package io.trino.plugin.raptor.legacy.storage; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.stats.CounterStat; import io.airlift.stats.DistributionStat; import io.airlift.units.DataSize; @@ -20,8 +21,6 @@ import org.weakref.jmx.Managed; import org.weakref.jmx.Nested; -import javax.annotation.concurrent.ThreadSafe; - import static io.trino.plugin.raptor.legacy.storage.ShardRecoveryManager.dataRate; @ThreadSafe diff --git a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/storage/ShardRecoveryStats.java b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/storage/ShardRecoveryStats.java index e85a0531abf0..ff25a862cdb4 100644 --- a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/storage/ShardRecoveryStats.java +++ b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/storage/ShardRecoveryStats.java @@ -13,6 +13,7 @@ */ package io.trino.plugin.raptor.legacy.storage; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.stats.CounterStat; import io.airlift.stats.DistributionStat; import io.airlift.units.DataSize; @@ -20,8 +21,6 @@ import org.weakref.jmx.Managed; import org.weakref.jmx.Nested; -import javax.annotation.concurrent.ThreadSafe; - @ThreadSafe public class ShardRecoveryStats { diff --git a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/storage/StorageManagerConfig.java b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/storage/StorageManagerConfig.java index 3a71d4285b4e..2ce5a87410cb 100644 --- a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/storage/StorageManagerConfig.java +++ b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/storage/StorageManagerConfig.java @@ -23,10 +23,9 @@ import io.airlift.units.MinDataSize; import io.airlift.units.MinDuration; import io.trino.orc.OrcReaderOptions; - -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import java.io.File; import java.util.concurrent.TimeUnit; diff --git a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/systemtables/ValueBuffer.java b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/systemtables/ValueBuffer.java index 256a49850bde..539156f705a6 100644 --- a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/systemtables/ValueBuffer.java +++ b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/systemtables/ValueBuffer.java @@ -16,8 +16,7 @@ import com.google.common.primitives.Primitives; import io.airlift.slice.Slice; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Objects; diff --git a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/util/PrioritizedFifoExecutor.java b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/util/PrioritizedFifoExecutor.java index 4f9234d21518..15ddd990d7b3 100644 --- a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/util/PrioritizedFifoExecutor.java +++ b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/util/PrioritizedFifoExecutor.java @@ -16,10 +16,9 @@ import com.google.common.collect.ComparisonChain; import com.google.common.util.concurrent.ExecutionList; import com.google.common.util.concurrent.ListenableFuture; +import com.google.errorprone.annotations.ThreadSafe; import io.airlift.log.Logger; -import javax.annotation.concurrent.ThreadSafe; - import java.util.Comparator; import java.util.Objects; import java.util.Queue; diff --git a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/util/SynchronizedResultIterator.java b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/util/SynchronizedResultIterator.java index 5d237237833b..2562cb727761 100644 --- a/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/util/SynchronizedResultIterator.java +++ b/plugin/trino-raptor-legacy/src/main/java/io/trino/plugin/raptor/legacy/util/SynchronizedResultIterator.java @@ -13,11 +13,10 @@ */ package io.trino.plugin.raptor.legacy.util; +import com.google.errorprone.annotations.concurrent.GuardedBy; import org.jdbi.v3.core.result.ResultIterator; import org.jdbi.v3.core.statement.StatementContext; -import javax.annotation.concurrent.GuardedBy; - import static com.google.common.base.Preconditions.checkState; import static java.util.Objects.requireNonNull; diff --git a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/backup/TestingHttpBackupResource.java b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/backup/TestingHttpBackupResource.java index 23085921a63e..17eb2634d2e1 100644 --- a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/backup/TestingHttpBackupResource.java +++ b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/backup/TestingHttpBackupResource.java @@ -13,6 +13,7 @@ */ package io.trino.plugin.raptor.legacy.backup; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.airlift.slice.Slices; import io.airlift.slice.XxHash64; @@ -30,8 +31,6 @@ import jakarta.ws.rs.core.Context; import jakarta.ws.rs.core.Response; -import javax.annotation.concurrent.GuardedBy; - import java.util.Arrays; import java.util.HashMap; import java.util.Map; diff --git a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/storage/TestStorageManagerConfig.java b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/storage/TestStorageManagerConfig.java index e4edc7206e28..57116c729648 100644 --- a/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/storage/TestStorageManagerConfig.java +++ b/plugin/trino-raptor-legacy/src/test/java/io/trino/plugin/raptor/legacy/storage/TestStorageManagerConfig.java @@ -16,10 +16,9 @@ import com.google.common.collect.ImmutableMap; import io.airlift.units.DataSize; import io.airlift.units.Duration; +import jakarta.validation.constraints.NotNull; import org.testng.annotations.Test; -import javax.validation.constraints.NotNull; - import java.io.File; import java.util.Map; @@ -128,6 +127,6 @@ public void testExplicitPropertyMappings() @Test public void testValidations() { - assertFailsValidation(new StorageManagerConfig().setDataDirectory(null), "dataDirectory", "may not be null", NotNull.class); + assertFailsValidation(new StorageManagerConfig().setDataDirectory(null), "dataDirectory", "must not be null", NotNull.class); } } diff --git a/plugin/trino-redis/pom.xml b/plugin/trino-redis/pom.xml index 1b6aa0a83a4c..65382f7130bc 100644 --- a/plugin/trino-redis/pom.xml +++ b/plugin/trino-redis/pom.xml @@ -18,12 +18,6 @@ - - com.google.code.findbugs - jsr305 - true - - com.google.guava guava @@ -75,8 +69,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-redis/src/main/java/io/trino/plugin/redis/RedisConnectorConfig.java b/plugin/trino-redis/src/main/java/io/trino/plugin/redis/RedisConnectorConfig.java index f93730192115..88a0caa51908 100644 --- a/plugin/trino-redis/src/main/java/io/trino/plugin/redis/RedisConnectorConfig.java +++ b/plugin/trino-redis/src/main/java/io/trino/plugin/redis/RedisConnectorConfig.java @@ -21,11 +21,10 @@ import io.airlift.units.Duration; import io.airlift.units.MinDuration; import io.trino.spi.HostAddress; - -import javax.annotation.Nullable; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.annotation.Nullable; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import java.io.File; import java.util.Set; diff --git a/plugin/trino-redis/src/main/java/io/trino/plugin/redis/RedisMetadata.java b/plugin/trino-redis/src/main/java/io/trino/plugin/redis/RedisMetadata.java index 5bb498d51d40..ead3c6e30fa1 100644 --- a/plugin/trino-redis/src/main/java/io/trino/plugin/redis/RedisMetadata.java +++ b/plugin/trino-redis/src/main/java/io/trino/plugin/redis/RedisMetadata.java @@ -37,8 +37,7 @@ import io.trino.spi.predicate.SortedRangeSet; import io.trino.spi.predicate.TupleDomain; import io.trino.spi.predicate.ValueSet; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.HashMap; import java.util.LinkedHashSet; diff --git a/plugin/trino-redis/src/main/java/io/trino/plugin/redis/RedisRecordCursor.java b/plugin/trino-redis/src/main/java/io/trino/plugin/redis/RedisRecordCursor.java index 5c591291096d..7e9f24ae87dc 100644 --- a/plugin/trino-redis/src/main/java/io/trino/plugin/redis/RedisRecordCursor.java +++ b/plugin/trino-redis/src/main/java/io/trino/plugin/redis/RedisRecordCursor.java @@ -30,6 +30,7 @@ import io.trino.spi.predicate.TupleDomain; import io.trino.spi.predicate.ValueSet; import io.trino.spi.type.Type; +import jakarta.annotation.Nullable; import redis.clients.jedis.Jedis; import redis.clients.jedis.JedisPool; import redis.clients.jedis.Pipeline; @@ -37,8 +38,6 @@ import redis.clients.jedis.params.ScanParams; import redis.clients.jedis.resps.ScanResult; -import javax.annotation.Nullable; - import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.LinkedList; diff --git a/plugin/trino-redis/src/main/java/io/trino/plugin/redis/decoder/RedisRowDecoder.java b/plugin/trino-redis/src/main/java/io/trino/plugin/redis/decoder/RedisRowDecoder.java index 980397a3e9e2..935e6856c2fa 100644 --- a/plugin/trino-redis/src/main/java/io/trino/plugin/redis/decoder/RedisRowDecoder.java +++ b/plugin/trino-redis/src/main/java/io/trino/plugin/redis/decoder/RedisRowDecoder.java @@ -16,8 +16,7 @@ import io.trino.decoder.DecoderColumnHandle; import io.trino.decoder.FieldValueProvider; import io.trino.decoder.RowDecoder; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Map; import java.util.Optional; diff --git a/plugin/trino-redshift/src/test/java/io/trino/plugin/redshift/TestRedshiftConnectorSmokeTest.java b/plugin/trino-redshift/src/test/java/io/trino/plugin/redshift/TestRedshiftConnectorSmokeTest.java index 7d7f43c45212..365a226d3036 100644 --- a/plugin/trino-redshift/src/test/java/io/trino/plugin/redshift/TestRedshiftConnectorSmokeTest.java +++ b/plugin/trino-redshift/src/test/java/io/trino/plugin/redshift/TestRedshiftConnectorSmokeTest.java @@ -19,7 +19,6 @@ import io.trino.testing.TestingConnectorBehavior; import static io.trino.plugin.redshift.RedshiftQueryRunner.createRedshiftQueryRunner; -import static io.trino.testing.TestingConnectorBehavior.SUPPORTS_RENAME_TABLE_ACROSS_SCHEMAS; public class TestRedshiftConnectorSmokeTest extends BaseJdbcConnectorSmokeTest diff --git a/plugin/trino-resource-group-managers/pom.xml b/plugin/trino-resource-group-managers/pom.xml index a117522b77a1..43cee682e2f2 100644 --- a/plugin/trino-resource-group-managers/pom.xml +++ b/plugin/trino-resource-group-managers/pom.xml @@ -29,8 +29,8 @@ - com.google.code.findbugs - jsr305 + com.google.errorprone + error_prone_annotations true @@ -90,8 +90,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-resource-group-managers/src/main/java/io/trino/plugin/resourcegroups/AbstractResourceConfigurationManager.java b/plugin/trino-resource-group-managers/src/main/java/io/trino/plugin/resourcegroups/AbstractResourceConfigurationManager.java index 2f363a3d0641..c9c758ca70c0 100644 --- a/plugin/trino-resource-group-managers/src/main/java/io/trino/plugin/resourcegroups/AbstractResourceConfigurationManager.java +++ b/plugin/trino-resource-group-managers/src/main/java/io/trino/plugin/resourcegroups/AbstractResourceConfigurationManager.java @@ -14,6 +14,7 @@ package io.trino.plugin.resourcegroups; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.units.DataSize; import io.airlift.units.Duration; import io.trino.spi.TrinoException; @@ -24,8 +25,6 @@ import io.trino.spi.resourcegroups.ResourceGroupId; import io.trino.spi.resourcegroups.SelectionContext; -import javax.annotation.concurrent.GuardedBy; - import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedList; diff --git a/plugin/trino-resource-group-managers/src/main/java/io/trino/plugin/resourcegroups/FileResourceGroupConfig.java b/plugin/trino-resource-group-managers/src/main/java/io/trino/plugin/resourcegroups/FileResourceGroupConfig.java index 0228d1142bb8..37ee8cb036f7 100644 --- a/plugin/trino-resource-group-managers/src/main/java/io/trino/plugin/resourcegroups/FileResourceGroupConfig.java +++ b/plugin/trino-resource-group-managers/src/main/java/io/trino/plugin/resourcegroups/FileResourceGroupConfig.java @@ -15,8 +15,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.validation.FileExists; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class FileResourceGroupConfig { diff --git a/plugin/trino-resource-group-managers/src/main/java/io/trino/plugin/resourcegroups/db/DbResourceGroupConfig.java b/plugin/trino-resource-group-managers/src/main/java/io/trino/plugin/resourcegroups/db/DbResourceGroupConfig.java index 965424bb9c2e..d954edfa95c8 100644 --- a/plugin/trino-resource-group-managers/src/main/java/io/trino/plugin/resourcegroups/db/DbResourceGroupConfig.java +++ b/plugin/trino-resource-group-managers/src/main/java/io/trino/plugin/resourcegroups/db/DbResourceGroupConfig.java @@ -18,8 +18,7 @@ import io.airlift.configuration.ConfigSecuritySensitive; import io.airlift.units.Duration; import io.airlift.units.MinDuration; - -import javax.validation.constraints.AssertTrue; +import jakarta.validation.constraints.AssertTrue; import static java.util.concurrent.TimeUnit.HOURS; import static java.util.concurrent.TimeUnit.SECONDS; diff --git a/plugin/trino-resource-group-managers/src/main/java/io/trino/plugin/resourcegroups/db/DbResourceGroupConfigurationManager.java b/plugin/trino-resource-group-managers/src/main/java/io/trino/plugin/resourcegroups/db/DbResourceGroupConfigurationManager.java index a2fa0f0adae9..09393d3252ab 100644 --- a/plugin/trino-resource-group-managers/src/main/java/io/trino/plugin/resourcegroups/db/DbResourceGroupConfigurationManager.java +++ b/plugin/trino-resource-group-managers/src/main/java/io/trino/plugin/resourcegroups/db/DbResourceGroupConfigurationManager.java @@ -17,6 +17,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Sets; +import com.google.errorprone.annotations.concurrent.GuardedBy; import com.google.inject.Inject; import io.airlift.log.Logger; import io.airlift.stats.CounterStat; @@ -38,8 +39,6 @@ import org.weakref.jmx.Managed; import org.weakref.jmx.Nested; -import javax.annotation.concurrent.GuardedBy; - import java.util.AbstractMap; import java.util.ArrayList; import java.util.HashMap; diff --git a/plugin/trino-resource-group-managers/src/test/java/io/trino/plugin/resourcegroups/db/TestDbResourceGroupConfig.java b/plugin/trino-resource-group-managers/src/test/java/io/trino/plugin/resourcegroups/db/TestDbResourceGroupConfig.java index 6bf518e8ecb3..0832722560ab 100644 --- a/plugin/trino-resource-group-managers/src/test/java/io/trino/plugin/resourcegroups/db/TestDbResourceGroupConfig.java +++ b/plugin/trino-resource-group-managers/src/test/java/io/trino/plugin/resourcegroups/db/TestDbResourceGroupConfig.java @@ -15,10 +15,9 @@ import com.google.common.collect.ImmutableMap; import io.airlift.units.Duration; +import jakarta.validation.constraints.AssertTrue; import org.testng.annotations.Test; -import javax.validation.constraints.AssertTrue; - import java.util.Map; import static io.airlift.configuration.testing.ConfigAssertions.assertFullMapping; diff --git a/plugin/trino-session-property-managers/pom.xml b/plugin/trino-session-property-managers/pom.xml index b3423b2c06a3..27cb9bcd1e47 100644 --- a/plugin/trino-session-property-managers/pom.xml +++ b/plugin/trino-session-property-managers/pom.xml @@ -28,12 +28,6 @@ jackson-databind - - com.google.code.findbugs - jsr305 - true - - com.google.guava guava @@ -90,8 +84,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-session-property-managers/src/main/java/io/trino/plugin/session/db/DbSessionPropertyManagerConfig.java b/plugin/trino-session-property-managers/src/main/java/io/trino/plugin/session/db/DbSessionPropertyManagerConfig.java index 387b2e36198b..0b64533bca71 100644 --- a/plugin/trino-session-property-managers/src/main/java/io/trino/plugin/session/db/DbSessionPropertyManagerConfig.java +++ b/plugin/trino-session-property-managers/src/main/java/io/trino/plugin/session/db/DbSessionPropertyManagerConfig.java @@ -17,9 +17,8 @@ import io.airlift.configuration.ConfigSecuritySensitive; import io.airlift.units.Duration; import io.airlift.units.MinDuration; - -import javax.annotation.Nullable; -import javax.validation.constraints.NotNull; +import jakarta.annotation.Nullable; +import jakarta.validation.constraints.NotNull; import static java.util.concurrent.TimeUnit.SECONDS; diff --git a/plugin/trino-session-property-managers/src/main/java/io/trino/plugin/session/file/FileSessionPropertyManagerConfig.java b/plugin/trino-session-property-managers/src/main/java/io/trino/plugin/session/file/FileSessionPropertyManagerConfig.java index 37df69d5d8b6..13fe4f5f6cf6 100644 --- a/plugin/trino-session-property-managers/src/main/java/io/trino/plugin/session/file/FileSessionPropertyManagerConfig.java +++ b/plugin/trino-session-property-managers/src/main/java/io/trino/plugin/session/file/FileSessionPropertyManagerConfig.java @@ -15,8 +15,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.validation.FileExists; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.io.File; diff --git a/plugin/trino-singlestore/pom.xml b/plugin/trino-singlestore/pom.xml index 2fce8eb26028..00b6fb79622d 100644 --- a/plugin/trino-singlestore/pom.xml +++ b/plugin/trino-singlestore/pom.xml @@ -55,8 +55,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-singlestore/src/main/java/io/trino/plugin/singlestore/SingleStoreConfig.java b/plugin/trino-singlestore/src/main/java/io/trino/plugin/singlestore/SingleStoreConfig.java index d3051ce031f5..f195e905aaa5 100644 --- a/plugin/trino-singlestore/src/main/java/io/trino/plugin/singlestore/SingleStoreConfig.java +++ b/plugin/trino-singlestore/src/main/java/io/trino/plugin/singlestore/SingleStoreConfig.java @@ -17,8 +17,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.LegacyConfig; import io.airlift.units.Duration; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.util.concurrent.TimeUnit; diff --git a/plugin/trino-singlestore/src/main/java/io/trino/plugin/singlestore/SingleStoreJdbcConfig.java b/plugin/trino-singlestore/src/main/java/io/trino/plugin/singlestore/SingleStoreJdbcConfig.java index 4e4f19497208..dfd550c0712f 100644 --- a/plugin/trino-singlestore/src/main/java/io/trino/plugin/singlestore/SingleStoreJdbcConfig.java +++ b/plugin/trino-singlestore/src/main/java/io/trino/plugin/singlestore/SingleStoreJdbcConfig.java @@ -14,8 +14,7 @@ package io.trino.plugin.singlestore; import io.trino.plugin.jdbc.BaseJdbcConfig; - -import javax.validation.constraints.AssertFalse; +import jakarta.validation.constraints.AssertFalse; public class SingleStoreJdbcConfig extends BaseJdbcConfig diff --git a/plugin/trino-thrift-api/pom.xml b/plugin/trino-thrift-api/pom.xml index 3b25c6cc9295..5397d5769e8e 100644 --- a/plugin/trino-thrift-api/pom.xml +++ b/plugin/trino-thrift-api/pom.xml @@ -23,12 +23,6 @@ jackson-annotations - - com.google.code.findbugs - jsr305 - true - - com.google.guava guava @@ -49,6 +43,11 @@ trino-spi + + jakarta.annotation + jakarta.annotation-api + + io.airlift stats diff --git a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftBlock.java b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftBlock.java index 7279ca56741c..dd77d85fd430 100644 --- a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftBlock.java +++ b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftBlock.java @@ -41,8 +41,7 @@ import io.trino.spi.type.TimestampType; import io.trino.spi.type.Type; import io.trino.spi.type.VarcharType; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Objects; diff --git a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftColumnMetadata.java b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftColumnMetadata.java index a6f1640f645d..7c25d650d8fb 100644 --- a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftColumnMetadata.java +++ b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftColumnMetadata.java @@ -18,8 +18,7 @@ import io.airlift.drift.annotations.ThriftStruct; import io.trino.spi.connector.ColumnMetadata; import io.trino.spi.type.TypeManager; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Objects; import java.util.Optional; diff --git a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftNullableColumnSet.java b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftNullableColumnSet.java index 7bb6b1994ea6..1ff7d6327027 100644 --- a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftNullableColumnSet.java +++ b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftNullableColumnSet.java @@ -16,8 +16,7 @@ import io.airlift.drift.annotations.ThriftConstructor; import io.airlift.drift.annotations.ThriftField; import io.airlift.drift.annotations.ThriftStruct; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Objects; import java.util.Set; diff --git a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftNullableSchemaName.java b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftNullableSchemaName.java index 7216d42d8b18..c789b3159916 100644 --- a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftNullableSchemaName.java +++ b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftNullableSchemaName.java @@ -16,8 +16,7 @@ import io.airlift.drift.annotations.ThriftConstructor; import io.airlift.drift.annotations.ThriftField; import io.airlift.drift.annotations.ThriftStruct; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Objects; diff --git a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftNullableTableMetadata.java b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftNullableTableMetadata.java index e017fdd0397b..edaa2eb57c9f 100644 --- a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftNullableTableMetadata.java +++ b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftNullableTableMetadata.java @@ -16,8 +16,7 @@ import io.airlift.drift.annotations.ThriftConstructor; import io.airlift.drift.annotations.ThriftField; import io.airlift.drift.annotations.ThriftStruct; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Objects; diff --git a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftNullableToken.java b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftNullableToken.java index 9726a016a69c..d4bf886cc04f 100644 --- a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftNullableToken.java +++ b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftNullableToken.java @@ -16,8 +16,7 @@ import io.airlift.drift.annotations.ThriftConstructor; import io.airlift.drift.annotations.ThriftField; import io.airlift.drift.annotations.ThriftStruct; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Objects; diff --git a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftPageResult.java b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftPageResult.java index f451d63fa3f8..d93adab16fbe 100644 --- a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftPageResult.java +++ b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftPageResult.java @@ -22,8 +22,7 @@ import io.trino.spi.connector.RecordCursor; import io.trino.spi.connector.RecordSet; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.ArrayList; import java.util.List; diff --git a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftSplitBatch.java b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftSplitBatch.java index 82856f7745b3..8b0da515e307 100644 --- a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftSplitBatch.java +++ b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftSplitBatch.java @@ -16,8 +16,7 @@ import io.airlift.drift.annotations.ThriftConstructor; import io.airlift.drift.annotations.ThriftField; import io.airlift.drift.annotations.ThriftStruct; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.List; import java.util.Objects; diff --git a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftTableMetadata.java b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftTableMetadata.java index 8e75620c6922..7900c3085bdd 100644 --- a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftTableMetadata.java +++ b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftTableMetadata.java @@ -16,8 +16,7 @@ import io.airlift.drift.annotations.ThriftConstructor; import io.airlift.drift.annotations.ThriftField; import io.airlift.drift.annotations.ThriftStruct; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.List; import java.util.Objects; diff --git a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftTupleDomain.java b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftTupleDomain.java index 9175d99bf8c4..bb404de7992b 100644 --- a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftTupleDomain.java +++ b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/TrinoThriftTupleDomain.java @@ -17,8 +17,7 @@ import io.airlift.drift.annotations.ThriftConstructor; import io.airlift.drift.annotations.ThriftField; import io.airlift.drift.annotations.ThriftStruct; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Map; import java.util.Objects; diff --git a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/SliceData.java b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/SliceData.java index 7a620164c9ba..8bd273f7385b 100644 --- a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/SliceData.java +++ b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/SliceData.java @@ -19,8 +19,7 @@ import io.trino.spi.block.Block; import io.trino.spi.block.VariableWidthBlock; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Arrays; import java.util.Objects; diff --git a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftBigint.java b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftBigint.java index e483bdff0a3d..3b5d301d7504 100644 --- a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftBigint.java +++ b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftBigint.java @@ -21,8 +21,7 @@ import io.trino.spi.block.LongArrayBlock; import io.trino.spi.connector.RecordSet; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Arrays; import java.util.Objects; diff --git a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftBigintArray.java b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftBigintArray.java index 56874d0fed87..774abb9581ae 100644 --- a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftBigintArray.java +++ b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftBigintArray.java @@ -23,8 +23,7 @@ import io.trino.spi.block.LongArrayBlock; import io.trino.spi.block.RunLengthEncodedBlock; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Arrays; import java.util.Objects; diff --git a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftBoolean.java b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftBoolean.java index 156367323a6c..fd71e7dff297 100644 --- a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftBoolean.java +++ b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftBoolean.java @@ -20,8 +20,7 @@ import io.trino.spi.block.Block; import io.trino.spi.block.ByteArrayBlock; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Arrays; import java.util.Objects; diff --git a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftDate.java b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftDate.java index d448279c49cb..76af0146ed01 100644 --- a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftDate.java +++ b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftDate.java @@ -21,8 +21,7 @@ import io.trino.spi.block.IntArrayBlock; import io.trino.spi.connector.RecordSet; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Arrays; import java.util.Objects; diff --git a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftDouble.java b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftDouble.java index b0570260ddaf..7c2c49993d54 100644 --- a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftDouble.java +++ b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftDouble.java @@ -20,8 +20,7 @@ import io.trino.spi.block.Block; import io.trino.spi.block.LongArrayBlock; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Arrays; import java.util.Objects; diff --git a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftHyperLogLog.java b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftHyperLogLog.java index 3dac3c05a48e..ce9bc978b99f 100644 --- a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftHyperLogLog.java +++ b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftHyperLogLog.java @@ -19,8 +19,7 @@ import io.trino.plugin.thrift.api.TrinoThriftBlock; import io.trino.spi.block.Block; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Objects; diff --git a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftInteger.java b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftInteger.java index c9d658f349f9..d27a34a7d68a 100644 --- a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftInteger.java +++ b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftInteger.java @@ -21,8 +21,7 @@ import io.trino.spi.block.IntArrayBlock; import io.trino.spi.connector.RecordSet; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Arrays; import java.util.Objects; diff --git a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftJson.java b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftJson.java index a60b98b5bbb0..61aefc3bba2c 100644 --- a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftJson.java +++ b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftJson.java @@ -19,8 +19,7 @@ import io.trino.plugin.thrift.api.TrinoThriftBlock; import io.trino.spi.block.Block; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Objects; diff --git a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftTimestamp.java b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftTimestamp.java index dbbb243f3326..c792e1dc12a3 100644 --- a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftTimestamp.java +++ b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftTimestamp.java @@ -21,8 +21,7 @@ import io.trino.spi.block.LongArrayBlock; import io.trino.spi.connector.RecordSet; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Arrays; import java.util.Objects; diff --git a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftVarchar.java b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftVarchar.java index f72dc006b900..358f7d205366 100644 --- a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftVarchar.java +++ b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/datatypes/TrinoThriftVarchar.java @@ -20,8 +20,7 @@ import io.trino.spi.block.Block; import io.trino.spi.type.Type; import io.trino.spi.type.VarcharType; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Objects; diff --git a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/valuesets/TrinoThriftRangeValueSet.java b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/valuesets/TrinoThriftRangeValueSet.java index 215cb2215dd9..faf432f3f13b 100644 --- a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/valuesets/TrinoThriftRangeValueSet.java +++ b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/valuesets/TrinoThriftRangeValueSet.java @@ -21,8 +21,7 @@ import io.trino.plugin.thrift.api.TrinoThriftBlock; import io.trino.spi.predicate.Range; import io.trino.spi.predicate.SortedRangeSet; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.List; import java.util.Objects; diff --git a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/valuesets/TrinoThriftValueSet.java b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/valuesets/TrinoThriftValueSet.java index 8741510796b8..0f8b47286bf1 100644 --- a/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/valuesets/TrinoThriftValueSet.java +++ b/plugin/trino-thrift-api/src/main/java/io/trino/plugin/thrift/api/valuesets/TrinoThriftValueSet.java @@ -20,8 +20,7 @@ import io.trino.spi.predicate.EquatableValueSet; import io.trino.spi.predicate.SortedRangeSet; import io.trino.spi.predicate.ValueSet; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Objects; diff --git a/plugin/trino-thrift-testing-server/pom.xml b/plugin/trino-thrift-testing-server/pom.xml index 9eabe0a6de4e..13465e71ef53 100644 --- a/plugin/trino-thrift-testing-server/pom.xml +++ b/plugin/trino-thrift-testing-server/pom.xml @@ -24,12 +24,6 @@ jackson-annotations - - com.google.code.findbugs - jsr305 - true - - com.google.guava guava diff --git a/plugin/trino-thrift-testing-server/src/main/java/io/trino/plugin/thrift/server/ThriftTpchService.java b/plugin/trino-thrift-testing-server/src/main/java/io/trino/plugin/thrift/server/ThriftTpchService.java index dfb52d26eb60..3d7f753d855f 100644 --- a/plugin/trino-thrift-testing-server/src/main/java/io/trino/plugin/thrift/server/ThriftTpchService.java +++ b/plugin/trino-thrift-testing-server/src/main/java/io/trino/plugin/thrift/server/ThriftTpchService.java @@ -42,10 +42,9 @@ import io.trino.tpch.TpchColumn; import io.trino.tpch.TpchEntity; import io.trino.tpch.TpchTable; +import jakarta.annotation.Nullable; import jakarta.annotation.PreDestroy; -import javax.annotation.Nullable; - import java.io.Closeable; import java.util.ArrayList; import java.util.List; diff --git a/plugin/trino-thrift/pom.xml b/plugin/trino-thrift/pom.xml index 0fb7883e0475..71cde2bc1b51 100644 --- a/plugin/trino-thrift/pom.xml +++ b/plugin/trino-thrift/pom.xml @@ -18,12 +18,6 @@ - - com.google.code.findbugs - jsr305 - true - - com.google.guava guava @@ -67,6 +61,12 @@ io.airlift.drift drift-client + + + javax.validation + validation-api + + @@ -100,8 +100,14 @@ - javax.validation - validation-api + jakarta.annotation + jakarta.annotation-api + true + + + + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-thrift/src/main/java/io/trino/plugin/thrift/ThriftColumnHandle.java b/plugin/trino-thrift/src/main/java/io/trino/plugin/thrift/ThriftColumnHandle.java index ec1a9b62a0b4..3e9d1779aa71 100644 --- a/plugin/trino-thrift/src/main/java/io/trino/plugin/thrift/ThriftColumnHandle.java +++ b/plugin/trino-thrift/src/main/java/io/trino/plugin/thrift/ThriftColumnHandle.java @@ -18,8 +18,7 @@ import io.trino.spi.connector.ColumnHandle; import io.trino.spi.connector.ColumnMetadata; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Objects; import java.util.Optional; diff --git a/plugin/trino-thrift/src/main/java/io/trino/plugin/thrift/ThriftConnectorConfig.java b/plugin/trino-thrift/src/main/java/io/trino/plugin/thrift/ThriftConnectorConfig.java index 510c15199134..5f7c972d099b 100644 --- a/plugin/trino-thrift/src/main/java/io/trino/plugin/thrift/ThriftConnectorConfig.java +++ b/plugin/trino-thrift/src/main/java/io/trino/plugin/thrift/ThriftConnectorConfig.java @@ -17,9 +17,8 @@ import io.airlift.units.DataSize; import io.airlift.units.MaxDataSize; import io.airlift.units.MinDataSize; - -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import static io.airlift.units.DataSize.Unit.MEGABYTE; diff --git a/plugin/trino-thrift/src/main/java/io/trino/plugin/thrift/ThriftIndexPageSource.java b/plugin/trino-thrift/src/main/java/io/trino/plugin/thrift/ThriftIndexPageSource.java index 36ead2d164ee..318ece1ad96c 100644 --- a/plugin/trino-thrift/src/main/java/io/trino/plugin/thrift/ThriftIndexPageSource.java +++ b/plugin/trino-thrift/src/main/java/io/trino/plugin/thrift/ThriftIndexPageSource.java @@ -29,8 +29,7 @@ import io.trino.spi.connector.ConnectorPageSource; import io.trino.spi.connector.RecordSet; import io.trino.spi.type.Type; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.ArrayList; import java.util.HashMap; diff --git a/plugin/trino-thrift/src/main/java/io/trino/plugin/thrift/location/ExtendedSimpleAddressSelectorBinder.java b/plugin/trino-thrift/src/main/java/io/trino/plugin/thrift/location/ExtendedSimpleAddressSelectorBinder.java index ee30cb3e12d3..757330a4ef1d 100644 --- a/plugin/trino-thrift/src/main/java/io/trino/plugin/thrift/location/ExtendedSimpleAddressSelectorBinder.java +++ b/plugin/trino-thrift/src/main/java/io/trino/plugin/thrift/location/ExtendedSimpleAddressSelectorBinder.java @@ -21,6 +21,7 @@ import io.airlift.drift.client.address.SimpleAddressSelectorConfig; import io.airlift.drift.client.guice.AbstractAnnotatedProvider; import io.airlift.drift.client.guice.AddressSelectorBinder; +import io.airlift.drift.transport.client.Address; import java.lang.annotation.Annotation; @@ -45,7 +46,7 @@ public void bind(Binder binder, Annotation annotation, String prefix) } private static class ExtendedSimpleAddressSelectorProvider - extends AbstractAnnotatedProvider> + extends AbstractAnnotatedProvider> { public ExtendedSimpleAddressSelectorProvider(Annotation annotation) { @@ -53,7 +54,7 @@ public ExtendedSimpleAddressSelectorProvider(Annotation annotation) } @Override - protected AddressSelector get(Injector injector, Annotation annotation) + protected AddressSelector get(Injector injector, Annotation annotation) { return new ExtendedSimpleAddressSelector(new SimpleAddressSelector( injector.getInstance(Key.get(SimpleAddressSelectorConfig.class, annotation)))); diff --git a/plugin/trino-tpcds/pom.xml b/plugin/trino-tpcds/pom.xml index ffe7ea47eb28..362dec1a47af 100644 --- a/plugin/trino-tpcds/pom.xml +++ b/plugin/trino-tpcds/pom.xml @@ -58,8 +58,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/plugin/trino-tpcds/src/main/java/io/trino/plugin/tpcds/TpcdsConfig.java b/plugin/trino-tpcds/src/main/java/io/trino/plugin/tpcds/TpcdsConfig.java index 2089fb36c81a..ee068000c926 100644 --- a/plugin/trino-tpcds/src/main/java/io/trino/plugin/tpcds/TpcdsConfig.java +++ b/plugin/trino-tpcds/src/main/java/io/trino/plugin/tpcds/TpcdsConfig.java @@ -15,8 +15,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; - -import javax.validation.constraints.Min; +import jakarta.validation.constraints.Min; public class TpcdsConfig { diff --git a/pom.xml b/pom.xml index f7b6c99e9582..3e76aa0931c8 100644 --- a/pom.xml +++ b/pom.xml @@ -151,7 +151,7 @@ 1.10.2 2.7.7-1 4.13.0 - 233 + 234 11.0.0 1.11.1 ${dep.airlift.version} @@ -672,7 +672,7 @@ io.airlift units - 1.8 + 1.9 @@ -2290,6 +2290,22 @@ jar MAIN + + io.airlift + event-http + + ${dep.airlift.version} + jar + MAIN + + + io.airlift + jmx-http-rpc + + ${dep.airlift.version} + jar + MAIN + diff --git a/service/trino-proxy/pom.xml b/service/trino-proxy/pom.xml index 6acb4c0e73f7..d120752e07d4 100644 --- a/service/trino-proxy/pom.xml +++ b/service/trino-proxy/pom.xml @@ -139,13 +139,13 @@ - jakarta.ws.rs - jakarta.ws.rs-api + jakarta.validation + jakarta.validation-api - javax.validation - validation-api + jakarta.ws.rs + jakarta.ws.rs-api diff --git a/service/trino-proxy/src/main/java/io/trino/proxy/ProxyConfig.java b/service/trino-proxy/src/main/java/io/trino/proxy/ProxyConfig.java index 456dadfe906f..5f30518fb9f8 100644 --- a/service/trino-proxy/src/main/java/io/trino/proxy/ProxyConfig.java +++ b/service/trino-proxy/src/main/java/io/trino/proxy/ProxyConfig.java @@ -16,8 +16,7 @@ import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; import io.airlift.configuration.validation.FileExists; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.io.File; import java.net.URI; diff --git a/service/trino-verifier/pom.xml b/service/trino-verifier/pom.xml index 0989dadd2020..486c360c857b 100644 --- a/service/trino-verifier/pom.xml +++ b/service/trino-verifier/pom.xml @@ -24,8 +24,8 @@ - com.google.code.findbugs - jsr305 + com.google.errorprone + error_prone_annotations true @@ -105,8 +105,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/service/trino-verifier/src/main/java/io/trino/verifier/DatabaseEventClient.java b/service/trino-verifier/src/main/java/io/trino/verifier/DatabaseEventClient.java index 0bc3d50d7d4a..c8f0733f2a24 100644 --- a/service/trino-verifier/src/main/java/io/trino/verifier/DatabaseEventClient.java +++ b/service/trino-verifier/src/main/java/io/trino/verifier/DatabaseEventClient.java @@ -16,10 +16,9 @@ import com.google.inject.Inject; import io.airlift.event.client.AbstractEventClient; import io.airlift.json.JsonCodec; +import jakarta.annotation.Nullable; import jakarta.annotation.PostConstruct; -import javax.annotation.Nullable; - import java.util.List; import java.util.Optional; import java.util.OptionalDouble; diff --git a/service/trino-verifier/src/main/java/io/trino/verifier/Verifier.java b/service/trino-verifier/src/main/java/io/trino/verifier/Verifier.java index e3446b3ab491..1cd786b7a4e4 100644 --- a/service/trino-verifier/src/main/java/io/trino/verifier/Verifier.java +++ b/service/trino-verifier/src/main/java/io/trino/verifier/Verifier.java @@ -20,8 +20,7 @@ import io.airlift.units.Duration; import io.trino.spi.ErrorCode; import io.trino.spi.TrinoException; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.Closeable; import java.io.IOException; diff --git a/service/trino-verifier/src/main/java/io/trino/verifier/VerifierConfig.java b/service/trino-verifier/src/main/java/io/trino/verifier/VerifierConfig.java index ca9938346c67..22f7b4da045c 100644 --- a/service/trino-verifier/src/main/java/io/trino/verifier/VerifierConfig.java +++ b/service/trino-verifier/src/main/java/io/trino/verifier/VerifierConfig.java @@ -23,12 +23,11 @@ import io.airlift.units.Duration; import io.trino.sql.tree.Identifier; import io.trino.sql.tree.QualifiedName; +import jakarta.annotation.Nullable; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import org.joda.time.DateTime; -import javax.annotation.Nullable; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; - import java.util.Arrays; import java.util.List; import java.util.Set; diff --git a/service/trino-verifier/src/main/java/io/trino/verifier/VerifierQueryEvent.java b/service/trino-verifier/src/main/java/io/trino/verifier/VerifierQueryEvent.java index afc33a57c3ad..7845278818f4 100644 --- a/service/trino-verifier/src/main/java/io/trino/verifier/VerifierQueryEvent.java +++ b/service/trino-verifier/src/main/java/io/trino/verifier/VerifierQueryEvent.java @@ -14,11 +14,10 @@ package io.trino.verifier; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.Immutable; import io.airlift.event.client.EventField; import io.airlift.event.client.EventType; -import javax.annotation.concurrent.Immutable; - import java.util.List; @Immutable diff --git a/testing/trino-benchmark/pom.xml b/testing/trino-benchmark/pom.xml index 898d328869c0..7e404c71226c 100644 --- a/testing/trino-benchmark/pom.xml +++ b/testing/trino-benchmark/pom.xml @@ -27,12 +27,6 @@ jackson-core - - com.google.code.findbugs - jsr305 - true - - com.google.guava guava @@ -93,6 +87,11 @@ trino-tpch + + jakarta.annotation + jakarta.annotation-api + + org.jetbrains annotations diff --git a/testing/trino-benchmark/src/main/java/io/trino/benchmark/AbstractBenchmark.java b/testing/trino-benchmark/src/main/java/io/trino/benchmark/AbstractBenchmark.java index 7521542d49ba..0d93d5e799c2 100644 --- a/testing/trino-benchmark/src/main/java/io/trino/benchmark/AbstractBenchmark.java +++ b/testing/trino-benchmark/src/main/java/io/trino/benchmark/AbstractBenchmark.java @@ -15,8 +15,7 @@ import io.airlift.units.DataSize; import io.airlift.units.Duration; - -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.util.Map; diff --git a/testing/trino-faulttolerant-tests/pom.xml b/testing/trino-faulttolerant-tests/pom.xml index 9ea71669532a..246e8082a317 100644 --- a/testing/trino-faulttolerant-tests/pom.xml +++ b/testing/trino-faulttolerant-tests/pom.xml @@ -33,12 +33,6 @@ provided - - com.google.code.findbugs - jsr305 - runtime - - com.google.guava guava diff --git a/testing/trino-product-tests-launcher/pom.xml b/testing/trino-product-tests-launcher/pom.xml index c5dc43a74221..e8b12814758b 100644 --- a/testing/trino-product-tests-launcher/pom.xml +++ b/testing/trino-product-tests-launcher/pom.xml @@ -44,8 +44,8 @@ - com.google.code.findbugs - jsr305 + com.google.errorprone + error_prone_annotations true diff --git a/testing/trino-product-tests-launcher/src/main/java/io/trino/tests/product/launcher/docker/DockerFiles.java b/testing/trino-product-tests-launcher/src/main/java/io/trino/tests/product/launcher/docker/DockerFiles.java index f6dc72747dc1..cffdce82086e 100644 --- a/testing/trino-product-tests-launcher/src/main/java/io/trino/tests/product/launcher/docker/DockerFiles.java +++ b/testing/trino-product-tests-launcher/src/main/java/io/trino/tests/product/launcher/docker/DockerFiles.java @@ -14,13 +14,12 @@ package io.trino.tests.product.launcher.docker; import com.google.common.reflect.ClassPath; +import com.google.errorprone.annotations.concurrent.GuardedBy; import dev.failsafe.Failsafe; import dev.failsafe.RetryPolicy; import io.airlift.log.Logger; import jakarta.annotation.PreDestroy; -import javax.annotation.concurrent.GuardedBy; - import java.io.IOException; import java.io.InputStream; import java.io.UncheckedIOException; diff --git a/testing/trino-product-tests-launcher/src/main/java/io/trino/tests/product/launcher/env/DockerContainer.java b/testing/trino-product-tests-launcher/src/main/java/io/trino/tests/product/launcher/env/DockerContainer.java index a6441dfe8b80..d204eed5854d 100644 --- a/testing/trino-product-tests-launcher/src/main/java/io/trino/tests/product/launcher/env/DockerContainer.java +++ b/testing/trino-product-tests-launcher/src/main/java/io/trino/tests/product/launcher/env/DockerContainer.java @@ -20,6 +20,7 @@ import com.google.common.base.Stopwatch; import com.google.common.collect.ImmutableList; import com.google.common.io.RecursiveDeleteOption; +import com.google.errorprone.annotations.concurrent.GuardedBy; import dev.failsafe.Failsafe; import dev.failsafe.FailsafeExecutor; import dev.failsafe.Timeout; @@ -36,8 +37,6 @@ import org.testcontainers.images.builder.Transferable; import org.testcontainers.utility.DockerImageName; -import javax.annotation.concurrent.GuardedBy; - import java.io.IOException; import java.io.UncheckedIOException; import java.nio.file.Files; diff --git a/testing/trino-server-dev/pom.xml b/testing/trino-server-dev/pom.xml index 16f53817505a..95c82036f34e 100644 --- a/testing/trino-server-dev/pom.xml +++ b/testing/trino-server-dev/pom.xml @@ -48,8 +48,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api diff --git a/testing/trino-server-dev/src/main/java/io/trino/server/DevelopmentLoaderConfig.java b/testing/trino-server-dev/src/main/java/io/trino/server/DevelopmentLoaderConfig.java index d5601e3edf5a..d624a9a7b023 100644 --- a/testing/trino-server-dev/src/main/java/io/trino/server/DevelopmentLoaderConfig.java +++ b/testing/trino-server-dev/src/main/java/io/trino/server/DevelopmentLoaderConfig.java @@ -17,8 +17,7 @@ import com.google.common.collect.ImmutableList; import io.airlift.configuration.Config; import io.airlift.resolver.ArtifactResolver; - -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.util.List; diff --git a/testing/trino-testing-services/pom.xml b/testing/trino-testing-services/pom.xml index 811189121982..9d3c36541a3f 100644 --- a/testing/trino-testing-services/pom.xml +++ b/testing/trino-testing-services/pom.xml @@ -17,11 +17,6 @@ - - com.google.code.findbugs - jsr305 - - com.google.errorprone error_prone_annotations @@ -48,6 +43,11 @@ units + + jakarta.annotation + jakarta.annotation-api + + org.jetbrains annotations diff --git a/testing/trino-testing-services/src/main/java/io/trino/testing/SharedResource.java b/testing/trino-testing-services/src/main/java/io/trino/testing/SharedResource.java index d3e272442105..2a98d55f78fc 100644 --- a/testing/trino-testing-services/src/main/java/io/trino/testing/SharedResource.java +++ b/testing/trino-testing-services/src/main/java/io/trino/testing/SharedResource.java @@ -13,9 +13,9 @@ */ package io.trino.testing; -import javax.annotation.Nullable; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; +import jakarta.annotation.Nullable; import java.util.concurrent.Callable; import java.util.function.Supplier; diff --git a/testing/trino-testing-services/src/main/java/io/trino/testng/services/FlakyTestRetryAnalyzer.java b/testing/trino-testing-services/src/main/java/io/trino/testng/services/FlakyTestRetryAnalyzer.java index be8269c8fd2f..849403bea407 100644 --- a/testing/trino-testing-services/src/main/java/io/trino/testng/services/FlakyTestRetryAnalyzer.java +++ b/testing/trino-testing-services/src/main/java/io/trino/testng/services/FlakyTestRetryAnalyzer.java @@ -15,13 +15,12 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Joiner; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.log.Logger; import org.testng.IRetryAnalyzer; import org.testng.ITestNGMethod; import org.testng.ITestResult; -import javax.annotation.concurrent.GuardedBy; - import java.lang.reflect.Method; import java.util.HashMap; import java.util.Map; diff --git a/testing/trino-testing-services/src/main/java/io/trino/testng/services/LogTestDurationListener.java b/testing/trino-testing-services/src/main/java/io/trino/testng/services/LogTestDurationListener.java index 03c7c4627a16..f5e0e4d726b7 100644 --- a/testing/trino-testing-services/src/main/java/io/trino/testng/services/LogTestDurationListener.java +++ b/testing/trino-testing-services/src/main/java/io/trino/testng/services/LogTestDurationListener.java @@ -14,6 +14,7 @@ package io.trino.testng.services; import com.google.common.collect.ImmutableMap; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.log.Logger; import io.airlift.units.Duration; import io.trino.jvm.Threads; @@ -24,8 +25,6 @@ import org.testng.ITestClass; import org.testng.ITestResult; -import javax.annotation.concurrent.GuardedBy; - import java.util.Arrays; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; diff --git a/testing/trino-tests/pom.xml b/testing/trino-tests/pom.xml index e4cc082f0369..4faf39652a41 100644 --- a/testing/trino-tests/pom.xml +++ b/testing/trino-tests/pom.xml @@ -34,8 +34,8 @@ - com.google.code.findbugs - jsr305 + com.google.errorprone + error_prone_annotations runtime @@ -111,6 +111,12 @@ runtime + + jakarta.annotation + jakarta.annotation-api + runtime + + jakarta.ws.rs jakarta.ws.rs-api diff --git a/testing/trino-tests/src/test/java/io/trino/execution/EventsCollector.java b/testing/trino-tests/src/test/java/io/trino/execution/EventsCollector.java index 1eb1f553202a..bda5aaf11920 100644 --- a/testing/trino-tests/src/test/java/io/trino/execution/EventsCollector.java +++ b/testing/trino-tests/src/test/java/io/trino/execution/EventsCollector.java @@ -14,15 +14,14 @@ package io.trino.execution; import com.google.common.collect.ImmutableList; +import com.google.errorprone.annotations.ThreadSafe; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.units.Duration; import io.trino.spi.QueryId; import io.trino.spi.eventlistener.QueryCompletedEvent; import io.trino.spi.eventlistener.QueryCreatedEvent; import io.trino.spi.eventlistener.SplitCompletedEvent; -import javax.annotation.concurrent.GuardedBy; -import javax.annotation.concurrent.ThreadSafe; - import java.util.ArrayList; import java.util.List; import java.util.concurrent.ConcurrentHashMap; diff --git a/testing/trino-tests/src/test/java/io/trino/execution/TestUserImpersonationAccessControl.java b/testing/trino-tests/src/test/java/io/trino/execution/TestUserImpersonationAccessControl.java index a4ae993975a2..02acc057e16c 100644 --- a/testing/trino-tests/src/test/java/io/trino/execution/TestUserImpersonationAccessControl.java +++ b/testing/trino-tests/src/test/java/io/trino/execution/TestUserImpersonationAccessControl.java @@ -24,11 +24,10 @@ import io.trino.testing.AbstractTestQueryFramework; import io.trino.testing.DistributedQueryRunner; import io.trino.testing.QueryRunner; +import jakarta.annotation.Nullable; import okhttp3.OkHttpClient; import org.testng.annotations.Test; -import javax.annotation.Nullable; - import java.time.ZoneId; import java.util.Locale; import java.util.Optional; diff --git a/testing/trino-tests/src/test/java/io/trino/sql/planner/BaseIcebergCostBasedPlanTest.java b/testing/trino-tests/src/test/java/io/trino/sql/planner/BaseIcebergCostBasedPlanTest.java index d6b22e1f7c24..a76924bccaef 100644 --- a/testing/trino-tests/src/test/java/io/trino/sql/planner/BaseIcebergCostBasedPlanTest.java +++ b/testing/trino-tests/src/test/java/io/trino/sql/planner/BaseIcebergCostBasedPlanTest.java @@ -15,6 +15,7 @@ package io.trino.sql.planner; import com.google.common.collect.ImmutableMap; +import com.google.errorprone.annotations.concurrent.GuardedBy; import io.airlift.log.Logger; import io.trino.hdfs.DynamicHdfsConfiguration; import io.trino.hdfs.HdfsConfig; @@ -40,8 +41,6 @@ import org.testng.annotations.AfterSuite; import org.testng.annotations.BeforeClass; -import javax.annotation.concurrent.GuardedBy; - import java.io.IOException; import java.io.UncheckedIOException; import java.nio.file.Path;