Skip to content

Commit 45aebf3

Browse files
committed
use jspecify annotations
1 parent c1ed191 commit 45aebf3

40 files changed

+61
-60
lines changed

client/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@
4848

4949
<dependencies>
5050
<!-- https://mvnrepository.com/artifact/commons-fileupload/commons-fileupload -->
51+
<dependency>
52+
<groupId>org.jspecify</groupId>
53+
<artifactId>jspecify</artifactId>
54+
<version>1.0.0</version>
55+
</dependency>
5156
<dependency>
5257
<groupId>commons-fileupload</groupId>
5358
<artifactId>commons-fileupload</artifactId>

client/src/main/java/org/asynchttpclient/AsyncCompletionHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import io.netty.handler.codec.http.HttpHeaders;
2020
import org.asynchttpclient.handler.ProgressAsyncHandler;
21-
import org.jetbrains.annotations.Nullable;
21+
import org.jspecify.annotations.Nullable;
2222
import org.slf4j.Logger;
2323
import org.slf4j.LoggerFactory;
2424

client/src/main/java/org/asynchttpclient/AsyncCompletionHandlerBase.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
*/
1717
package org.asynchttpclient;
1818

19-
20-
import org.jetbrains.annotations.Nullable;
19+
import org.jspecify.annotations.Nullable;
2120

2221
/**
2322
* Simple {@link AsyncHandler} of type {@link Response}

client/src/main/java/org/asynchttpclient/AsyncHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import io.netty.channel.Channel;
1919
import io.netty.handler.codec.http.HttpHeaders;
2020
import org.asynchttpclient.netty.request.NettyRequest;
21-
import org.jetbrains.annotations.Nullable;
21+
import org.jspecify.annotations.Nullable;
2222

2323
import javax.net.ssl.SSLSession;
2424
import java.net.InetSocketAddress;

client/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import org.asynchttpclient.netty.channel.ConnectionSemaphoreFactory;
3535
import org.asynchttpclient.proxy.ProxyServer;
3636
import org.asynchttpclient.proxy.ProxyServerSelector;
37-
import org.jetbrains.annotations.Nullable;
37+
import org.jspecify.annotations.Nullable;
3838

3939
import java.io.IOException;
4040
import java.time.Duration;
@@ -263,14 +263,12 @@ public interface AsyncHttpClientConfig {
263263
/**
264264
* @return the array of enabled protocols
265265
*/
266-
@Nullable
267-
String[] getEnabledProtocols();
266+
String @Nullable[] getEnabledProtocols();
268267

269268
/**
270269
* @return the array of enabled cipher suites
271270
*/
272-
@Nullable
273-
String[] getEnabledCipherSuites();
271+
String @Nullable[] getEnabledCipherSuites();
274272

275273
/**
276274
* @return if insecure cipher suites must be filtered out (only used when not explicitly passing enabled cipher suites)

client/src/main/java/org/asynchttpclient/DefaultAsyncHttpClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import org.asynchttpclient.handler.resumable.ResumableAsyncHandler;
3131
import org.asynchttpclient.netty.channel.ChannelManager;
3232
import org.asynchttpclient.netty.request.NettyRequestSender;
33-
import org.jetbrains.annotations.Nullable;
33+
import org.jspecify.annotations.Nullable;
3434
import org.slf4j.Logger;
3535
import org.slf4j.LoggerFactory;
3636

client/src/main/java/org/asynchttpclient/DefaultAsyncHttpClientConfig.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import org.asynchttpclient.proxy.ProxyServer;
3535
import org.asynchttpclient.proxy.ProxyServerSelector;
3636
import org.asynchttpclient.util.ProxyUtils;
37-
import org.jetbrains.annotations.Nullable;
37+
import org.jspecify.annotations.Nullable;
3838

3939
import java.time.Duration;
4040
import java.util.Collections;
@@ -158,8 +158,8 @@ public class DefaultAsyncHttpClientConfig implements AsyncHttpClientConfig {
158158
private final boolean useInsecureTrustManager;
159159
private final boolean disableHttpsEndpointIdentificationAlgorithm;
160160
private final int handshakeTimeout;
161-
private final @Nullable String[] enabledProtocols;
162-
private final @Nullable String[] enabledCipherSuites;
161+
private final String @Nullable[] enabledProtocols;
162+
private final String @Nullable[] enabledCipherSuites;
163163
private final boolean filterInsecureCipherSuites;
164164
private final int sslSessionCacheSize;
165165
private final int sslSessionTimeout;
@@ -244,8 +244,8 @@ private DefaultAsyncHttpClientConfig(// http
244244
boolean useInsecureTrustManager,
245245
boolean disableHttpsEndpointIdentificationAlgorithm,
246246
int handshakeTimeout,
247-
@Nullable String[] enabledProtocols,
248-
@Nullable String[] enabledCipherSuites,
247+
String @Nullable[] enabledProtocols,
248+
String @Nullable[] enabledCipherSuites,
249249
boolean filterInsecureCipherSuites,
250250
int sslSessionCacheSize,
251251
int sslSessionTimeout,
@@ -586,12 +586,12 @@ public int getHandshakeTimeout() {
586586
}
587587

588588
@Override
589-
public @Nullable String[] getEnabledProtocols() {
589+
public String @Nullable[] getEnabledProtocols() {
590590
return enabledProtocols;
591591
}
592592

593593
@Override
594-
public @Nullable String[] getEnabledCipherSuites() {
594+
public String @Nullable[] getEnabledCipherSuites() {
595595
return enabledCipherSuites;
596596
}
597597

@@ -831,8 +831,8 @@ public static class Builder {
831831
private boolean useInsecureTrustManager = defaultUseInsecureTrustManager();
832832
private boolean disableHttpsEndpointIdentificationAlgorithm = defaultDisableHttpsEndpointIdentificationAlgorithm();
833833
private int handshakeTimeout = defaultHandshakeTimeout();
834-
private @Nullable String[] enabledProtocols = defaultEnabledProtocols();
835-
private @Nullable String[] enabledCipherSuites = defaultEnabledCipherSuites();
834+
private String @Nullable[] enabledProtocols = defaultEnabledProtocols();
835+
private String @Nullable[] enabledCipherSuites = defaultEnabledCipherSuites();
836836
private boolean filterInsecureCipherSuites = defaultFilterInsecureCipherSuites();
837837
private int sslSessionCacheSize = defaultSslSessionCacheSize();
838838
private int sslSessionTimeout = defaultSslSessionTimeout();

client/src/main/java/org/asynchttpclient/DefaultRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import org.asynchttpclient.request.body.generator.BodyGenerator;
2525
import org.asynchttpclient.request.body.multipart.Part;
2626
import org.asynchttpclient.uri.Uri;
27-
import org.jetbrains.annotations.Nullable;
27+
import org.jspecify.annotations.Nullable;
2828

2929
import java.io.File;
3030
import java.io.InputStream;

client/src/main/java/org/asynchttpclient/Param.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
package org.asynchttpclient;
1717

18-
import org.jetbrains.annotations.Nullable;
18+
import org.jspecify.annotations.Nullable;
1919

2020
import java.util.ArrayList;
2121
import java.util.List;

client/src/main/java/org/asynchttpclient/Realm.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import org.asynchttpclient.util.AuthenticatorUtils;
2121
import org.asynchttpclient.util.StringBuilderPool;
2222
import org.asynchttpclient.util.StringUtils;
23-
import org.jetbrains.annotations.Nullable;
23+
import org.jspecify.annotations.Nullable;
2424

2525
import java.nio.charset.Charset;
2626
import java.security.MessageDigest;

0 commit comments

Comments
 (0)