From 3ab9e4692623235e62d86319882fd5514620fe37 Mon Sep 17 00:00:00 2001 From: Idel Pivnitskiy Date: Tue, 10 Oct 2023 12:12:38 -0700 Subject: [PATCH] Restore API/ABI compatibility with version 0.42.37 Motivation: `japicmp.sh` shows the following warnings: ``` Comparing binary compatibility of servicetalk-http-netty-0.42.38-SNAPSHOT.jar against servicetalk-http-netty-0.42.37.jar ***! MODIFIED CLASS: PUBLIC NON_FINAL (<- FINAL) io.servicetalk.http.netty.ProxyResponseException (Serializable removed) === CLASS FILE FORMAT VERSION: 52.0 <- 52.0 ---! REMOVED SUPERCLASS: java.io.IOException ---! REMOVED METHOD: PUBLIC(-) java.lang.String toString() Comparing binary compatibility of servicetalk-transport-netty-internal-0.42.38-SNAPSHOT.jar against servicetalk-transport-netty-internal-0.42.37.jar ***! MODIFIED CLASS: PUBLIC STATIC FINAL io.servicetalk.transport.netty.internal.NoopTransportObserver$NoopConnectionObserver (not serializable) === CLASS FILE FORMAT VERSION: 52.0 <- 52.0 === UNCHANGED SUPERCLASS: java.lang.Object (<- java.lang.Object) ---! REMOVED METHOD: PUBLIC(-) void onTransportHandshakeComplete() ``` Modifications: - Restore `ProxyResponseException.toString()`; - Restore `NoopTransportObserver.onTransportHandshakeComplete()`; Result: Less warnings produced by `japicmp.sh` script. --- .../io/servicetalk/http/netty/ProxyResponseException.java | 5 +++++ .../io/servicetalk/transport/api/ConnectionObserver.java | 2 +- .../transport/netty/internal/NoopTransportObserver.java | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/ProxyResponseException.java b/servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/ProxyResponseException.java index 72146423e0..dae94398d1 100644 --- a/servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/ProxyResponseException.java +++ b/servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/ProxyResponseException.java @@ -41,4 +41,9 @@ public class ProxyResponseException extends ProxyConnectResponseException implem public HttpResponseStatus status() { return response().status(); } + + @Override + public String toString() { + return super.toString(); + } } diff --git a/servicetalk-transport-api/src/main/java/io/servicetalk/transport/api/ConnectionObserver.java b/servicetalk-transport-api/src/main/java/io/servicetalk/transport/api/ConnectionObserver.java index 1b2c5c0353..4e23a70b72 100644 --- a/servicetalk-transport-api/src/main/java/io/servicetalk/transport/api/ConnectionObserver.java +++ b/servicetalk-transport-api/src/main/java/io/servicetalk/transport/api/ConnectionObserver.java @@ -56,7 +56,7 @@ public interface ConnectionObserver { * @deprecated Use {@link #onTransportHandshakeComplete(ConnectionInfo)} */ @Deprecated - default void onTransportHandshakeComplete() { + default void onTransportHandshakeComplete() { // FIXME: 0.43 - remove deprecated method } /** diff --git a/servicetalk-transport-netty-internal/src/main/java/io/servicetalk/transport/netty/internal/NoopTransportObserver.java b/servicetalk-transport-netty-internal/src/main/java/io/servicetalk/transport/netty/internal/NoopTransportObserver.java index e0cf91f583..3a7a5c465e 100644 --- a/servicetalk-transport-netty-internal/src/main/java/io/servicetalk/transport/netty/internal/NoopTransportObserver.java +++ b/servicetalk-transport-netty-internal/src/main/java/io/servicetalk/transport/netty/internal/NoopTransportObserver.java @@ -68,6 +68,11 @@ public void onDataWrite(final int size) { public void onFlush() { } + @Override + @SuppressWarnings("deprecation") + public void onTransportHandshakeComplete() { + } + @Override public void onTransportHandshakeComplete(final ConnectionInfo info) { }