From 45aebf3df3a75ee63c4b7f849764547c4a518646 Mon Sep 17 00:00:00 2001 From: sullis Date: Sat, 9 Nov 2024 20:33:41 -0800 Subject: [PATCH] use jspecify annotations --- client/pom.xml | 5 +++++ .../AsyncCompletionHandler.java | 2 +- .../AsyncCompletionHandlerBase.java | 3 +-- .../java/org/asynchttpclient/AsyncHandler.java | 2 +- .../asynchttpclient/AsyncHttpClientConfig.java | 8 +++----- .../DefaultAsyncHttpClient.java | 2 +- .../DefaultAsyncHttpClientConfig.java | 18 +++++++++--------- .../org/asynchttpclient/DefaultRequest.java | 2 +- .../main/java/org/asynchttpclient/Param.java | 2 +- .../main/java/org/asynchttpclient/Realm.java | 2 +- .../main/java/org/asynchttpclient/Request.java | 2 +- .../asynchttpclient/RequestBuilderBase.java | 2 +- .../java/org/asynchttpclient/Response.java | 2 +- .../asynchttpclient/channel/ChannelPool.java | 2 +- .../channel/ChannelPoolPartitioning.java | 2 +- .../channel/NoopChannelPool.java | 2 +- .../config/AsyncHttpClientConfigDefaults.java | 6 +++--- .../config/AsyncHttpClientConfigHelper.java | 6 +++--- .../cookie/ThreadSafeCookieStore.java | 6 +++--- .../asynchttpclient/filter/FilterContext.java | 2 +- .../handler/BodyDeferringAsyncHandler.java | 2 +- .../handler/TransferCompletionHandler.java | 2 +- .../resumable/ResumableAsyncHandler.java | 2 +- .../org/asynchttpclient/ntlm/NtlmEngine.java | 2 +- .../ntlm/NtlmEngineException.java | 3 +-- .../org/asynchttpclient/proxy/ProxyServer.java | 2 +- .../proxy/ProxyServerSelector.java | 2 +- .../spnego/NamePasswordCallbackHandler.java | 2 +- .../asynchttpclient/spnego/SpnegoEngine.java | 2 +- .../spnego/SpnegoEngineException.java | 2 +- .../main/java/org/asynchttpclient/uri/Uri.java | 2 +- .../org/asynchttpclient/uri/UriParser.java | 2 +- .../org/asynchttpclient/util/Assertions.java | 2 +- .../util/AuthenticatorUtils.java | 2 +- .../org/asynchttpclient/util/HttpUtils.java | 2 +- .../org/asynchttpclient/util/MiscUtils.java | 4 ++-- .../org/asynchttpclient/util/ProxyUtils.java | 2 +- .../org/asynchttpclient/util/UriEncoder.java | 2 +- .../asynchttpclient/util/Utf8UrlEncoder.java | 2 +- .../ws/WebSocketUpgradeHandler.java | 2 +- 40 files changed, 61 insertions(+), 60 deletions(-) diff --git a/client/pom.xml b/client/pom.xml index a31faffad..e6528650d 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -48,6 +48,11 @@ + + org.jspecify + jspecify + 1.0.0 + commons-fileupload commons-fileupload diff --git a/client/src/main/java/org/asynchttpclient/AsyncCompletionHandler.java b/client/src/main/java/org/asynchttpclient/AsyncCompletionHandler.java index 63335cb29..719aa8483 100644 --- a/client/src/main/java/org/asynchttpclient/AsyncCompletionHandler.java +++ b/client/src/main/java/org/asynchttpclient/AsyncCompletionHandler.java @@ -18,7 +18,7 @@ import io.netty.handler.codec.http.HttpHeaders; import org.asynchttpclient.handler.ProgressAsyncHandler; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/client/src/main/java/org/asynchttpclient/AsyncCompletionHandlerBase.java b/client/src/main/java/org/asynchttpclient/AsyncCompletionHandlerBase.java index 25fc9da18..721b9cacd 100644 --- a/client/src/main/java/org/asynchttpclient/AsyncCompletionHandlerBase.java +++ b/client/src/main/java/org/asynchttpclient/AsyncCompletionHandlerBase.java @@ -16,8 +16,7 @@ */ package org.asynchttpclient; - -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; /** * Simple {@link AsyncHandler} of type {@link Response} diff --git a/client/src/main/java/org/asynchttpclient/AsyncHandler.java b/client/src/main/java/org/asynchttpclient/AsyncHandler.java index 22451fe09..8e338bd61 100644 --- a/client/src/main/java/org/asynchttpclient/AsyncHandler.java +++ b/client/src/main/java/org/asynchttpclient/AsyncHandler.java @@ -18,7 +18,7 @@ import io.netty.channel.Channel; import io.netty.handler.codec.http.HttpHeaders; import org.asynchttpclient.netty.request.NettyRequest; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import javax.net.ssl.SSLSession; import java.net.InetSocketAddress; diff --git a/client/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java b/client/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java index 12dc93d7d..2bad88232 100644 --- a/client/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java +++ b/client/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java @@ -34,7 +34,7 @@ import org.asynchttpclient.netty.channel.ConnectionSemaphoreFactory; import org.asynchttpclient.proxy.ProxyServer; import org.asynchttpclient.proxy.ProxyServerSelector; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import java.io.IOException; import java.time.Duration; @@ -263,14 +263,12 @@ public interface AsyncHttpClientConfig { /** * @return the array of enabled protocols */ - @Nullable - String[] getEnabledProtocols(); + String @Nullable[] getEnabledProtocols(); /** * @return the array of enabled cipher suites */ - @Nullable - String[] getEnabledCipherSuites(); + String @Nullable[] getEnabledCipherSuites(); /** * @return if insecure cipher suites must be filtered out (only used when not explicitly passing enabled cipher suites) diff --git a/client/src/main/java/org/asynchttpclient/DefaultAsyncHttpClient.java b/client/src/main/java/org/asynchttpclient/DefaultAsyncHttpClient.java index 1f616c328..fd437e050 100644 --- a/client/src/main/java/org/asynchttpclient/DefaultAsyncHttpClient.java +++ b/client/src/main/java/org/asynchttpclient/DefaultAsyncHttpClient.java @@ -30,7 +30,7 @@ import org.asynchttpclient.handler.resumable.ResumableAsyncHandler; import org.asynchttpclient.netty.channel.ChannelManager; import org.asynchttpclient.netty.request.NettyRequestSender; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/client/src/main/java/org/asynchttpclient/DefaultAsyncHttpClientConfig.java b/client/src/main/java/org/asynchttpclient/DefaultAsyncHttpClientConfig.java index e72235c17..56ec56260 100644 --- a/client/src/main/java/org/asynchttpclient/DefaultAsyncHttpClientConfig.java +++ b/client/src/main/java/org/asynchttpclient/DefaultAsyncHttpClientConfig.java @@ -34,7 +34,7 @@ import org.asynchttpclient.proxy.ProxyServer; import org.asynchttpclient.proxy.ProxyServerSelector; import org.asynchttpclient.util.ProxyUtils; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import java.time.Duration; import java.util.Collections; @@ -158,8 +158,8 @@ public class DefaultAsyncHttpClientConfig implements AsyncHttpClientConfig { private final boolean useInsecureTrustManager; private final boolean disableHttpsEndpointIdentificationAlgorithm; private final int handshakeTimeout; - private final @Nullable String[] enabledProtocols; - private final @Nullable String[] enabledCipherSuites; + private final String @Nullable[] enabledProtocols; + private final String @Nullable[] enabledCipherSuites; private final boolean filterInsecureCipherSuites; private final int sslSessionCacheSize; private final int sslSessionTimeout; @@ -244,8 +244,8 @@ private DefaultAsyncHttpClientConfig(// http boolean useInsecureTrustManager, boolean disableHttpsEndpointIdentificationAlgorithm, int handshakeTimeout, - @Nullable String[] enabledProtocols, - @Nullable String[] enabledCipherSuites, + String @Nullable[] enabledProtocols, + String @Nullable[] enabledCipherSuites, boolean filterInsecureCipherSuites, int sslSessionCacheSize, int sslSessionTimeout, @@ -586,12 +586,12 @@ public int getHandshakeTimeout() { } @Override - public @Nullable String[] getEnabledProtocols() { + public String @Nullable[] getEnabledProtocols() { return enabledProtocols; } @Override - public @Nullable String[] getEnabledCipherSuites() { + public String @Nullable[] getEnabledCipherSuites() { return enabledCipherSuites; } @@ -831,8 +831,8 @@ public static class Builder { private boolean useInsecureTrustManager = defaultUseInsecureTrustManager(); private boolean disableHttpsEndpointIdentificationAlgorithm = defaultDisableHttpsEndpointIdentificationAlgorithm(); private int handshakeTimeout = defaultHandshakeTimeout(); - private @Nullable String[] enabledProtocols = defaultEnabledProtocols(); - private @Nullable String[] enabledCipherSuites = defaultEnabledCipherSuites(); + private String @Nullable[] enabledProtocols = defaultEnabledProtocols(); + private String @Nullable[] enabledCipherSuites = defaultEnabledCipherSuites(); private boolean filterInsecureCipherSuites = defaultFilterInsecureCipherSuites(); private int sslSessionCacheSize = defaultSslSessionCacheSize(); private int sslSessionTimeout = defaultSslSessionTimeout(); diff --git a/client/src/main/java/org/asynchttpclient/DefaultRequest.java b/client/src/main/java/org/asynchttpclient/DefaultRequest.java index 09c615d2a..3883d233d 100644 --- a/client/src/main/java/org/asynchttpclient/DefaultRequest.java +++ b/client/src/main/java/org/asynchttpclient/DefaultRequest.java @@ -24,7 +24,7 @@ import org.asynchttpclient.request.body.generator.BodyGenerator; import org.asynchttpclient.request.body.multipart.Part; import org.asynchttpclient.uri.Uri; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import java.io.File; import java.io.InputStream; diff --git a/client/src/main/java/org/asynchttpclient/Param.java b/client/src/main/java/org/asynchttpclient/Param.java index 4f7a5530a..e8328d29f 100644 --- a/client/src/main/java/org/asynchttpclient/Param.java +++ b/client/src/main/java/org/asynchttpclient/Param.java @@ -15,7 +15,7 @@ */ package org.asynchttpclient; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import java.util.ArrayList; import java.util.List; diff --git a/client/src/main/java/org/asynchttpclient/Realm.java b/client/src/main/java/org/asynchttpclient/Realm.java index c6b70a7de..f8aeb2bc3 100644 --- a/client/src/main/java/org/asynchttpclient/Realm.java +++ b/client/src/main/java/org/asynchttpclient/Realm.java @@ -20,7 +20,7 @@ import org.asynchttpclient.util.AuthenticatorUtils; import org.asynchttpclient.util.StringBuilderPool; import org.asynchttpclient.util.StringUtils; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import java.nio.charset.Charset; import java.security.MessageDigest; diff --git a/client/src/main/java/org/asynchttpclient/Request.java b/client/src/main/java/org/asynchttpclient/Request.java index 1d95016b3..dea5abbd3 100644 --- a/client/src/main/java/org/asynchttpclient/Request.java +++ b/client/src/main/java/org/asynchttpclient/Request.java @@ -25,7 +25,7 @@ import org.asynchttpclient.request.body.generator.BodyGenerator; import org.asynchttpclient.request.body.multipart.Part; import org.asynchttpclient.uri.Uri; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import java.io.File; import java.io.InputStream; diff --git a/client/src/main/java/org/asynchttpclient/RequestBuilderBase.java b/client/src/main/java/org/asynchttpclient/RequestBuilderBase.java index 9f5cf9e5e..ecc1e854e 100644 --- a/client/src/main/java/org/asynchttpclient/RequestBuilderBase.java +++ b/client/src/main/java/org/asynchttpclient/RequestBuilderBase.java @@ -29,7 +29,7 @@ import org.asynchttpclient.uri.Uri; import org.asynchttpclient.util.EnsuresNonNull; import org.asynchttpclient.util.UriEncoder; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/client/src/main/java/org/asynchttpclient/Response.java b/client/src/main/java/org/asynchttpclient/Response.java index 220d989b0..74ae5e4fc 100644 --- a/client/src/main/java/org/asynchttpclient/Response.java +++ b/client/src/main/java/org/asynchttpclient/Response.java @@ -21,7 +21,7 @@ import io.netty.handler.codec.http.cookie.Cookie; import org.asynchttpclient.netty.NettyResponse; import org.asynchttpclient.uri.Uri; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import java.io.InputStream; import java.net.SocketAddress; diff --git a/client/src/main/java/org/asynchttpclient/channel/ChannelPool.java b/client/src/main/java/org/asynchttpclient/channel/ChannelPool.java index 4f2bc3b9b..1b0897bd2 100755 --- a/client/src/main/java/org/asynchttpclient/channel/ChannelPool.java +++ b/client/src/main/java/org/asynchttpclient/channel/ChannelPool.java @@ -16,7 +16,7 @@ package org.asynchttpclient.channel; import io.netty.channel.Channel; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import java.util.Map; import java.util.function.Predicate; diff --git a/client/src/main/java/org/asynchttpclient/channel/ChannelPoolPartitioning.java b/client/src/main/java/org/asynchttpclient/channel/ChannelPoolPartitioning.java index 324a4ce34..8df7e89ac 100644 --- a/client/src/main/java/org/asynchttpclient/channel/ChannelPoolPartitioning.java +++ b/client/src/main/java/org/asynchttpclient/channel/ChannelPoolPartitioning.java @@ -18,7 +18,7 @@ import org.asynchttpclient.proxy.ProxyServer; import org.asynchttpclient.proxy.ProxyType; import org.asynchttpclient.uri.Uri; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import java.util.Objects; diff --git a/client/src/main/java/org/asynchttpclient/channel/NoopChannelPool.java b/client/src/main/java/org/asynchttpclient/channel/NoopChannelPool.java index ae3aab81a..351a10994 100644 --- a/client/src/main/java/org/asynchttpclient/channel/NoopChannelPool.java +++ b/client/src/main/java/org/asynchttpclient/channel/NoopChannelPool.java @@ -16,7 +16,7 @@ package org.asynchttpclient.channel; import io.netty.channel.Channel; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import java.util.Collections; import java.util.Map; diff --git a/client/src/main/java/org/asynchttpclient/config/AsyncHttpClientConfigDefaults.java b/client/src/main/java/org/asynchttpclient/config/AsyncHttpClientConfigDefaults.java index 3596c67a9..bc70dff72 100644 --- a/client/src/main/java/org/asynchttpclient/config/AsyncHttpClientConfigDefaults.java +++ b/client/src/main/java/org/asynchttpclient/config/AsyncHttpClientConfigDefaults.java @@ -15,7 +15,7 @@ */ package org.asynchttpclient.config; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import java.io.IOException; import java.io.InputStream; @@ -159,11 +159,11 @@ public static String defaultUserAgent() { return AsyncHttpClientConfigHelper.getAsyncHttpClientConfig().getString(ASYNC_CLIENT_CONFIG_ROOT + USER_AGENT_CONFIG); } - public static @Nullable String[] defaultEnabledProtocols() { + public static String @Nullable[] defaultEnabledProtocols() { return AsyncHttpClientConfigHelper.getAsyncHttpClientConfig().getStringArray(ASYNC_CLIENT_CONFIG_ROOT + ENABLED_PROTOCOLS_CONFIG); } - public static @Nullable String[] defaultEnabledCipherSuites() { + public static String @Nullable[] defaultEnabledCipherSuites() { return AsyncHttpClientConfigHelper.getAsyncHttpClientConfig().getStringArray(ASYNC_CLIENT_CONFIG_ROOT + ENABLED_CIPHER_SUITES_CONFIG); } diff --git a/client/src/main/java/org/asynchttpclient/config/AsyncHttpClientConfigHelper.java b/client/src/main/java/org/asynchttpclient/config/AsyncHttpClientConfigHelper.java index 7bb87afb3..87a5625b7 100644 --- a/client/src/main/java/org/asynchttpclient/config/AsyncHttpClientConfigHelper.java +++ b/client/src/main/java/org/asynchttpclient/config/AsyncHttpClientConfigHelper.java @@ -15,7 +15,7 @@ */ package org.asynchttpclient.config; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import java.io.IOException; import java.io.InputStream; @@ -105,8 +105,8 @@ public String getString(String key) { }); } - @Nullable - public String[] getStringArray(String key) { + + public String @Nullable[] getStringArray(String key) { String s = getString(key); s = s.trim(); if (s.isEmpty()) { diff --git a/client/src/main/java/org/asynchttpclient/cookie/ThreadSafeCookieStore.java b/client/src/main/java/org/asynchttpclient/cookie/ThreadSafeCookieStore.java index 5832185cc..48a2566e5 100644 --- a/client/src/main/java/org/asynchttpclient/cookie/ThreadSafeCookieStore.java +++ b/client/src/main/java/org/asynchttpclient/cookie/ThreadSafeCookieStore.java @@ -18,8 +18,8 @@ import io.netty.handler.codec.http.cookie.Cookie; import org.asynchttpclient.uri.Uri; import org.asynchttpclient.util.MiscUtils; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.NonNull; +import org.jspecify.annotations.Nullable; import java.util.AbstractMap; import java.util.ArrayList; @@ -246,7 +246,7 @@ private static class CookieKey implements Comparable { } @Override - public int compareTo(@NotNull CookieKey cookieKey) { + public int compareTo(@NonNull CookieKey cookieKey) { requireNonNull(cookieKey, "Parameter can't be null"); int result; diff --git a/client/src/main/java/org/asynchttpclient/filter/FilterContext.java b/client/src/main/java/org/asynchttpclient/filter/FilterContext.java index 733455389..3168dc975 100644 --- a/client/src/main/java/org/asynchttpclient/filter/FilterContext.java +++ b/client/src/main/java/org/asynchttpclient/filter/FilterContext.java @@ -17,7 +17,7 @@ import org.asynchttpclient.AsyncHttpClient; import org.asynchttpclient.HttpResponseStatus; import org.asynchttpclient.Request; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import java.io.IOException; diff --git a/client/src/main/java/org/asynchttpclient/handler/BodyDeferringAsyncHandler.java b/client/src/main/java/org/asynchttpclient/handler/BodyDeferringAsyncHandler.java index dc58fc2c5..e3d037760 100644 --- a/client/src/main/java/org/asynchttpclient/handler/BodyDeferringAsyncHandler.java +++ b/client/src/main/java/org/asynchttpclient/handler/BodyDeferringAsyncHandler.java @@ -17,7 +17,7 @@ import org.asynchttpclient.HttpResponseBodyPart; import org.asynchttpclient.HttpResponseStatus; import org.asynchttpclient.Response; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import java.io.FilterInputStream; import java.io.IOException; diff --git a/client/src/main/java/org/asynchttpclient/handler/TransferCompletionHandler.java b/client/src/main/java/org/asynchttpclient/handler/TransferCompletionHandler.java index e0705ad25..8ad2f6ae9 100644 --- a/client/src/main/java/org/asynchttpclient/handler/TransferCompletionHandler.java +++ b/client/src/main/java/org/asynchttpclient/handler/TransferCompletionHandler.java @@ -17,7 +17,7 @@ import org.asynchttpclient.AsyncHandler; import org.asynchttpclient.HttpResponseBodyPart; import org.asynchttpclient.Response; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/client/src/main/java/org/asynchttpclient/handler/resumable/ResumableAsyncHandler.java b/client/src/main/java/org/asynchttpclient/handler/resumable/ResumableAsyncHandler.java index 6b8794547..bf366a3ab 100644 --- a/client/src/main/java/org/asynchttpclient/handler/resumable/ResumableAsyncHandler.java +++ b/client/src/main/java/org/asynchttpclient/handler/resumable/ResumableAsyncHandler.java @@ -21,7 +21,7 @@ import org.asynchttpclient.Response; import org.asynchttpclient.Response.ResponseBuilder; import org.asynchttpclient.handler.TransferCompletionHandler; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/client/src/main/java/org/asynchttpclient/ntlm/NtlmEngine.java b/client/src/main/java/org/asynchttpclient/ntlm/NtlmEngine.java index c2338c46a..081020bd2 100644 --- a/client/src/main/java/org/asynchttpclient/ntlm/NtlmEngine.java +++ b/client/src/main/java/org/asynchttpclient/ntlm/NtlmEngine.java @@ -28,7 +28,7 @@ package org.asynchttpclient.ntlm; import org.jetbrains.annotations.Contract; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import javax.crypto.Cipher; import javax.crypto.spec.SecretKeySpec; diff --git a/client/src/main/java/org/asynchttpclient/ntlm/NtlmEngineException.java b/client/src/main/java/org/asynchttpclient/ntlm/NtlmEngineException.java index dd7827cbf..df9a049e3 100644 --- a/client/src/main/java/org/asynchttpclient/ntlm/NtlmEngineException.java +++ b/client/src/main/java/org/asynchttpclient/ntlm/NtlmEngineException.java @@ -25,8 +25,7 @@ */ package org.asynchttpclient.ntlm; - -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; /** * Signals NTLM protocol failure. diff --git a/client/src/main/java/org/asynchttpclient/proxy/ProxyServer.java b/client/src/main/java/org/asynchttpclient/proxy/ProxyServer.java index 9cb33362c..4e5cf78f5 100644 --- a/client/src/main/java/org/asynchttpclient/proxy/ProxyServer.java +++ b/client/src/main/java/org/asynchttpclient/proxy/ProxyServer.java @@ -19,7 +19,7 @@ import io.netty.handler.codec.http.HttpHeaders; import org.asynchttpclient.Realm; import org.asynchttpclient.Request; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import java.util.ArrayList; import java.util.Collections; diff --git a/client/src/main/java/org/asynchttpclient/proxy/ProxyServerSelector.java b/client/src/main/java/org/asynchttpclient/proxy/ProxyServerSelector.java index 048f2e78e..510e4dae4 100644 --- a/client/src/main/java/org/asynchttpclient/proxy/ProxyServerSelector.java +++ b/client/src/main/java/org/asynchttpclient/proxy/ProxyServerSelector.java @@ -16,7 +16,7 @@ package org.asynchttpclient.proxy; import org.asynchttpclient.uri.Uri; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; /** * Selector for a proxy server diff --git a/client/src/main/java/org/asynchttpclient/spnego/NamePasswordCallbackHandler.java b/client/src/main/java/org/asynchttpclient/spnego/NamePasswordCallbackHandler.java index 164ee5471..2a3e70832 100644 --- a/client/src/main/java/org/asynchttpclient/spnego/NamePasswordCallbackHandler.java +++ b/client/src/main/java/org/asynchttpclient/spnego/NamePasswordCallbackHandler.java @@ -15,7 +15,7 @@ */ package org.asynchttpclient.spnego; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/client/src/main/java/org/asynchttpclient/spnego/SpnegoEngine.java b/client/src/main/java/org/asynchttpclient/spnego/SpnegoEngine.java index d67d923bb..95e853473 100644 --- a/client/src/main/java/org/asynchttpclient/spnego/SpnegoEngine.java +++ b/client/src/main/java/org/asynchttpclient/spnego/SpnegoEngine.java @@ -42,7 +42,7 @@ import org.ietf.jgss.GSSManager; import org.ietf.jgss.GSSName; import org.ietf.jgss.Oid; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/client/src/main/java/org/asynchttpclient/spnego/SpnegoEngineException.java b/client/src/main/java/org/asynchttpclient/spnego/SpnegoEngineException.java index a28c0996a..475c24920 100644 --- a/client/src/main/java/org/asynchttpclient/spnego/SpnegoEngineException.java +++ b/client/src/main/java/org/asynchttpclient/spnego/SpnegoEngineException.java @@ -15,7 +15,7 @@ */ package org.asynchttpclient.spnego; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; /** * Signals SPNEGO protocol failure. diff --git a/client/src/main/java/org/asynchttpclient/uri/Uri.java b/client/src/main/java/org/asynchttpclient/uri/Uri.java index e1d53d1ca..94d05bce3 100644 --- a/client/src/main/java/org/asynchttpclient/uri/Uri.java +++ b/client/src/main/java/org/asynchttpclient/uri/Uri.java @@ -16,7 +16,7 @@ package org.asynchttpclient.uri; import org.asynchttpclient.util.StringBuilderPool; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import java.net.URI; import java.net.URISyntaxException; diff --git a/client/src/main/java/org/asynchttpclient/uri/UriParser.java b/client/src/main/java/org/asynchttpclient/uri/UriParser.java index c65f145dd..8536f7c60 100644 --- a/client/src/main/java/org/asynchttpclient/uri/UriParser.java +++ b/client/src/main/java/org/asynchttpclient/uri/UriParser.java @@ -15,7 +15,7 @@ */ package org.asynchttpclient.uri; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import static java.util.Objects.requireNonNull; import static org.asynchttpclient.util.MiscUtils.isNonEmpty; diff --git a/client/src/main/java/org/asynchttpclient/util/Assertions.java b/client/src/main/java/org/asynchttpclient/util/Assertions.java index 0b2e38a7c..6a8cf925d 100644 --- a/client/src/main/java/org/asynchttpclient/util/Assertions.java +++ b/client/src/main/java/org/asynchttpclient/util/Assertions.java @@ -16,7 +16,7 @@ package org.asynchttpclient.util; import org.jetbrains.annotations.Contract; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import static java.util.Objects.requireNonNull; diff --git a/client/src/main/java/org/asynchttpclient/util/AuthenticatorUtils.java b/client/src/main/java/org/asynchttpclient/util/AuthenticatorUtils.java index 4e2c4aed3..f0400abd8 100644 --- a/client/src/main/java/org/asynchttpclient/util/AuthenticatorUtils.java +++ b/client/src/main/java/org/asynchttpclient/util/AuthenticatorUtils.java @@ -19,7 +19,7 @@ import org.asynchttpclient.spnego.SpnegoEngine; import org.asynchttpclient.spnego.SpnegoEngineException; import org.asynchttpclient.uri.Uri; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; diff --git a/client/src/main/java/org/asynchttpclient/util/HttpUtils.java b/client/src/main/java/org/asynchttpclient/util/HttpUtils.java index 3cca41e61..42ff981bc 100644 --- a/client/src/main/java/org/asynchttpclient/util/HttpUtils.java +++ b/client/src/main/java/org/asynchttpclient/util/HttpUtils.java @@ -19,7 +19,7 @@ import org.asynchttpclient.Param; import org.asynchttpclient.Request; import org.asynchttpclient.uri.Uri; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import java.net.URLEncoder; import java.nio.ByteBuffer; diff --git a/client/src/main/java/org/asynchttpclient/util/MiscUtils.java b/client/src/main/java/org/asynchttpclient/util/MiscUtils.java index 5a37cce75..e1d1f1117 100644 --- a/client/src/main/java/org/asynchttpclient/util/MiscUtils.java +++ b/client/src/main/java/org/asynchttpclient/util/MiscUtils.java @@ -13,7 +13,7 @@ package org.asynchttpclient.util; import org.jetbrains.annotations.Contract; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import java.io.Closeable; import java.io.IOException; @@ -38,7 +38,7 @@ public static boolean isEmpty(@Nullable String string) { } @Contract(value = "null -> false", pure = true) - public static boolean isNonEmpty(@Nullable Object[] array) { + public static boolean isNonEmpty(Object @Nullable[] array) { return array != null && array.length != 0; } diff --git a/client/src/main/java/org/asynchttpclient/util/ProxyUtils.java b/client/src/main/java/org/asynchttpclient/util/ProxyUtils.java index a7bf5b7e2..b83c3c3c3 100644 --- a/client/src/main/java/org/asynchttpclient/util/ProxyUtils.java +++ b/client/src/main/java/org/asynchttpclient/util/ProxyUtils.java @@ -17,7 +17,7 @@ import org.asynchttpclient.Request; import org.asynchttpclient.proxy.ProxyServer; import org.asynchttpclient.proxy.ProxyServerSelector; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/client/src/main/java/org/asynchttpclient/util/UriEncoder.java b/client/src/main/java/org/asynchttpclient/util/UriEncoder.java index 92706d292..4ea289c31 100644 --- a/client/src/main/java/org/asynchttpclient/util/UriEncoder.java +++ b/client/src/main/java/org/asynchttpclient/util/UriEncoder.java @@ -17,7 +17,7 @@ import org.asynchttpclient.Param; import org.asynchttpclient.uri.Uri; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import java.util.List; diff --git a/client/src/main/java/org/asynchttpclient/util/Utf8UrlEncoder.java b/client/src/main/java/org/asynchttpclient/util/Utf8UrlEncoder.java index fe01e3208..80ed3d601 100644 --- a/client/src/main/java/org/asynchttpclient/util/Utf8UrlEncoder.java +++ b/client/src/main/java/org/asynchttpclient/util/Utf8UrlEncoder.java @@ -16,7 +16,7 @@ package org.asynchttpclient.util; import org.jetbrains.annotations.Contract; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import java.util.BitSet; diff --git a/client/src/main/java/org/asynchttpclient/ws/WebSocketUpgradeHandler.java b/client/src/main/java/org/asynchttpclient/ws/WebSocketUpgradeHandler.java index b4c6e1a44..ccc39d418 100644 --- a/client/src/main/java/org/asynchttpclient/ws/WebSocketUpgradeHandler.java +++ b/client/src/main/java/org/asynchttpclient/ws/WebSocketUpgradeHandler.java @@ -20,7 +20,7 @@ import org.asynchttpclient.HttpResponseBodyPart; import org.asynchttpclient.HttpResponseStatus; import org.asynchttpclient.netty.ws.NettyWebSocket; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import java.util.ArrayList; import java.util.List;