You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2022/09/14 14:10:14 UTC
[httpcomponents-core] branch master updated: Fixed deprecation and varargs warnings
This is an automated email from the ASF dual-hosted git repository.
olegk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git
The following commit(s) were added to refs/heads/master by this push:
new 82e33d66b Fixed deprecation and varargs warnings
82e33d66b is described below
commit 82e33d66b471f681b300a7b8d6947b96d7efe90c
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Wed Sep 14 16:05:41 2022 +0200
Fixed deprecation and varargs warnings
---
.../hc/core5/http2/ssl/ConscryptServerTlsStrategy.java | 15 +++++++--------
.../apache/hc/core5/http2/ssl/H2ServerTlsStrategy.java | 15 +++++++--------
.../apache/hc/core5/testing/nio/TLSIntegrationTest.java | 4 ++++
.../test/java/org/apache/hc/core5/http/ssl/TLSTest.java | 2 +-
.../java/org/apache/hc/core5/http/ssl/TestTlsCiphers.java | 2 +-
5 files changed, 20 insertions(+), 18 deletions(-)
diff --git a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/ssl/ConscryptServerTlsStrategy.java b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/ssl/ConscryptServerTlsStrategy.java
index abacfeb83..d5557580b 100644
--- a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/ssl/ConscryptServerTlsStrategy.java
+++ b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/ssl/ConscryptServerTlsStrategy.java
@@ -33,8 +33,6 @@ import javax.net.ssl.SSLContext;
import org.apache.hc.core5.concurrent.FutureCallback;
import org.apache.hc.core5.http.HttpHost;
-import org.apache.hc.core5.http.nio.ssl.FixedPortStrategy;
-import org.apache.hc.core5.http.nio.ssl.SecurePortStrategy;
import org.apache.hc.core5.http.nio.ssl.TlsStrategy;
import org.apache.hc.core5.net.NamedEndpoint;
import org.apache.hc.core5.reactor.ssl.SSLBufferMode;
@@ -55,7 +53,7 @@ public class ConscryptServerTlsStrategy implements TlsStrategy {
private final SSLContext sslContext;
@SuppressWarnings("deprecation")
- private final SecurePortStrategy securePortStrategy;
+ private final org.apache.hc.core5.http.nio.ssl.SecurePortStrategy securePortStrategy;
private final SSLBufferMode sslBufferMode;
private final SSLSessionInitializer initializer;
private final SSLSessionVerifier verifier;
@@ -66,7 +64,7 @@ public class ConscryptServerTlsStrategy implements TlsStrategy {
@Deprecated
public ConscryptServerTlsStrategy(
final SSLContext sslContext,
- final SecurePortStrategy securePortStrategy,
+ final org.apache.hc.core5.http.nio.ssl.SecurePortStrategy securePortStrategy,
final SSLBufferMode sslBufferMode,
final SSLSessionInitializer initializer,
final SSLSessionVerifier verifier) {
@@ -83,7 +81,7 @@ public class ConscryptServerTlsStrategy implements TlsStrategy {
@Deprecated
public ConscryptServerTlsStrategy(
final SSLContext sslContext,
- final SecurePortStrategy securePortStrategy,
+ final org.apache.hc.core5.http.nio.ssl.SecurePortStrategy securePortStrategy,
final SSLSessionInitializer initializer,
final SSLSessionVerifier verifier) {
this(sslContext, securePortStrategy, null, initializer, verifier);
@@ -95,7 +93,7 @@ public class ConscryptServerTlsStrategy implements TlsStrategy {
@Deprecated
public ConscryptServerTlsStrategy(
final SSLContext sslContext,
- final SecurePortStrategy securePortStrategy,
+ final org.apache.hc.core5.http.nio.ssl.SecurePortStrategy securePortStrategy,
final SSLSessionVerifier verifier) {
this(sslContext, securePortStrategy, null, null, verifier);
}
@@ -104,7 +102,8 @@ public class ConscryptServerTlsStrategy implements TlsStrategy {
* @deprecated Use {@link ConscryptServerTlsStrategy#ConscryptServerTlsStrategy(SSLContext)}
*/
@Deprecated
- public ConscryptServerTlsStrategy(final SSLContext sslContext, final SecurePortStrategy securePortStrategy) {
+ public ConscryptServerTlsStrategy(final SSLContext sslContext,
+ final org.apache.hc.core5.http.nio.ssl.SecurePortStrategy securePortStrategy) {
this(sslContext, securePortStrategy, null, null, null);
}
@@ -113,7 +112,7 @@ public class ConscryptServerTlsStrategy implements TlsStrategy {
*/
@Deprecated
public ConscryptServerTlsStrategy(final SSLContext sslContext, final int... securePorts) {
- this(sslContext, new FixedPortStrategy(securePorts));
+ this(sslContext, new org.apache.hc.core5.http.nio.ssl.FixedPortStrategy(securePorts));
}
public ConscryptServerTlsStrategy(
diff --git a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/ssl/H2ServerTlsStrategy.java b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/ssl/H2ServerTlsStrategy.java
index e850eddd5..9b9a13caf 100644
--- a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/ssl/H2ServerTlsStrategy.java
+++ b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/ssl/H2ServerTlsStrategy.java
@@ -33,8 +33,6 @@ import javax.net.ssl.SSLContext;
import org.apache.hc.core5.concurrent.FutureCallback;
import org.apache.hc.core5.http.HttpHost;
-import org.apache.hc.core5.http.nio.ssl.FixedPortStrategy;
-import org.apache.hc.core5.http.nio.ssl.SecurePortStrategy;
import org.apache.hc.core5.http.nio.ssl.TlsStrategy;
import org.apache.hc.core5.net.NamedEndpoint;
import org.apache.hc.core5.reactor.ssl.SSLBufferMode;
@@ -55,7 +53,7 @@ public class H2ServerTlsStrategy implements TlsStrategy {
private final SSLContext sslContext;
@SuppressWarnings("deprecation")
- private final SecurePortStrategy securePortStrategy;
+ private final org.apache.hc.core5.http.nio.ssl.SecurePortStrategy securePortStrategy;
private final SSLBufferMode sslBufferMode;
private final SSLSessionInitializer initializer;
private final SSLSessionVerifier verifier;
@@ -66,7 +64,7 @@ public class H2ServerTlsStrategy implements TlsStrategy {
@Deprecated
public H2ServerTlsStrategy(
final SSLContext sslContext,
- final SecurePortStrategy securePortStrategy,
+ final org.apache.hc.core5.http.nio.ssl.SecurePortStrategy securePortStrategy,
final SSLBufferMode sslBufferMode,
final SSLSessionInitializer initializer,
final SSLSessionVerifier verifier) {
@@ -83,7 +81,7 @@ public class H2ServerTlsStrategy implements TlsStrategy {
@Deprecated
public H2ServerTlsStrategy(
final SSLContext sslContext,
- final SecurePortStrategy securePortStrategy,
+ final org.apache.hc.core5.http.nio.ssl.SecurePortStrategy securePortStrategy,
final SSLSessionInitializer initializer,
final SSLSessionVerifier verifier) {
this(sslContext, securePortStrategy, null, initializer, verifier);
@@ -95,7 +93,7 @@ public class H2ServerTlsStrategy implements TlsStrategy {
@Deprecated
public H2ServerTlsStrategy(
final SSLContext sslContext,
- final SecurePortStrategy securePortStrategy,
+ final org.apache.hc.core5.http.nio.ssl.SecurePortStrategy securePortStrategy,
final SSLSessionVerifier verifier) {
this(sslContext, securePortStrategy, null, null, verifier);
}
@@ -104,7 +102,8 @@ public class H2ServerTlsStrategy implements TlsStrategy {
* @deprecated Use {@link H2ServerTlsStrategy#H2ServerTlsStrategy(SSLContext)}
*/
@Deprecated
- public H2ServerTlsStrategy(final SSLContext sslContext, final SecurePortStrategy securePortStrategy) {
+ public H2ServerTlsStrategy(final SSLContext sslContext,
+ final org.apache.hc.core5.http.nio.ssl.SecurePortStrategy securePortStrategy) {
this(sslContext, securePortStrategy, null, null, null);
}
@@ -113,7 +112,7 @@ public class H2ServerTlsStrategy implements TlsStrategy {
*/
@Deprecated
public H2ServerTlsStrategy(final int... securePorts) {
- this(SSLContexts.createSystemDefault(), new FixedPortStrategy(securePorts));
+ this(SSLContexts.createSystemDefault(), new org.apache.hc.core5.http.nio.ssl.FixedPortStrategy(securePorts));
}
public H2ServerTlsStrategy(
diff --git a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/TLSIntegrationTest.java b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/TLSIntegrationTest.java
index 247f2c12f..09c401cae 100644
--- a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/TLSIntegrationTest.java
+++ b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/TLSIntegrationTest.java
@@ -401,6 +401,10 @@ public class TLSIntegrationTest {
TlsSupport.enforceStrongSecurity(initializer), verifier, handshakeTimeout, callback);
}
+ /**
+ * @deprecated do not use.
+ */
+ @Deprecated
@Override
public boolean upgrade(
final TransportSecurityLayer tlsSession,
diff --git a/httpcore5/src/test/java/org/apache/hc/core5/http/ssl/TLSTest.java b/httpcore5/src/test/java/org/apache/hc/core5/http/ssl/TLSTest.java
index 72ebb829d..e9a2730a4 100644
--- a/httpcore5/src/test/java/org/apache/hc/core5/http/ssl/TLSTest.java
+++ b/httpcore5/src/test/java/org/apache/hc/core5/http/ssl/TLSTest.java
@@ -69,7 +69,7 @@ class TLSTest {
@Test
void excludeWeakNull() {
- assertNull((TLS.excludeWeak(null)));
+ assertNull((TLS.excludeWeak((String[]) null)));
}
@Test
diff --git a/httpcore5/src/test/java/org/apache/hc/core5/http/ssl/TestTlsCiphers.java b/httpcore5/src/test/java/org/apache/hc/core5/http/ssl/TestTlsCiphers.java
index eeec5d7ec..8313b9e39 100644
--- a/httpcore5/src/test/java/org/apache/hc/core5/http/ssl/TestTlsCiphers.java
+++ b/httpcore5/src/test/java/org/apache/hc/core5/http/ssl/TestTlsCiphers.java
@@ -125,7 +125,7 @@ public class TestTlsCiphers {
@Test
void excludeWeakNull(){
- Assertions.assertNull(TlsCiphers.excludeWeak(null));
+ Assertions.assertNull(TlsCiphers.excludeWeak((String[]) null));
}
}