From c3435f28207a673fce09d21926a64d271f21558f Mon Sep 17 00:00:00 2001 From: Sergii Tkachenko Date: Wed, 2 Sep 2020 16:49:11 -0400 Subject: [PATCH] okhttp, testing: remove server builder accessor hacks --- .../io/grpc/internal/AccessProtectedHack.java | 33 ----------------- .../io/grpc/internal/TestingAccessor.java | 35 ------------------- 2 files changed, 68 deletions(-) delete mode 100644 okhttp/src/test/java/io/grpc/internal/AccessProtectedHack.java delete mode 100644 testing/src/main/java/io/grpc/internal/TestingAccessor.java diff --git a/okhttp/src/test/java/io/grpc/internal/AccessProtectedHack.java b/okhttp/src/test/java/io/grpc/internal/AccessProtectedHack.java deleted file mode 100644 index 6b53d821731a..000000000000 --- a/okhttp/src/test/java/io/grpc/internal/AccessProtectedHack.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2016 The gRPC Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.grpc.internal; - -import io.grpc.ServerStreamTracer; -import java.util.List; - -/** A hack to access protected methods from io.grpc.internal. */ -public final class AccessProtectedHack { - public static List serverBuilderBuildTransportServer( - AbstractServerImplBuilder builder, - List streamTracerFactories, - TransportTracer.Factory transportTracerFactory) { - builder.transportTracerFactory = transportTracerFactory; - return builder.buildTransportServers(streamTracerFactories); - } - - private AccessProtectedHack() {} -} diff --git a/testing/src/main/java/io/grpc/internal/TestingAccessor.java b/testing/src/main/java/io/grpc/internal/TestingAccessor.java deleted file mode 100644 index 92dc114d9c60..000000000000 --- a/testing/src/main/java/io/grpc/internal/TestingAccessor.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2017 The gRPC Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.grpc.internal; - -/** - * Test helper that allows accessing package-private stuff. - */ -public final class TestingAccessor { - - /** - * Disable or enable server side census stats features. - */ - public static void setStatsEnabled( - AbstractServerImplBuilder builder, - boolean statsEnabled) { - builder.setStatsEnabled(statsEnabled); - } - - private TestingAccessor() { - } -}