From af6fbf6b7448768d214f8df1888eb7064bd3c650 Mon Sep 17 00:00:00 2001 From: Sergii Tkachenko Date: Fri, 11 Sep 2020 18:42:00 -0400 Subject: [PATCH] okhttp: make OkHttpChannelBuilder final --- .../io/grpc/okhttp/OkHttpChannelBuilder.java | 39 +++++++++---------- .../grpc/okhttp/OkHttpChannelBuilderTest.java | 6 +-- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/okhttp/src/main/java/io/grpc/okhttp/OkHttpChannelBuilder.java b/okhttp/src/main/java/io/grpc/okhttp/OkHttpChannelBuilder.java index a7759127e6..93ea57e2df 100644 --- a/okhttp/src/main/java/io/grpc/okhttp/OkHttpChannelBuilder.java +++ b/okhttp/src/main/java/io/grpc/okhttp/OkHttpChannelBuilder.java @@ -58,7 +58,7 @@ import javax.net.ssl.SSLSocketFactory; /** Convenience class for building channels with the OkHttp transport. */ @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1785") -public class OkHttpChannelBuilder extends ForwardingChannelBuilder { +public final class OkHttpChannelBuilder extends ForwardingChannelBuilder { public static final int DEFAULT_FLOW_CONTROL_WINDOW = 65535; private final ManagedChannelImplBuilder managedChannelImplBuilder; @@ -142,7 +142,7 @@ public class OkHttpChannelBuilder extends ForwardingChannelBuilder delegate() { + protected ManagedChannelBuilder delegate() { return managedChannelImplBuilder; } @VisibleForTesting - final OkHttpChannelBuilder setTransportTracerFactory( - TransportTracer.Factory transportTracerFactory) { + OkHttpChannelBuilder setTransportTracerFactory(TransportTracer.Factory transportTracerFactory) { this.transportTracerFactory = transportTracerFactory; return this; } @@ -185,7 +184,7 @@ public class OkHttpChannelBuilder extends ForwardingChannelBuilderThe channel does not take ownership of the given executor. It is the caller' responsibility * to shutdown the executor when appropriate. */ - public final OkHttpChannelBuilder transportExecutor(@Nullable Executor transportExecutor) { + public OkHttpChannelBuilder transportExecutor(@Nullable Executor transportExecutor) { this.transportExecutor = transportExecutor; return this; } @@ -196,7 +195,7 @@ public class OkHttpChannelBuilder extends ForwardingChannelBuilder= 0, "negative max"); maxInboundMessageSize = max; return this; } - final ClientTransportFactory buildTransportFactory() { + ClientTransportFactory buildTransportFactory() { boolean enableKeepAlive = keepAliveTimeNanos != KEEPALIVE_TIME_NANOS_DISABLED; return new OkHttpTransportFactory( transportExecutor, @@ -424,17 +423,17 @@ public class OkHttpChannelBuilder extends ForwardingChannelBuilder