From 89bc2cd3b23d583387d104bb1ca6ec86ad9816be Mon Sep 17 00:00:00 2001 From: Carl Mastrangelo Date: Thu, 26 Jan 2017 13:43:06 -0800 Subject: [PATCH] all: update to latest import ordering --- .../io/grpc/auth/ClientAuthInterceptor.java | 2 -- .../GoogleAuthLibraryCallCredentials.java | 3 -- .../io/grpc/auth/MoreCallCredentials.java | 1 - .../grpc/auth/ClientAuthInterceptorTest.java | 11 +++---- .../GoogleAuthLibraryCallCredentialsTest.java | 23 +++++++-------- .../grpc/DecompressorRegistryBenchmark.java | 9 +++--- .../src/jmh/java/io/grpc/StatusBenchmark.java | 5 ++-- .../grpc/benchmarks/CallOptionsBenchmark.java | 12 ++++---- .../grpc/benchmarks/TransportBenchmark.java | 7 ++--- .../benchmarks/netty/AbstractBenchmark.java | 1 - ...wControlledMessagesPerSecondBenchmark.java | 11 ++++--- .../netty/HandlerRegistryBenchmark.java | 8 ++--- .../SingleThreadBlockingQpsBenchmark.java | 1 - .../StreamingPingPongsPerSecondBenchmark.java | 11 ++++--- .../StreamingResponseBandwidthBenchmark.java | 9 +++--- .../netty/UnaryCallQpsBenchmark.java | 5 ++-- .../UnaryCallResponseBandwidthBenchmark.java | 5 ++-- .../grpc/netty/InboundHeadersBenchmark.java | 3 +- .../grpc/netty/MethodDescriptorBenchmark.java | 8 ++--- .../grpc/netty/OutboundHeadersBenchmark.java | 6 ++-- .../grpc/benchmarks/ByteBufInputStream.java | 1 - .../benchmarks/ByteBufOutputMarshaller.java | 1 - .../main/java/io/grpc/benchmarks/Utils.java | 6 +--- .../io/grpc/benchmarks/driver/LoadClient.java | 11 +++---- .../io/grpc/benchmarks/driver/LoadServer.java | 3 -- .../io/grpc/benchmarks/driver/LoadWorker.java | 2 -- .../qps/AbstractConfigurationBuilder.java | 1 - .../io/grpc/benchmarks/qps/AsyncClient.java | 7 ++--- .../io/grpc/benchmarks/qps/AsyncServer.java | 2 -- .../benchmarks/qps/ClientConfiguration.java | 1 - .../grpc/benchmarks/qps/OpenLoopClient.java | 7 ++--- .../benchmarks/qps/ServerConfiguration.java | 1 - .../benchmarks/driver/LoadClientTest.java | 1 - .../benchmarks/driver/LoadWorkerTest.java | 10 +++---- checkstyle.xml | 4 +-- .../src/test/java/io/grpc/ContextTest.java | 12 ++++---- .../src/test/java/io/grpc/DeadlineTest.java | 10 +++---- core/src/main/java/io/grpc/Attributes.java | 2 -- .../main/java/io/grpc/CallCredentials.java | 1 - core/src/main/java/io/grpc/CallOptions.java | 2 -- core/src/main/java/io/grpc/ClientCall.java | 1 - .../main/java/io/grpc/ClientInterceptors.java | 1 - .../main/java/io/grpc/CompressorRegistry.java | 3 -- .../java/io/grpc/ConnectivityStateInfo.java | 2 -- core/src/main/java/io/grpc/Contexts.java | 1 - .../java/io/grpc/DecompressorRegistry.java | 2 -- .../java/io/grpc/EquivalentAddressGroup.java | 1 - core/src/main/java/io/grpc/Grpc.java | 2 -- .../main/java/io/grpc/HandlerRegistry.java | 1 - .../main/java/io/grpc/InternalMetadata.java | 1 - core/src/main/java/io/grpc/LoadBalancer.java | 1 - core/src/main/java/io/grpc/LoadBalancer2.java | 1 - .../java/io/grpc/ManagedChannelProvider.java | 1 - core/src/main/java/io/grpc/Metadata.java | 2 -- .../main/java/io/grpc/MethodDescriptor.java | 2 -- core/src/main/java/io/grpc/NameResolver.java | 1 - .../java/io/grpc/NameResolverProvider.java | 1 - .../io/grpc/PickFirstBalancerFactory.java | 3 -- .../io/grpc/PickFirstBalancerFactory2.java | 1 - .../main/java/io/grpc/ResolvedServerInfo.java | 2 -- .../java/io/grpc/ResolvedServerInfoGroup.java | 2 -- core/src/main/java/io/grpc/Server.java | 1 - core/src/main/java/io/grpc/ServerBuilder.java | 1 - core/src/main/java/io/grpc/ServerCall.java | 2 -- .../main/java/io/grpc/ServerInterceptors.java | 1 - .../src/main/java/io/grpc/ServerProvider.java | 2 -- .../main/java/io/grpc/ServiceDescriptor.java | 2 -- core/src/main/java/io/grpc/Status.java | 3 -- .../main/java/io/grpc/TransportManager.java | 1 - .../inprocess/InProcessChannelBuilder.java | 2 -- .../io/grpc/inprocess/InProcessServer.java | 2 -- .../inprocess/InProcessServerBuilder.java | 2 -- .../io/grpc/inprocess/InProcessTransport.java | 2 -- .../grpc/internal/AbstractClientStream.java | 2 -- .../grpc/internal/AbstractClientStream2.java | 3 -- .../AbstractManagedChannelImplBuilder.java | 3 -- .../internal/AbstractServerImplBuilder.java | 3 -- .../grpc/internal/AbstractServerStream.java | 2 -- .../java/io/grpc/internal/AbstractStream.java | 3 -- .../io/grpc/internal/AbstractStream2.java | 3 -- ...llCredentialsApplyingTransportFactory.java | 1 - .../io/grpc/internal/ChannelExecutor.java | 1 - .../java/io/grpc/internal/ClientCallImpl.java | 3 -- .../io/grpc/internal/ClientTransport.java | 1 - .../grpc/internal/ClientTransportFactory.java | 1 - .../internal/ConnectionClientTransport.java | 1 - .../internal/ConnectivityStateManager.java | 2 -- .../grpc/internal/DelayedClientTransport.java | 3 -- .../internal/DelayedClientTransport2.java | 3 -- .../java/io/grpc/internal/DelayedStream.java | 3 -- .../io/grpc/internal/DnsNameResolver.java | 3 -- .../internal/DnsNameResolverProvider.java | 2 -- .../internal/ExponentialBackoffPolicy.java | 1 - .../io/grpc/internal/FailingClientStream.java | 1 - .../grpc/internal/FailingClientTransport.java | 2 -- .../ForwardingConnectionClientTransport.java | 1 - .../internal/ForwardingReadableBuffer.java | 1 - .../main/java/io/grpc/internal/GrpcUtil.java | 3 -- .../io/grpc/internal/Http2ClientStream.java | 3 -- .../Http2ClientStreamTransportState.java | 3 -- .../main/java/io/grpc/internal/Http2Ping.java | 3 -- .../grpc/internal/InUseStateAggregator.java | 1 - .../grpc/internal/InUseStateAggregator2.java | 1 - .../internal/InternalHandlerRegistry.java | 2 -- .../java/io/grpc/internal/InternalServer.java | 1 - .../io/grpc/internal/InternalSubchannel.java | 3 -- .../io/grpc/internal/KeepAliveManager.java | 10 +++---- .../grpc/internal/LogExceptionRunnable.java | 1 - .../io/grpc/internal/ManagedChannelImpl.java | 3 -- .../io/grpc/internal/ManagedChannelImpl2.java | 5 +--- .../grpc/internal/ManagedClientTransport.java | 1 - .../io/grpc/internal/MessageDeframer.java | 3 -- .../java/io/grpc/internal/MessageFramer.java | 3 -- .../io/grpc/internal/MetadataApplierImpl.java | 1 - .../io/grpc/internal/NoopClientStream.java | 1 - .../internal/NoopStatsContextFactory.java | 1 - .../java/io/grpc/internal/OobChannel.java | 5 +--- .../io/grpc/internal/ReadableBuffers.java | 2 -- .../grpc/internal/RoundRobinServerList.java | 3 -- ...SerializeReentrantCallsDirectExecutor.java | 1 - .../io/grpc/internal/SerializingExecutor.java | 2 -- .../java/io/grpc/internal/ServerCallImpl.java | 2 -- .../java/io/grpc/internal/ServerImpl.java | 3 -- .../grpc/internal/SharedResourceHolder.java | 2 -- .../grpc/internal/SingleTransportChannel.java | 2 -- .../io/grpc/internal/StatsTraceContext.java | 2 -- .../main/java/io/grpc/internal/Stream.java | 1 - .../java/io/grpc/internal/SubchannelImpl.java | 1 - .../io/grpc/internal/TransportFrameUtil.java | 2 -- .../java/io/grpc/internal/TransportSet.java | 3 -- .../io/grpc/util/MutableHandlerRegistry.java | 2 -- .../util/RoundRobinLoadBalancerFactory.java | 2 -- .../util/RoundRobinLoadBalancerFactory2.java | 3 -- .../test/java/io/grpc/CallOptionsTest.java | 7 ++--- .../java/io/grpc/ClientInterceptorsTest.java | 8 ++--- core/src/test/java/io/grpc/ContextsTest.java | 8 ++--- .../io/grpc/DecompressorRegistryTest.java | 7 ++--- .../ForwardingServerCallListenerTest.java | 1 - .../io/grpc/ManagedChannelProviderTest.java | 3 +- core/src/test/java/io/grpc/MetadataTest.java | 9 ++---- .../java/io/grpc/MethodDescriptorTest.java | 2 -- .../io/grpc/NameResolverProviderTest.java | 8 ++--- .../java/io/grpc/PickFirstBalancerTest.java | 7 ++--- .../io/grpc/PickFirstLoadBalancer2Test.java | 7 ++--- .../java/io/grpc/ResolvedServerInfoTest.java | 3 +- .../java/io/grpc/ServerInterceptorsTest.java | 12 ++++---- .../io/grpc/ServerServiceDefinitionTest.java | 5 ++-- .../java/io/grpc/ServiceDescriptorTest.java | 8 ++--- core/src/test/java/io/grpc/StatusTest.java | 4 +-- .../test/java/io/grpc/StringMarshaller.java | 1 - .../grpc/inprocess/InProcessServerTest.java | 1 - .../inprocess/InProcessTransportTest.java | 1 - .../internal/AbstractClientStream2Test.java | 1 - .../internal/AbstractClientStreamTest.java | 1 - ...AbstractManagedChannelImplBuilderTest.java | 7 ++--- .../internal/AbstractServerStreamTest.java | 6 ++-- .../io/grpc/internal/AbstractStreamTest.java | 5 +--- .../grpc/internal/ByteWritableBufferTest.java | 3 +- .../internal/CallCredentialsApplyingTest.java | 6 ++-- .../io/grpc/internal/ChannelExecutorTest.java | 7 ++--- .../io/grpc/internal/ClientCallImplTest.java | 23 +++++++-------- .../internal/CompositeReadableBufferTest.java | 7 ++--- .../ConnectivityStateManagerTest.java | 7 ++--- .../internal/DelayedClientTransport2Test.java | 10 +++---- .../internal/DelayedClientTransportTest.java | 9 ++---- .../io/grpc/internal/DelayedStreamTest.java | 6 ++-- .../internal/DnsNameResolverProviderTest.java | 4 +-- .../io/grpc/internal/DnsNameResolverTest.java | 21 ++++++-------- .../ExponentialBackoffPolicyTest.java | 3 +- .../test/java/io/grpc/internal/FakeClock.java | 1 - .../java/io/grpc/internal/FakeClockTest.java | 8 ++--- .../ForwardingReadableBufferTest.java | 3 +- .../java/io/grpc/internal/GrpcUtilTest.java | 1 - .../Http2ClientStreamTransportStateTest.java | 1 - .../grpc/internal/InternalSubchannelTest.java | 12 ++++---- .../java/io/grpc/internal/IoUtilsTest.java | 5 ++-- .../grpc/internal/KeepAliveManagerTest.java | 10 +++---- .../ManagedChannelImpl2IdlenessTest.java | 21 ++++++-------- .../internal/ManagedChannelImpl2Test.java | 27 ++++++++--------- ...ManagedChannelImplGetNameResolverTest.java | 4 +-- .../ManagedChannelImplIdlenessTest.java | 23 +++++++-------- .../grpc/internal/ManagedChannelImplTest.java | 27 ++++++++--------- ...anagedChannelImplTransportManagerTest.java | 18 +++++------- .../io/grpc/internal/MessageDeframerTest.java | 15 ++++------ .../io/grpc/internal/MessageFramerTest.java | 14 ++++----- .../internal/NoopClientStreamListener.java | 1 - .../grpc/internal/ReadableBufferTestBase.java | 7 ++--- ...alizeReentrantCallsDirectExecutorTest.java | 9 +++--- .../io/grpc/internal/ServerCallImplTest.java | 11 +++---- .../java/io/grpc/internal/ServerImplTest.java | 25 +++++++--------- .../internal/SharedResourceHolderTest.java | 12 ++++---- .../test/java/io/grpc/internal/TestUtils.java | 6 ++-- .../grpc/internal/TransportFrameUtilTest.java | 5 +--- .../io/grpc/internal/TransportSetTest.java | 10 +++---- .../grpc/util/MutableHandlerRegistryTest.java | 3 +- .../util/RoundRobinLoadBalancer2Test.java | 13 ++++----- .../grpc/util/RoundRobinLoadBalancerTest.java | 8 ++--- .../io/grpc/grpclb/GrpclbLoadBalancer.java | 3 -- .../io/grpc/grpclb/GrpclbLoadBalancer2.java | 4 +-- .../grpc/grpclb/GrpclbLoadBalancer2Test.java | 24 +++++++-------- .../grpc/grpclb/GrpclbLoadBalancerTest.java | 21 ++++++-------- .../integration/AbstractInteropTest.java | 20 +++++-------- .../grpc/testing/integration/Http2Client.java | 3 -- .../integration/ReconnectTestClient.java | 1 - .../testing/integration/StressTestClient.java | 3 -- .../integration/TestServiceClient.java | 3 -- .../testing/integration/TestServiceImpl.java | 2 -- .../integration/TestServiceServer.java | 2 -- .../io/grpc/testing/integration/Util.java | 5 +--- .../java/io/grpc/stub/StubConfigTest.java | 1 - .../integration/AutoWindowSizingOnTest.java | 1 - .../testing/integration/CascadingTest.java | 17 +++++------ .../testing/integration/CompressionTest.java | 13 ++++----- .../testing/integration/ConcurrencyTest.java | 13 ++++----- .../Http2NettyLocalChannelTest.java | 1 - .../testing/integration/Http2NettyTest.java | 4 +-- .../testing/integration/Http2OkHttpTest.java | 9 ++---- .../testing/integration/InProcessTest.java | 1 - .../integration/MoreInProcessTest.java | 8 ++--- .../integration/NettyFlowControlTest.java | 17 +++++------ .../grpc/testing/integration/ProxyTest.java | 12 ++++---- .../integration/StressTestClientTest.java | 9 ++---- .../testing/integration/TestCasesTest.java | 5 ++-- .../io/grpc/testing/integration/TlsTest.java | 20 +++++-------- .../integration/TrafficControlProxy.java | 1 - .../integration/TransportCompressionTest.java | 13 ++++----- .../io/grpc/netty/AbstractHttp2Headers.java | 1 - .../io/grpc/netty/AbstractNettyHandler.java | 2 -- .../grpc/netty/CancelClientStreamCommand.java | 1 - .../grpc/netty/CancelServerStreamCommand.java | 1 - .../io/grpc/netty/CreateStreamCommand.java | 1 - .../grpc/netty/GrpcHttp2HeadersDecoder.java | 2 -- .../grpc/netty/GrpcHttp2OutboundHeaders.java | 1 - .../java/io/grpc/netty/GrpcSslContexts.java | 1 - .../netty/InternalNettyChannelBuilder.java | 1 - .../io/grpc/netty/NettyChannelBuilder.java | 3 -- .../io/grpc/netty/NettyClientHandler.java | 3 -- .../java/io/grpc/netty/NettyClientStream.java | 2 -- .../io/grpc/netty/NettyClientTransport.java | 3 -- .../io/grpc/netty/NettyReadableBuffer.java | 2 -- .../main/java/io/grpc/netty/NettyServer.java | 2 -- .../io/grpc/netty/NettyServerBuilder.java | 3 -- .../io/grpc/netty/NettyServerHandler.java | 2 -- .../java/io/grpc/netty/NettyServerStream.java | 1 - .../io/grpc/netty/NettyServerTransport.java | 2 -- .../io/grpc/netty/ProtocolNegotiators.java | 2 -- .../java/io/grpc/netty/SendPingCommand.java | 1 - .../netty/SendResponseHeadersCommand.java | 1 - netty/src/main/java/io/grpc/netty/Utils.java | 2 -- .../main/java/io/grpc/netty/WriteQueue.java | 2 -- .../grpc/netty/AbstractHttp2HeadersTest.java | 9 ++---- .../netty/GrpcHttp2HeadersDecoderTest.java | 1 - .../netty/GrpcHttp2InboundHeadersTest.java | 4 +-- .../grpc/netty/NettyChannelBuilderTest.java | 9 ++---- .../grpc/netty/NettyChannelProviderTest.java | 1 - .../io/grpc/netty/NettyClientHandlerTest.java | 7 ++--- .../io/grpc/netty/NettyClientStreamTest.java | 9 ++---- .../grpc/netty/NettyClientTransportTest.java | 18 +++++------- .../io/grpc/netty/NettyHandlerTestBase.java | 4 +-- .../grpc/netty/NettyReadableBufferTest.java | 1 - .../io/grpc/netty/NettyServerHandlerTest.java | 5 +--- .../grpc/netty/NettyServerProviderTest.java | 1 - .../io/grpc/netty/NettyServerStreamTest.java | 5 +--- .../java/io/grpc/netty/NettyServerTest.java | 4 +-- .../io/grpc/netty/NettyStreamTestBase.java | 10 +++---- .../java/io/grpc/netty/NettyTestUtil.java | 2 -- .../io/grpc/netty/NettyTransportTest.java | 4 +-- .../NettyWritableBufferAllocatorTest.java | 1 - .../grpc/netty/NettyWritableBufferTest.java | 4 +-- .../grpc/netty/ProtocolNegotiatorsTest.java | 15 ++++------ .../test/java/io/grpc/netty/UtilsTest.java | 1 - .../java/io/grpc/netty/WriteQueueTest.java | 6 ++-- .../java/io/grpc/okhttp/AsyncFrameWriter.java | 5 +--- .../src/main/java/io/grpc/okhttp/Headers.java | 5 +--- .../io/grpc/okhttp/OkHttpChannelBuilder.java | 4 --- .../io/grpc/okhttp/OkHttpClientStream.java | 5 +--- .../io/grpc/okhttp/OkHttpClientTransport.java | 18 +++++------- .../grpc/okhttp/OkHttpProtocolNegotiator.java | 3 -- .../io/grpc/okhttp/OkHttpReadableBuffer.java | 1 - .../io/grpc/okhttp/OkHttpTlsUpgrader.java | 2 -- .../io/grpc/okhttp/OkHttpWritableBuffer.java | 1 - .../grpc/okhttp/OutboundFlowController.java | 6 +--- .../src/main/java/io/grpc/okhttp/Utils.java | 2 -- .../grpc/okhttp/OkHttpChannelBuilderTest.java | 5 +--- .../okhttp/OkHttpChannelProviderTest.java | 1 - .../grpc/okhttp/OkHttpClientStreamTest.java | 8 ++--- .../okhttp/OkHttpClientTransportTest.java | 29 ++++++++----------- .../okhttp/OkHttpProtocolNegotiatorTest.java | 18 +++++------- .../grpc/okhttp/OkHttpReadableBufferTest.java | 2 -- .../io/grpc/okhttp/OkHttpTransportTest.java | 4 +-- .../OkHttpWritableBufferAllocatorTest.java | 1 - .../test/java/io/grpc/okhttp/UtilsTest.java | 4 +-- .../grpc/protobuf/lite/ProtoInputStream.java | 3 -- .../io/grpc/protobuf/lite/ProtoLiteUtils.java | 2 -- .../protobuf/lite/ProtoLiteUtilsTest.java | 13 ++++----- .../protobuf/nano/NanoProtoInputStream.java | 3 -- .../java/io/grpc/protobuf/nano/NanoUtils.java | 2 -- .../io/grpc/protobuf/nano/NanoUtilsTest.java | 9 ++---- .../java/io/grpc/protobuf/ProtoUtils.java | 2 -- .../java/io/grpc/protobuf/ProtoUtilsTest.java | 9 ++---- .../service/ProtoReflectionService.java | 3 -- .../io/grpc/services/HealthServiceImpl.java | 2 -- .../service/ProtoReflectionServiceTest.java | 13 ++++----- .../services/HealthStatusManagerTest.java | 1 - .../main/java/io/grpc/stub/AbstractStub.java | 2 -- .../main/java/io/grpc/stub/ClientCalls.java | 3 -- .../main/java/io/grpc/stub/MetadataUtils.java | 1 - .../java/io/grpc/stub/StreamObservers.java | 2 -- .../java/io/grpc/stub/AbstractStubTest.java | 1 - .../java/io/grpc/stub/ClientCallsTest.java | 15 ++++------ .../java/io/grpc/stub/ServerCallsTest.java | 8 ++--- .../AbstractClientTransportFactoryTest.java | 3 +- .../testing/AbstractTransportTest.java | 21 ++++++-------- .../grpc/internal/testing/StatsTestUtils.java | 3 -- .../java/io/grpc/testing/DeadlineSubject.java | 3 -- .../java/io/grpc/testing/GrpcServerRule.java | 6 ++-- .../java/io/grpc/testing/StreamRecorder.java | 3 -- .../grpc/testing/TestMethodDescriptors.java | 1 - .../main/java/io/grpc/testing/TestUtils.java | 2 -- .../io/grpc/testing/GrpcServerRuleTest.java | 9 ++---- .../java/io/grpc/thrift/MessageFactory.java | 1 - .../io/grpc/thrift/ThriftInputStream.java | 9 ++---- .../main/java/io/grpc/thrift/ThriftUtils.java | 5 ++-- .../java/io/grpc/thrift/ThriftUtilsTest.java | 11 ++++--- 324 files changed, 491 insertions(+), 1146 deletions(-) diff --git a/auth/src/main/java/io/grpc/auth/ClientAuthInterceptor.java b/auth/src/main/java/io/grpc/auth/ClientAuthInterceptor.java index fe56b6f1bb2..68f4a44dafd 100644 --- a/auth/src/main/java/io/grpc/auth/ClientAuthInterceptor.java +++ b/auth/src/main/java/io/grpc/auth/ClientAuthInterceptor.java @@ -33,7 +33,6 @@ import com.google.auth.Credentials; import com.google.common.base.Preconditions; - import io.grpc.CallOptions; import io.grpc.Channel; import io.grpc.ClientCall; @@ -43,7 +42,6 @@ import io.grpc.MethodDescriptor; import io.grpc.Status; import io.grpc.StatusException; - import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; diff --git a/auth/src/main/java/io/grpc/auth/GoogleAuthLibraryCallCredentials.java b/auth/src/main/java/io/grpc/auth/GoogleAuthLibraryCallCredentials.java index 4564b693ec4..7c8556c422b 100644 --- a/auth/src/main/java/io/grpc/auth/GoogleAuthLibraryCallCredentials.java +++ b/auth/src/main/java/io/grpc/auth/GoogleAuthLibraryCallCredentials.java @@ -36,15 +36,12 @@ import com.google.auth.Credentials; import com.google.common.annotations.VisibleForTesting; import com.google.common.io.BaseEncoding; - import io.grpc.Attributes; -import io.grpc.CallCredentials.MetadataApplier; import io.grpc.CallCredentials; import io.grpc.Metadata; import io.grpc.MethodDescriptor; import io.grpc.Status; import io.grpc.StatusException; - import java.lang.reflect.Constructor; import java.lang.reflect.Method; import java.net.URI; diff --git a/auth/src/main/java/io/grpc/auth/MoreCallCredentials.java b/auth/src/main/java/io/grpc/auth/MoreCallCredentials.java index b8e8ca52a20..9961b6253db 100644 --- a/auth/src/main/java/io/grpc/auth/MoreCallCredentials.java +++ b/auth/src/main/java/io/grpc/auth/MoreCallCredentials.java @@ -32,7 +32,6 @@ package io.grpc.auth; import com.google.auth.Credentials; - import io.grpc.CallCredentials; import io.grpc.ExperimentalApi; diff --git a/auth/src/test/java/io/grpc/auth/ClientAuthInterceptorTest.java b/auth/src/test/java/io/grpc/auth/ClientAuthInterceptorTest.java index e13c5839b96..9dd4429cd09 100644 --- a/auth/src/test/java/io/grpc/auth/ClientAuthInterceptorTest.java +++ b/auth/src/test/java/io/grpc/auth/ClientAuthInterceptorTest.java @@ -48,7 +48,6 @@ import com.google.common.collect.ListMultimap; import com.google.common.collect.Multimaps; import com.google.common.util.concurrent.MoreExecutors; - import io.grpc.CallOptions; import io.grpc.Channel; import io.grpc.ClientCall; @@ -56,7 +55,10 @@ import io.grpc.MethodDescriptor; import io.grpc.MethodDescriptor.Marshaller; import io.grpc.Status; - +import java.io.IOException; +import java.net.URI; +import java.util.Date; +import java.util.concurrent.Executor; import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -67,11 +69,6 @@ import org.mockito.Mockito; import org.mockito.MockitoAnnotations; -import java.io.IOException; -import java.net.URI; -import java.util.Date; -import java.util.concurrent.Executor; - /** * Tests for {@link ClientAuthInterceptor}. */ diff --git a/auth/src/test/java/io/grpc/auth/GoogleAuthLibraryCallCredentialsTest.java b/auth/src/test/java/io/grpc/auth/GoogleAuthLibraryCallCredentialsTest.java index 8fb0f54e105..c88e15d9421 100644 --- a/auth/src/test/java/io/grpc/auth/GoogleAuthLibraryCallCredentialsTest.java +++ b/auth/src/test/java/io/grpc/auth/GoogleAuthLibraryCallCredentialsTest.java @@ -51,15 +51,22 @@ import com.google.common.collect.LinkedListMultimap; import com.google.common.collect.ListMultimap; import com.google.common.collect.Multimaps; - import io.grpc.Attributes; -import io.grpc.CallCredentials.MetadataApplier; import io.grpc.CallCredentials; +import io.grpc.CallCredentials.MetadataApplier; import io.grpc.Metadata; import io.grpc.MethodDescriptor; import io.grpc.SecurityLevel; import io.grpc.Status; - +import java.io.IOException; +import java.net.URI; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.concurrent.Executor; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -71,16 +78,6 @@ import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -import java.io.IOException; -import java.net.URI; -import java.security.KeyPair; -import java.security.KeyPairGenerator; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; -import java.util.List; -import java.util.concurrent.Executor; - /** * Tests for {@link GoogleAuthLibraryCallCredentials}. */ diff --git a/benchmarks/src/jmh/java/io/grpc/DecompressorRegistryBenchmark.java b/benchmarks/src/jmh/java/io/grpc/DecompressorRegistryBenchmark.java index d940fc2c511..61a7a56c190 100644 --- a/benchmarks/src/jmh/java/io/grpc/DecompressorRegistryBenchmark.java +++ b/benchmarks/src/jmh/java/io/grpc/DecompressorRegistryBenchmark.java @@ -33,6 +33,10 @@ import static io.grpc.DecompressorRegistry.ACCEPT_ENCODING_JOINER; +import java.io.IOException; +import java.io.InputStream; +import java.util.UUID; +import java.util.concurrent.TimeUnit; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Mode; @@ -42,11 +46,6 @@ import org.openjdk.jmh.annotations.Setup; import org.openjdk.jmh.annotations.State; -import java.io.IOException; -import java.io.InputStream; -import java.util.UUID; -import java.util.concurrent.TimeUnit; - /** * Decomressor Registry encoding benchmark. */ diff --git a/benchmarks/src/jmh/java/io/grpc/StatusBenchmark.java b/benchmarks/src/jmh/java/io/grpc/StatusBenchmark.java index b4a573a665c..24740ecf0be 100644 --- a/benchmarks/src/jmh/java/io/grpc/StatusBenchmark.java +++ b/benchmarks/src/jmh/java/io/grpc/StatusBenchmark.java @@ -31,6 +31,8 @@ package io.grpc; +import java.nio.charset.Charset; +import java.util.concurrent.TimeUnit; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Mode; @@ -38,9 +40,6 @@ import org.openjdk.jmh.annotations.Scope; import org.openjdk.jmh.annotations.State; -import java.nio.charset.Charset; -import java.util.concurrent.TimeUnit; - /** StatusBenchmark. */ @State(Scope.Benchmark) public class StatusBenchmark { diff --git a/benchmarks/src/jmh/java/io/grpc/benchmarks/CallOptionsBenchmark.java b/benchmarks/src/jmh/java/io/grpc/benchmarks/CallOptionsBenchmark.java index 0ae9cf4f274..cf9a4b5d721 100644 --- a/benchmarks/src/jmh/java/io/grpc/benchmarks/CallOptionsBenchmark.java +++ b/benchmarks/src/jmh/java/io/grpc/benchmarks/CallOptionsBenchmark.java @@ -32,7 +32,11 @@ package io.grpc.benchmarks; import io.grpc.CallOptions; - +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Random; +import java.util.concurrent.TimeUnit; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Mode; @@ -42,12 +46,6 @@ import org.openjdk.jmh.annotations.Setup; import org.openjdk.jmh.annotations.State; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Random; -import java.util.concurrent.TimeUnit; - /** * Call options benchmark. */ diff --git a/benchmarks/src/jmh/java/io/grpc/benchmarks/TransportBenchmark.java b/benchmarks/src/jmh/java/io/grpc/benchmarks/TransportBenchmark.java index 5d12876cb1d..e57c16c3ac3 100644 --- a/benchmarks/src/jmh/java/io/grpc/benchmarks/TransportBenchmark.java +++ b/benchmarks/src/jmh/java/io/grpc/benchmarks/TransportBenchmark.java @@ -34,7 +34,6 @@ import static io.grpc.benchmarks.Utils.pickUnusedPort; import com.google.protobuf.ByteString; - import io.grpc.ManagedChannel; import io.grpc.Server; import io.grpc.benchmarks.proto.BenchmarkServiceGrpc; @@ -56,7 +55,8 @@ import io.netty.channel.local.LocalAddress; import io.netty.channel.local.LocalChannel; import io.netty.channel.local.LocalServerChannel; - +import java.net.InetSocketAddress; +import java.util.concurrent.TimeUnit; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Mode; @@ -67,9 +67,6 @@ import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.annotations.TearDown; -import java.net.InetSocketAddress; -import java.util.concurrent.TimeUnit; - /** Some text. */ @State(Scope.Benchmark) public class TransportBenchmark { diff --git a/benchmarks/src/jmh/java/io/grpc/benchmarks/netty/AbstractBenchmark.java b/benchmarks/src/jmh/java/io/grpc/benchmarks/netty/AbstractBenchmark.java index 157a853bec9..325dc0fe93d 100644 --- a/benchmarks/src/jmh/java/io/grpc/benchmarks/netty/AbstractBenchmark.java +++ b/benchmarks/src/jmh/java/io/grpc/benchmarks/netty/AbstractBenchmark.java @@ -56,7 +56,6 @@ import io.netty.channel.local.LocalServerChannel; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.util.concurrent.DefaultThreadFactory; - import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.NetworkInterface; diff --git a/benchmarks/src/jmh/java/io/grpc/benchmarks/netty/FlowControlledMessagesPerSecondBenchmark.java b/benchmarks/src/jmh/java/io/grpc/benchmarks/netty/FlowControlledMessagesPerSecondBenchmark.java index 556334f6753..3b4dcf9ea13 100644 --- a/benchmarks/src/jmh/java/io/grpc/benchmarks/netty/FlowControlledMessagesPerSecondBenchmark.java +++ b/benchmarks/src/jmh/java/io/grpc/benchmarks/netty/FlowControlledMessagesPerSecondBenchmark.java @@ -31,6 +31,11 @@ package io.grpc.benchmarks.netty; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicLong; +import java.util.logging.Logger; import org.openjdk.jmh.annotations.AuxCounters; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.Fork; @@ -41,12 +46,6 @@ import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.annotations.TearDown; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicLong; -import java.util.logging.Logger; - /** * Benchmark measuring messages per second received from a streaming server. The server * is obeying outbound flow-control. diff --git a/benchmarks/src/jmh/java/io/grpc/benchmarks/netty/HandlerRegistryBenchmark.java b/benchmarks/src/jmh/java/io/grpc/benchmarks/netty/HandlerRegistryBenchmark.java index 1928cee58e9..36bdb454a9d 100644 --- a/benchmarks/src/jmh/java/io/grpc/benchmarks/netty/HandlerRegistryBenchmark.java +++ b/benchmarks/src/jmh/java/io/grpc/benchmarks/netty/HandlerRegistryBenchmark.java @@ -40,7 +40,9 @@ import io.grpc.ServiceDescriptor; import io.grpc.testing.TestMethodDescriptors; import io.grpc.util.MutableHandlerRegistry; - +import java.util.ArrayList; +import java.util.List; +import java.util.Random; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.Fork; import org.openjdk.jmh.annotations.Level; @@ -50,10 +52,6 @@ import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.infra.Blackhole; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - /** * Benchmark for {@link MutableHandlerRegistry}. */ diff --git a/benchmarks/src/jmh/java/io/grpc/benchmarks/netty/SingleThreadBlockingQpsBenchmark.java b/benchmarks/src/jmh/java/io/grpc/benchmarks/netty/SingleThreadBlockingQpsBenchmark.java index 6c3369f2fd5..3ad482edc68 100644 --- a/benchmarks/src/jmh/java/io/grpc/benchmarks/netty/SingleThreadBlockingQpsBenchmark.java +++ b/benchmarks/src/jmh/java/io/grpc/benchmarks/netty/SingleThreadBlockingQpsBenchmark.java @@ -34,7 +34,6 @@ import io.grpc.CallOptions; import io.grpc.stub.ClientCalls; import io.netty.buffer.Unpooled; - import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.Fork; import org.openjdk.jmh.annotations.Level; diff --git a/benchmarks/src/jmh/java/io/grpc/benchmarks/netty/StreamingPingPongsPerSecondBenchmark.java b/benchmarks/src/jmh/java/io/grpc/benchmarks/netty/StreamingPingPongsPerSecondBenchmark.java index 9dceb6c10e6..787121ff855 100644 --- a/benchmarks/src/jmh/java/io/grpc/benchmarks/netty/StreamingPingPongsPerSecondBenchmark.java +++ b/benchmarks/src/jmh/java/io/grpc/benchmarks/netty/StreamingPingPongsPerSecondBenchmark.java @@ -31,6 +31,11 @@ package io.grpc.benchmarks.netty; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicLong; +import java.util.logging.Logger; import org.openjdk.jmh.annotations.AuxCounters; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.Fork; @@ -41,12 +46,6 @@ import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.annotations.TearDown; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicLong; -import java.util.logging.Logger; - /** * Benchmark measuring messages per second using a set of permanently open duplex streams which * ping-pong messages. diff --git a/benchmarks/src/jmh/java/io/grpc/benchmarks/netty/StreamingResponseBandwidthBenchmark.java b/benchmarks/src/jmh/java/io/grpc/benchmarks/netty/StreamingResponseBandwidthBenchmark.java index d7de0a452e3..cd0403c11f3 100644 --- a/benchmarks/src/jmh/java/io/grpc/benchmarks/netty/StreamingResponseBandwidthBenchmark.java +++ b/benchmarks/src/jmh/java/io/grpc/benchmarks/netty/StreamingResponseBandwidthBenchmark.java @@ -31,6 +31,10 @@ package io.grpc.benchmarks.netty; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicLong; import org.openjdk.jmh.annotations.AuxCounters; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.Fork; @@ -41,11 +45,6 @@ import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.annotations.TearDown; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicLong; - /** * Benchmark intended to test response bandwidth in bytes/sec for streaming calls by permuting * payload size and flow-control windows with number of concurrent calls. Async stubs are used diff --git a/benchmarks/src/jmh/java/io/grpc/benchmarks/netty/UnaryCallQpsBenchmark.java b/benchmarks/src/jmh/java/io/grpc/benchmarks/netty/UnaryCallQpsBenchmark.java index 172b909028a..6deeadacfec 100644 --- a/benchmarks/src/jmh/java/io/grpc/benchmarks/netty/UnaryCallQpsBenchmark.java +++ b/benchmarks/src/jmh/java/io/grpc/benchmarks/netty/UnaryCallQpsBenchmark.java @@ -31,6 +31,8 @@ package io.grpc.benchmarks.netty; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicLong; import org.openjdk.jmh.annotations.AuxCounters; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.Fork; @@ -41,9 +43,6 @@ import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.annotations.TearDown; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicLong; - /** * Benchmark using configuration intended to allow maximum QPS for unary calls. */ diff --git a/benchmarks/src/jmh/java/io/grpc/benchmarks/netty/UnaryCallResponseBandwidthBenchmark.java b/benchmarks/src/jmh/java/io/grpc/benchmarks/netty/UnaryCallResponseBandwidthBenchmark.java index 4a2f4e5589a..a1b146b6fe8 100644 --- a/benchmarks/src/jmh/java/io/grpc/benchmarks/netty/UnaryCallResponseBandwidthBenchmark.java +++ b/benchmarks/src/jmh/java/io/grpc/benchmarks/netty/UnaryCallResponseBandwidthBenchmark.java @@ -31,6 +31,8 @@ package io.grpc.benchmarks.netty; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicLong; import org.openjdk.jmh.annotations.AuxCounters; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.Fork; @@ -41,9 +43,6 @@ import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.annotations.TearDown; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicLong; - /** * Benchmark intended to test response bandwidth in bytes/sec for unary calls by permuting * payload size and flow-control windows with number of concurrent calls. Async stubs are used diff --git a/benchmarks/src/jmh/java/io/grpc/netty/InboundHeadersBenchmark.java b/benchmarks/src/jmh/java/io/grpc/netty/InboundHeadersBenchmark.java index 366e79887fe..66c0accd015 100644 --- a/benchmarks/src/jmh/java/io/grpc/netty/InboundHeadersBenchmark.java +++ b/benchmarks/src/jmh/java/io/grpc/netty/InboundHeadersBenchmark.java @@ -40,6 +40,7 @@ import io.netty.handler.codec.http2.DefaultHttp2Headers; import io.netty.handler.codec.http2.Http2Headers; import io.netty.util.AsciiString; +import java.util.concurrent.TimeUnit; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.CompilerControl; @@ -49,8 +50,6 @@ import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.infra.Blackhole; -import java.util.concurrent.TimeUnit; - /** * Benchmarks for {@link GrpcHttp2RequestHeaders} and {@link GrpcHttp2ResponseHeaders}. */ diff --git a/benchmarks/src/jmh/java/io/grpc/netty/MethodDescriptorBenchmark.java b/benchmarks/src/jmh/java/io/grpc/netty/MethodDescriptorBenchmark.java index d5377136900..c11d6c90d3e 100644 --- a/benchmarks/src/jmh/java/io/grpc/netty/MethodDescriptorBenchmark.java +++ b/benchmarks/src/jmh/java/io/grpc/netty/MethodDescriptorBenchmark.java @@ -35,7 +35,9 @@ import io.grpc.InternalMethodDescriptor; import io.grpc.MethodDescriptor; import io.netty.util.AsciiString; - +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.util.concurrent.TimeUnit; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Mode; @@ -43,10 +45,6 @@ import org.openjdk.jmh.annotations.Scope; import org.openjdk.jmh.annotations.State; -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.util.concurrent.TimeUnit; - /** * Benchmark for Method Descriptors. */ diff --git a/benchmarks/src/jmh/java/io/grpc/netty/OutboundHeadersBenchmark.java b/benchmarks/src/jmh/java/io/grpc/netty/OutboundHeadersBenchmark.java index c2bc5c23d9e..e38a1e5cd63 100644 --- a/benchmarks/src/jmh/java/io/grpc/netty/OutboundHeadersBenchmark.java +++ b/benchmarks/src/jmh/java/io/grpc/netty/OutboundHeadersBenchmark.java @@ -39,7 +39,8 @@ import io.netty.handler.codec.http2.Http2Headers; import io.netty.handler.codec.http2.Http2HeadersEncoder; import io.netty.util.AsciiString; - +import java.util.UUID; +import java.util.concurrent.TimeUnit; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Mode; @@ -49,9 +50,6 @@ import org.openjdk.jmh.annotations.Setup; import org.openjdk.jmh.annotations.State; -import java.util.UUID; -import java.util.concurrent.TimeUnit; - /** * Header encoding benchmark. */ diff --git a/benchmarks/src/main/java/io/grpc/benchmarks/ByteBufInputStream.java b/benchmarks/src/main/java/io/grpc/benchmarks/ByteBufInputStream.java index 1572096718f..91ba08bc576 100644 --- a/benchmarks/src/main/java/io/grpc/benchmarks/ByteBufInputStream.java +++ b/benchmarks/src/main/java/io/grpc/benchmarks/ByteBufInputStream.java @@ -34,7 +34,6 @@ import io.grpc.Drainable; import io.grpc.KnownLength; import io.netty.buffer.ByteBuf; - import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; diff --git a/benchmarks/src/main/java/io/grpc/benchmarks/ByteBufOutputMarshaller.java b/benchmarks/src/main/java/io/grpc/benchmarks/ByteBufOutputMarshaller.java index d93587e7612..efa50492b88 100644 --- a/benchmarks/src/main/java/io/grpc/benchmarks/ByteBufOutputMarshaller.java +++ b/benchmarks/src/main/java/io/grpc/benchmarks/ByteBufOutputMarshaller.java @@ -35,7 +35,6 @@ import io.netty.buffer.ByteBuf; import io.netty.buffer.EmptyByteBuf; import io.netty.buffer.PooledByteBufAllocator; - import java.io.IOException; import java.io.InputStream; diff --git a/benchmarks/src/main/java/io/grpc/benchmarks/Utils.java b/benchmarks/src/main/java/io/grpc/benchmarks/Utils.java index b165457224f..0d064422919 100644 --- a/benchmarks/src/main/java/io/grpc/benchmarks/Utils.java +++ b/benchmarks/src/main/java/io/grpc/benchmarks/Utils.java @@ -35,7 +35,6 @@ import com.google.common.util.concurrent.UncaughtExceptionHandlers; import com.google.protobuf.ByteString; - import io.grpc.ManagedChannel; import io.grpc.ManagedChannelBuilder; import io.grpc.Status; @@ -60,9 +59,6 @@ import io.netty.handler.ssl.SslContextBuilder; import io.netty.handler.ssl.SslProvider; import io.netty.util.concurrent.DefaultThreadFactory; - -import org.HdrHistogram.Histogram; - import java.io.File; import java.io.FileOutputStream; import java.io.IOException; @@ -75,9 +71,9 @@ import java.util.concurrent.ForkJoinPool.ForkJoinWorkerThreadFactory; import java.util.concurrent.ForkJoinWorkerThread; import java.util.concurrent.atomic.AtomicInteger; - import javax.annotation.Nullable; import javax.net.ssl.SSLSocketFactory; +import org.HdrHistogram.Histogram; /** * Utility methods to support benchmarking classes. diff --git a/benchmarks/src/main/java/io/grpc/benchmarks/driver/LoadClient.java b/benchmarks/src/main/java/io/grpc/benchmarks/driver/LoadClient.java index df1ec468434..6eb559a78a2 100644 --- a/benchmarks/src/main/java/io/grpc/benchmarks/driver/LoadClient.java +++ b/benchmarks/src/main/java/io/grpc/benchmarks/driver/LoadClient.java @@ -32,7 +32,6 @@ package io.grpc.benchmarks.driver; import com.sun.management.OperatingSystemMXBean; - import io.grpc.CallOptions; import io.grpc.Channel; import io.grpc.ClientCall; @@ -52,12 +51,6 @@ import io.netty.buffer.PooledByteBufAllocator; import io.netty.channel.epoll.Epoll; import io.netty.util.concurrent.DefaultThreadFactory; - -import org.HdrHistogram.Histogram; -import org.HdrHistogram.LogarithmicIterator; -import org.HdrHistogram.Recorder; -import org.apache.commons.math3.distribution.ExponentialDistribution; - import java.lang.management.ManagementFactory; import java.util.List; import java.util.concurrent.ExecutorService; @@ -68,6 +61,10 @@ import java.util.concurrent.locks.LockSupport; import java.util.logging.Level; import java.util.logging.Logger; +import org.HdrHistogram.Histogram; +import org.HdrHistogram.LogarithmicIterator; +import org.HdrHistogram.Recorder; +import org.apache.commons.math3.distribution.ExponentialDistribution; /** * Implements the client-side contract for the load testing scenarios. diff --git a/benchmarks/src/main/java/io/grpc/benchmarks/driver/LoadServer.java b/benchmarks/src/main/java/io/grpc/benchmarks/driver/LoadServer.java index 1d7380d6659..873cb7f0bfb 100644 --- a/benchmarks/src/main/java/io/grpc/benchmarks/driver/LoadServer.java +++ b/benchmarks/src/main/java/io/grpc/benchmarks/driver/LoadServer.java @@ -34,9 +34,7 @@ import static java.util.concurrent.ForkJoinPool.defaultForkJoinWorkerThreadFactory; import com.google.common.util.concurrent.UncaughtExceptionHandlers; - import com.sun.management.OperatingSystemMXBean; - import io.grpc.Metadata; import io.grpc.MethodDescriptor; import io.grpc.MethodDescriptor.Marshaller; @@ -57,7 +55,6 @@ import io.grpc.testing.TestUtils; import io.netty.buffer.ByteBuf; import io.netty.buffer.PooledByteBufAllocator; - import java.io.File; import java.lang.management.ManagementFactory; import java.util.List; diff --git a/benchmarks/src/main/java/io/grpc/benchmarks/driver/LoadWorker.java b/benchmarks/src/main/java/io/grpc/benchmarks/driver/LoadWorker.java index 5f88ba999d0..1e462a4115b 100644 --- a/benchmarks/src/main/java/io/grpc/benchmarks/driver/LoadWorker.java +++ b/benchmarks/src/main/java/io/grpc/benchmarks/driver/LoadWorker.java @@ -32,7 +32,6 @@ package io.grpc.benchmarks.driver; import com.google.common.util.concurrent.ThreadFactoryBuilder; - import io.grpc.Status; import io.grpc.benchmarks.proto.Control; import io.grpc.benchmarks.proto.Control.ClientArgs; @@ -43,7 +42,6 @@ import io.grpc.netty.NettyServerBuilder; import io.grpc.stub.StreamObserver; import io.netty.channel.nio.NioEventLoopGroup; - import java.util.logging.Level; import java.util.logging.Logger; diff --git a/benchmarks/src/main/java/io/grpc/benchmarks/qps/AbstractConfigurationBuilder.java b/benchmarks/src/main/java/io/grpc/benchmarks/qps/AbstractConfigurationBuilder.java index 8cc92f09f69..216ba59c94b 100644 --- a/benchmarks/src/main/java/io/grpc/benchmarks/qps/AbstractConfigurationBuilder.java +++ b/benchmarks/src/main/java/io/grpc/benchmarks/qps/AbstractConfigurationBuilder.java @@ -35,7 +35,6 @@ import static java.lang.String.CASE_INSENSITIVE_ORDER; import com.google.common.base.Strings; - import java.util.ArrayList; import java.util.Collection; import java.util.List; diff --git a/benchmarks/src/main/java/io/grpc/benchmarks/qps/AsyncClient.java b/benchmarks/src/main/java/io/grpc/benchmarks/qps/AsyncClient.java index 5d5c053378f..4871bcf61ff 100644 --- a/benchmarks/src/main/java/io/grpc/benchmarks/qps/AsyncClient.java +++ b/benchmarks/src/main/java/io/grpc/benchmarks/qps/AsyncClient.java @@ -52,7 +52,6 @@ import com.google.common.base.Preconditions; import com.google.protobuf.ByteString; - import io.grpc.Channel; import io.grpc.ManagedChannel; import io.grpc.Status; @@ -62,10 +61,6 @@ import io.grpc.benchmarks.proto.Messages.SimpleRequest; import io.grpc.benchmarks.proto.Messages.SimpleResponse; import io.grpc.stub.StreamObserver; - -import org.HdrHistogram.Histogram; -import org.HdrHistogram.HistogramIterationValue; - import java.util.ArrayList; import java.util.List; import java.util.concurrent.CancellationException; @@ -73,6 +68,8 @@ import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import org.HdrHistogram.Histogram; +import org.HdrHistogram.HistogramIterationValue; /** * QPS Client using the non-blocking API. diff --git a/benchmarks/src/main/java/io/grpc/benchmarks/qps/AsyncServer.java b/benchmarks/src/main/java/io/grpc/benchmarks/qps/AsyncServer.java index 407136411d6..95b305b28a7 100644 --- a/benchmarks/src/main/java/io/grpc/benchmarks/qps/AsyncServer.java +++ b/benchmarks/src/main/java/io/grpc/benchmarks/qps/AsyncServer.java @@ -32,7 +32,6 @@ package io.grpc.benchmarks.qps; import com.google.common.util.concurrent.UncaughtExceptionHandlers; - import io.grpc.Server; import io.grpc.benchmarks.Utils; import io.grpc.benchmarks.proto.BenchmarkServiceGrpc; @@ -49,7 +48,6 @@ import io.netty.handler.ssl.SslContext; import io.netty.handler.ssl.SslContextBuilder; import io.netty.handler.ssl.SslProvider; - import java.io.File; import java.io.IOException; import java.util.concurrent.ForkJoinPool; diff --git a/benchmarks/src/main/java/io/grpc/benchmarks/qps/ClientConfiguration.java b/benchmarks/src/main/java/io/grpc/benchmarks/qps/ClientConfiguration.java index 89b65d46bc6..2ef8cb2f8cd 100644 --- a/benchmarks/src/main/java/io/grpc/benchmarks/qps/ClientConfiguration.java +++ b/benchmarks/src/main/java/io/grpc/benchmarks/qps/ClientConfiguration.java @@ -42,7 +42,6 @@ import io.grpc.benchmarks.proto.Messages; import io.grpc.benchmarks.proto.Messages.PayloadType; import io.grpc.testing.TestUtils; - import java.io.IOException; import java.net.InetSocketAddress; import java.net.SocketAddress; diff --git a/benchmarks/src/main/java/io/grpc/benchmarks/qps/OpenLoopClient.java b/benchmarks/src/main/java/io/grpc/benchmarks/qps/OpenLoopClient.java index 91e8dc731cf..b055c3d6290 100644 --- a/benchmarks/src/main/java/io/grpc/benchmarks/qps/OpenLoopClient.java +++ b/benchmarks/src/main/java/io/grpc/benchmarks/qps/OpenLoopClient.java @@ -53,14 +53,11 @@ import io.grpc.benchmarks.proto.BenchmarkServiceGrpc; import io.grpc.benchmarks.proto.Messages.SimpleRequest; import io.grpc.benchmarks.proto.Messages.SimpleResponse; - import io.grpc.stub.StreamObserver; - -import org.HdrHistogram.AtomicHistogram; -import org.HdrHistogram.Histogram; - import java.util.Random; import java.util.concurrent.Callable; +import org.HdrHistogram.AtomicHistogram; +import org.HdrHistogram.Histogram; /** * Tries to generate traffic that closely resembles user-generated RPC traffic. This is done using diff --git a/benchmarks/src/main/java/io/grpc/benchmarks/qps/ServerConfiguration.java b/benchmarks/src/main/java/io/grpc/benchmarks/qps/ServerConfiguration.java index 2eb3b9bbdd7..43865eed30f 100644 --- a/benchmarks/src/main/java/io/grpc/benchmarks/qps/ServerConfiguration.java +++ b/benchmarks/src/main/java/io/grpc/benchmarks/qps/ServerConfiguration.java @@ -37,7 +37,6 @@ import io.grpc.benchmarks.SocketAddressValidator; import io.grpc.benchmarks.Utils; import io.grpc.netty.NettyChannelBuilder; - import java.net.InetSocketAddress; import java.net.SocketAddress; import java.util.ArrayList; diff --git a/benchmarks/src/test/java/io/grpc/benchmarks/driver/LoadClientTest.java b/benchmarks/src/test/java/io/grpc/benchmarks/driver/LoadClientTest.java index e70297f2e21..cb164976477 100644 --- a/benchmarks/src/test/java/io/grpc/benchmarks/driver/LoadClientTest.java +++ b/benchmarks/src/test/java/io/grpc/benchmarks/driver/LoadClientTest.java @@ -36,7 +36,6 @@ import io.grpc.benchmarks.proto.Control; import io.grpc.benchmarks.proto.Stats; - import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; diff --git a/benchmarks/src/test/java/io/grpc/benchmarks/driver/LoadWorkerTest.java b/benchmarks/src/test/java/io/grpc/benchmarks/driver/LoadWorkerTest.java index cfa06fe1b1f..429bc1e7a8a 100644 --- a/benchmarks/src/test/java/io/grpc/benchmarks/driver/LoadWorkerTest.java +++ b/benchmarks/src/test/java/io/grpc/benchmarks/driver/LoadWorkerTest.java @@ -41,16 +41,14 @@ import io.grpc.benchmarks.proto.WorkerServiceGrpc; import io.grpc.netty.NettyChannelBuilder; import io.grpc.stub.StreamObserver; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - import java.util.concurrent.CountDownLatch; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Basic tests for {@link io.grpc.benchmarks.driver.LoadWorker} diff --git a/checkstyle.xml b/checkstyle.xml index 626649919f8..4da20ac87ca 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -175,9 +175,9 @@ - - + + diff --git a/context/src/test/java/io/grpc/ContextTest.java b/context/src/test/java/io/grpc/ContextTest.java index a05808e84eb..cd1c405936e 100644 --- a/context/src/test/java/io/grpc/ContextTest.java +++ b/context/src/test/java/io/grpc/ContextTest.java @@ -44,13 +44,6 @@ import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - import java.util.ArrayDeque; import java.util.Queue; import java.util.concurrent.Callable; @@ -67,6 +60,11 @@ import java.util.logging.Level; import java.util.logging.LogRecord; import java.util.logging.Logger; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Tests for {@link Context}. diff --git a/context/src/test/java/io/grpc/DeadlineTest.java b/context/src/test/java/io/grpc/DeadlineTest.java index f85edf18cd3..d1934efc4b2 100644 --- a/context/src/test/java/io/grpc/DeadlineTest.java +++ b/context/src/test/java/io/grpc/DeadlineTest.java @@ -42,18 +42,16 @@ import static org.mockito.Mockito.verify; import com.google.common.truth.Truth; - +import java.util.Arrays; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; import org.mockito.ArgumentCaptor; -import java.util.Arrays; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicBoolean; - /** * Tests for {@link Context}. */ diff --git a/core/src/main/java/io/grpc/Attributes.java b/core/src/main/java/io/grpc/Attributes.java index 452374dfaee..b31a442fdc4 100644 --- a/core/src/main/java/io/grpc/Attributes.java +++ b/core/src/main/java/io/grpc/Attributes.java @@ -33,11 +33,9 @@ import com.google.common.base.Objects; import com.google.common.base.Preconditions; - import java.util.Collections; import java.util.HashMap; import java.util.Set; - import javax.annotation.Nullable; import javax.annotation.concurrent.Immutable; diff --git a/core/src/main/java/io/grpc/CallCredentials.java b/core/src/main/java/io/grpc/CallCredentials.java index 1d9b7a9134b..1b649dc3ec9 100644 --- a/core/src/main/java/io/grpc/CallCredentials.java +++ b/core/src/main/java/io/grpc/CallCredentials.java @@ -32,7 +32,6 @@ package io.grpc; import io.grpc.Attributes.Key; - import java.util.concurrent.Executor; /** diff --git a/core/src/main/java/io/grpc/CallOptions.java b/core/src/main/java/io/grpc/CallOptions.java index ac1aa8b5554..b6b668b3794 100644 --- a/core/src/main/java/io/grpc/CallOptions.java +++ b/core/src/main/java/io/grpc/CallOptions.java @@ -35,11 +35,9 @@ import com.google.common.base.MoreObjects; import com.google.common.base.Preconditions; - import java.util.Arrays; import java.util.concurrent.Executor; import java.util.concurrent.TimeUnit; - import javax.annotation.Nullable; import javax.annotation.concurrent.Immutable; diff --git a/core/src/main/java/io/grpc/ClientCall.java b/core/src/main/java/io/grpc/ClientCall.java index d75fcc571dd..c45e03ca825 100644 --- a/core/src/main/java/io/grpc/ClientCall.java +++ b/core/src/main/java/io/grpc/ClientCall.java @@ -32,7 +32,6 @@ package io.grpc; import com.google.errorprone.annotations.DoNotMock; - import javax.annotation.Nullable; /** diff --git a/core/src/main/java/io/grpc/ClientInterceptors.java b/core/src/main/java/io/grpc/ClientInterceptors.java index f92345cdc2d..01cff324cab 100644 --- a/core/src/main/java/io/grpc/ClientInterceptors.java +++ b/core/src/main/java/io/grpc/ClientInterceptors.java @@ -32,7 +32,6 @@ package io.grpc; import com.google.common.base.Preconditions; - import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; diff --git a/core/src/main/java/io/grpc/CompressorRegistry.java b/core/src/main/java/io/grpc/CompressorRegistry.java index 3ad12f75660..9412a8bf8f1 100644 --- a/core/src/main/java/io/grpc/CompressorRegistry.java +++ b/core/src/main/java/io/grpc/CompressorRegistry.java @@ -34,11 +34,8 @@ import static com.google.common.base.Preconditions.checkArgument; import com.google.common.annotations.VisibleForTesting; - - import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; - import javax.annotation.Nullable; import javax.annotation.concurrent.ThreadSafe; diff --git a/core/src/main/java/io/grpc/ConnectivityStateInfo.java b/core/src/main/java/io/grpc/ConnectivityStateInfo.java index 8698cd10a95..8b813fced8f 100644 --- a/core/src/main/java/io/grpc/ConnectivityStateInfo.java +++ b/core/src/main/java/io/grpc/ConnectivityStateInfo.java @@ -33,8 +33,6 @@ import com.google.common.base.Preconditions; -import io.grpc.Status; - /** * A tuple of a {@link ConnectivityState} and its associated {@link Status}. * diff --git a/core/src/main/java/io/grpc/Contexts.java b/core/src/main/java/io/grpc/Contexts.java index 355aa4e42cb..f71ea2497e4 100644 --- a/core/src/main/java/io/grpc/Contexts.java +++ b/core/src/main/java/io/grpc/Contexts.java @@ -32,7 +32,6 @@ package io.grpc; import com.google.common.base.Preconditions; - import java.util.concurrent.TimeoutException; /** diff --git a/core/src/main/java/io/grpc/DecompressorRegistry.java b/core/src/main/java/io/grpc/DecompressorRegistry.java index 92c86235c50..606c4b611d3 100644 --- a/core/src/main/java/io/grpc/DecompressorRegistry.java +++ b/core/src/main/java/io/grpc/DecompressorRegistry.java @@ -35,14 +35,12 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.google.common.base.Joiner; - import java.util.Collections; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.Map; import java.util.Map.Entry; import java.util.Set; - import javax.annotation.Nullable; import javax.annotation.concurrent.ThreadSafe; diff --git a/core/src/main/java/io/grpc/EquivalentAddressGroup.java b/core/src/main/java/io/grpc/EquivalentAddressGroup.java index 4fe963eafe3..d398bbef373 100644 --- a/core/src/main/java/io/grpc/EquivalentAddressGroup.java +++ b/core/src/main/java/io/grpc/EquivalentAddressGroup.java @@ -32,7 +32,6 @@ package io.grpc; import com.google.common.base.Preconditions; - import java.net.SocketAddress; import java.util.ArrayList; import java.util.Collections; diff --git a/core/src/main/java/io/grpc/Grpc.java b/core/src/main/java/io/grpc/Grpc.java index 2387ca823cb..fc614d4f390 100644 --- a/core/src/main/java/io/grpc/Grpc.java +++ b/core/src/main/java/io/grpc/Grpc.java @@ -31,8 +31,6 @@ package io.grpc; -import io.grpc.Attributes; - import java.net.SocketAddress; import javax.net.ssl.SSLSession; diff --git a/core/src/main/java/io/grpc/HandlerRegistry.java b/core/src/main/java/io/grpc/HandlerRegistry.java index 78ba4f4edd6..6c68538e6d6 100644 --- a/core/src/main/java/io/grpc/HandlerRegistry.java +++ b/core/src/main/java/io/grpc/HandlerRegistry.java @@ -33,7 +33,6 @@ import java.util.Collections; import java.util.List; - import javax.annotation.Nullable; import javax.annotation.concurrent.ThreadSafe; diff --git a/core/src/main/java/io/grpc/InternalMetadata.java b/core/src/main/java/io/grpc/InternalMetadata.java index cf27b2bb2a4..d027d2dc43f 100644 --- a/core/src/main/java/io/grpc/InternalMetadata.java +++ b/core/src/main/java/io/grpc/InternalMetadata.java @@ -32,7 +32,6 @@ package io.grpc; import io.grpc.Metadata.Key; - import java.nio.charset.Charset; /** diff --git a/core/src/main/java/io/grpc/LoadBalancer.java b/core/src/main/java/io/grpc/LoadBalancer.java index d3a149be479..550e24c9b33 100644 --- a/core/src/main/java/io/grpc/LoadBalancer.java +++ b/core/src/main/java/io/grpc/LoadBalancer.java @@ -32,7 +32,6 @@ package io.grpc; import java.util.List; - import javax.annotation.concurrent.ThreadSafe; /** diff --git a/core/src/main/java/io/grpc/LoadBalancer2.java b/core/src/main/java/io/grpc/LoadBalancer2.java index 2945efbb097..df1977556f5 100644 --- a/core/src/main/java/io/grpc/LoadBalancer2.java +++ b/core/src/main/java/io/grpc/LoadBalancer2.java @@ -32,7 +32,6 @@ package io.grpc; import com.google.common.base.Preconditions; - import java.util.List; import javax.annotation.Nullable; import javax.annotation.concurrent.Immutable; diff --git a/core/src/main/java/io/grpc/ManagedChannelProvider.java b/core/src/main/java/io/grpc/ManagedChannelProvider.java index 6e8a6799443..8ba786e8633 100644 --- a/core/src/main/java/io/grpc/ManagedChannelProvider.java +++ b/core/src/main/java/io/grpc/ManagedChannelProvider.java @@ -32,7 +32,6 @@ package io.grpc; import com.google.common.annotations.VisibleForTesting; - import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; diff --git a/core/src/main/java/io/grpc/Metadata.java b/core/src/main/java/io/grpc/Metadata.java index cda73e7a2ac..e133ca2450f 100644 --- a/core/src/main/java/io/grpc/Metadata.java +++ b/core/src/main/java/io/grpc/Metadata.java @@ -38,7 +38,6 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; import com.google.common.io.BaseEncoding; - import java.nio.ByteBuffer; import java.util.Arrays; import java.util.BitSet; @@ -52,7 +51,6 @@ import java.util.Map; import java.util.NoSuchElementException; import java.util.Set; - import javax.annotation.Nullable; import javax.annotation.concurrent.NotThreadSafe; diff --git a/core/src/main/java/io/grpc/MethodDescriptor.java b/core/src/main/java/io/grpc/MethodDescriptor.java index c73b3d44903..380c8928a78 100644 --- a/core/src/main/java/io/grpc/MethodDescriptor.java +++ b/core/src/main/java/io/grpc/MethodDescriptor.java @@ -34,10 +34,8 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.google.common.base.Preconditions; - import java.io.InputStream; import java.util.concurrent.atomic.AtomicReferenceArray; - import javax.annotation.CheckReturnValue; import javax.annotation.Nullable; import javax.annotation.concurrent.Immutable; diff --git a/core/src/main/java/io/grpc/NameResolver.java b/core/src/main/java/io/grpc/NameResolver.java index b3914f1dfb3..a7fa94d87c0 100644 --- a/core/src/main/java/io/grpc/NameResolver.java +++ b/core/src/main/java/io/grpc/NameResolver.java @@ -33,7 +33,6 @@ import java.net.URI; import java.util.List; - import javax.annotation.Nullable; import javax.annotation.concurrent.ThreadSafe; diff --git a/core/src/main/java/io/grpc/NameResolverProvider.java b/core/src/main/java/io/grpc/NameResolverProvider.java index 6ba42cad044..5b572ff4fe7 100644 --- a/core/src/main/java/io/grpc/NameResolverProvider.java +++ b/core/src/main/java/io/grpc/NameResolverProvider.java @@ -33,7 +33,6 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; - import java.net.URI; import java.util.ArrayList; import java.util.Collections; diff --git a/core/src/main/java/io/grpc/PickFirstBalancerFactory.java b/core/src/main/java/io/grpc/PickFirstBalancerFactory.java index 60258340954..b125b03c1d8 100644 --- a/core/src/main/java/io/grpc/PickFirstBalancerFactory.java +++ b/core/src/main/java/io/grpc/PickFirstBalancerFactory.java @@ -32,13 +32,10 @@ package io.grpc; import com.google.common.base.Supplier; - import io.grpc.TransportManager.InterimTransport; - import java.net.SocketAddress; import java.util.ArrayList; import java.util.List; - import javax.annotation.concurrent.GuardedBy; /** diff --git a/core/src/main/java/io/grpc/PickFirstBalancerFactory2.java b/core/src/main/java/io/grpc/PickFirstBalancerFactory2.java index 706ffdda86d..f1b038d9f3d 100644 --- a/core/src/main/java/io/grpc/PickFirstBalancerFactory2.java +++ b/core/src/main/java/io/grpc/PickFirstBalancerFactory2.java @@ -34,7 +34,6 @@ import static io.grpc.ConnectivityState.SHUTDOWN; import com.google.common.annotations.VisibleForTesting; - import java.net.SocketAddress; import java.util.ArrayList; import java.util.List; diff --git a/core/src/main/java/io/grpc/ResolvedServerInfo.java b/core/src/main/java/io/grpc/ResolvedServerInfo.java index f4d76378b4e..5607eab92df 100644 --- a/core/src/main/java/io/grpc/ResolvedServerInfo.java +++ b/core/src/main/java/io/grpc/ResolvedServerInfo.java @@ -34,9 +34,7 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.google.common.base.Objects; - import java.net.SocketAddress; - import javax.annotation.concurrent.Immutable; /** diff --git a/core/src/main/java/io/grpc/ResolvedServerInfoGroup.java b/core/src/main/java/io/grpc/ResolvedServerInfoGroup.java index c03f193ee2d..2b44f54f568 100644 --- a/core/src/main/java/io/grpc/ResolvedServerInfoGroup.java +++ b/core/src/main/java/io/grpc/ResolvedServerInfoGroup.java @@ -35,13 +35,11 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.google.common.base.Objects; - import java.net.SocketAddress; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; - import javax.annotation.concurrent.Immutable; /** diff --git a/core/src/main/java/io/grpc/Server.java b/core/src/main/java/io/grpc/Server.java index dc713c0b1c2..c214a38aaff 100644 --- a/core/src/main/java/io/grpc/Server.java +++ b/core/src/main/java/io/grpc/Server.java @@ -35,7 +35,6 @@ import java.util.Collections; import java.util.List; import java.util.concurrent.TimeUnit; - import javax.annotation.concurrent.ThreadSafe; /** diff --git a/core/src/main/java/io/grpc/ServerBuilder.java b/core/src/main/java/io/grpc/ServerBuilder.java index 75a1ea38e08..efdae35be0c 100644 --- a/core/src/main/java/io/grpc/ServerBuilder.java +++ b/core/src/main/java/io/grpc/ServerBuilder.java @@ -33,7 +33,6 @@ import java.io.File; import java.util.concurrent.Executor; - import javax.annotation.Nullable; /** diff --git a/core/src/main/java/io/grpc/ServerCall.java b/core/src/main/java/io/grpc/ServerCall.java index 5a23d4b4988..07f5afcf0ee 100644 --- a/core/src/main/java/io/grpc/ServerCall.java +++ b/core/src/main/java/io/grpc/ServerCall.java @@ -32,9 +32,7 @@ package io.grpc; import com.google.errorprone.annotations.DoNotMock; - import java.net.SocketAddress; - import javax.net.ssl.SSLSession; /** diff --git a/core/src/main/java/io/grpc/ServerInterceptors.java b/core/src/main/java/io/grpc/ServerInterceptors.java index 52ef6641b27..f1587dcee04 100644 --- a/core/src/main/java/io/grpc/ServerInterceptors.java +++ b/core/src/main/java/io/grpc/ServerInterceptors.java @@ -32,7 +32,6 @@ package io.grpc; import com.google.common.base.Preconditions; - import java.io.BufferedInputStream; import java.io.InputStream; import java.util.ArrayList; diff --git a/core/src/main/java/io/grpc/ServerProvider.java b/core/src/main/java/io/grpc/ServerProvider.java index 93723ea46da..a1314fffa36 100644 --- a/core/src/main/java/io/grpc/ServerProvider.java +++ b/core/src/main/java/io/grpc/ServerProvider.java @@ -32,9 +32,7 @@ package io.grpc; import com.google.common.annotations.VisibleForTesting; - import io.grpc.ManagedChannelProvider.ProviderNotFoundException; - import java.util.ServiceLoader; /** diff --git a/core/src/main/java/io/grpc/ServiceDescriptor.java b/core/src/main/java/io/grpc/ServiceDescriptor.java index caa14f06c58..634e041b8f7 100644 --- a/core/src/main/java/io/grpc/ServiceDescriptor.java +++ b/core/src/main/java/io/grpc/ServiceDescriptor.java @@ -34,14 +34,12 @@ import static com.google.common.base.Preconditions.checkArgument; import com.google.common.base.Preconditions; - import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.Set; - import javax.annotation.Nullable; /** diff --git a/core/src/main/java/io/grpc/Status.java b/core/src/main/java/io/grpc/Status.java index 58d3733258c..3f7dcd23f4d 100644 --- a/core/src/main/java/io/grpc/Status.java +++ b/core/src/main/java/io/grpc/Status.java @@ -38,15 +38,12 @@ import com.google.common.base.MoreObjects; import com.google.common.base.Objects; - import io.grpc.Metadata.TrustedAsciiMarshaller; - import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.TreeMap; - import javax.annotation.Nullable; import javax.annotation.concurrent.Immutable; diff --git a/core/src/main/java/io/grpc/TransportManager.java b/core/src/main/java/io/grpc/TransportManager.java index 4c0ccd5fdee..648ad9cffd4 100644 --- a/core/src/main/java/io/grpc/TransportManager.java +++ b/core/src/main/java/io/grpc/TransportManager.java @@ -32,7 +32,6 @@ package io.grpc; import com.google.common.base.Supplier; - import java.util.Collection; /** diff --git a/core/src/main/java/io/grpc/inprocess/InProcessChannelBuilder.java b/core/src/main/java/io/grpc/inprocess/InProcessChannelBuilder.java index d95aaba7e3f..22ac9758e21 100644 --- a/core/src/main/java/io/grpc/inprocess/InProcessChannelBuilder.java +++ b/core/src/main/java/io/grpc/inprocess/InProcessChannelBuilder.java @@ -33,14 +33,12 @@ import com.google.common.base.Preconditions; import com.google.instrumentation.stats.StatsContextFactory; - import io.grpc.ExperimentalApi; import io.grpc.Internal; import io.grpc.internal.AbstractManagedChannelImplBuilder; import io.grpc.internal.ClientTransportFactory; import io.grpc.internal.ConnectionClientTransport; import io.grpc.internal.NoopStatsContextFactory; - import java.net.SocketAddress; /** diff --git a/core/src/main/java/io/grpc/inprocess/InProcessServer.java b/core/src/main/java/io/grpc/inprocess/InProcessServer.java index 0dabae71486..9613f292d75 100644 --- a/core/src/main/java/io/grpc/inprocess/InProcessServer.java +++ b/core/src/main/java/io/grpc/inprocess/InProcessServer.java @@ -34,11 +34,9 @@ import io.grpc.internal.InternalServer; import io.grpc.internal.ServerListener; import io.grpc.internal.ServerTransportListener; - import java.io.IOException; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; - import javax.annotation.concurrent.ThreadSafe; @ThreadSafe diff --git a/core/src/main/java/io/grpc/inprocess/InProcessServerBuilder.java b/core/src/main/java/io/grpc/inprocess/InProcessServerBuilder.java index e7fedc43792..a1f05d2f8b1 100644 --- a/core/src/main/java/io/grpc/inprocess/InProcessServerBuilder.java +++ b/core/src/main/java/io/grpc/inprocess/InProcessServerBuilder.java @@ -33,12 +33,10 @@ import com.google.common.base.Preconditions; import com.google.instrumentation.stats.StatsContextFactory; - import io.grpc.ExperimentalApi; import io.grpc.Internal; import io.grpc.internal.AbstractServerImplBuilder; import io.grpc.internal.NoopStatsContextFactory; - import java.io.File; /** diff --git a/core/src/main/java/io/grpc/inprocess/InProcessTransport.java b/core/src/main/java/io/grpc/inprocess/InProcessTransport.java index 910ea12cf4f..1139c3df2c0 100644 --- a/core/src/main/java/io/grpc/inprocess/InProcessTransport.java +++ b/core/src/main/java/io/grpc/inprocess/InProcessTransport.java @@ -52,7 +52,6 @@ import io.grpc.internal.ServerTransport; import io.grpc.internal.ServerTransportListener; import io.grpc.internal.StatsTraceContext; - import java.io.InputStream; import java.util.ArrayDeque; import java.util.ArrayList; @@ -62,7 +61,6 @@ import java.util.concurrent.Executor; import java.util.logging.Level; import java.util.logging.Logger; - import javax.annotation.CheckReturnValue; import javax.annotation.concurrent.GuardedBy; import javax.annotation.concurrent.ThreadSafe; diff --git a/core/src/main/java/io/grpc/internal/AbstractClientStream.java b/core/src/main/java/io/grpc/internal/AbstractClientStream.java index c0036ca77f2..56949609a0f 100644 --- a/core/src/main/java/io/grpc/internal/AbstractClientStream.java +++ b/core/src/main/java/io/grpc/internal/AbstractClientStream.java @@ -37,10 +37,8 @@ import com.google.common.base.MoreObjects; import com.google.common.base.Preconditions; - import io.grpc.Metadata; import io.grpc.Status; - import java.io.InputStream; import java.util.logging.Level; import java.util.logging.Logger; diff --git a/core/src/main/java/io/grpc/internal/AbstractClientStream2.java b/core/src/main/java/io/grpc/internal/AbstractClientStream2.java index 35de0fd5a77..b0c408ebd3f 100644 --- a/core/src/main/java/io/grpc/internal/AbstractClientStream2.java +++ b/core/src/main/java/io/grpc/internal/AbstractClientStream2.java @@ -33,13 +33,10 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; - import io.grpc.Metadata; import io.grpc.Status; - import java.util.logging.Level; import java.util.logging.Logger; - import javax.annotation.Nullable; /** diff --git a/core/src/main/java/io/grpc/internal/AbstractManagedChannelImplBuilder.java b/core/src/main/java/io/grpc/internal/AbstractManagedChannelImplBuilder.java index 7006c54c9df..d20819affbb 100644 --- a/core/src/main/java/io/grpc/internal/AbstractManagedChannelImplBuilder.java +++ b/core/src/main/java/io/grpc/internal/AbstractManagedChannelImplBuilder.java @@ -39,7 +39,6 @@ import com.google.common.util.concurrent.MoreExecutors; import com.google.instrumentation.stats.Stats; import com.google.instrumentation.stats.StatsContextFactory; - import io.grpc.Attributes; import io.grpc.ClientInterceptor; import io.grpc.CompressorRegistry; @@ -53,7 +52,6 @@ import io.grpc.PickFirstBalancerFactory; import io.grpc.ResolvedServerInfo; import io.grpc.ResolvedServerInfoGroup; - import java.net.SocketAddress; import java.net.URI; import java.net.URISyntaxException; @@ -62,7 +60,6 @@ import java.util.Collections; import java.util.List; import java.util.concurrent.Executor; - import java.util.concurrent.TimeUnit; import javax.annotation.Nullable; diff --git a/core/src/main/java/io/grpc/internal/AbstractServerImplBuilder.java b/core/src/main/java/io/grpc/internal/AbstractServerImplBuilder.java index 5cc49100ead..751a3878c25 100644 --- a/core/src/main/java/io/grpc/internal/AbstractServerImplBuilder.java +++ b/core/src/main/java/io/grpc/internal/AbstractServerImplBuilder.java @@ -38,7 +38,6 @@ import com.google.common.util.concurrent.MoreExecutors; import com.google.instrumentation.stats.Stats; import com.google.instrumentation.stats.StatsContextFactory; - import io.grpc.BindableService; import io.grpc.CompressorRegistry; import io.grpc.Context; @@ -50,12 +49,10 @@ import io.grpc.ServerMethodDefinition; import io.grpc.ServerServiceDefinition; import io.grpc.ServerTransportFilter; - import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.concurrent.Executor; - import javax.annotation.Nullable; /** diff --git a/core/src/main/java/io/grpc/internal/AbstractServerStream.java b/core/src/main/java/io/grpc/internal/AbstractServerStream.java index 4d8829ac16a..54f4e99bdea 100644 --- a/core/src/main/java/io/grpc/internal/AbstractServerStream.java +++ b/core/src/main/java/io/grpc/internal/AbstractServerStream.java @@ -32,11 +32,9 @@ package io.grpc.internal; import com.google.common.base.Preconditions; - import io.grpc.Attributes; import io.grpc.Metadata; import io.grpc.Status; - import javax.annotation.Nullable; /** diff --git a/core/src/main/java/io/grpc/internal/AbstractStream.java b/core/src/main/java/io/grpc/internal/AbstractStream.java index 951ae7f3892..4a5f7338467 100644 --- a/core/src/main/java/io/grpc/internal/AbstractStream.java +++ b/core/src/main/java/io/grpc/internal/AbstractStream.java @@ -36,13 +36,10 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.MoreObjects; - import io.grpc.Codec; import io.grpc.Compressor; import io.grpc.Decompressor; - import java.io.InputStream; - import javax.annotation.concurrent.GuardedBy; /** diff --git a/core/src/main/java/io/grpc/internal/AbstractStream2.java b/core/src/main/java/io/grpc/internal/AbstractStream2.java index 0acde6d65e2..ba9821cc9ee 100644 --- a/core/src/main/java/io/grpc/internal/AbstractStream2.java +++ b/core/src/main/java/io/grpc/internal/AbstractStream2.java @@ -35,13 +35,10 @@ import static com.google.common.base.Preconditions.checkState; import com.google.common.annotations.VisibleForTesting; - import io.grpc.Codec; import io.grpc.Compressor; import io.grpc.Decompressor; - import java.io.InputStream; - import javax.annotation.concurrent.GuardedBy; /** diff --git a/core/src/main/java/io/grpc/internal/CallCredentialsApplyingTransportFactory.java b/core/src/main/java/io/grpc/internal/CallCredentialsApplyingTransportFactory.java index 0664310b179..14b9ddb3095 100644 --- a/core/src/main/java/io/grpc/internal/CallCredentialsApplyingTransportFactory.java +++ b/core/src/main/java/io/grpc/internal/CallCredentialsApplyingTransportFactory.java @@ -40,7 +40,6 @@ import io.grpc.Metadata; import io.grpc.MethodDescriptor; import io.grpc.SecurityLevel; - import java.net.SocketAddress; import java.util.concurrent.Executor; import javax.annotation.Nullable; diff --git a/core/src/main/java/io/grpc/internal/ChannelExecutor.java b/core/src/main/java/io/grpc/internal/ChannelExecutor.java index 1c92f564618..3bf549d9108 100644 --- a/core/src/main/java/io/grpc/internal/ChannelExecutor.java +++ b/core/src/main/java/io/grpc/internal/ChannelExecutor.java @@ -34,7 +34,6 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.google.common.annotations.VisibleForTesting; - import java.util.LinkedList; import java.util.logging.Level; import java.util.logging.Logger; diff --git a/core/src/main/java/io/grpc/internal/ClientCallImpl.java b/core/src/main/java/io/grpc/internal/ClientCallImpl.java index 2a760e7981a..c1fda5361c6 100644 --- a/core/src/main/java/io/grpc/internal/ClientCallImpl.java +++ b/core/src/main/java/io/grpc/internal/ClientCallImpl.java @@ -44,7 +44,6 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; - import io.grpc.Attributes; import io.grpc.CallOptions; import io.grpc.ClientCall; @@ -59,7 +58,6 @@ import io.grpc.MethodDescriptor; import io.grpc.MethodDescriptor.MethodType; import io.grpc.Status; - import java.io.InputStream; import java.util.concurrent.CancellationException; import java.util.concurrent.Executor; @@ -68,7 +66,6 @@ import java.util.concurrent.TimeUnit; import java.util.logging.Level; import java.util.logging.Logger; - import javax.annotation.Nullable; /** diff --git a/core/src/main/java/io/grpc/internal/ClientTransport.java b/core/src/main/java/io/grpc/internal/ClientTransport.java index 41619b9384d..17f3729e7c3 100644 --- a/core/src/main/java/io/grpc/internal/ClientTransport.java +++ b/core/src/main/java/io/grpc/internal/ClientTransport.java @@ -34,7 +34,6 @@ import io.grpc.CallOptions; import io.grpc.Metadata; import io.grpc.MethodDescriptor; - import java.util.concurrent.Executor; import javax.annotation.concurrent.ThreadSafe; diff --git a/core/src/main/java/io/grpc/internal/ClientTransportFactory.java b/core/src/main/java/io/grpc/internal/ClientTransportFactory.java index b54b5ddbf51..75c22e3b7db 100644 --- a/core/src/main/java/io/grpc/internal/ClientTransportFactory.java +++ b/core/src/main/java/io/grpc/internal/ClientTransportFactory.java @@ -33,7 +33,6 @@ import java.io.Closeable; import java.net.SocketAddress; - import javax.annotation.Nullable; /** Pre-configured factory for creating {@link ConnectionClientTransport} instances. */ diff --git a/core/src/main/java/io/grpc/internal/ConnectionClientTransport.java b/core/src/main/java/io/grpc/internal/ConnectionClientTransport.java index e3337cee536..eccb3ce6743 100644 --- a/core/src/main/java/io/grpc/internal/ConnectionClientTransport.java +++ b/core/src/main/java/io/grpc/internal/ConnectionClientTransport.java @@ -32,7 +32,6 @@ package io.grpc.internal; import io.grpc.Attributes; - import javax.annotation.concurrent.ThreadSafe; /** diff --git a/core/src/main/java/io/grpc/internal/ConnectivityStateManager.java b/core/src/main/java/io/grpc/internal/ConnectivityStateManager.java index 016164a2483..29065a95eef 100644 --- a/core/src/main/java/io/grpc/internal/ConnectivityStateManager.java +++ b/core/src/main/java/io/grpc/internal/ConnectivityStateManager.java @@ -32,10 +32,8 @@ package io.grpc.internal; import io.grpc.ConnectivityState; - import java.util.ArrayList; import java.util.concurrent.Executor; - import javax.annotation.concurrent.NotThreadSafe; /** diff --git a/core/src/main/java/io/grpc/internal/DelayedClientTransport.java b/core/src/main/java/io/grpc/internal/DelayedClientTransport.java index 02eb92af42d..803c3c5ac1e 100644 --- a/core/src/main/java/io/grpc/internal/DelayedClientTransport.java +++ b/core/src/main/java/io/grpc/internal/DelayedClientTransport.java @@ -35,7 +35,6 @@ import com.google.common.base.Preconditions; import com.google.common.base.Supplier; import com.google.common.base.Suppliers; - import io.grpc.CallOptions; import io.grpc.Context; import io.grpc.LoadBalancer2; @@ -44,13 +43,11 @@ import io.grpc.Metadata; import io.grpc.MethodDescriptor; import io.grpc.Status; - import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.LinkedHashSet; import java.util.concurrent.Executor; - import javax.annotation.Nullable; import javax.annotation.concurrent.GuardedBy; diff --git a/core/src/main/java/io/grpc/internal/DelayedClientTransport2.java b/core/src/main/java/io/grpc/internal/DelayedClientTransport2.java index ec67dd4c4f7..3318db861c6 100644 --- a/core/src/main/java/io/grpc/internal/DelayedClientTransport2.java +++ b/core/src/main/java/io/grpc/internal/DelayedClientTransport2.java @@ -32,7 +32,6 @@ package io.grpc.internal; import com.google.common.annotations.VisibleForTesting; - import io.grpc.CallOptions; import io.grpc.Context; import io.grpc.LoadBalancer2.PickResult; @@ -40,12 +39,10 @@ import io.grpc.Metadata; import io.grpc.MethodDescriptor; import io.grpc.Status; - import java.util.ArrayList; import java.util.Collection; import java.util.LinkedHashSet; import java.util.concurrent.Executor; - import javax.annotation.Nullable; import javax.annotation.concurrent.GuardedBy; diff --git a/core/src/main/java/io/grpc/internal/DelayedStream.java b/core/src/main/java/io/grpc/internal/DelayedStream.java index 5eda364c05e..5daf203cb38 100644 --- a/core/src/main/java/io/grpc/internal/DelayedStream.java +++ b/core/src/main/java/io/grpc/internal/DelayedStream.java @@ -35,17 +35,14 @@ import static com.google.common.base.Preconditions.checkState; import com.google.common.annotations.VisibleForTesting; - import io.grpc.Attributes; import io.grpc.Compressor; import io.grpc.Decompressor; import io.grpc.Metadata; import io.grpc.Status; - import java.io.InputStream; import java.util.ArrayList; import java.util.List; - import javax.annotation.concurrent.GuardedBy; /** diff --git a/core/src/main/java/io/grpc/internal/DnsNameResolver.java b/core/src/main/java/io/grpc/internal/DnsNameResolver.java index 93d2f07f7b3..15f3685f619 100644 --- a/core/src/main/java/io/grpc/internal/DnsNameResolver.java +++ b/core/src/main/java/io/grpc/internal/DnsNameResolver.java @@ -33,14 +33,12 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; - import io.grpc.Attributes; import io.grpc.NameResolver; import io.grpc.ResolvedServerInfo; import io.grpc.ResolvedServerInfoGroup; import io.grpc.Status; import io.grpc.internal.SharedResourceHolder.Resource; - import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.URI; @@ -50,7 +48,6 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; - import javax.annotation.Nullable; import javax.annotation.concurrent.GuardedBy; diff --git a/core/src/main/java/io/grpc/internal/DnsNameResolverProvider.java b/core/src/main/java/io/grpc/internal/DnsNameResolverProvider.java index 071176bb3c0..35f96354f9b 100644 --- a/core/src/main/java/io/grpc/internal/DnsNameResolverProvider.java +++ b/core/src/main/java/io/grpc/internal/DnsNameResolverProvider.java @@ -32,10 +32,8 @@ package io.grpc.internal; import com.google.common.base.Preconditions; - import io.grpc.Attributes; import io.grpc.NameResolverProvider; - import java.net.URI; /** diff --git a/core/src/main/java/io/grpc/internal/ExponentialBackoffPolicy.java b/core/src/main/java/io/grpc/internal/ExponentialBackoffPolicy.java index 8d3191fb3bc..0ba320938c1 100644 --- a/core/src/main/java/io/grpc/internal/ExponentialBackoffPolicy.java +++ b/core/src/main/java/io/grpc/internal/ExponentialBackoffPolicy.java @@ -34,7 +34,6 @@ import static com.google.common.base.Preconditions.checkArgument; import com.google.common.annotations.VisibleForTesting; - import java.util.Random; import java.util.concurrent.TimeUnit; diff --git a/core/src/main/java/io/grpc/internal/FailingClientStream.java b/core/src/main/java/io/grpc/internal/FailingClientStream.java index c502b5ff3e9..a076987d1b7 100644 --- a/core/src/main/java/io/grpc/internal/FailingClientStream.java +++ b/core/src/main/java/io/grpc/internal/FailingClientStream.java @@ -32,7 +32,6 @@ package io.grpc.internal; import com.google.common.base.Preconditions; - import io.grpc.Metadata; import io.grpc.Status; diff --git a/core/src/main/java/io/grpc/internal/FailingClientTransport.java b/core/src/main/java/io/grpc/internal/FailingClientTransport.java index 806e357acaa..e1d46d42cc4 100644 --- a/core/src/main/java/io/grpc/internal/FailingClientTransport.java +++ b/core/src/main/java/io/grpc/internal/FailingClientTransport.java @@ -33,12 +33,10 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; - import io.grpc.CallOptions; import io.grpc.Metadata; import io.grpc.MethodDescriptor; import io.grpc.Status; - import java.util.concurrent.Executor; /** diff --git a/core/src/main/java/io/grpc/internal/ForwardingConnectionClientTransport.java b/core/src/main/java/io/grpc/internal/ForwardingConnectionClientTransport.java index 5580193ebd6..ab52e055636 100644 --- a/core/src/main/java/io/grpc/internal/ForwardingConnectionClientTransport.java +++ b/core/src/main/java/io/grpc/internal/ForwardingConnectionClientTransport.java @@ -36,7 +36,6 @@ import io.grpc.Metadata; import io.grpc.MethodDescriptor; import io.grpc.Status; - import java.util.concurrent.Executor; abstract class ForwardingConnectionClientTransport implements ConnectionClientTransport { diff --git a/core/src/main/java/io/grpc/internal/ForwardingReadableBuffer.java b/core/src/main/java/io/grpc/internal/ForwardingReadableBuffer.java index 59faffa9861..338890017b8 100644 --- a/core/src/main/java/io/grpc/internal/ForwardingReadableBuffer.java +++ b/core/src/main/java/io/grpc/internal/ForwardingReadableBuffer.java @@ -32,7 +32,6 @@ package io.grpc.internal; import com.google.common.base.Preconditions; - import java.io.IOException; import java.io.OutputStream; import java.nio.ByteBuffer; diff --git a/core/src/main/java/io/grpc/internal/GrpcUtil.java b/core/src/main/java/io/grpc/internal/GrpcUtil.java index acca2c9a9d9..c078f17ca17 100644 --- a/core/src/main/java/io/grpc/internal/GrpcUtil.java +++ b/core/src/main/java/io/grpc/internal/GrpcUtil.java @@ -40,13 +40,11 @@ import com.google.common.base.Supplier; import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.ThreadFactoryBuilder; - import io.grpc.LoadBalancer2.PickResult; import io.grpc.LoadBalancer2.Subchannel; import io.grpc.Metadata; import io.grpc.Status; import io.grpc.internal.SharedResourceHolder.Resource; - import java.lang.reflect.Method; import java.net.HttpURLConnection; import java.net.URI; @@ -56,7 +54,6 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ThreadFactory; import java.util.concurrent.TimeUnit; - import javax.annotation.Nullable; /** diff --git a/core/src/main/java/io/grpc/internal/Http2ClientStream.java b/core/src/main/java/io/grpc/internal/Http2ClientStream.java index 8b61ab09a34..e68dbdf3f99 100644 --- a/core/src/main/java/io/grpc/internal/Http2ClientStream.java +++ b/core/src/main/java/io/grpc/internal/Http2ClientStream.java @@ -33,13 +33,10 @@ import com.google.common.base.Charsets; import com.google.common.base.Preconditions; - import io.grpc.InternalMetadata; import io.grpc.Metadata; import io.grpc.Status; - import java.nio.charset.Charset; - import javax.annotation.Nullable; /** diff --git a/core/src/main/java/io/grpc/internal/Http2ClientStreamTransportState.java b/core/src/main/java/io/grpc/internal/Http2ClientStreamTransportState.java index b2a8bab7530..cfab5f3a995 100644 --- a/core/src/main/java/io/grpc/internal/Http2ClientStreamTransportState.java +++ b/core/src/main/java/io/grpc/internal/Http2ClientStreamTransportState.java @@ -33,13 +33,10 @@ import com.google.common.base.Charsets; import com.google.common.base.Preconditions; - import io.grpc.InternalMetadata; import io.grpc.Metadata; import io.grpc.Status; - import java.nio.charset.Charset; - import javax.annotation.Nullable; /** diff --git a/core/src/main/java/io/grpc/internal/Http2Ping.java b/core/src/main/java/io/grpc/internal/Http2Ping.java index 550e7bd36af..51a149cb220 100644 --- a/core/src/main/java/io/grpc/internal/Http2Ping.java +++ b/core/src/main/java/io/grpc/internal/Http2Ping.java @@ -32,16 +32,13 @@ package io.grpc.internal; import com.google.common.base.Stopwatch; - import io.grpc.internal.ClientTransport.PingCallback; - import java.util.LinkedHashMap; import java.util.Map; import java.util.concurrent.Executor; import java.util.concurrent.TimeUnit; import java.util.logging.Level; import java.util.logging.Logger; - import javax.annotation.concurrent.GuardedBy; /** diff --git a/core/src/main/java/io/grpc/internal/InUseStateAggregator.java b/core/src/main/java/io/grpc/internal/InUseStateAggregator.java index 45e3b26de3c..dc8a927078d 100644 --- a/core/src/main/java/io/grpc/internal/InUseStateAggregator.java +++ b/core/src/main/java/io/grpc/internal/InUseStateAggregator.java @@ -32,7 +32,6 @@ package io.grpc.internal; import java.util.HashSet; - import javax.annotation.CheckReturnValue; import javax.annotation.concurrent.GuardedBy; diff --git a/core/src/main/java/io/grpc/internal/InUseStateAggregator2.java b/core/src/main/java/io/grpc/internal/InUseStateAggregator2.java index 3cf319b9794..6333f360973 100644 --- a/core/src/main/java/io/grpc/internal/InUseStateAggregator2.java +++ b/core/src/main/java/io/grpc/internal/InUseStateAggregator2.java @@ -32,7 +32,6 @@ package io.grpc.internal; import java.util.HashSet; - import javax.annotation.concurrent.NotThreadSafe; /** diff --git a/core/src/main/java/io/grpc/internal/InternalHandlerRegistry.java b/core/src/main/java/io/grpc/internal/InternalHandlerRegistry.java index ac56564a759..bf99d1860db 100644 --- a/core/src/main/java/io/grpc/internal/InternalHandlerRegistry.java +++ b/core/src/main/java/io/grpc/internal/InternalHandlerRegistry.java @@ -33,14 +33,12 @@ import io.grpc.ServerMethodDefinition; import io.grpc.ServerServiceDefinition; - import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; - import javax.annotation.Nullable; final class InternalHandlerRegistry { diff --git a/core/src/main/java/io/grpc/internal/InternalServer.java b/core/src/main/java/io/grpc/internal/InternalServer.java index 8f47a961991..ad0903a24c3 100644 --- a/core/src/main/java/io/grpc/internal/InternalServer.java +++ b/core/src/main/java/io/grpc/internal/InternalServer.java @@ -32,7 +32,6 @@ package io.grpc.internal; import java.io.IOException; - import javax.annotation.concurrent.ThreadSafe; /** diff --git a/core/src/main/java/io/grpc/internal/InternalSubchannel.java b/core/src/main/java/io/grpc/internal/InternalSubchannel.java index 5590ee9f2e3..d221803c930 100644 --- a/core/src/main/java/io/grpc/internal/InternalSubchannel.java +++ b/core/src/main/java/io/grpc/internal/InternalSubchannel.java @@ -41,12 +41,10 @@ import com.google.common.base.Stopwatch; import com.google.common.base.Supplier; import com.google.errorprone.annotations.ForOverride; - import io.grpc.ConnectivityState; import io.grpc.ConnectivityStateInfo; import io.grpc.EquivalentAddressGroup; import io.grpc.Status; - import java.net.SocketAddress; import java.util.ArrayList; import java.util.Collection; @@ -56,7 +54,6 @@ import java.util.concurrent.TimeUnit; import java.util.logging.Level; import java.util.logging.Logger; - import javax.annotation.Nullable; import javax.annotation.concurrent.GuardedBy; import javax.annotation.concurrent.ThreadSafe; diff --git a/core/src/main/java/io/grpc/internal/KeepAliveManager.java b/core/src/main/java/io/grpc/internal/KeepAliveManager.java index 7f1257381de..d8376b7b0f1 100644 --- a/core/src/main/java/io/grpc/internal/KeepAliveManager.java +++ b/core/src/main/java/io/grpc/internal/KeepAliveManager.java @@ -34,9 +34,7 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; import com.google.common.util.concurrent.MoreExecutors; - import io.grpc.Status; - import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; @@ -59,7 +57,7 @@ public class KeepAliveManager { @Override public void run() { boolean shouldShutdown = false; - synchronized (KeepAliveManager.this) { + synchronized (KeepAliveManager.this) { if (state != State.DISCONNECTED) { // We haven't received a ping response within the timeout. The connection is likely gone // already. Shutdown the transport and fail all existing rpcs. @@ -77,7 +75,7 @@ public void run() { @Override public void run() { boolean shouldSendPing = false; - synchronized (KeepAliveManager.this) { + synchronized (KeepAliveManager.this) { if (state == State.PING_SCHEDULED) { shouldSendPing = true; state = State.PING_SENT; @@ -191,7 +189,7 @@ public synchronized void onTransportIdle() { state = State.IDLE_AND_PING_SENT; } } - + /** * Transport is shutting down. We no longer need to do keepalives. */ @@ -205,7 +203,7 @@ public synchronized void onTransportShutdown() { pingFuture.cancel(false); } } - } + } private class KeepAlivePingCallback implements ClientTransport.PingCallback { diff --git a/core/src/main/java/io/grpc/internal/LogExceptionRunnable.java b/core/src/main/java/io/grpc/internal/LogExceptionRunnable.java index ee1dae4c2d9..5bf192b86bd 100644 --- a/core/src/main/java/io/grpc/internal/LogExceptionRunnable.java +++ b/core/src/main/java/io/grpc/internal/LogExceptionRunnable.java @@ -34,7 +34,6 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.google.common.base.Throwables; - import java.util.logging.Level; import java.util.logging.Logger; diff --git a/core/src/main/java/io/grpc/internal/ManagedChannelImpl.java b/core/src/main/java/io/grpc/internal/ManagedChannelImpl.java index b6edab86537..80f7a0c060c 100644 --- a/core/src/main/java/io/grpc/internal/ManagedChannelImpl.java +++ b/core/src/main/java/io/grpc/internal/ManagedChannelImpl.java @@ -39,7 +39,6 @@ import com.google.common.base.Stopwatch; import com.google.common.base.Supplier; import com.google.instrumentation.stats.StatsContextFactory; - import io.grpc.Attributes; import io.grpc.CallOptions; import io.grpc.Channel; @@ -60,7 +59,6 @@ import io.grpc.TransportManager.InterimTransport; import io.grpc.TransportManager.OobTransportProvider; import io.grpc.internal.ClientCallImpl.ClientTransportProvider; - import java.net.URI; import java.net.URISyntaxException; import java.util.ArrayList; @@ -77,7 +75,6 @@ import java.util.logging.Level; import java.util.logging.Logger; import java.util.regex.Pattern; - import javax.annotation.Nullable; import javax.annotation.concurrent.GuardedBy; import javax.annotation.concurrent.ThreadSafe; diff --git a/core/src/main/java/io/grpc/internal/ManagedChannelImpl2.java b/core/src/main/java/io/grpc/internal/ManagedChannelImpl2.java index a1acaac3afe..04b7474190d 100644 --- a/core/src/main/java/io/grpc/internal/ManagedChannelImpl2.java +++ b/core/src/main/java/io/grpc/internal/ManagedChannelImpl2.java @@ -41,7 +41,6 @@ import com.google.common.base.Stopwatch; import com.google.common.base.Supplier; import com.google.instrumentation.stats.StatsContextFactory; - import io.grpc.Attributes; import io.grpc.CallOptions; import io.grpc.Channel; @@ -52,9 +51,9 @@ import io.grpc.ConnectivityStateInfo; import io.grpc.DecompressorRegistry; import io.grpc.EquivalentAddressGroup; +import io.grpc.LoadBalancer2; import io.grpc.LoadBalancer2.PickResult; import io.grpc.LoadBalancer2.SubchannelPicker; -import io.grpc.LoadBalancer2; import io.grpc.ManagedChannel; import io.grpc.Metadata; import io.grpc.MethodDescriptor; @@ -62,7 +61,6 @@ import io.grpc.ResolvedServerInfoGroup; import io.grpc.Status; import io.grpc.internal.ClientCallImpl.ClientTransportProvider; - import java.net.URI; import java.net.URISyntaxException; import java.util.HashSet; @@ -77,7 +75,6 @@ import java.util.logging.Level; import java.util.logging.Logger; import java.util.regex.Pattern; - import javax.annotation.Nullable; import javax.annotation.concurrent.GuardedBy; import javax.annotation.concurrent.ThreadSafe; diff --git a/core/src/main/java/io/grpc/internal/ManagedClientTransport.java b/core/src/main/java/io/grpc/internal/ManagedClientTransport.java index cbe2c088c9c..2b2c646393e 100644 --- a/core/src/main/java/io/grpc/internal/ManagedClientTransport.java +++ b/core/src/main/java/io/grpc/internal/ManagedClientTransport.java @@ -32,7 +32,6 @@ package io.grpc.internal; import io.grpc.Status; - import javax.annotation.CheckReturnValue; import javax.annotation.Nullable; import javax.annotation.concurrent.ThreadSafe; diff --git a/core/src/main/java/io/grpc/internal/MessageDeframer.java b/core/src/main/java/io/grpc/internal/MessageDeframer.java index cef64a303af..654acbd02e1 100644 --- a/core/src/main/java/io/grpc/internal/MessageDeframer.java +++ b/core/src/main/java/io/grpc/internal/MessageDeframer.java @@ -35,16 +35,13 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; - import io.grpc.Codec; import io.grpc.Decompressor; import io.grpc.Status; - import java.io.Closeable; import java.io.FilterInputStream; import java.io.IOException; import java.io.InputStream; - import javax.annotation.concurrent.NotThreadSafe; /** diff --git a/core/src/main/java/io/grpc/internal/MessageFramer.java b/core/src/main/java/io/grpc/internal/MessageFramer.java index 15b9ca9cdb5..3bf64c38273 100644 --- a/core/src/main/java/io/grpc/internal/MessageFramer.java +++ b/core/src/main/java/io/grpc/internal/MessageFramer.java @@ -37,13 +37,11 @@ import static java.lang.Math.min; import com.google.common.io.ByteStreams; - import io.grpc.Codec; import io.grpc.Compressor; import io.grpc.Drainable; import io.grpc.KnownLength; import io.grpc.Status; - import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; @@ -51,7 +49,6 @@ import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; - import javax.annotation.Nullable; /** diff --git a/core/src/main/java/io/grpc/internal/MetadataApplierImpl.java b/core/src/main/java/io/grpc/internal/MetadataApplierImpl.java index 89904466277..f2157053178 100644 --- a/core/src/main/java/io/grpc/internal/MetadataApplierImpl.java +++ b/core/src/main/java/io/grpc/internal/MetadataApplierImpl.java @@ -41,7 +41,6 @@ import io.grpc.Metadata; import io.grpc.MethodDescriptor; import io.grpc.Status; - import javax.annotation.Nullable; import javax.annotation.concurrent.GuardedBy; diff --git a/core/src/main/java/io/grpc/internal/NoopClientStream.java b/core/src/main/java/io/grpc/internal/NoopClientStream.java index 9a7e38afa34..dc27143bde3 100644 --- a/core/src/main/java/io/grpc/internal/NoopClientStream.java +++ b/core/src/main/java/io/grpc/internal/NoopClientStream.java @@ -35,7 +35,6 @@ import io.grpc.Compressor; import io.grpc.Decompressor; import io.grpc.Status; - import java.io.InputStream; /** diff --git a/core/src/main/java/io/grpc/internal/NoopStatsContextFactory.java b/core/src/main/java/io/grpc/internal/NoopStatsContextFactory.java index c55ce24f781..3716a8b6938 100644 --- a/core/src/main/java/io/grpc/internal/NoopStatsContextFactory.java +++ b/core/src/main/java/io/grpc/internal/NoopStatsContextFactory.java @@ -36,7 +36,6 @@ import com.google.instrumentation.stats.StatsContextFactory; import com.google.instrumentation.stats.TagKey; import com.google.instrumentation.stats.TagValue; - import java.io.InputStream; import java.io.OutputStream; diff --git a/core/src/main/java/io/grpc/internal/OobChannel.java b/core/src/main/java/io/grpc/internal/OobChannel.java index 921e96f4cb6..0dfdfedbef6 100644 --- a/core/src/main/java/io/grpc/internal/OobChannel.java +++ b/core/src/main/java/io/grpc/internal/OobChannel.java @@ -32,18 +32,16 @@ package io.grpc.internal; import static com.google.common.base.Preconditions.checkNotNull; -import static io.grpc.ConnectivityState.READY; -import static io.grpc.ConnectivityState.TRANSIENT_FAILURE; import com.google.common.base.Stopwatch; import com.google.common.base.Supplier; import com.google.instrumentation.stats.StatsContextFactory; - import io.grpc.Attributes; import io.grpc.CallOptions; import io.grpc.ClientCall; import io.grpc.ConnectivityStateInfo; import io.grpc.EquivalentAddressGroup; +import io.grpc.LoadBalancer2; import io.grpc.LoadBalancer2.PickResult; import io.grpc.LoadBalancer2.SubchannelPicker; import io.grpc.ManagedChannel; @@ -51,7 +49,6 @@ import io.grpc.MethodDescriptor; import io.grpc.Status; import io.grpc.internal.ClientCallImpl.ClientTransportProvider; - import java.util.concurrent.CountDownLatch; import java.util.concurrent.Executor; import java.util.concurrent.ScheduledExecutorService; diff --git a/core/src/main/java/io/grpc/internal/ReadableBuffers.java b/core/src/main/java/io/grpc/internal/ReadableBuffers.java index 8eba4fdf755..38a29069b7e 100644 --- a/core/src/main/java/io/grpc/internal/ReadableBuffers.java +++ b/core/src/main/java/io/grpc/internal/ReadableBuffers.java @@ -34,9 +34,7 @@ import static com.google.common.base.Charsets.UTF_8; import com.google.common.base.Preconditions; - import io.grpc.KnownLength; - import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; diff --git a/core/src/main/java/io/grpc/internal/RoundRobinServerList.java b/core/src/main/java/io/grpc/internal/RoundRobinServerList.java index 35336bb006d..c45790a9068 100644 --- a/core/src/main/java/io/grpc/internal/RoundRobinServerList.java +++ b/core/src/main/java/io/grpc/internal/RoundRobinServerList.java @@ -32,11 +32,9 @@ package io.grpc.internal; import com.google.common.annotations.VisibleForTesting; - import io.grpc.EquivalentAddressGroup; import io.grpc.Status; import io.grpc.TransportManager; - import java.net.SocketAddress; import java.util.ArrayList; import java.util.Collection; @@ -44,7 +42,6 @@ import java.util.Iterator; import java.util.List; import java.util.NoSuchElementException; - import javax.annotation.Nullable; import javax.annotation.concurrent.NotThreadSafe; import javax.annotation.concurrent.ThreadSafe; diff --git a/core/src/main/java/io/grpc/internal/SerializeReentrantCallsDirectExecutor.java b/core/src/main/java/io/grpc/internal/SerializeReentrantCallsDirectExecutor.java index 1a11d6ba70e..7f2b36365ca 100644 --- a/core/src/main/java/io/grpc/internal/SerializeReentrantCallsDirectExecutor.java +++ b/core/src/main/java/io/grpc/internal/SerializeReentrantCallsDirectExecutor.java @@ -32,7 +32,6 @@ package io.grpc.internal; import com.google.common.base.Preconditions; - import java.util.ArrayDeque; import java.util.concurrent.Executor; import java.util.logging.Level; diff --git a/core/src/main/java/io/grpc/internal/SerializingExecutor.java b/core/src/main/java/io/grpc/internal/SerializingExecutor.java index 41a0abe55fd..0355aa38579 100644 --- a/core/src/main/java/io/grpc/internal/SerializingExecutor.java +++ b/core/src/main/java/io/grpc/internal/SerializingExecutor.java @@ -32,13 +32,11 @@ package io.grpc.internal; import com.google.common.base.Preconditions; - import java.util.ArrayDeque; import java.util.Queue; import java.util.concurrent.Executor; import java.util.logging.Level; import java.util.logging.Logger; - import javax.annotation.concurrent.GuardedBy; /** diff --git a/core/src/main/java/io/grpc/internal/ServerCallImpl.java b/core/src/main/java/io/grpc/internal/ServerCallImpl.java index f1fd684ed7c..2318738a1c6 100644 --- a/core/src/main/java/io/grpc/internal/ServerCallImpl.java +++ b/core/src/main/java/io/grpc/internal/ServerCallImpl.java @@ -40,7 +40,6 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Throwables; - import io.grpc.Attributes; import io.grpc.Codec; import io.grpc.Compressor; @@ -53,7 +52,6 @@ import io.grpc.MethodDescriptor.MethodType; import io.grpc.ServerCall; import io.grpc.Status; - import java.io.IOException; import java.io.InputStream; import java.util.List; diff --git a/core/src/main/java/io/grpc/internal/ServerImpl.java b/core/src/main/java/io/grpc/internal/ServerImpl.java index bc17761f6b2..3018a0aae6c 100644 --- a/core/src/main/java/io/grpc/internal/ServerImpl.java +++ b/core/src/main/java/io/grpc/internal/ServerImpl.java @@ -43,7 +43,6 @@ import com.google.common.base.Stopwatch; import com.google.common.base.Supplier; import com.google.instrumentation.stats.StatsContextFactory; - import io.grpc.Attributes; import io.grpc.CompressorRegistry; import io.grpc.Context; @@ -55,7 +54,6 @@ import io.grpc.ServerServiceDefinition; import io.grpc.ServerTransportFilter; import io.grpc.Status; - import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; @@ -66,7 +64,6 @@ import java.util.concurrent.Executor; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; - import javax.annotation.concurrent.GuardedBy; /** diff --git a/core/src/main/java/io/grpc/internal/SharedResourceHolder.java b/core/src/main/java/io/grpc/internal/SharedResourceHolder.java index a9f8c5ff410..d8da7702738 100644 --- a/core/src/main/java/io/grpc/internal/SharedResourceHolder.java +++ b/core/src/main/java/io/grpc/internal/SharedResourceHolder.java @@ -32,13 +32,11 @@ package io.grpc.internal; import com.google.common.base.Preconditions; - import java.util.IdentityHashMap; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; - import javax.annotation.concurrent.ThreadSafe; /** diff --git a/core/src/main/java/io/grpc/internal/SingleTransportChannel.java b/core/src/main/java/io/grpc/internal/SingleTransportChannel.java index a8b5a430cd9..9585d615628 100644 --- a/core/src/main/java/io/grpc/internal/SingleTransportChannel.java +++ b/core/src/main/java/io/grpc/internal/SingleTransportChannel.java @@ -35,14 +35,12 @@ import com.google.common.base.Stopwatch; import com.google.common.base.Supplier; import com.google.instrumentation.stats.StatsContextFactory; - import io.grpc.CallOptions; import io.grpc.Channel; import io.grpc.ClientCall; import io.grpc.Metadata; import io.grpc.MethodDescriptor; import io.grpc.internal.ClientCallImpl.ClientTransportProvider; - import java.util.concurrent.Executor; import java.util.concurrent.ScheduledExecutorService; diff --git a/core/src/main/java/io/grpc/internal/StatsTraceContext.java b/core/src/main/java/io/grpc/internal/StatsTraceContext.java index 110b0ccb2e6..f15db8b2cd5 100644 --- a/core/src/main/java/io/grpc/internal/StatsTraceContext.java +++ b/core/src/main/java/io/grpc/internal/StatsTraceContext.java @@ -41,10 +41,8 @@ import com.google.instrumentation.stats.StatsContextFactory; import com.google.instrumentation.stats.TagKey; import com.google.instrumentation.stats.TagValue; - import io.grpc.Metadata; import io.grpc.Status; - import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; diff --git a/core/src/main/java/io/grpc/internal/Stream.java b/core/src/main/java/io/grpc/internal/Stream.java index f526b16cea6..7cb1e640713 100644 --- a/core/src/main/java/io/grpc/internal/Stream.java +++ b/core/src/main/java/io/grpc/internal/Stream.java @@ -33,7 +33,6 @@ import io.grpc.Compressor; import io.grpc.Decompressor; - import java.io.InputStream; /** diff --git a/core/src/main/java/io/grpc/internal/SubchannelImpl.java b/core/src/main/java/io/grpc/internal/SubchannelImpl.java index 3cd6143e899..c35218701f0 100644 --- a/core/src/main/java/io/grpc/internal/SubchannelImpl.java +++ b/core/src/main/java/io/grpc/internal/SubchannelImpl.java @@ -32,7 +32,6 @@ package io.grpc.internal; import io.grpc.LoadBalancer2; - import javax.annotation.Nullable; /** diff --git a/core/src/main/java/io/grpc/internal/TransportFrameUtil.java b/core/src/main/java/io/grpc/internal/TransportFrameUtil.java index 112a4148f46..ae947996474 100644 --- a/core/src/main/java/io/grpc/internal/TransportFrameUtil.java +++ b/core/src/main/java/io/grpc/internal/TransportFrameUtil.java @@ -34,10 +34,8 @@ import static com.google.common.base.Charsets.US_ASCII; import com.google.common.io.BaseEncoding; - import io.grpc.InternalMetadata; import io.grpc.Metadata; - import java.util.Arrays; import java.util.logging.Logger; diff --git a/core/src/main/java/io/grpc/internal/TransportSet.java b/core/src/main/java/io/grpc/internal/TransportSet.java index 07c1e68b390..d42547fb686 100644 --- a/core/src/main/java/io/grpc/internal/TransportSet.java +++ b/core/src/main/java/io/grpc/internal/TransportSet.java @@ -34,7 +34,6 @@ import com.google.common.base.Preconditions; import com.google.common.base.Stopwatch; import com.google.common.base.Supplier; - import io.grpc.CallOptions; import io.grpc.ClientCall; import io.grpc.ConnectivityState; @@ -45,7 +44,6 @@ import io.grpc.MethodDescriptor; import io.grpc.Status; import io.grpc.internal.ClientCallImpl.ClientTransportProvider; - import java.net.SocketAddress; import java.util.ArrayList; import java.util.Collection; @@ -57,7 +55,6 @@ import java.util.concurrent.TimeUnit; import java.util.logging.Level; import java.util.logging.Logger; - import javax.annotation.CheckReturnValue; import javax.annotation.Nullable; import javax.annotation.concurrent.GuardedBy; diff --git a/core/src/main/java/io/grpc/util/MutableHandlerRegistry.java b/core/src/main/java/io/grpc/util/MutableHandlerRegistry.java index 815e85055d3..06a1c06a945 100644 --- a/core/src/main/java/io/grpc/util/MutableHandlerRegistry.java +++ b/core/src/main/java/io/grpc/util/MutableHandlerRegistry.java @@ -37,13 +37,11 @@ import io.grpc.MethodDescriptor; import io.grpc.ServerMethodDefinition; import io.grpc.ServerServiceDefinition; - import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; - import javax.annotation.Nullable; import javax.annotation.concurrent.ThreadSafe; diff --git a/core/src/main/java/io/grpc/util/RoundRobinLoadBalancerFactory.java b/core/src/main/java/io/grpc/util/RoundRobinLoadBalancerFactory.java index d47cb4276fa..83516178f1b 100644 --- a/core/src/main/java/io/grpc/util/RoundRobinLoadBalancerFactory.java +++ b/core/src/main/java/io/grpc/util/RoundRobinLoadBalancerFactory.java @@ -32,7 +32,6 @@ package io.grpc.util; import com.google.common.base.Supplier; - import io.grpc.Attributes; import io.grpc.EquivalentAddressGroup; import io.grpc.ExperimentalApi; @@ -43,7 +42,6 @@ import io.grpc.TransportManager; import io.grpc.TransportManager.InterimTransport; import io.grpc.internal.RoundRobinServerList; - import java.util.ArrayList; import java.util.List; import javax.annotation.concurrent.GuardedBy; diff --git a/core/src/main/java/io/grpc/util/RoundRobinLoadBalancerFactory2.java b/core/src/main/java/io/grpc/util/RoundRobinLoadBalancerFactory2.java index ff2c3193fec..008b193f46a 100644 --- a/core/src/main/java/io/grpc/util/RoundRobinLoadBalancerFactory2.java +++ b/core/src/main/java/io/grpc/util/RoundRobinLoadBalancerFactory2.java @@ -37,7 +37,6 @@ import static io.grpc.ConnectivityState.TRANSIENT_FAILURE; import com.google.common.annotations.VisibleForTesting; - import io.grpc.Attributes; import io.grpc.ConnectivityStateInfo; import io.grpc.EquivalentAddressGroup; @@ -52,7 +51,6 @@ import io.grpc.ResolvedServerInfo; import io.grpc.ResolvedServerInfoGroup; import io.grpc.Status; - import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -63,7 +61,6 @@ import java.util.NoSuchElementException; import java.util.Set; import java.util.concurrent.atomic.AtomicReference; - import javax.annotation.Nullable; import javax.annotation.concurrent.GuardedBy; diff --git a/core/src/test/java/io/grpc/CallOptionsTest.java b/core/src/test/java/io/grpc/CallOptionsTest.java index 2c3de963e0d..9544e17269a 100644 --- a/core/src/test/java/io/grpc/CallOptionsTest.java +++ b/core/src/test/java/io/grpc/CallOptionsTest.java @@ -42,17 +42,14 @@ import static org.mockito.Mockito.mock; import com.google.common.base.Objects; - import io.grpc.Attributes.Key; import io.grpc.internal.SerializingExecutor; - +import java.util.concurrent.Executor; +import java.util.concurrent.TimeUnit; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import java.util.concurrent.Executor; -import java.util.concurrent.TimeUnit; - /** Unit tests for {@link CallOptions}. */ @RunWith(JUnit4.class) public class CallOptionsTest { diff --git a/core/src/test/java/io/grpc/ClientInterceptorsTest.java b/core/src/test/java/io/grpc/ClientInterceptorsTest.java index 86affaaf828..7097641a86b 100644 --- a/core/src/test/java/io/grpc/ClientInterceptorsTest.java +++ b/core/src/test/java/io/grpc/ClientInterceptorsTest.java @@ -52,7 +52,9 @@ import io.grpc.ForwardingClientCall.SimpleForwardingClientCall; import io.grpc.ForwardingClientCallListener.SimpleForwardingClientCallListener; import io.grpc.testing.TestMethodDescriptors; - +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -62,10 +64,6 @@ import org.mockito.Mockito; import org.mockito.MockitoAnnotations; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - /** Unit tests for {@link ClientInterceptors}. */ @RunWith(JUnit4.class) public class ClientInterceptorsTest { diff --git a/core/src/test/java/io/grpc/ContextsTest.java b/core/src/test/java/io/grpc/ContextsTest.java index e2aba328ee8..36bc9d6186c 100644 --- a/core/src/test/java/io/grpc/ContextsTest.java +++ b/core/src/test/java/io/grpc/ContextsTest.java @@ -45,16 +45,14 @@ import io.grpc.internal.FakeClock; import io.grpc.testing.NoopServerCall; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Tests for {@link Contexts}. diff --git a/core/src/test/java/io/grpc/DecompressorRegistryTest.java b/core/src/test/java/io/grpc/DecompressorRegistryTest.java index 531e307da99..5289aa0e70a 100644 --- a/core/src/test/java/io/grpc/DecompressorRegistryTest.java +++ b/core/src/test/java/io/grpc/DecompressorRegistryTest.java @@ -36,14 +36,13 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - import java.io.IOException; import java.io.InputStream; import java.util.HashSet; import java.util.Set; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Tests for {@link DecompressorRegistry}. diff --git a/core/src/test/java/io/grpc/ForwardingServerCallListenerTest.java b/core/src/test/java/io/grpc/ForwardingServerCallListenerTest.java index 57daa0cfb89..e8031062ef7 100644 --- a/core/src/test/java/io/grpc/ForwardingServerCallListenerTest.java +++ b/core/src/test/java/io/grpc/ForwardingServerCallListenerTest.java @@ -34,7 +34,6 @@ import static org.mockito.Mockito.verify; import io.grpc.ForwardingServerCallListener.SimpleForwardingServerCallListener; - import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/core/src/test/java/io/grpc/ManagedChannelProviderTest.java b/core/src/test/java/io/grpc/ManagedChannelProviderTest.java index 0cadb0c8f21..484de1ec89e 100644 --- a/core/src/test/java/io/grpc/ManagedChannelProviderTest.java +++ b/core/src/test/java/io/grpc/ManagedChannelProviderTest.java @@ -37,12 +37,11 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; +import java.util.ServiceConfigurationError; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import java.util.ServiceConfigurationError; - /** Unit tests for {@link ManagedChannelProvider}. */ @RunWith(JUnit4.class) public class ManagedChannelProviderTest { diff --git a/core/src/test/java/io/grpc/MetadataTest.java b/core/src/test/java/io/grpc/MetadataTest.java index d662d1b90ee..c263e2931c0 100644 --- a/core/src/test/java/io/grpc/MetadataTest.java +++ b/core/src/test/java/io/grpc/MetadataTest.java @@ -42,20 +42,17 @@ import static org.junit.Assert.fail; import com.google.common.collect.Lists; - import io.grpc.Metadata.Key; import io.grpc.internal.GrpcUtil; - +import java.util.Arrays; +import java.util.Iterator; +import java.util.Locale; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import java.util.Arrays; -import java.util.Iterator; -import java.util.Locale; - /** * Tests for {@link Metadata}. */ diff --git a/core/src/test/java/io/grpc/MethodDescriptorTest.java b/core/src/test/java/io/grpc/MethodDescriptorTest.java index 9796686fe54..db1433df480 100644 --- a/core/src/test/java/io/grpc/MethodDescriptorTest.java +++ b/core/src/test/java/io/grpc/MethodDescriptorTest.java @@ -35,9 +35,7 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -import io.grpc.MethodDescriptor; import io.grpc.MethodDescriptor.MethodType; - import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; diff --git a/core/src/test/java/io/grpc/NameResolverProviderTest.java b/core/src/test/java/io/grpc/NameResolverProviderTest.java index b08baa28cda..9485e4e36ba 100644 --- a/core/src/test/java/io/grpc/NameResolverProviderTest.java +++ b/core/src/test/java/io/grpc/NameResolverProviderTest.java @@ -40,15 +40,13 @@ import static org.mockito.Mockito.mock; import io.grpc.internal.DnsNameResolverProvider; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - import java.net.URI; import java.util.Collections; import java.util.List; import java.util.ServiceConfigurationError; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** Unit tests for {@link NameResolverProvider}. */ @RunWith(JUnit4.class) diff --git a/core/src/test/java/io/grpc/PickFirstBalancerTest.java b/core/src/test/java/io/grpc/PickFirstBalancerTest.java index e32018488de..5ae2de6b1ca 100644 --- a/core/src/test/java/io/grpc/PickFirstBalancerTest.java +++ b/core/src/test/java/io/grpc/PickFirstBalancerTest.java @@ -42,9 +42,9 @@ import com.google.common.base.Supplier; import com.google.common.collect.Lists; - import io.grpc.TransportManager.InterimTransport; - +import java.net.SocketAddress; +import java.util.List; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -54,9 +54,6 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import java.net.SocketAddress; -import java.util.List; - /** Unit test for {@link PickFirstBalancerFactory}. */ @RunWith(JUnit4.class) public class PickFirstBalancerTest { diff --git a/core/src/test/java/io/grpc/PickFirstLoadBalancer2Test.java b/core/src/test/java/io/grpc/PickFirstLoadBalancer2Test.java index b92b2e0cef5..541f6da4560 100644 --- a/core/src/test/java/io/grpc/PickFirstLoadBalancer2Test.java +++ b/core/src/test/java/io/grpc/PickFirstLoadBalancer2Test.java @@ -44,13 +44,13 @@ import static org.mockito.Mockito.when; import com.google.common.collect.Lists; - import io.grpc.LoadBalancer2.Helper; import io.grpc.LoadBalancer2.PickResult; import io.grpc.LoadBalancer2.Subchannel; import io.grpc.PickFirstBalancerFactory2.PickFirstBalancer; import io.grpc.PickFirstBalancerFactory2.Picker; - +import java.net.SocketAddress; +import java.util.List; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -61,9 +61,6 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import java.net.SocketAddress; -import java.util.List; - /** Unit test for {@link PickFirstBalancerFactory2}. */ @RunWith(JUnit4.class) diff --git a/core/src/test/java/io/grpc/ResolvedServerInfoTest.java b/core/src/test/java/io/grpc/ResolvedServerInfoTest.java index b3e89e539eb..ed328a706f5 100644 --- a/core/src/test/java/io/grpc/ResolvedServerInfoTest.java +++ b/core/src/test/java/io/grpc/ResolvedServerInfoTest.java @@ -36,12 +36,11 @@ import static org.junit.Assert.assertNotSame; import static org.junit.Assert.fail; +import java.net.InetSocketAddress; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import java.net.InetSocketAddress; - @RunWith(JUnit4.class) public class ResolvedServerInfoTest { private static final Attributes.Key FOO = Attributes.Key.of("foo"); diff --git a/core/src/test/java/io/grpc/ServerInterceptorsTest.java b/core/src/test/java/io/grpc/ServerInterceptorsTest.java index a9b0f70d2cb..3ab50e4ece2 100644 --- a/core/src/test/java/io/grpc/ServerInterceptorsTest.java +++ b/core/src/test/java/io/grpc/ServerInterceptorsTest.java @@ -46,7 +46,11 @@ import io.grpc.MethodDescriptor.MethodType; import io.grpc.ServerCall.Listener; import io.grpc.testing.NoopServerCall; - +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -56,12 +60,6 @@ import org.mockito.Mockito; import org.mockito.MockitoAnnotations; -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - /** Unit tests for {@link ServerInterceptors}. */ @RunWith(JUnit4.class) public class ServerInterceptorsTest { diff --git a/core/src/test/java/io/grpc/ServerServiceDefinitionTest.java b/core/src/test/java/io/grpc/ServerServiceDefinitionTest.java index 2bde53c8785..491716c4eed 100644 --- a/core/src/test/java/io/grpc/ServerServiceDefinitionTest.java +++ b/core/src/test/java/io/grpc/ServerServiceDefinitionTest.java @@ -35,15 +35,14 @@ import static org.junit.Assert.assertSame; import static org.junit.Assert.fail; +import java.util.Collections; +import java.util.HashSet; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import java.util.Collections; -import java.util.HashSet; - /** Unit tests for {@link ServerServiceDefinition}. */ @RunWith(JUnit4.class) public class ServerServiceDefinitionTest { diff --git a/core/src/test/java/io/grpc/ServiceDescriptorTest.java b/core/src/test/java/io/grpc/ServiceDescriptorTest.java index 0255be65f91..9873715f8f4 100644 --- a/core/src/test/java/io/grpc/ServiceDescriptorTest.java +++ b/core/src/test/java/io/grpc/ServiceDescriptorTest.java @@ -33,17 +33,15 @@ import io.grpc.MethodDescriptor.MethodType; import io.grpc.testing.TestMethodDescriptors; - +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; - /** * Tests for {@link ServiceDescriptor}. */ diff --git a/core/src/test/java/io/grpc/StatusTest.java b/core/src/test/java/io/grpc/StatusTest.java index 697a708c9c1..bd86b70055b 100644 --- a/core/src/test/java/io/grpc/StatusTest.java +++ b/core/src/test/java/io/grpc/StatusTest.java @@ -35,13 +35,11 @@ import static org.junit.Assert.assertSame; import io.grpc.Status.Code; - +import java.nio.charset.Charset; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import java.nio.charset.Charset; - /** Unit tests for {@link Status}. */ @RunWith(JUnit4.class) public class StatusTest { diff --git a/core/src/test/java/io/grpc/StringMarshaller.java b/core/src/test/java/io/grpc/StringMarshaller.java index c485a4d8651..c9129f2e63e 100644 --- a/core/src/test/java/io/grpc/StringMarshaller.java +++ b/core/src/test/java/io/grpc/StringMarshaller.java @@ -34,7 +34,6 @@ import static com.google.common.base.Charsets.UTF_8; import com.google.common.io.ByteStreams; - import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; diff --git a/core/src/test/java/io/grpc/inprocess/InProcessServerTest.java b/core/src/test/java/io/grpc/inprocess/InProcessServerTest.java index 3c8aef93ff5..2060a89a9cb 100644 --- a/core/src/test/java/io/grpc/inprocess/InProcessServerTest.java +++ b/core/src/test/java/io/grpc/inprocess/InProcessServerTest.java @@ -32,7 +32,6 @@ package io.grpc.inprocess; import com.google.common.truth.Truth; - import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; diff --git a/core/src/test/java/io/grpc/inprocess/InProcessTransportTest.java b/core/src/test/java/io/grpc/inprocess/InProcessTransportTest.java index 396c6a2163b..e6ab87d5314 100644 --- a/core/src/test/java/io/grpc/inprocess/InProcessTransportTest.java +++ b/core/src/test/java/io/grpc/inprocess/InProcessTransportTest.java @@ -34,7 +34,6 @@ import io.grpc.internal.InternalServer; import io.grpc.internal.ManagedClientTransport; import io.grpc.internal.testing.AbstractTransportTest; - import org.junit.runner.RunWith; import org.junit.runners.JUnit4; diff --git a/core/src/test/java/io/grpc/internal/AbstractClientStream2Test.java b/core/src/test/java/io/grpc/internal/AbstractClientStream2Test.java index 42d7c46758b..3ab1aad2cdf 100644 --- a/core/src/test/java/io/grpc/internal/AbstractClientStream2Test.java +++ b/core/src/test/java/io/grpc/internal/AbstractClientStream2Test.java @@ -43,7 +43,6 @@ import io.grpc.Status; import io.grpc.Status.Code; import io.grpc.internal.MessageFramerTest.ByteWritableBuffer; - import org.junit.Before; import org.junit.Rule; import org.junit.Test; diff --git a/core/src/test/java/io/grpc/internal/AbstractClientStreamTest.java b/core/src/test/java/io/grpc/internal/AbstractClientStreamTest.java index b08b2042220..029017e0afa 100644 --- a/core/src/test/java/io/grpc/internal/AbstractClientStreamTest.java +++ b/core/src/test/java/io/grpc/internal/AbstractClientStreamTest.java @@ -45,7 +45,6 @@ import io.grpc.Status.Code; import io.grpc.internal.AbstractStream.Phase; import io.grpc.internal.MessageFramerTest.ByteWritableBuffer; - import org.junit.Before; import org.junit.Rule; import org.junit.Test; diff --git a/core/src/test/java/io/grpc/internal/AbstractManagedChannelImplBuilderTest.java b/core/src/test/java/io/grpc/internal/AbstractManagedChannelImplBuilderTest.java index f6d09db142e..3413e778155 100644 --- a/core/src/test/java/io/grpc/internal/AbstractManagedChannelImplBuilderTest.java +++ b/core/src/test/java/io/grpc/internal/AbstractManagedChannelImplBuilderTest.java @@ -34,13 +34,12 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - import java.net.InetSocketAddress; import java.net.URI; import java.util.concurrent.TimeUnit; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** Unit tests for {@link AbstractManagedChannelImplBuilder}. */ @RunWith(JUnit4.class) diff --git a/core/src/test/java/io/grpc/internal/AbstractServerStreamTest.java b/core/src/test/java/io/grpc/internal/AbstractServerStreamTest.java index e451b1a8c2c..1b744a95673 100644 --- a/core/src/test/java/io/grpc/internal/AbstractServerStreamTest.java +++ b/core/src/test/java/io/grpc/internal/AbstractServerStreamTest.java @@ -45,7 +45,8 @@ import io.grpc.Metadata; import io.grpc.Status; import io.grpc.internal.MessageFramerTest.ByteWritableBuffer; - +import java.io.ByteArrayInputStream; +import java.io.InputStream; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; @@ -53,9 +54,6 @@ import org.junit.runners.JUnit4; import org.mockito.ArgumentCaptor; -import java.io.ByteArrayInputStream; -import java.io.InputStream; - /** * Tests for {@link AbstractServerStream}. */ diff --git a/core/src/test/java/io/grpc/internal/AbstractStreamTest.java b/core/src/test/java/io/grpc/internal/AbstractStreamTest.java index 1336cb46a45..446ede1af05 100644 --- a/core/src/test/java/io/grpc/internal/AbstractStreamTest.java +++ b/core/src/test/java/io/grpc/internal/AbstractStreamTest.java @@ -38,10 +38,9 @@ import com.google.common.collect.ImmutableMultimap; import com.google.common.collect.Multimap; - import io.grpc.internal.AbstractStream.Phase; import io.grpc.internal.MessageFramerTest.ByteWritableBuffer; - +import java.io.InputStream; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -49,8 +48,6 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import java.io.InputStream; - @RunWith(JUnit4.class) public class AbstractStreamTest { @Mock private StreamListener streamListener; diff --git a/core/src/test/java/io/grpc/internal/ByteWritableBufferTest.java b/core/src/test/java/io/grpc/internal/ByteWritableBufferTest.java index c4772baaa1d..6d9c16159c9 100644 --- a/core/src/test/java/io/grpc/internal/ByteWritableBufferTest.java +++ b/core/src/test/java/io/grpc/internal/ByteWritableBufferTest.java @@ -31,9 +31,8 @@ package io.grpc.internal; -import org.junit.Before; - import java.util.Arrays; +import org.junit.Before; public class ByteWritableBufferTest extends WritableBufferTestBase { diff --git a/core/src/test/java/io/grpc/internal/CallCredentialsApplyingTest.java b/core/src/test/java/io/grpc/internal/CallCredentialsApplyingTest.java index 1829b441f22..cfd69721983 100644 --- a/core/src/test/java/io/grpc/internal/CallCredentialsApplyingTest.java +++ b/core/src/test/java/io/grpc/internal/CallCredentialsApplyingTest.java @@ -52,7 +52,8 @@ import io.grpc.SecurityLevel; import io.grpc.Status; import io.grpc.StringMarshaller; - +import java.net.SocketAddress; +import java.util.concurrent.Executor; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -63,9 +64,6 @@ import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -import java.net.SocketAddress; -import java.util.concurrent.Executor; - /** * Unit test for {@link CallCredentials} applying functionality implemented by {@link * CallCredentialsApplyingTransportFactory} and {@link MetadataApplierImpl}. diff --git a/core/src/test/java/io/grpc/internal/ChannelExecutorTest.java b/core/src/test/java/io/grpc/internal/ChannelExecutorTest.java index 9d758ada4e8..f0c639b78ce 100644 --- a/core/src/test/java/io/grpc/internal/ChannelExecutorTest.java +++ b/core/src/test/java/io/grpc/internal/ChannelExecutorTest.java @@ -36,6 +36,9 @@ import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.inOrder; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicReference; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -46,10 +49,6 @@ import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicReference; - /** * Unit tests for {@link ChannelExecutor}. */ diff --git a/core/src/test/java/io/grpc/internal/ClientCallImplTest.java b/core/src/test/java/io/grpc/internal/ClientCallImplTest.java index ce673b71516..c9c3bffa14c 100644 --- a/core/src/test/java/io/grpc/internal/ClientCallImplTest.java +++ b/core/src/test/java/io/grpc/internal/ClientCallImplTest.java @@ -58,7 +58,6 @@ import com.google.instrumentation.stats.RpcConstants; import com.google.instrumentation.stats.StatsContext; import com.google.instrumentation.stats.TagValue; - import io.grpc.Attributes; import io.grpc.Attributes.Key; import io.grpc.CallOptions; @@ -76,18 +75,6 @@ import io.grpc.internal.testing.StatsTestUtils; import io.grpc.internal.testing.StatsTestUtils.FakeStatsContextFactory; import io.grpc.testing.TestMethodDescriptors; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.mockito.Matchers; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; - import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; @@ -100,6 +87,16 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +import org.mockito.Matchers; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; /** * Test for {@link ClientCallImpl}. diff --git a/core/src/test/java/io/grpc/internal/CompositeReadableBufferTest.java b/core/src/test/java/io/grpc/internal/CompositeReadableBufferTest.java index d183050c794..3aa6c9b3a4c 100644 --- a/core/src/test/java/io/grpc/internal/CompositeReadableBufferTest.java +++ b/core/src/test/java/io/grpc/internal/CompositeReadableBufferTest.java @@ -36,16 +36,15 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.nio.ByteBuffer; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.nio.ByteBuffer; - /** * Tests for {@link CompositeReadableBuffer}. */ diff --git a/core/src/test/java/io/grpc/internal/ConnectivityStateManagerTest.java b/core/src/test/java/io/grpc/internal/ConnectivityStateManagerTest.java index ab9c2e798b2..ce1e8e4454d 100644 --- a/core/src/test/java/io/grpc/internal/ConnectivityStateManagerTest.java +++ b/core/src/test/java/io/grpc/internal/ConnectivityStateManagerTest.java @@ -34,16 +34,13 @@ import static org.junit.Assert.assertEquals; import com.google.common.util.concurrent.MoreExecutors; - import io.grpc.ConnectivityState; - +import java.util.LinkedList; +import java.util.concurrent.Executor; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import java.util.LinkedList; -import java.util.concurrent.Executor; - /** * Unit tests for {@link ConnectivityStateManager}. */ diff --git a/core/src/test/java/io/grpc/internal/DelayedClientTransport2Test.java b/core/src/test/java/io/grpc/internal/DelayedClientTransport2Test.java index c29fe62c6d6..a2c503d674d 100644 --- a/core/src/test/java/io/grpc/internal/DelayedClientTransport2Test.java +++ b/core/src/test/java/io/grpc/internal/DelayedClientTransport2Test.java @@ -58,7 +58,10 @@ import io.grpc.MethodDescriptor.MethodType; import io.grpc.Status; import io.grpc.StringMarshaller; - +import java.util.concurrent.CyclicBarrier; +import java.util.concurrent.Executor; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -72,11 +75,6 @@ import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -import java.util.concurrent.CyclicBarrier; -import java.util.concurrent.Executor; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicBoolean; - /** * Unit tests for {@link DelayedClientTransport2}. */ diff --git a/core/src/test/java/io/grpc/internal/DelayedClientTransportTest.java b/core/src/test/java/io/grpc/internal/DelayedClientTransportTest.java index 52ac4c06d18..189f1596723 100644 --- a/core/src/test/java/io/grpc/internal/DelayedClientTransportTest.java +++ b/core/src/test/java/io/grpc/internal/DelayedClientTransportTest.java @@ -47,7 +47,6 @@ import static org.mockito.Mockito.when; import com.google.common.base.Supplier; - import io.grpc.Attributes; import io.grpc.CallOptions; import io.grpc.IntegerMarshaller; @@ -58,7 +57,9 @@ import io.grpc.MethodDescriptor.MethodType; import io.grpc.Status; import io.grpc.StringMarshaller; - +import java.util.Arrays; +import java.util.Iterator; +import java.util.concurrent.Executor; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -70,10 +71,6 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import java.util.Arrays; -import java.util.Iterator; -import java.util.concurrent.Executor; - /** * Unit tests for {@link DelayedClientTransport}. */ diff --git a/core/src/test/java/io/grpc/internal/DelayedStreamTest.java b/core/src/test/java/io/grpc/internal/DelayedStreamTest.java index 4e35866bd51..c6d013b0fa5 100644 --- a/core/src/test/java/io/grpc/internal/DelayedStreamTest.java +++ b/core/src/test/java/io/grpc/internal/DelayedStreamTest.java @@ -50,7 +50,8 @@ import io.grpc.Codec; import io.grpc.Metadata; import io.grpc.Status; - +import java.io.ByteArrayInputStream; +import java.io.InputStream; import org.junit.Before; import org.junit.Rule; import org.junit.Test; @@ -63,9 +64,6 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import java.io.ByteArrayInputStream; -import java.io.InputStream; - /** * Tests for {@link DelayedStream}. Most of the state checking is enforced by * {@link ClientCallImpl} so we don't check it here. diff --git a/core/src/test/java/io/grpc/internal/DnsNameResolverProviderTest.java b/core/src/test/java/io/grpc/internal/DnsNameResolverProviderTest.java index 826b501d33e..c0e5fbc9772 100644 --- a/core/src/test/java/io/grpc/internal/DnsNameResolverProviderTest.java +++ b/core/src/test/java/io/grpc/internal/DnsNameResolverProviderTest.java @@ -38,13 +38,11 @@ import io.grpc.Attributes; import io.grpc.NameResolverProvider; - +import java.net.URI; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import java.net.URI; - /** Unit tests for {@link DnsNameResolverProvider}. */ @RunWith(JUnit4.class) public class DnsNameResolverProviderTest { diff --git a/core/src/test/java/io/grpc/internal/DnsNameResolverTest.java b/core/src/test/java/io/grpc/internal/DnsNameResolverTest.java index 0ecca6eeab9..ff5bb94925f 100644 --- a/core/src/test/java/io/grpc/internal/DnsNameResolverTest.java +++ b/core/src/test/java/io/grpc/internal/DnsNameResolverTest.java @@ -41,23 +41,11 @@ import static org.mockito.Mockito.verifyNoMoreInteractions; import com.google.common.collect.Iterables; - import io.grpc.Attributes; import io.grpc.NameResolver; import io.grpc.ResolvedServerInfoGroup; import io.grpc.Status; import io.grpc.internal.SharedResourceHolder.Resource; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; - import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.URI; @@ -67,6 +55,15 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; /** Unit tests for {@link DnsNameResolver}. */ @RunWith(JUnit4.class) diff --git a/core/src/test/java/io/grpc/internal/ExponentialBackoffPolicyTest.java b/core/src/test/java/io/grpc/internal/ExponentialBackoffPolicyTest.java index af580329d66..5eca3eeb8e8 100644 --- a/core/src/test/java/io/grpc/internal/ExponentialBackoffPolicyTest.java +++ b/core/src/test/java/io/grpc/internal/ExponentialBackoffPolicyTest.java @@ -34,12 +34,11 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; +import java.util.Random; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import java.util.Random; - /** * Test for {@link ExponentialBackoffPolicy}. */ diff --git a/core/src/test/java/io/grpc/internal/FakeClock.java b/core/src/test/java/io/grpc/internal/FakeClock.java index c7876ae9636..3ea0b851fc1 100644 --- a/core/src/test/java/io/grpc/internal/FakeClock.java +++ b/core/src/test/java/io/grpc/internal/FakeClock.java @@ -35,7 +35,6 @@ import com.google.common.base.Supplier; import com.google.common.base.Ticker; import com.google.common.util.concurrent.AbstractFuture; - import java.util.ArrayList; import java.util.Collection; import java.util.List; diff --git a/core/src/test/java/io/grpc/internal/FakeClockTest.java b/core/src/test/java/io/grpc/internal/FakeClockTest.java index cd102a58da3..c311224a346 100644 --- a/core/src/test/java/io/grpc/internal/FakeClockTest.java +++ b/core/src/test/java/io/grpc/internal/FakeClockTest.java @@ -36,14 +36,12 @@ import static org.junit.Assert.assertTrue; import com.google.common.base.Stopwatch; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** Unit tests for {@link FakeClock}. */ @RunWith(JUnit4.class) diff --git a/core/src/test/java/io/grpc/internal/ForwardingReadableBufferTest.java b/core/src/test/java/io/grpc/internal/ForwardingReadableBufferTest.java index 21eff778725..278a89ab251 100644 --- a/core/src/test/java/io/grpc/internal/ForwardingReadableBufferTest.java +++ b/core/src/test/java/io/grpc/internal/ForwardingReadableBufferTest.java @@ -35,6 +35,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; +import java.io.IOException; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -42,8 +43,6 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import java.io.IOException; - /** * Tests for {@link ForwardingReadableBuffer}. */ diff --git a/core/src/test/java/io/grpc/internal/GrpcUtilTest.java b/core/src/test/java/io/grpc/internal/GrpcUtilTest.java index f841d0d6717..5e78019a9bd 100644 --- a/core/src/test/java/io/grpc/internal/GrpcUtilTest.java +++ b/core/src/test/java/io/grpc/internal/GrpcUtilTest.java @@ -39,7 +39,6 @@ import io.grpc.Status; import io.grpc.internal.GrpcUtil.Http2Error; - import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; diff --git a/core/src/test/java/io/grpc/internal/Http2ClientStreamTransportStateTest.java b/core/src/test/java/io/grpc/internal/Http2ClientStreamTransportStateTest.java index 3078b3fadbc..ce09427b2de 100644 --- a/core/src/test/java/io/grpc/internal/Http2ClientStreamTransportStateTest.java +++ b/core/src/test/java/io/grpc/internal/Http2ClientStreamTransportStateTest.java @@ -43,7 +43,6 @@ import io.grpc.Metadata; import io.grpc.Status; import io.grpc.Status.Code; - import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/core/src/test/java/io/grpc/internal/InternalSubchannelTest.java b/core/src/test/java/io/grpc/internal/InternalSubchannelTest.java index 1dc7ec95a93..260ebd75247 100644 --- a/core/src/test/java/io/grpc/internal/InternalSubchannelTest.java +++ b/core/src/test/java/io/grpc/internal/InternalSubchannelTest.java @@ -51,7 +51,11 @@ import io.grpc.EquivalentAddressGroup; import io.grpc.Status; import io.grpc.internal.TestUtils.MockClientTransportInfo; - +import java.net.SocketAddress; +import java.util.Arrays; +import java.util.LinkedList; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.atomic.AtomicInteger; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -60,12 +64,6 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import java.net.SocketAddress; -import java.util.Arrays; -import java.util.LinkedList; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.atomic.AtomicInteger; - /** * Unit tests for {@link InternalSubchannel}. * diff --git a/core/src/test/java/io/grpc/internal/IoUtilsTest.java b/core/src/test/java/io/grpc/internal/IoUtilsTest.java index 43b3bd746f0..527c7b6da5a 100644 --- a/core/src/test/java/io/grpc/internal/IoUtilsTest.java +++ b/core/src/test/java/io/grpc/internal/IoUtilsTest.java @@ -34,13 +34,12 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotSame; +import java.io.ByteArrayInputStream; +import java.io.InputStream; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import java.io.ByteArrayInputStream; -import java.io.InputStream; - /** Unit test for IoUtils. */ @RunWith(JUnit4.class) public class IoUtilsTest { diff --git a/core/src/test/java/io/grpc/internal/KeepAliveManagerTest.java b/core/src/test/java/io/grpc/internal/KeepAliveManagerTest.java index a1662e1d4b5..cbeb58b1f0e 100644 --- a/core/src/test/java/io/grpc/internal/KeepAliveManagerTest.java +++ b/core/src/test/java/io/grpc/internal/KeepAliveManagerTest.java @@ -39,7 +39,10 @@ import static org.mockito.Mockito.verify; import io.grpc.Status; - +import java.util.concurrent.Executor; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -48,11 +51,6 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import java.util.concurrent.Executor; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.TimeUnit; - @RunWith(JUnit4.class) public final class KeepAliveManagerTest { private final FakeTicker ticker = new FakeTicker(); diff --git a/core/src/test/java/io/grpc/internal/ManagedChannelImpl2IdlenessTest.java b/core/src/test/java/io/grpc/internal/ManagedChannelImpl2IdlenessTest.java index 2d9b4479240..f3b64bb548e 100644 --- a/core/src/test/java/io/grpc/internal/ManagedChannelImpl2IdlenessTest.java +++ b/core/src/test/java/io/grpc/internal/ManagedChannelImpl2IdlenessTest.java @@ -44,7 +44,6 @@ import static org.mockito.Mockito.when; import com.google.common.collect.Lists; - import io.grpc.Attributes; import io.grpc.CallOptions; import io.grpc.ClientCall; @@ -68,17 +67,6 @@ import io.grpc.Status; import io.grpc.StringMarshaller; import io.grpc.internal.TestUtils.MockClientTransportInfo; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; - import java.net.SocketAddress; import java.net.URI; import java.util.ArrayList; @@ -88,6 +76,15 @@ import java.util.concurrent.Executor; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; /** * Unit tests for {@link ManagedChannelImpl}'s idle mode. diff --git a/core/src/test/java/io/grpc/internal/ManagedChannelImpl2Test.java b/core/src/test/java/io/grpc/internal/ManagedChannelImpl2Test.java index 861fefce792..7e5ed2889b4 100644 --- a/core/src/test/java/io/grpc/internal/ManagedChannelImpl2Test.java +++ b/core/src/test/java/io/grpc/internal/ManagedChannelImpl2Test.java @@ -58,7 +58,6 @@ import static org.mockito.Mockito.when; import com.google.common.collect.ImmutableList; - import io.grpc.Attributes; import io.grpc.CallCredentials; import io.grpc.CallCredentials.MetadataApplier; @@ -89,7 +88,18 @@ import io.grpc.StringMarshaller; import io.grpc.internal.TestUtils.MockClientTransportInfo; import io.grpc.internal.testing.StatsTestUtils.FakeStatsContextFactory; - +import java.net.SocketAddress; +import java.net.URI; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.Executor; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicLong; import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -106,19 +116,6 @@ import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -import java.net.SocketAddress; -import java.net.URI; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.Executor; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicLong; - /** Unit tests for {@link ManagedChannelImpl2}. */ @RunWith(JUnit4.class) public class ManagedChannelImpl2Test { diff --git a/core/src/test/java/io/grpc/internal/ManagedChannelImplGetNameResolverTest.java b/core/src/test/java/io/grpc/internal/ManagedChannelImplGetNameResolverTest.java index 13342593fbb..cd6d59901d3 100644 --- a/core/src/test/java/io/grpc/internal/ManagedChannelImplGetNameResolverTest.java +++ b/core/src/test/java/io/grpc/internal/ManagedChannelImplGetNameResolverTest.java @@ -38,13 +38,11 @@ import io.grpc.Attributes; import io.grpc.NameResolver; import io.grpc.NameResolver.Factory; - +import java.net.URI; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import java.net.URI; - /** Unit tests for {@link ManagedChannelImpl#getNameResolver}. */ @RunWith(JUnit4.class) public class ManagedChannelImplGetNameResolverTest { diff --git a/core/src/test/java/io/grpc/internal/ManagedChannelImplIdlenessTest.java b/core/src/test/java/io/grpc/internal/ManagedChannelImplIdlenessTest.java index 328c2a278cf..6b86caa1905 100644 --- a/core/src/test/java/io/grpc/internal/ManagedChannelImplIdlenessTest.java +++ b/core/src/test/java/io/grpc/internal/ManagedChannelImplIdlenessTest.java @@ -46,7 +46,6 @@ import static org.mockito.Mockito.when; import com.google.common.collect.Lists; - import io.grpc.Attributes; import io.grpc.CallOptions; import io.grpc.ClientCall; @@ -67,7 +66,16 @@ import io.grpc.TransportManager; import io.grpc.TransportManager.OobTransportProvider; import io.grpc.internal.TestUtils.MockClientTransportInfo; - +import java.net.SocketAddress; +import java.net.URI; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -81,17 +89,6 @@ import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -import java.net.SocketAddress; -import java.net.URI; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.TimeUnit; - /** * Unit tests for {@link ManagedChannelImpl}'s idle mode. */ diff --git a/core/src/test/java/io/grpc/internal/ManagedChannelImplTest.java b/core/src/test/java/io/grpc/internal/ManagedChannelImplTest.java index 149cb3fcdd1..f03a33c5718 100644 --- a/core/src/test/java/io/grpc/internal/ManagedChannelImplTest.java +++ b/core/src/test/java/io/grpc/internal/ManagedChannelImplTest.java @@ -54,7 +54,6 @@ import static org.mockito.Mockito.when; import com.google.common.collect.ImmutableList; - import io.grpc.Attributes; import io.grpc.CallCredentials; import io.grpc.CallCredentials.MetadataApplier; @@ -80,7 +79,18 @@ import io.grpc.StringMarshaller; import io.grpc.TransportManager; import io.grpc.internal.testing.StatsTestUtils.FakeStatsContextFactory; - +import java.net.SocketAddress; +import java.net.URI; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; +import java.util.concurrent.CyclicBarrier; +import java.util.concurrent.Executor; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicLong; import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -96,19 +106,6 @@ import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -import java.net.SocketAddress; -import java.net.URI; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; -import java.util.concurrent.CyclicBarrier; -import java.util.concurrent.Executor; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicLong; - /** Unit tests for {@link ManagedChannelImpl}. */ @RunWith(JUnit4.class) public class ManagedChannelImplTest { diff --git a/core/src/test/java/io/grpc/internal/ManagedChannelImplTransportManagerTest.java b/core/src/test/java/io/grpc/internal/ManagedChannelImplTransportManagerTest.java index eda7713a8c2..a1ed1390765 100644 --- a/core/src/test/java/io/grpc/internal/ManagedChannelImplTransportManagerTest.java +++ b/core/src/test/java/io/grpc/internal/ManagedChannelImplTransportManagerTest.java @@ -63,7 +63,14 @@ import io.grpc.TransportManager.InterimTransport; import io.grpc.TransportManager.OobTransportProvider; import io.grpc.internal.TestUtils.MockClientTransportInfo; - +import java.net.SocketAddress; +import java.net.URI; +import java.util.Arrays; +import java.util.Collections; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -74,15 +81,6 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import java.net.SocketAddress; -import java.net.URI; -import java.util.Arrays; -import java.util.Collections; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; - /** * Unit tests for {@link ManagedChannelImpl}'s {@link TransportManager} implementation as well as * {@link TransportSet}. diff --git a/core/src/test/java/io/grpc/internal/MessageDeframerTest.java b/core/src/test/java/io/grpc/internal/MessageDeframerTest.java index b7787a2dded..93e0e900c7f 100644 --- a/core/src/test/java/io/grpc/internal/MessageDeframerTest.java +++ b/core/src/test/java/io/grpc/internal/MessageDeframerTest.java @@ -47,7 +47,6 @@ import com.google.common.io.ByteStreams; import com.google.common.primitives.Bytes; import com.google.instrumentation.stats.RpcConstants; - import io.grpc.Codec; import io.grpc.Status; import io.grpc.StatusRuntimeException; @@ -55,7 +54,12 @@ import io.grpc.internal.MessageDeframer.SizeEnforcingInputStream; import io.grpc.internal.testing.StatsTestUtils.FakeStatsContextFactory; import io.grpc.internal.testing.StatsTestUtils.MetricsRecord; - +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.List; +import java.util.zip.GZIPOutputStream; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; @@ -66,13 +70,6 @@ import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.List; -import java.util.zip.GZIPOutputStream; - /** * Tests for {@link MessageDeframer}. */ diff --git a/core/src/test/java/io/grpc/internal/MessageFramerTest.java b/core/src/test/java/io/grpc/internal/MessageFramerTest.java index fada3ee9bf4..68cb7fc6d14 100644 --- a/core/src/test/java/io/grpc/internal/MessageFramerTest.java +++ b/core/src/test/java/io/grpc/internal/MessageFramerTest.java @@ -42,14 +42,16 @@ import static org.mockito.Mockito.verifyZeroInteractions; import com.google.instrumentation.stats.RpcConstants; - import io.grpc.Codec; import io.grpc.Metadata; import io.grpc.Status; -import io.grpc.internal.StatsTraceContext; import io.grpc.internal.testing.StatsTestUtils.FakeStatsContextFactory; import io.grpc.internal.testing.StatsTestUtils.MetricsRecord; - +import java.io.BufferedInputStream; +import java.io.ByteArrayInputStream; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.util.Arrays; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -59,12 +61,6 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import java.io.BufferedInputStream; -import java.io.ByteArrayInputStream; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.util.Arrays; - /** * Tests for {@link MessageFramer}. */ diff --git a/core/src/test/java/io/grpc/internal/NoopClientStreamListener.java b/core/src/test/java/io/grpc/internal/NoopClientStreamListener.java index 9589c1d5850..1a2a342b234 100644 --- a/core/src/test/java/io/grpc/internal/NoopClientStreamListener.java +++ b/core/src/test/java/io/grpc/internal/NoopClientStreamListener.java @@ -33,7 +33,6 @@ import io.grpc.Metadata; import io.grpc.Status; - import java.io.InputStream; /** diff --git a/core/src/test/java/io/grpc/internal/ReadableBufferTestBase.java b/core/src/test/java/io/grpc/internal/ReadableBufferTestBase.java index 8663183be99..0dff9a09304 100644 --- a/core/src/test/java/io/grpc/internal/ReadableBufferTestBase.java +++ b/core/src/test/java/io/grpc/internal/ReadableBufferTestBase.java @@ -35,13 +35,12 @@ import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - import java.io.ByteArrayOutputStream; import java.nio.ByteBuffer; import java.util.Arrays; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Abstract base class for tests of {@link ReadableBuffer} subclasses. diff --git a/core/src/test/java/io/grpc/internal/SerializeReentrantCallsDirectExecutorTest.java b/core/src/test/java/io/grpc/internal/SerializeReentrantCallsDirectExecutorTest.java index 4e96e214b32..2da64552697 100644 --- a/core/src/test/java/io/grpc/internal/SerializeReentrantCallsDirectExecutorTest.java +++ b/core/src/test/java/io/grpc/internal/SerializeReentrantCallsDirectExecutorTest.java @@ -35,15 +35,14 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - import java.util.ArrayList; import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; @RunWith(JUnit4.class) public class SerializeReentrantCallsDirectExecutorTest { diff --git a/core/src/test/java/io/grpc/internal/ServerCallImplTest.java b/core/src/test/java/io/grpc/internal/ServerCallImplTest.java index 137146d98d0..4a7acdc2504 100644 --- a/core/src/test/java/io/grpc/internal/ServerCallImplTest.java +++ b/core/src/test/java/io/grpc/internal/ServerCallImplTest.java @@ -46,7 +46,6 @@ import com.google.common.io.CharStreams; import com.google.instrumentation.stats.RpcConstants; import com.google.instrumentation.stats.TagValue; - import io.grpc.CompressorRegistry; import io.grpc.Context; import io.grpc.DecompressorRegistry; @@ -57,9 +56,11 @@ import io.grpc.ServerCall; import io.grpc.Status; import io.grpc.internal.ServerCallImpl.ServerStreamListenerImpl; -import io.grpc.internal.testing.StatsTestUtils.FakeStatsContextFactory; import io.grpc.internal.testing.StatsTestUtils; - +import io.grpc.internal.testing.StatsTestUtils.FakeStatsContextFactory; +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.InputStreamReader; import org.junit.Before; import org.junit.Rule; import org.junit.Test; @@ -72,10 +73,6 @@ import org.mockito.Mockito; import org.mockito.MockitoAnnotations; -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.io.InputStreamReader; - @RunWith(JUnit4.class) public class ServerCallImplTest { @Rule public final ExpectedException thrown = ExpectedException.none(); diff --git a/core/src/test/java/io/grpc/internal/ServerImplTest.java b/core/src/test/java/io/grpc/internal/ServerImplTest.java index a94f66d3a7a..4276b66e2dc 100644 --- a/core/src/test/java/io/grpc/internal/ServerImplTest.java +++ b/core/src/test/java/io/grpc/internal/ServerImplTest.java @@ -59,7 +59,6 @@ import com.google.instrumentation.stats.RpcConstants; import com.google.instrumentation.stats.StatsContext; import com.google.instrumentation.stats.TagValue; - import io.grpc.Attributes; import io.grpc.Compressor; import io.grpc.CompressorRegistry; @@ -81,7 +80,17 @@ import io.grpc.internal.testing.StatsTestUtils; import io.grpc.internal.testing.StatsTestUtils.FakeStatsContextFactory; import io.grpc.util.MutableHandlerRegistry; - +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.SocketAddress; +import java.util.List; +import java.util.concurrent.CyclicBarrier; +import java.util.concurrent.Executor; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; @@ -96,18 +105,6 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.SocketAddress; -import java.util.List; -import java.util.concurrent.CyclicBarrier; -import java.util.concurrent.Executor; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicReference; - /** Unit tests for {@link ServerImpl}. */ @RunWith(JUnit4.class) public class ServerImplTest { diff --git a/core/src/test/java/io/grpc/internal/SharedResourceHolderTest.java b/core/src/test/java/io/grpc/internal/SharedResourceHolderTest.java index 9a613509191..adb56be6802 100644 --- a/core/src/test/java/io/grpc/internal/SharedResourceHolderTest.java +++ b/core/src/test/java/io/grpc/internal/SharedResourceHolderTest.java @@ -44,7 +44,11 @@ import static org.mockito.Mockito.when; import io.grpc.internal.SharedResourceHolder.Resource; - +import java.util.LinkedList; +import java.util.concurrent.Delayed; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -52,12 +56,6 @@ import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -import java.util.LinkedList; -import java.util.concurrent.Delayed; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.TimeUnit; - /** Unit tests for {@link SharedResourceHolder}. */ @RunWith(JUnit4.class) public class SharedResourceHolderTest { diff --git a/core/src/test/java/io/grpc/internal/TestUtils.java b/core/src/test/java/io/grpc/internal/TestUtils.java index 14588352acf..36532eaea0e 100644 --- a/core/src/test/java/io/grpc/internal/TestUtils.java +++ b/core/src/test/java/io/grpc/internal/TestUtils.java @@ -39,14 +39,12 @@ import io.grpc.CallOptions; import io.grpc.Metadata; import io.grpc.MethodDescriptor; - -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; - import java.net.SocketAddress; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import javax.annotation.Nullable; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.stubbing.Answer; /** * Common utility methods for tests. diff --git a/core/src/test/java/io/grpc/internal/TransportFrameUtilTest.java b/core/src/test/java/io/grpc/internal/TransportFrameUtilTest.java index ab8c11835df..14505246e99 100644 --- a/core/src/test/java/io/grpc/internal/TransportFrameUtilTest.java +++ b/core/src/test/java/io/grpc/internal/TransportFrameUtilTest.java @@ -40,18 +40,15 @@ import static org.junit.Assert.fail; import com.google.common.io.BaseEncoding; - import io.grpc.InternalMetadata; import io.grpc.Metadata; import io.grpc.Metadata.BinaryMarshaller; import io.grpc.Metadata.Key; - +import java.util.Arrays; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import java.util.Arrays; - /** Unit tests for {@link TransportFrameUtil}. */ @RunWith(JUnit4.class) public class TransportFrameUtilTest { diff --git a/core/src/test/java/io/grpc/internal/TransportSetTest.java b/core/src/test/java/io/grpc/internal/TransportSetTest.java index d7e9ac5c782..7fbbb34430c 100644 --- a/core/src/test/java/io/grpc/internal/TransportSetTest.java +++ b/core/src/test/java/io/grpc/internal/TransportSetTest.java @@ -58,7 +58,10 @@ import io.grpc.Status; import io.grpc.StringMarshaller; import io.grpc.internal.TestUtils.MockClientTransportInfo; - +import java.net.SocketAddress; +import java.util.Arrays; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.Executor; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -67,11 +70,6 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import java.net.SocketAddress; -import java.util.Arrays; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.Executor; - /** * Unit tests for {@link TransportSet}. * diff --git a/core/src/test/java/io/grpc/util/MutableHandlerRegistryTest.java b/core/src/test/java/io/grpc/util/MutableHandlerRegistryTest.java index 3a137228043..7235ba0e08f 100644 --- a/core/src/test/java/io/grpc/util/MutableHandlerRegistryTest.java +++ b/core/src/test/java/io/grpc/util/MutableHandlerRegistryTest.java @@ -39,14 +39,13 @@ import static org.junit.Assert.assertTrue; import io.grpc.BindableService; +import io.grpc.MethodDescriptor; import io.grpc.MethodDescriptor.Marshaller; import io.grpc.MethodDescriptor.MethodType; -import io.grpc.MethodDescriptor; import io.grpc.ServerCallHandler; import io.grpc.ServerMethodDefinition; import io.grpc.ServerServiceDefinition; import io.grpc.ServiceDescriptor; - import org.junit.After; import org.junit.Before; import org.junit.Test; diff --git a/core/src/test/java/io/grpc/util/RoundRobinLoadBalancer2Test.java b/core/src/test/java/io/grpc/util/RoundRobinLoadBalancer2Test.java index 796030be398..fb28afa4963 100644 --- a/core/src/test/java/io/grpc/util/RoundRobinLoadBalancer2Test.java +++ b/core/src/test/java/io/grpc/util/RoundRobinLoadBalancer2Test.java @@ -49,7 +49,6 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; - import io.grpc.Attributes; import io.grpc.ConnectivityState; import io.grpc.ConnectivityStateInfo; @@ -63,7 +62,11 @@ import io.grpc.Status; import io.grpc.util.RoundRobinLoadBalancerFactory2.Picker; import io.grpc.util.RoundRobinLoadBalancerFactory2.RoundRobinLoadBalancer; - +import java.net.SocketAddress; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.concurrent.atomic.AtomicReference; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -76,12 +79,6 @@ import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -import java.net.SocketAddress; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.concurrent.atomic.AtomicReference; - /** Unit test for {@link RoundRobinLoadBalancerFactory2}. */ @RunWith(JUnit4.class) public class RoundRobinLoadBalancer2Test { diff --git a/core/src/test/java/io/grpc/util/RoundRobinLoadBalancerTest.java b/core/src/test/java/io/grpc/util/RoundRobinLoadBalancerTest.java index e8e0743d969..7dc3f7e04dd 100644 --- a/core/src/test/java/io/grpc/util/RoundRobinLoadBalancerTest.java +++ b/core/src/test/java/io/grpc/util/RoundRobinLoadBalancerTest.java @@ -42,17 +42,16 @@ import com.google.common.base.Supplier; import com.google.common.collect.Lists; - import io.grpc.Attributes; import io.grpc.EquivalentAddressGroup; import io.grpc.LoadBalancer; - import io.grpc.ResolvedServerInfo; import io.grpc.ResolvedServerInfoGroup; import io.grpc.Status; import io.grpc.TransportManager; import io.grpc.TransportManager.InterimTransport; - +import java.net.SocketAddress; +import java.util.List; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -64,9 +63,6 @@ import org.mockito.Mockito; import org.mockito.MockitoAnnotations; -import java.net.SocketAddress; -import java.util.List; - /** Unit test for {@link RoundRobinLoadBalancerFactory}. */ @RunWith(JUnit4.class) public class RoundRobinLoadBalancerTest { diff --git a/grpclb/src/main/java/io/grpc/grpclb/GrpclbLoadBalancer.java b/grpclb/src/main/java/io/grpc/grpclb/GrpclbLoadBalancer.java index 7c527cf4eb8..e5e899ab0b2 100644 --- a/grpclb/src/main/java/io/grpc/grpclb/GrpclbLoadBalancer.java +++ b/grpclb/src/main/java/io/grpc/grpclb/GrpclbLoadBalancer.java @@ -35,7 +35,6 @@ import com.google.common.base.Preconditions; import com.google.common.base.Supplier; import com.google.common.base.Suppliers; - import io.grpc.Attributes; import io.grpc.Channel; import io.grpc.EquivalentAddressGroup; @@ -49,7 +48,6 @@ import io.grpc.internal.RoundRobinServerList; import io.grpc.internal.SharedResourceHolder; import io.grpc.stub.StreamObserver; - import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.SocketAddress; @@ -60,7 +58,6 @@ import java.util.List; import java.util.concurrent.ExecutorService; import java.util.logging.Logger; - import javax.annotation.concurrent.GuardedBy; /** diff --git a/grpclb/src/main/java/io/grpc/grpclb/GrpclbLoadBalancer2.java b/grpclb/src/main/java/io/grpc/grpclb/GrpclbLoadBalancer2.java index 9942fb3bd0b..d3b95071fb5 100644 --- a/grpclb/src/main/java/io/grpc/grpclb/GrpclbLoadBalancer2.java +++ b/grpclb/src/main/java/io/grpc/grpclb/GrpclbLoadBalancer2.java @@ -40,7 +40,6 @@ import static io.grpc.ConnectivityState.TRANSIENT_FAILURE; import com.google.common.annotations.VisibleForTesting; - import io.grpc.Attributes; import io.grpc.ConnectivityStateInfo; import io.grpc.EquivalentAddressGroup; @@ -53,7 +52,6 @@ import io.grpc.internal.LogId; import io.grpc.internal.WithLogId; import io.grpc.stub.StreamObserver; - import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.UnknownHostException; @@ -61,8 +59,8 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; -import java.util.Map.Entry; import java.util.Map; +import java.util.Map.Entry; import java.util.concurrent.atomic.AtomicReference; import java.util.logging.Level; import java.util.logging.Logger; diff --git a/grpclb/src/test/java/io/grpc/grpclb/GrpclbLoadBalancer2Test.java b/grpclb/src/test/java/io/grpc/grpclb/GrpclbLoadBalancer2Test.java index d6922d460be..28d25fd749a 100644 --- a/grpclb/src/test/java/io/grpc/grpclb/GrpclbLoadBalancer2Test.java +++ b/grpclb/src/test/java/io/grpc/grpclb/GrpclbLoadBalancer2Test.java @@ -58,20 +58,19 @@ import com.google.common.io.ByteStreams; import com.google.common.util.concurrent.MoreExecutors; import com.google.protobuf.ByteString; - import io.grpc.Attributes; import io.grpc.CallOptions; import io.grpc.ConnectivityStateInfo; import io.grpc.EquivalentAddressGroup; +import io.grpc.LoadBalancer2; import io.grpc.LoadBalancer2.Helper; import io.grpc.LoadBalancer2.PickResult; import io.grpc.LoadBalancer2.Subchannel; import io.grpc.LoadBalancer2.SubchannelPicker; -import io.grpc.LoadBalancer2; import io.grpc.ManagedChannel; import io.grpc.Metadata; -import io.grpc.MethodDescriptor.Marshaller; import io.grpc.MethodDescriptor; +import io.grpc.MethodDescriptor.Marshaller; import io.grpc.ResolvedServerInfo; import io.grpc.ResolvedServerInfoGroup; import io.grpc.Status; @@ -84,6 +83,15 @@ import io.grpc.internal.SerializingExecutor; import io.grpc.stub.ClientCalls; import io.grpc.stub.StreamObserver; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.InetSocketAddress; +import java.net.SocketAddress; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -97,16 +105,6 @@ import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.InetSocketAddress; -import java.net.SocketAddress; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedList; -import java.util.List; - /** Unit tests for {@link GrpclbLoadBalancer2}. */ @RunWith(JUnit4.class) public class GrpclbLoadBalancer2Test { diff --git a/grpclb/src/test/java/io/grpc/grpclb/GrpclbLoadBalancerTest.java b/grpclb/src/test/java/io/grpc/grpclb/GrpclbLoadBalancerTest.java index cf91ecf44fc..5e0d594d8e2 100644 --- a/grpclb/src/test/java/io/grpc/grpclb/GrpclbLoadBalancerTest.java +++ b/grpclb/src/test/java/io/grpc/grpclb/GrpclbLoadBalancerTest.java @@ -47,24 +47,13 @@ import com.google.common.base.Supplier; import com.google.protobuf.ByteString; - import io.grpc.Attributes; import io.grpc.EquivalentAddressGroup; import io.grpc.ResolvedServerInfo; import io.grpc.ResolvedServerInfoGroup; import io.grpc.Status; -import io.grpc.TransportManager.InterimTransport; import io.grpc.TransportManager; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; - +import io.grpc.TransportManager.InterimTransport; import java.net.InetSocketAddress; import java.util.ArrayList; import java.util.Collection; @@ -73,6 +62,14 @@ import java.util.List; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; /** Unit tests for {@link GrpclbLoadBalancer}. */ @RunWith(JUnit4.class) diff --git a/interop-testing/src/main/java/io/grpc/testing/integration/AbstractInteropTest.java b/interop-testing/src/main/java/io/grpc/testing/integration/AbstractInteropTest.java index 60c8b459910..342ccd4a3f7 100644 --- a/interop-testing/src/main/java/io/grpc/testing/integration/AbstractInteropTest.java +++ b/interop-testing/src/main/java/io/grpc/testing/integration/AbstractInteropTest.java @@ -58,7 +58,6 @@ import com.google.protobuf.ByteString; import com.google.protobuf.EmptyProtos.Empty; import com.google.protobuf.MessageLite; - import io.grpc.CallOptions; import io.grpc.ClientCall; import io.grpc.Grpc; @@ -90,16 +89,6 @@ import io.grpc.testing.integration.Messages.StreamingInputCallResponse; import io.grpc.testing.integration.Messages.StreamingOutputCallRequest; import io.grpc.testing.integration.Messages.StreamingOutputCallResponse; - -import org.junit.After; -import org.junit.Assert; -import org.junit.Assume; -import org.junit.Before; -import org.junit.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import org.mockito.verification.VerificationMode; - import java.io.IOException; import java.io.InputStream; import java.security.cert.Certificate; @@ -114,9 +103,16 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; - import javax.net.ssl.SSLPeerUnverifiedException; import javax.net.ssl.SSLSession; +import org.junit.After; +import org.junit.Assert; +import org.junit.Assume; +import org.junit.Before; +import org.junit.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import org.mockito.verification.VerificationMode; /** * Abstract base class for all GRPC transport tests. diff --git a/interop-testing/src/main/java/io/grpc/testing/integration/Http2Client.java b/interop-testing/src/main/java/io/grpc/testing/integration/Http2Client.java index 8e9948add5b..6dd086b01ad 100644 --- a/interop-testing/src/main/java/io/grpc/testing/integration/Http2Client.java +++ b/interop-testing/src/main/java/io/grpc/testing/integration/Http2Client.java @@ -38,7 +38,6 @@ import com.google.common.util.concurrent.ListeningExecutorService; import com.google.common.util.concurrent.MoreExecutors; import com.google.protobuf.ByteString; - import io.grpc.ManagedChannel; import io.grpc.Status; import io.grpc.StatusRuntimeException; @@ -49,11 +48,9 @@ import io.grpc.testing.integration.Messages.PayloadType; import io.grpc.testing.integration.Messages.SimpleRequest; import io.grpc.testing.integration.Messages.SimpleResponse; - import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.UnknownHostException; - import java.util.ArrayList; import java.util.List; import java.util.concurrent.CountDownLatch; diff --git a/interop-testing/src/main/java/io/grpc/testing/integration/ReconnectTestClient.java b/interop-testing/src/main/java/io/grpc/testing/integration/ReconnectTestClient.java index 39cfe3552ee..f552d1b41b2 100644 --- a/interop-testing/src/main/java/io/grpc/testing/integration/ReconnectTestClient.java +++ b/interop-testing/src/main/java/io/grpc/testing/integration/ReconnectTestClient.java @@ -34,7 +34,6 @@ import static org.junit.Assert.assertTrue; import com.google.protobuf.EmptyProtos.Empty; - import io.grpc.ManagedChannel; import io.grpc.StatusRuntimeException; import io.grpc.netty.NegotiationType; diff --git a/interop-testing/src/main/java/io/grpc/testing/integration/StressTestClient.java b/interop-testing/src/main/java/io/grpc/testing/integration/StressTestClient.java index 78437a01370..54ec0425f66 100644 --- a/interop-testing/src/main/java/io/grpc/testing/integration/StressTestClient.java +++ b/interop-testing/src/main/java/io/grpc/testing/integration/StressTestClient.java @@ -47,7 +47,6 @@ import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListeningExecutorService; import com.google.common.util.concurrent.MoreExecutors; - import io.grpc.ManagedChannel; import io.grpc.Server; import io.grpc.ServerBuilder; @@ -58,9 +57,7 @@ import io.grpc.netty.NettyChannelBuilder; import io.grpc.stub.StreamObserver; import io.grpc.testing.TestUtils; - import io.netty.handler.ssl.SslContext; - import java.io.IOException; import java.net.InetAddress; import java.net.InetSocketAddress; diff --git a/interop-testing/src/main/java/io/grpc/testing/integration/TestServiceClient.java b/interop-testing/src/main/java/io/grpc/testing/integration/TestServiceClient.java index 678d2de1503..e9f2e7d8f80 100644 --- a/interop-testing/src/main/java/io/grpc/testing/integration/TestServiceClient.java +++ b/interop-testing/src/main/java/io/grpc/testing/integration/TestServiceClient.java @@ -32,7 +32,6 @@ package io.grpc.testing.integration; import com.google.common.io.Files; - import io.grpc.ManagedChannel; import io.grpc.internal.GrpcUtil; import io.grpc.netty.GrpcSslContexts; @@ -42,14 +41,12 @@ import io.grpc.okhttp.internal.Platform; import io.grpc.testing.TestUtils; import io.netty.handler.ssl.SslContext; - import java.io.File; import java.io.FileInputStream; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.UnknownHostException; import java.nio.charset.Charset; - import javax.net.ssl.SSLSocketFactory; /** diff --git a/interop-testing/src/main/java/io/grpc/testing/integration/TestServiceImpl.java b/interop-testing/src/main/java/io/grpc/testing/integration/TestServiceImpl.java index 580f72bf086..a812d0b6e6d 100644 --- a/interop-testing/src/main/java/io/grpc/testing/integration/TestServiceImpl.java +++ b/interop-testing/src/main/java/io/grpc/testing/integration/TestServiceImpl.java @@ -35,7 +35,6 @@ import com.google.common.collect.Queues; import com.google.protobuf.ByteString; import com.google.protobuf.EmptyProtos; - import io.grpc.ForwardingServerCall.SimpleForwardingServerCall; import io.grpc.Metadata; import io.grpc.ServerCall; @@ -53,7 +52,6 @@ import io.grpc.testing.integration.Messages.StreamingInputCallResponse; import io.grpc.testing.integration.Messages.StreamingOutputCallRequest; import io.grpc.testing.integration.Messages.StreamingOutputCallResponse; - import java.io.IOException; import java.io.InputStream; import java.util.Arrays; diff --git a/interop-testing/src/main/java/io/grpc/testing/integration/TestServiceServer.java b/interop-testing/src/main/java/io/grpc/testing/integration/TestServiceServer.java index 3f0d9480d78..95d188fa754 100644 --- a/interop-testing/src/main/java/io/grpc/testing/integration/TestServiceServer.java +++ b/interop-testing/src/main/java/io/grpc/testing/integration/TestServiceServer.java @@ -33,14 +33,12 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.util.concurrent.MoreExecutors; - import io.grpc.Server; import io.grpc.ServerInterceptors; import io.grpc.netty.GrpcSslContexts; import io.grpc.netty.NettyServerBuilder; import io.grpc.testing.TestUtils; import io.netty.handler.ssl.SslContext; - import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; diff --git a/interop-testing/src/main/java/io/grpc/testing/integration/Util.java b/interop-testing/src/main/java/io/grpc/testing/integration/Util.java index 88e6fb56f97..02d838135a3 100644 --- a/interop-testing/src/main/java/io/grpc/testing/integration/Util.java +++ b/interop-testing/src/main/java/io/grpc/testing/integration/Util.java @@ -32,13 +32,10 @@ package io.grpc.testing.integration; import com.google.protobuf.MessageLite; - import io.grpc.Metadata; import io.grpc.protobuf.ProtoUtils; - -import org.junit.Assert; - import java.util.List; +import org.junit.Assert; /** * Utility methods to support integration testing. diff --git a/interop-testing/src/test/java/io/grpc/stub/StubConfigTest.java b/interop-testing/src/test/java/io/grpc/stub/StubConfigTest.java index 294af82a60d..d5b23bbabe7 100644 --- a/interop-testing/src/test/java/io/grpc/stub/StubConfigTest.java +++ b/interop-testing/src/test/java/io/grpc/stub/StubConfigTest.java @@ -49,7 +49,6 @@ import io.grpc.testing.integration.Messages.SimpleRequest; import io.grpc.testing.integration.Messages.SimpleResponse; import io.grpc.testing.integration.TestServiceGrpc; - import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/interop-testing/src/test/java/io/grpc/testing/integration/AutoWindowSizingOnTest.java b/interop-testing/src/test/java/io/grpc/testing/integration/AutoWindowSizingOnTest.java index ba5e37c639f..a490712a0fe 100644 --- a/interop-testing/src/test/java/io/grpc/testing/integration/AutoWindowSizingOnTest.java +++ b/interop-testing/src/test/java/io/grpc/testing/integration/AutoWindowSizingOnTest.java @@ -36,7 +36,6 @@ import io.grpc.netty.NegotiationType; import io.grpc.netty.NettyChannelBuilder; import io.grpc.netty.NettyServerBuilder; - import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.runner.RunWith; diff --git a/interop-testing/src/test/java/io/grpc/testing/integration/CascadingTest.java b/interop-testing/src/test/java/io/grpc/testing/integration/CascadingTest.java index c1e65338f0e..b409371198d 100644 --- a/interop-testing/src/test/java/io/grpc/testing/integration/CascadingTest.java +++ b/interop-testing/src/test/java/io/grpc/testing/integration/CascadingTest.java @@ -39,7 +39,6 @@ import static org.junit.Assert.fail; import com.google.common.util.concurrent.SettableFuture; - import io.grpc.Context; import io.grpc.Context.CancellableContext; import io.grpc.Deadline; @@ -58,15 +57,6 @@ import io.grpc.stub.StreamObserver; import io.grpc.testing.integration.Messages.SimpleRequest; import io.grpc.testing.integration.Messages.SimpleResponse; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; - import java.io.IOException; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutionException; @@ -75,6 +65,13 @@ import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; /** * Integration test for various forms of cancellation and deadline propagation. diff --git a/interop-testing/src/test/java/io/grpc/testing/integration/CompressionTest.java b/interop-testing/src/test/java/io/grpc/testing/integration/CompressionTest.java index a6a2ee41253..d37e41cc792 100644 --- a/interop-testing/src/test/java/io/grpc/testing/integration/CompressionTest.java +++ b/interop-testing/src/test/java/io/grpc/testing/integration/CompressionTest.java @@ -40,7 +40,6 @@ import static org.junit.Assert.assertTrue; import com.google.protobuf.ByteString; - import io.grpc.CallOptions; import io.grpc.Channel; import io.grpc.ClientCall; @@ -67,7 +66,11 @@ import io.grpc.testing.integration.Messages.SimpleResponse; import io.grpc.testing.integration.TestServiceGrpc.TestServiceBlockingStub; import io.grpc.testing.integration.TransportCompressionTest.Fzip; - +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -75,12 +78,6 @@ import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; - /** * Tests for compression configurations. * diff --git a/interop-testing/src/test/java/io/grpc/testing/integration/ConcurrencyTest.java b/interop-testing/src/test/java/io/grpc/testing/integration/ConcurrencyTest.java index 05b4df4dbe1..321a34b463f 100644 --- a/interop-testing/src/test/java/io/grpc/testing/integration/ConcurrencyTest.java +++ b/interop-testing/src/test/java/io/grpc/testing/integration/ConcurrencyTest.java @@ -33,7 +33,6 @@ import com.google.common.base.Preconditions; import com.google.common.util.concurrent.MoreExecutors; - import io.grpc.ManagedChannel; import io.grpc.Server; import io.grpc.netty.GrpcSslContexts; @@ -48,13 +47,6 @@ import io.grpc.testing.integration.Messages.StreamingOutputCallResponse; import io.netty.handler.ssl.ClientAuth; import io.netty.handler.ssl.SslContext; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - import java.io.File; import java.io.IOException; import java.security.cert.CertificateException; @@ -65,6 +57,11 @@ import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** diff --git a/interop-testing/src/test/java/io/grpc/testing/integration/Http2NettyLocalChannelTest.java b/interop-testing/src/test/java/io/grpc/testing/integration/Http2NettyLocalChannelTest.java index cfe93d9255a..05d3c8f20f6 100644 --- a/interop-testing/src/test/java/io/grpc/testing/integration/Http2NettyLocalChannelTest.java +++ b/interop-testing/src/test/java/io/grpc/testing/integration/Http2NettyLocalChannelTest.java @@ -38,7 +38,6 @@ import io.netty.channel.local.LocalAddress; import io.netty.channel.local.LocalChannel; import io.netty.channel.local.LocalServerChannel; - import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.runner.RunWith; diff --git a/interop-testing/src/test/java/io/grpc/testing/integration/Http2NettyTest.java b/interop-testing/src/test/java/io/grpc/testing/integration/Http2NettyTest.java index f30dcf59dfc..846c584b087 100644 --- a/interop-testing/src/test/java/io/grpc/testing/integration/Http2NettyTest.java +++ b/interop-testing/src/test/java/io/grpc/testing/integration/Http2NettyTest.java @@ -39,15 +39,13 @@ import io.netty.handler.ssl.ClientAuth; import io.netty.handler.ssl.SslProvider; import io.netty.handler.ssl.SupportedCipherSuiteFilter; - +import java.io.IOException; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import java.io.IOException; - /** * Integration tests for GRPC over HTTP2 using the Netty framework. */ diff --git a/interop-testing/src/test/java/io/grpc/testing/integration/Http2OkHttpTest.java b/interop-testing/src/test/java/io/grpc/testing/integration/Http2OkHttpTest.java index 37128759ac6..28d4ed1d047 100644 --- a/interop-testing/src/test/java/io/grpc/testing/integration/Http2OkHttpTest.java +++ b/interop-testing/src/test/java/io/grpc/testing/integration/Http2OkHttpTest.java @@ -37,10 +37,8 @@ import com.google.common.base.Throwables; import com.google.protobuf.EmptyProtos.Empty; - import com.squareup.okhttp.ConnectionSpec; import com.squareup.okhttp.TlsVersion; - import io.grpc.ManagedChannel; import io.grpc.internal.GrpcUtil; import io.grpc.netty.GrpcSslContexts; @@ -55,17 +53,14 @@ import io.netty.handler.ssl.SslContextBuilder; import io.netty.handler.ssl.SslProvider; import io.netty.handler.ssl.SupportedCipherSuiteFilter; - +import java.io.IOException; +import javax.net.ssl.SSLPeerUnverifiedException; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import java.io.IOException; - -import javax.net.ssl.SSLPeerUnverifiedException; - /** * Integration tests for GRPC over Http2 using the OkHttp framework. */ diff --git a/interop-testing/src/test/java/io/grpc/testing/integration/InProcessTest.java b/interop-testing/src/test/java/io/grpc/testing/integration/InProcessTest.java index d1db91a146a..dd6c494f957 100644 --- a/interop-testing/src/test/java/io/grpc/testing/integration/InProcessTest.java +++ b/interop-testing/src/test/java/io/grpc/testing/integration/InProcessTest.java @@ -34,7 +34,6 @@ import io.grpc.ManagedChannel; import io.grpc.inprocess.InProcessChannelBuilder; import io.grpc.inprocess.InProcessServerBuilder; - import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.runner.RunWith; diff --git a/interop-testing/src/test/java/io/grpc/testing/integration/MoreInProcessTest.java b/interop-testing/src/test/java/io/grpc/testing/integration/MoreInProcessTest.java index 48f982eccd2..23ccd6a5583 100644 --- a/interop-testing/src/test/java/io/grpc/testing/integration/MoreInProcessTest.java +++ b/interop-testing/src/test/java/io/grpc/testing/integration/MoreInProcessTest.java @@ -46,7 +46,9 @@ import io.grpc.testing.integration.Messages.StreamingInputCallResponse; import io.grpc.testing.integration.TestServiceGrpc.TestServiceImplBase; import io.grpc.util.MutableHandlerRegistry; - +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicReference; import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -55,10 +57,6 @@ import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicReference; - /** * Unit tests for {@link io.grpc.inprocess}. * Test more corner usecases, client not playing by the rules, server not playing by the rules, etc. diff --git a/interop-testing/src/test/java/io/grpc/testing/integration/NettyFlowControlTest.java b/interop-testing/src/test/java/io/grpc/testing/integration/NettyFlowControlTest.java index 3a1bcaebd96..e3594de81b7 100644 --- a/interop-testing/src/test/java/io/grpc/testing/integration/NettyFlowControlTest.java +++ b/interop-testing/src/test/java/io/grpc/testing/integration/NettyFlowControlTest.java @@ -34,7 +34,6 @@ import static org.junit.Assert.assertTrue; import com.google.common.collect.ImmutableList; - import io.grpc.ManagedChannel; import io.grpc.Server; import io.grpc.ServerBuilder; @@ -49,15 +48,6 @@ import io.grpc.testing.integration.Messages.StreamingOutputCallRequest; import io.grpc.testing.integration.Messages.StreamingOutputCallResponse; import io.netty.util.concurrent.DefaultThreadFactory; - -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - import java.io.IOException; import java.net.InetSocketAddress; import java.util.concurrent.CountDownLatch; @@ -65,6 +55,13 @@ import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; @RunWith(JUnit4.class) public class NettyFlowControlTest { diff --git a/interop-testing/src/test/java/io/grpc/testing/integration/ProxyTest.java b/interop-testing/src/test/java/io/grpc/testing/integration/ProxyTest.java index 952804a0c32..5dac0b32aab 100644 --- a/interop-testing/src/test/java/io/grpc/testing/integration/ProxyTest.java +++ b/interop-testing/src/test/java/io/grpc/testing/integration/ProxyTest.java @@ -34,13 +34,6 @@ import static org.junit.Assert.assertEquals; import io.netty.util.concurrent.DefaultThreadFactory; - -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; @@ -52,6 +45,11 @@ import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; @RunWith(JUnit4.class) public class ProxyTest { diff --git a/interop-testing/src/test/java/io/grpc/testing/integration/StressTestClientTest.java b/interop-testing/src/test/java/io/grpc/testing/integration/StressTestClientTest.java index f79134afac1..4e6000cbf4a 100644 --- a/interop-testing/src/test/java/io/grpc/testing/integration/StressTestClientTest.java +++ b/interop-testing/src/test/java/io/grpc/testing/integration/StressTestClientTest.java @@ -37,23 +37,20 @@ import static org.junit.Assert.assertTrue; import com.google.common.collect.ImmutableList; - import io.grpc.ManagedChannel; import io.grpc.ManagedChannelBuilder; import io.grpc.testing.integration.Metrics.EmptyMessage; import io.grpc.testing.integration.Metrics.GaugeResponse; import io.grpc.testing.integration.StressTestClient.TestCaseWeightPair; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - import java.net.InetSocketAddress; import java.util.Arrays; import java.util.List; import java.util.Set; import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.LockSupport; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** Unit tests for {@link StressTestClient}. */ @RunWith(JUnit4.class) diff --git a/interop-testing/src/test/java/io/grpc/testing/integration/TestCasesTest.java b/interop-testing/src/test/java/io/grpc/testing/integration/TestCasesTest.java index 90e10fc9495..fc4759265db 100644 --- a/interop-testing/src/test/java/io/grpc/testing/integration/TestCasesTest.java +++ b/interop-testing/src/test/java/io/grpc/testing/integration/TestCasesTest.java @@ -34,13 +34,12 @@ import static io.grpc.testing.integration.TestCases.fromString; import static org.junit.Assert.assertEquals; +import java.util.HashSet; +import java.util.Set; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import java.util.HashSet; -import java.util.Set; - /** * Unit tests for {@link TestCases}. */ diff --git a/interop-testing/src/test/java/io/grpc/testing/integration/TlsTest.java b/interop-testing/src/test/java/io/grpc/testing/integration/TlsTest.java index 30ff9e78ce1..9163943565f 100644 --- a/interop-testing/src/test/java/io/grpc/testing/integration/TlsTest.java +++ b/interop-testing/src/test/java/io/grpc/testing/integration/TlsTest.java @@ -37,7 +37,6 @@ import com.google.common.base.Throwables; import com.google.common.util.concurrent.MoreExecutors; import com.google.protobuf.EmptyProtos.Empty; - import io.grpc.ManagedChannel; import io.grpc.Server; import io.grpc.ServerBuilder; @@ -53,16 +52,6 @@ import io.netty.handler.ssl.SslContext; import io.netty.handler.ssl.SslContextBuilder; import io.netty.handler.ssl.SslProvider; - -import org.junit.After; -import org.junit.Assume; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; -import org.junit.runners.Parameterized.Parameter; -import org.junit.runners.Parameterized.Parameters; - import java.io.File; import java.io.IOException; import java.security.NoSuchAlgorithmException; @@ -71,8 +60,15 @@ import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; - import javax.net.ssl.SSLContext; +import org.junit.After; +import org.junit.Assume; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameter; +import org.junit.runners.Parameterized.Parameters; /** diff --git a/interop-testing/src/test/java/io/grpc/testing/integration/TrafficControlProxy.java b/interop-testing/src/test/java/io/grpc/testing/integration/TrafficControlProxy.java index 2eadf3c25a8..dcaa32d054f 100644 --- a/interop-testing/src/test/java/io/grpc/testing/integration/TrafficControlProxy.java +++ b/interop-testing/src/test/java/io/grpc/testing/integration/TrafficControlProxy.java @@ -34,7 +34,6 @@ import static com.google.common.base.Preconditions.checkArgument; import io.netty.util.concurrent.DefaultThreadFactory; - import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; diff --git a/interop-testing/src/test/java/io/grpc/testing/integration/TransportCompressionTest.java b/interop-testing/src/test/java/io/grpc/testing/integration/TransportCompressionTest.java index 8344e09e2b7..55a007e96bd 100644 --- a/interop-testing/src/test/java/io/grpc/testing/integration/TransportCompressionTest.java +++ b/interop-testing/src/test/java/io/grpc/testing/integration/TransportCompressionTest.java @@ -35,7 +35,6 @@ import static org.junit.Assert.assertTrue; import com.google.protobuf.ByteString; - import io.grpc.CallOptions; import io.grpc.Channel; import io.grpc.ClientCall; @@ -60,7 +59,11 @@ import io.grpc.testing.integration.Messages.PayloadType; import io.grpc.testing.integration.Messages.SimpleRequest; import io.grpc.testing.integration.Messages.SimpleResponse; - +import java.io.FilterInputStream; +import java.io.FilterOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; @@ -68,12 +71,6 @@ import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import java.io.FilterInputStream; -import java.io.FilterOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - /** * Tests that compression is turned on. */ diff --git a/netty/src/main/java/io/grpc/netty/AbstractHttp2Headers.java b/netty/src/main/java/io/grpc/netty/AbstractHttp2Headers.java index 2f1f2ddc228..3abe76b26ef 100644 --- a/netty/src/main/java/io/grpc/netty/AbstractHttp2Headers.java +++ b/netty/src/main/java/io/grpc/netty/AbstractHttp2Headers.java @@ -33,7 +33,6 @@ import io.netty.handler.codec.Headers; import io.netty.handler.codec.http2.Http2Headers; - import java.util.Iterator; import java.util.List; import java.util.Map.Entry; diff --git a/netty/src/main/java/io/grpc/netty/AbstractNettyHandler.java b/netty/src/main/java/io/grpc/netty/AbstractNettyHandler.java index 7c6f1eb9282..69759680264 100644 --- a/netty/src/main/java/io/grpc/netty/AbstractNettyHandler.java +++ b/netty/src/main/java/io/grpc/netty/AbstractNettyHandler.java @@ -37,7 +37,6 @@ import static java.util.concurrent.TimeUnit.SECONDS; import com.google.common.annotations.VisibleForTesting; - import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.http2.Http2ConnectionDecoder; @@ -46,7 +45,6 @@ import io.netty.handler.codec.http2.Http2LocalFlowController; import io.netty.handler.codec.http2.Http2Settings; import io.netty.handler.codec.http2.Http2Stream; - import java.util.concurrent.TimeUnit; /** diff --git a/netty/src/main/java/io/grpc/netty/CancelClientStreamCommand.java b/netty/src/main/java/io/grpc/netty/CancelClientStreamCommand.java index 16ed9ad6df5..249c724b2a7 100644 --- a/netty/src/main/java/io/grpc/netty/CancelClientStreamCommand.java +++ b/netty/src/main/java/io/grpc/netty/CancelClientStreamCommand.java @@ -32,7 +32,6 @@ package io.grpc.netty; import com.google.common.base.Preconditions; - import io.grpc.Status; /** diff --git a/netty/src/main/java/io/grpc/netty/CancelServerStreamCommand.java b/netty/src/main/java/io/grpc/netty/CancelServerStreamCommand.java index 420fd8f3ef0..bc27a379338 100644 --- a/netty/src/main/java/io/grpc/netty/CancelServerStreamCommand.java +++ b/netty/src/main/java/io/grpc/netty/CancelServerStreamCommand.java @@ -34,7 +34,6 @@ import com.google.common.base.MoreObjects; import com.google.common.base.Objects; import com.google.common.base.Preconditions; - import io.grpc.Status; /** diff --git a/netty/src/main/java/io/grpc/netty/CreateStreamCommand.java b/netty/src/main/java/io/grpc/netty/CreateStreamCommand.java index f524072384b..d79144e6387 100644 --- a/netty/src/main/java/io/grpc/netty/CreateStreamCommand.java +++ b/netty/src/main/java/io/grpc/netty/CreateStreamCommand.java @@ -32,7 +32,6 @@ package io.grpc.netty; import com.google.common.base.Preconditions; - import io.netty.handler.codec.http2.Http2Headers; /** diff --git a/netty/src/main/java/io/grpc/netty/GrpcHttp2HeadersDecoder.java b/netty/src/main/java/io/grpc/netty/GrpcHttp2HeadersDecoder.java index 2f166a56873..e910bf38dfc 100644 --- a/netty/src/main/java/io/grpc/netty/GrpcHttp2HeadersDecoder.java +++ b/netty/src/main/java/io/grpc/netty/GrpcHttp2HeadersDecoder.java @@ -54,7 +54,6 @@ import static io.netty.util.AsciiString.isUpperCase; import com.google.common.io.BaseEncoding; - import io.grpc.Metadata; import io.netty.buffer.ByteBuf; import io.netty.handler.codec.http2.DefaultHttp2HeadersDecoder; @@ -65,7 +64,6 @@ import io.netty.handler.codec.http2.internal.hpack.Decoder; import io.netty.util.AsciiString; import io.netty.util.internal.PlatformDependent; - import java.util.ArrayList; import java.util.Collections; import java.util.List; diff --git a/netty/src/main/java/io/grpc/netty/GrpcHttp2OutboundHeaders.java b/netty/src/main/java/io/grpc/netty/GrpcHttp2OutboundHeaders.java index d4fbfd6f95e..5314e93771c 100644 --- a/netty/src/main/java/io/grpc/netty/GrpcHttp2OutboundHeaders.java +++ b/netty/src/main/java/io/grpc/netty/GrpcHttp2OutboundHeaders.java @@ -33,7 +33,6 @@ import io.netty.handler.codec.http2.Http2Headers; import io.netty.util.AsciiString; - import java.util.Iterator; import java.util.Map.Entry; import java.util.NoSuchElementException; diff --git a/netty/src/main/java/io/grpc/netty/GrpcSslContexts.java b/netty/src/main/java/io/grpc/netty/GrpcSslContexts.java index 9598234c68f..a39925619c1 100644 --- a/netty/src/main/java/io/grpc/netty/GrpcSslContexts.java +++ b/netty/src/main/java/io/grpc/netty/GrpcSslContexts.java @@ -44,7 +44,6 @@ import io.netty.handler.ssl.SslContextBuilder; import io.netty.handler.ssl.SslProvider; import io.netty.handler.ssl.SupportedCipherSuiteFilter; - import java.io.File; import java.util.Arrays; import java.util.Collections; diff --git a/netty/src/main/java/io/grpc/netty/InternalNettyChannelBuilder.java b/netty/src/main/java/io/grpc/netty/InternalNettyChannelBuilder.java index f0d02d965c1..52ce0f5410c 100644 --- a/netty/src/main/java/io/grpc/netty/InternalNettyChannelBuilder.java +++ b/netty/src/main/java/io/grpc/netty/InternalNettyChannelBuilder.java @@ -32,7 +32,6 @@ package io.grpc.netty; import io.grpc.Internal; - import java.net.SocketAddress; /** diff --git a/netty/src/main/java/io/grpc/netty/NettyChannelBuilder.java b/netty/src/main/java/io/grpc/netty/NettyChannelBuilder.java index 2391e7090eb..3f35ed121a0 100644 --- a/netty/src/main/java/io/grpc/netty/NettyChannelBuilder.java +++ b/netty/src/main/java/io/grpc/netty/NettyChannelBuilder.java @@ -39,7 +39,6 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; - import io.grpc.Attributes; import io.grpc.ExperimentalApi; import io.grpc.NameResolver; @@ -53,13 +52,11 @@ import io.netty.channel.EventLoopGroup; import io.netty.channel.socket.nio.NioSocketChannel; import io.netty.handler.ssl.SslContext; - import java.net.InetSocketAddress; import java.net.SocketAddress; import java.util.HashMap; import java.util.Map; import java.util.concurrent.TimeUnit; - import javax.annotation.Nullable; import javax.net.ssl.SSLException; diff --git a/netty/src/main/java/io/grpc/netty/NettyClientHandler.java b/netty/src/main/java/io/grpc/netty/NettyClientHandler.java index d4d3bf5e1df..c2e5f8a1a91 100644 --- a/netty/src/main/java/io/grpc/netty/NettyClientHandler.java +++ b/netty/src/main/java/io/grpc/netty/NettyClientHandler.java @@ -38,7 +38,6 @@ import com.google.common.base.Preconditions; import com.google.common.base.Stopwatch; import com.google.common.base.Ticker; - import io.grpc.Attributes; import io.grpc.Metadata; import io.grpc.Status; @@ -80,12 +79,10 @@ import io.netty.handler.codec.http2.Http2StreamVisitor; import io.netty.handler.codec.http2.StreamBufferingEncoder; import io.netty.handler.logging.LogLevel; - import java.nio.channels.ClosedChannelException; import java.util.concurrent.Executor; import java.util.logging.Level; import java.util.logging.Logger; - import javax.annotation.Nullable; /** diff --git a/netty/src/main/java/io/grpc/netty/NettyClientStream.java b/netty/src/main/java/io/grpc/netty/NettyClientStream.java index 2b938f43f6b..ac96c78d6ab 100644 --- a/netty/src/main/java/io/grpc/netty/NettyClientStream.java +++ b/netty/src/main/java/io/grpc/netty/NettyClientStream.java @@ -48,7 +48,6 @@ import io.grpc.internal.Http2ClientStreamTransportState; import io.grpc.internal.StatsTraceContext; import io.grpc.internal.WritableBuffer; - import io.netty.buffer.ByteBuf; import io.netty.channel.Channel; import io.netty.channel.ChannelFuture; @@ -56,7 +55,6 @@ import io.netty.handler.codec.http2.Http2Headers; import io.netty.handler.codec.http2.Http2Stream; import io.netty.util.AsciiString; - import javax.annotation.Nullable; /** diff --git a/netty/src/main/java/io/grpc/netty/NettyClientTransport.java b/netty/src/main/java/io/grpc/netty/NettyClientTransport.java index 781474bea36..ce063f6c946 100644 --- a/netty/src/main/java/io/grpc/netty/NettyClientTransport.java +++ b/netty/src/main/java/io/grpc/netty/NettyClientTransport.java @@ -36,7 +36,6 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; import com.google.common.base.Ticker; - import io.grpc.Attributes; import io.grpc.CallOptions; import io.grpc.Metadata; @@ -59,12 +58,10 @@ import io.netty.channel.socket.nio.NioSocketChannel; import io.netty.handler.codec.http2.StreamBufferingEncoder.Http2ChannelClosedException; import io.netty.util.AsciiString; - import java.net.SocketAddress; import java.nio.channels.ClosedChannelException; import java.util.Map; import java.util.concurrent.Executor; - import javax.annotation.Nullable; /** diff --git a/netty/src/main/java/io/grpc/netty/NettyReadableBuffer.java b/netty/src/main/java/io/grpc/netty/NettyReadableBuffer.java index 521730df522..79d74f17a50 100644 --- a/netty/src/main/java/io/grpc/netty/NettyReadableBuffer.java +++ b/netty/src/main/java/io/grpc/netty/NettyReadableBuffer.java @@ -32,10 +32,8 @@ package io.grpc.netty; import com.google.common.base.Preconditions; - import io.grpc.internal.AbstractReadableBuffer; import io.netty.buffer.ByteBuf; - import java.io.IOException; import java.io.OutputStream; import java.nio.ByteBuffer; diff --git a/netty/src/main/java/io/grpc/netty/NettyServer.java b/netty/src/main/java/io/grpc/netty/NettyServer.java index a2e9b7306b0..d124e7a7e50 100644 --- a/netty/src/main/java/io/grpc/netty/NettyServer.java +++ b/netty/src/main/java/io/grpc/netty/NettyServer.java @@ -49,13 +49,11 @@ import io.netty.channel.socket.nio.NioServerSocketChannel; import io.netty.util.AbstractReferenceCounted; import io.netty.util.ReferenceCounted; - import java.io.IOException; import java.net.InetSocketAddress; import java.net.SocketAddress; import java.util.logging.Level; import java.util.logging.Logger; - import javax.annotation.Nullable; /** diff --git a/netty/src/main/java/io/grpc/netty/NettyServerBuilder.java b/netty/src/main/java/io/grpc/netty/NettyServerBuilder.java index 3102a90f2ed..3b8739fb13f 100644 --- a/netty/src/main/java/io/grpc/netty/NettyServerBuilder.java +++ b/netty/src/main/java/io/grpc/netty/NettyServerBuilder.java @@ -35,7 +35,6 @@ import static io.grpc.internal.GrpcUtil.DEFAULT_MAX_MESSAGE_SIZE; import com.google.common.base.Preconditions; - import io.grpc.ExperimentalApi; import io.grpc.Internal; import io.grpc.internal.AbstractServerImplBuilder; @@ -44,11 +43,9 @@ import io.netty.channel.ServerChannel; import io.netty.channel.socket.nio.NioServerSocketChannel; import io.netty.handler.ssl.SslContext; - import java.io.File; import java.net.InetSocketAddress; import java.net.SocketAddress; - import javax.annotation.Nullable; import javax.net.ssl.SSLException; diff --git a/netty/src/main/java/io/grpc/netty/NettyServerHandler.java b/netty/src/main/java/io/grpc/netty/NettyServerHandler.java index 2cddde674a4..e564fbb0175 100644 --- a/netty/src/main/java/io/grpc/netty/NettyServerHandler.java +++ b/netty/src/main/java/io/grpc/netty/NettyServerHandler.java @@ -41,7 +41,6 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; - import io.grpc.Attributes; import io.grpc.Grpc; import io.grpc.Metadata; @@ -80,7 +79,6 @@ import io.netty.handler.codec.http2.Http2StreamVisitor; import io.netty.handler.logging.LogLevel; import io.netty.util.ReferenceCountUtil; - import java.util.logging.Level; import java.util.logging.Logger; import javax.annotation.Nullable; diff --git a/netty/src/main/java/io/grpc/netty/NettyServerStream.java b/netty/src/main/java/io/grpc/netty/NettyServerStream.java index 0cf65c200ba..9d3cc77b955 100644 --- a/netty/src/main/java/io/grpc/netty/NettyServerStream.java +++ b/netty/src/main/java/io/grpc/netty/NettyServerStream.java @@ -45,7 +45,6 @@ import io.netty.channel.ChannelFutureListener; import io.netty.handler.codec.http2.Http2Headers; import io.netty.handler.codec.http2.Http2Stream; - import java.util.logging.Level; import java.util.logging.Logger; diff --git a/netty/src/main/java/io/grpc/netty/NettyServerTransport.java b/netty/src/main/java/io/grpc/netty/NettyServerTransport.java index c5a10171c81..52a8a31073a 100644 --- a/netty/src/main/java/io/grpc/netty/NettyServerTransport.java +++ b/netty/src/main/java/io/grpc/netty/NettyServerTransport.java @@ -32,7 +32,6 @@ package io.grpc.netty; import com.google.common.base.Preconditions; - import io.grpc.Status; import io.grpc.internal.LogId; import io.grpc.internal.ServerTransport; @@ -41,7 +40,6 @@ import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFutureListener; import io.netty.channel.ChannelHandler; - import java.util.logging.Level; import java.util.logging.Logger; diff --git a/netty/src/main/java/io/grpc/netty/ProtocolNegotiators.java b/netty/src/main/java/io/grpc/netty/ProtocolNegotiators.java index f2f4b8211ac..72c316d2edb 100644 --- a/netty/src/main/java/io/grpc/netty/ProtocolNegotiators.java +++ b/netty/src/main/java/io/grpc/netty/ProtocolNegotiators.java @@ -36,7 +36,6 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; - import io.grpc.Attributes; import io.grpc.Grpc; import io.grpc.Internal; @@ -62,7 +61,6 @@ import io.netty.handler.ssl.SslHandshakeCompletionEvent; import io.netty.util.AsciiString; import io.netty.util.ReferenceCountUtil; - import java.net.URI; import java.util.ArrayDeque; import java.util.Arrays; diff --git a/netty/src/main/java/io/grpc/netty/SendPingCommand.java b/netty/src/main/java/io/grpc/netty/SendPingCommand.java index 29cd29f166e..7fe4426a21e 100644 --- a/netty/src/main/java/io/grpc/netty/SendPingCommand.java +++ b/netty/src/main/java/io/grpc/netty/SendPingCommand.java @@ -32,7 +32,6 @@ package io.grpc.netty; import io.grpc.internal.ClientTransport.PingCallback; - import java.util.concurrent.Executor; /** diff --git a/netty/src/main/java/io/grpc/netty/SendResponseHeadersCommand.java b/netty/src/main/java/io/grpc/netty/SendResponseHeadersCommand.java index ae79936e279..b0a4ea4d93e 100644 --- a/netty/src/main/java/io/grpc/netty/SendResponseHeadersCommand.java +++ b/netty/src/main/java/io/grpc/netty/SendResponseHeadersCommand.java @@ -32,7 +32,6 @@ package io.grpc.netty; import com.google.common.base.Preconditions; - import io.netty.handler.codec.http2.Http2Headers; /** diff --git a/netty/src/main/java/io/grpc/netty/Utils.java b/netty/src/main/java/io/grpc/netty/Utils.java index 8ba58a49f7a..5546db394bb 100644 --- a/netty/src/main/java/io/grpc/netty/Utils.java +++ b/netty/src/main/java/io/grpc/netty/Utils.java @@ -39,7 +39,6 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; - import io.grpc.InternalMetadata; import io.grpc.Metadata; import io.grpc.Status; @@ -52,7 +51,6 @@ import io.netty.handler.codec.http2.Http2Headers; import io.netty.util.AsciiString; import io.netty.util.concurrent.DefaultThreadFactory; - import java.io.IOException; import java.nio.channels.ClosedChannelException; import java.util.Map; diff --git a/netty/src/main/java/io/grpc/netty/WriteQueue.java b/netty/src/main/java/io/grpc/netty/WriteQueue.java index 7c470e1e739..f909feb837a 100644 --- a/netty/src/main/java/io/grpc/netty/WriteQueue.java +++ b/netty/src/main/java/io/grpc/netty/WriteQueue.java @@ -33,11 +33,9 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; - import io.netty.channel.Channel; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelPromise; - import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.atomic.AtomicBoolean; diff --git a/netty/src/test/java/io/grpc/netty/AbstractHttp2HeadersTest.java b/netty/src/test/java/io/grpc/netty/AbstractHttp2HeadersTest.java index 57dae1f5cf1..6dad4bc07bd 100644 --- a/netty/src/test/java/io/grpc/netty/AbstractHttp2HeadersTest.java +++ b/netty/src/test/java/io/grpc/netty/AbstractHttp2HeadersTest.java @@ -35,16 +35,13 @@ import static org.junit.Assert.fail; import com.google.common.base.Defaults; - import io.netty.handler.codec.http2.Http2Headers; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** Unit tests for {@link AbstractHttp2Headers}. */ @RunWith(JUnit4.class) diff --git a/netty/src/test/java/io/grpc/netty/GrpcHttp2HeadersDecoderTest.java b/netty/src/test/java/io/grpc/netty/GrpcHttp2HeadersDecoderTest.java index 3196842457e..72304c6b926 100644 --- a/netty/src/test/java/io/grpc/netty/GrpcHttp2HeadersDecoderTest.java +++ b/netty/src/test/java/io/grpc/netty/GrpcHttp2HeadersDecoderTest.java @@ -48,7 +48,6 @@ import io.netty.handler.codec.http2.Http2HeadersDecoder; import io.netty.handler.codec.http2.Http2HeadersEncoder; import io.netty.handler.codec.http2.Http2HeadersEncoder.SensitivityDetector; - import org.junit.After; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/netty/src/test/java/io/grpc/netty/GrpcHttp2InboundHeadersTest.java b/netty/src/test/java/io/grpc/netty/GrpcHttp2InboundHeadersTest.java index 9d3e8fe5f64..971c23a9359 100644 --- a/netty/src/test/java/io/grpc/netty/GrpcHttp2InboundHeadersTest.java +++ b/netty/src/test/java/io/grpc/netty/GrpcHttp2InboundHeadersTest.java @@ -37,18 +37,16 @@ import static org.junit.Assert.assertEquals; import com.google.common.io.BaseEncoding; - import io.grpc.netty.GrpcHttp2HeadersDecoder.GrpcHttp2InboundHeaders; import io.grpc.netty.GrpcHttp2HeadersDecoder.GrpcHttp2RequestHeaders; import io.grpc.netty.GrpcHttp2HeadersDecoder.GrpcHttp2ResponseHeaders; import io.netty.handler.codec.http2.Http2Headers; import io.netty.util.AsciiString; +import java.util.Random; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import java.util.Random; - /** * Tests for {@link GrpcHttp2RequestHeaders} and {@link GrpcHttp2ResponseHeaders}. */ diff --git a/netty/src/test/java/io/grpc/netty/NettyChannelBuilderTest.java b/netty/src/test/java/io/grpc/netty/NettyChannelBuilderTest.java index d96d9745a2a..ca7c0f9d62b 100644 --- a/netty/src/test/java/io/grpc/netty/NettyChannelBuilderTest.java +++ b/netty/src/test/java/io/grpc/netty/NettyChannelBuilderTest.java @@ -38,18 +38,15 @@ import io.grpc.netty.InternalNettyChannelBuilder.OverrideAuthorityChecker; import io.grpc.netty.ProtocolNegotiators.TlsNegotiator; import io.netty.handler.ssl.SslContext; - +import java.net.InetSocketAddress; +import java.net.SocketAddress; +import javax.net.ssl.SSLException; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import java.net.InetSocketAddress; -import java.net.SocketAddress; - -import javax.net.ssl.SSLException; - @RunWith(JUnit4.class) public class NettyChannelBuilderTest { diff --git a/netty/src/test/java/io/grpc/netty/NettyChannelProviderTest.java b/netty/src/test/java/io/grpc/netty/NettyChannelProviderTest.java index b8fdeea295c..dbd034b633e 100644 --- a/netty/src/test/java/io/grpc/netty/NettyChannelProviderTest.java +++ b/netty/src/test/java/io/grpc/netty/NettyChannelProviderTest.java @@ -37,7 +37,6 @@ import static org.junit.Assert.fail; import io.grpc.ManagedChannelProvider; - import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; diff --git a/netty/src/test/java/io/grpc/netty/NettyClientHandlerTest.java b/netty/src/test/java/io/grpc/netty/NettyClientHandlerTest.java index 8976c1dc57d..df6260e5940 100644 --- a/netty/src/test/java/io/grpc/netty/NettyClientHandlerTest.java +++ b/netty/src/test/java/io/grpc/netty/NettyClientHandlerTest.java @@ -60,7 +60,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.io.ByteStreams; import com.google.common.util.concurrent.MoreExecutors; - import io.grpc.Metadata; import io.grpc.Status; import io.grpc.StatusException; @@ -87,7 +86,8 @@ import io.netty.handler.codec.http2.Http2Settings; import io.netty.handler.codec.http2.Http2Stream; import io.netty.util.AsciiString; - +import java.io.InputStream; +import java.util.List; import org.junit.Before; import org.junit.Ignore; import org.junit.Rule; @@ -99,9 +99,6 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import java.io.InputStream; -import java.util.List; - /** * Tests for {@link NettyClientHandler}. */ diff --git a/netty/src/test/java/io/grpc/netty/NettyClientStreamTest.java b/netty/src/test/java/io/grpc/netty/NettyClientStreamTest.java index 160f0fb2acf..136265d7c90 100644 --- a/netty/src/test/java/io/grpc/netty/NettyClientStreamTest.java +++ b/netty/src/test/java/io/grpc/netty/NettyClientStreamTest.java @@ -55,7 +55,6 @@ import static org.mockito.Mockito.when; import com.google.common.collect.ImmutableListMultimap; - import io.grpc.Metadata; import io.grpc.MethodDescriptor; import io.grpc.Status; @@ -70,7 +69,9 @@ import io.netty.handler.codec.http2.DefaultHttp2Headers; import io.netty.handler.codec.http2.Http2Headers; import io.netty.util.AsciiString; - +import java.io.BufferedInputStream; +import java.io.ByteArrayInputStream; +import java.io.InputStream; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -80,10 +81,6 @@ import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -import java.io.BufferedInputStream; -import java.io.ByteArrayInputStream; -import java.io.InputStream; - /** * Tests for {@link NettyClientStream}. */ diff --git a/netty/src/test/java/io/grpc/netty/NettyClientTransportTest.java b/netty/src/test/java/io/grpc/netty/NettyClientTransportTest.java index 035bc32003e..2a220b88141 100644 --- a/netty/src/test/java/io/grpc/netty/NettyClientTransportTest.java +++ b/netty/src/test/java/io/grpc/netty/NettyClientTransportTest.java @@ -44,7 +44,6 @@ import com.google.common.io.ByteStreams; import com.google.common.util.concurrent.SettableFuture; - import io.grpc.Attributes; import io.grpc.Attributes.Key; import io.grpc.Context; @@ -65,7 +64,6 @@ import io.grpc.internal.ServerTransportListener; import io.grpc.internal.StatsTraceContext; import io.grpc.testing.TestUtils; - import io.netty.channel.ChannelConfig; import io.netty.channel.ChannelOption; import io.netty.channel.nio.NioEventLoopGroup; @@ -76,15 +74,6 @@ import io.netty.handler.codec.http2.StreamBufferingEncoder; import io.netty.handler.ssl.SslContext; import io.netty.handler.ssl.SupportedCipherSuiteFilter; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; - import java.io.ByteArrayInputStream; import java.io.File; import java.io.IOException; @@ -98,6 +87,13 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; /** * Tests for {@link NettyClientTransport}. diff --git a/netty/src/test/java/io/grpc/netty/NettyHandlerTestBase.java b/netty/src/test/java/io/grpc/netty/NettyHandlerTestBase.java index fd3ef962f3e..8a82c38b0f4 100644 --- a/netty/src/test/java/io/grpc/netty/NettyHandlerTestBase.java +++ b/netty/src/test/java/io/grpc/netty/NettyHandlerTestBase.java @@ -64,7 +64,7 @@ import io.netty.handler.codec.http2.Http2LocalFlowController; import io.netty.handler.codec.http2.Http2Settings; import io.netty.handler.codec.http2.Http2Stream; - +import java.io.ByteArrayInputStream; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -72,8 +72,6 @@ import org.mockito.Mockito; import org.mockito.verification.VerificationMode; -import java.io.ByteArrayInputStream; - /** * Base class for Netty handler unit tests. */ diff --git a/netty/src/test/java/io/grpc/netty/NettyReadableBufferTest.java b/netty/src/test/java/io/grpc/netty/NettyReadableBufferTest.java index a57ae31bc5a..d426ee93f86 100644 --- a/netty/src/test/java/io/grpc/netty/NettyReadableBufferTest.java +++ b/netty/src/test/java/io/grpc/netty/NettyReadableBufferTest.java @@ -37,7 +37,6 @@ import io.grpc.internal.ReadableBuffer; import io.grpc.internal.ReadableBufferTestBase; import io.netty.buffer.Unpooled; - import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/netty/src/test/java/io/grpc/netty/NettyServerHandlerTest.java b/netty/src/test/java/io/grpc/netty/NettyServerHandlerTest.java index 134cf204676..3523d6bf000 100644 --- a/netty/src/test/java/io/grpc/netty/NettyServerHandlerTest.java +++ b/netty/src/test/java/io/grpc/netty/NettyServerHandlerTest.java @@ -53,7 +53,6 @@ import static org.mockito.Mockito.verifyNoMoreInteractions; import com.google.common.io.ByteStreams; - import io.grpc.Attributes; import io.grpc.Metadata; import io.grpc.Status; @@ -78,7 +77,7 @@ import io.netty.handler.codec.http2.Http2Settings; import io.netty.handler.codec.http2.Http2Stream; import io.netty.util.AsciiString; - +import java.io.InputStream; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; @@ -88,8 +87,6 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import java.io.InputStream; - /** * Unit tests for {@link NettyServerHandler}. */ diff --git a/netty/src/test/java/io/grpc/netty/NettyServerProviderTest.java b/netty/src/test/java/io/grpc/netty/NettyServerProviderTest.java index b1be645209b..16214ac016e 100644 --- a/netty/src/test/java/io/grpc/netty/NettyServerProviderTest.java +++ b/netty/src/test/java/io/grpc/netty/NettyServerProviderTest.java @@ -36,7 +36,6 @@ import static org.junit.Assert.assertTrue; import io.grpc.ServerProvider; - import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; diff --git a/netty/src/test/java/io/grpc/netty/NettyServerStreamTest.java b/netty/src/test/java/io/grpc/netty/NettyServerStreamTest.java index 58255d3d829..69d967d9c15 100644 --- a/netty/src/test/java/io/grpc/netty/NettyServerStreamTest.java +++ b/netty/src/test/java/io/grpc/netty/NettyServerStreamTest.java @@ -50,7 +50,6 @@ import com.google.common.collect.ImmutableListMultimap; import com.google.common.collect.ListMultimap; - import io.grpc.Attributes; import io.grpc.Metadata; import io.grpc.Status; @@ -62,7 +61,7 @@ import io.netty.channel.ChannelPromise; import io.netty.handler.codec.http2.DefaultHttp2Headers; import io.netty.util.AsciiString; - +import java.io.ByteArrayInputStream; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -72,8 +71,6 @@ import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -import java.io.ByteArrayInputStream; - /** Unit tests for {@link NettyServerStream}. */ @RunWith(JUnit4.class) public class NettyServerStreamTest extends NettyStreamTestBase { diff --git a/netty/src/test/java/io/grpc/netty/NettyServerTest.java b/netty/src/test/java/io/grpc/netty/NettyServerTest.java index ffc5c64e645..caa62de3aa3 100644 --- a/netty/src/test/java/io/grpc/netty/NettyServerTest.java +++ b/netty/src/test/java/io/grpc/netty/NettyServerTest.java @@ -37,13 +37,11 @@ import io.grpc.internal.ServerTransport; import io.grpc.internal.ServerTransportListener; import io.netty.channel.socket.nio.NioServerSocketChannel; - +import java.net.InetSocketAddress; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import java.net.InetSocketAddress; - @RunWith(JUnit4.class) public class NettyServerTest { diff --git a/netty/src/test/java/io/grpc/netty/NettyStreamTestBase.java b/netty/src/test/java/io/grpc/netty/NettyStreamTestBase.java index 061cfe5a9ea..d35b908593c 100644 --- a/netty/src/test/java/io/grpc/netty/NettyStreamTestBase.java +++ b/netty/src/test/java/io/grpc/netty/NettyStreamTestBase.java @@ -54,7 +54,10 @@ import io.netty.channel.DefaultChannelPromise; import io.netty.channel.EventLoop; import io.netty.handler.codec.http2.Http2Stream; - +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.concurrent.TimeUnit; import org.junit.Before; import org.junit.Test; import org.mockito.ArgumentCaptor; @@ -63,11 +66,6 @@ import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.concurrent.TimeUnit; - /** * Base class for Netty stream unit tests. */ diff --git a/netty/src/test/java/io/grpc/netty/NettyTestUtil.java b/netty/src/test/java/io/grpc/netty/NettyTestUtil.java index f378a055fc4..b8ee3bb6b44 100644 --- a/netty/src/test/java/io/grpc/netty/NettyTestUtil.java +++ b/netty/src/test/java/io/grpc/netty/NettyTestUtil.java @@ -34,10 +34,8 @@ import static io.netty.util.CharsetUtil.UTF_8; import com.google.common.io.ByteStreams; - import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; - import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.io.InputStream; diff --git a/netty/src/test/java/io/grpc/netty/NettyTransportTest.java b/netty/src/test/java/io/grpc/netty/NettyTransportTest.java index 123bd2349f8..630fe255ebb 100644 --- a/netty/src/test/java/io/grpc/netty/NettyTransportTest.java +++ b/netty/src/test/java/io/grpc/netty/NettyTransportTest.java @@ -35,15 +35,13 @@ import io.grpc.internal.InternalServer; import io.grpc.internal.ManagedClientTransport; import io.grpc.internal.testing.AbstractTransportTest; - +import java.net.InetSocketAddress; import org.junit.After; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import java.net.InetSocketAddress; - /** Unit tests for Netty transport. */ @RunWith(JUnit4.class) public class NettyTransportTest extends AbstractTransportTest { diff --git a/netty/src/test/java/io/grpc/netty/NettyWritableBufferAllocatorTest.java b/netty/src/test/java/io/grpc/netty/NettyWritableBufferAllocatorTest.java index d3e682737a5..5b6658f050d 100644 --- a/netty/src/test/java/io/grpc/netty/NettyWritableBufferAllocatorTest.java +++ b/netty/src/test/java/io/grpc/netty/NettyWritableBufferAllocatorTest.java @@ -37,7 +37,6 @@ import io.grpc.internal.WritableBufferAllocator; import io.grpc.internal.WritableBufferAllocatorTestBase; import io.netty.buffer.ByteBufAllocator; - import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; diff --git a/netty/src/test/java/io/grpc/netty/NettyWritableBufferTest.java b/netty/src/test/java/io/grpc/netty/NettyWritableBufferTest.java index 8353c5e7e05..ba69e962bfc 100644 --- a/netty/src/test/java/io/grpc/netty/NettyWritableBufferTest.java +++ b/netty/src/test/java/io/grpc/netty/NettyWritableBufferTest.java @@ -34,14 +34,12 @@ import io.grpc.internal.WritableBuffer; import io.grpc.internal.WritableBufferTestBase; import io.netty.buffer.Unpooled; - +import java.util.Arrays; import org.junit.After; import org.junit.Before; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import java.util.Arrays; - /** * Tests for {@link NettyWritableBuffer}. */ diff --git a/netty/src/test/java/io/grpc/netty/ProtocolNegotiatorsTest.java b/netty/src/test/java/io/grpc/netty/ProtocolNegotiatorsTest.java index 21d079e37dc..b533ce5a9bd 100644 --- a/netty/src/test/java/io/grpc/netty/ProtocolNegotiatorsTest.java +++ b/netty/src/test/java/io/grpc/netty/ProtocolNegotiatorsTest.java @@ -49,23 +49,20 @@ import io.netty.handler.ssl.SslHandler; import io.netty.handler.ssl.SslHandshakeCompletionEvent; import io.netty.handler.ssl.SupportedCipherSuiteFilter; - -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - import java.io.File; import java.util.logging.Filter; import java.util.logging.Level; import java.util.logging.LogRecord; import java.util.logging.Logger; - import javax.net.ssl.SSLContext; import javax.net.ssl.SSLEngine; import javax.net.ssl.SSLException; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; @RunWith(JUnit4.class) public class ProtocolNegotiatorsTest { diff --git a/netty/src/test/java/io/grpc/netty/UtilsTest.java b/netty/src/test/java/io/grpc/netty/UtilsTest.java index ec306d800fd..ce442b4ca1b 100644 --- a/netty/src/test/java/io/grpc/netty/UtilsTest.java +++ b/netty/src/test/java/io/grpc/netty/UtilsTest.java @@ -38,7 +38,6 @@ import io.netty.channel.ConnectTimeoutException; import io.netty.handler.codec.http2.Http2Error; import io.netty.handler.codec.http2.Http2Exception; - import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; diff --git a/netty/src/test/java/io/grpc/netty/WriteQueueTest.java b/netty/src/test/java/io/grpc/netty/WriteQueueTest.java index 8ab600f867b..6c2ab2c3d84 100644 --- a/netty/src/test/java/io/grpc/netty/WriteQueueTest.java +++ b/netty/src/test/java/io/grpc/netty/WriteQueueTest.java @@ -45,7 +45,8 @@ import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelPromise; import io.netty.channel.EventLoop; - +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.atomic.AtomicBoolean; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -56,9 +57,6 @@ import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.atomic.AtomicBoolean; - @RunWith(JUnit4.class) public class WriteQueueTest { diff --git a/okhttp/src/main/java/io/grpc/okhttp/AsyncFrameWriter.java b/okhttp/src/main/java/io/grpc/okhttp/AsyncFrameWriter.java index 9f5a9093e8e..0995a9226b9 100644 --- a/okhttp/src/main/java/io/grpc/okhttp/AsyncFrameWriter.java +++ b/okhttp/src/main/java/io/grpc/okhttp/AsyncFrameWriter.java @@ -32,20 +32,17 @@ package io.grpc.okhttp; import com.google.common.base.Preconditions; - import io.grpc.internal.SerializingExecutor; import io.grpc.okhttp.internal.framed.ErrorCode; import io.grpc.okhttp.internal.framed.FrameWriter; import io.grpc.okhttp.internal.framed.Header; import io.grpc.okhttp.internal.framed.Settings; - -import okio.Buffer; - import java.io.IOException; import java.net.Socket; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; +import okio.Buffer; class AsyncFrameWriter implements FrameWriter { private static final Logger log = Logger.getLogger(OkHttpClientTransport.class.getName()); diff --git a/okhttp/src/main/java/io/grpc/okhttp/Headers.java b/okhttp/src/main/java/io/grpc/okhttp/Headers.java index e532b6ea3be..e1f43b0b9d4 100644 --- a/okhttp/src/main/java/io/grpc/okhttp/Headers.java +++ b/okhttp/src/main/java/io/grpc/okhttp/Headers.java @@ -35,16 +35,13 @@ import static io.grpc.internal.GrpcUtil.USER_AGENT_KEY; import com.google.common.base.Preconditions; - import io.grpc.Metadata; import io.grpc.internal.GrpcUtil; import io.grpc.internal.TransportFrameUtil; import io.grpc.okhttp.internal.framed.Header; - -import okio.ByteString; - import java.util.ArrayList; import java.util.List; +import okio.ByteString; /** * Constants for request/response headers. diff --git a/okhttp/src/main/java/io/grpc/okhttp/OkHttpChannelBuilder.java b/okhttp/src/main/java/io/grpc/okhttp/OkHttpChannelBuilder.java index 0f4ea721969..3fa57db4a91 100644 --- a/okhttp/src/main/java/io/grpc/okhttp/OkHttpChannelBuilder.java +++ b/okhttp/src/main/java/io/grpc/okhttp/OkHttpChannelBuilder.java @@ -36,11 +36,9 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; - import com.squareup.okhttp.CipherSuite; import com.squareup.okhttp.ConnectionSpec; import com.squareup.okhttp.TlsVersion; - import io.grpc.Attributes; import io.grpc.ExperimentalApi; import io.grpc.Internal; @@ -52,7 +50,6 @@ import io.grpc.internal.SharedResourceHolder; import io.grpc.internal.SharedResourceHolder.Resource; import io.grpc.okhttp.internal.Platform; - import java.net.InetSocketAddress; import java.net.SocketAddress; import java.security.GeneralSecurityException; @@ -60,7 +57,6 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; - import javax.annotation.Nullable; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSocketFactory; diff --git a/okhttp/src/main/java/io/grpc/okhttp/OkHttpClientStream.java b/okhttp/src/main/java/io/grpc/okhttp/OkHttpClientStream.java index 10831ca9e95..3aad048ca14 100644 --- a/okhttp/src/main/java/io/grpc/okhttp/OkHttpClientStream.java +++ b/okhttp/src/main/java/io/grpc/okhttp/OkHttpClientStream.java @@ -45,14 +45,11 @@ import io.grpc.internal.WritableBuffer; import io.grpc.okhttp.internal.framed.ErrorCode; import io.grpc.okhttp.internal.framed.Header; - -import okio.Buffer; - import java.util.ArrayDeque; import java.util.List; import java.util.Queue; - import javax.annotation.concurrent.GuardedBy; +import okio.Buffer; /** * Client stream for the okhttp transport. diff --git a/okhttp/src/main/java/io/grpc/okhttp/OkHttpClientTransport.java b/okhttp/src/main/java/io/grpc/okhttp/OkHttpClientTransport.java index da4190b94cc..b1135d7b0b3 100644 --- a/okhttp/src/main/java/io/grpc/okhttp/OkHttpClientTransport.java +++ b/okhttp/src/main/java/io/grpc/okhttp/OkHttpClientTransport.java @@ -39,7 +39,6 @@ import com.google.common.base.Stopwatch; import com.google.common.base.Ticker; import com.google.common.util.concurrent.SettableFuture; - import io.grpc.Attributes; import io.grpc.CallOptions; import io.grpc.Metadata; @@ -64,15 +63,6 @@ import io.grpc.okhttp.internal.framed.Http2; import io.grpc.okhttp.internal.framed.Settings; import io.grpc.okhttp.internal.framed.Variant; - -import okio.Buffer; -import okio.BufferedSink; -import okio.BufferedSource; -import okio.ByteString; -import okio.Okio; -import okio.Source; -import okio.Timeout; - import java.io.IOException; import java.net.InetSocketAddress; import java.net.Socket; @@ -89,10 +79,16 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.logging.Level; import java.util.logging.Logger; - import javax.annotation.Nullable; import javax.annotation.concurrent.GuardedBy; import javax.net.ssl.SSLSocketFactory; +import okio.Buffer; +import okio.BufferedSink; +import okio.BufferedSource; +import okio.ByteString; +import okio.Okio; +import okio.Source; +import okio.Timeout; /** * A okhttp-based {@link ConnectionClientTransport} implementation. diff --git a/okhttp/src/main/java/io/grpc/okhttp/OkHttpProtocolNegotiator.java b/okhttp/src/main/java/io/grpc/okhttp/OkHttpProtocolNegotiator.java index b9ee439850a..b719ef6d932 100644 --- a/okhttp/src/main/java/io/grpc/okhttp/OkHttpProtocolNegotiator.java +++ b/okhttp/src/main/java/io/grpc/okhttp/OkHttpProtocolNegotiator.java @@ -34,18 +34,15 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.google.common.annotations.VisibleForTesting; - import io.grpc.okhttp.internal.OptionalMethod; import io.grpc.okhttp.internal.Platform; import io.grpc.okhttp.internal.Protocol; import io.grpc.okhttp.internal.Util; - import java.io.IOException; import java.net.Socket; import java.security.Provider; import java.security.Security; import java.util.List; - import javax.annotation.Nullable; import javax.net.ssl.SSLSocket; diff --git a/okhttp/src/main/java/io/grpc/okhttp/OkHttpReadableBuffer.java b/okhttp/src/main/java/io/grpc/okhttp/OkHttpReadableBuffer.java index fc99d594ee9..a1d77e17e94 100644 --- a/okhttp/src/main/java/io/grpc/okhttp/OkHttpReadableBuffer.java +++ b/okhttp/src/main/java/io/grpc/okhttp/OkHttpReadableBuffer.java @@ -33,7 +33,6 @@ import io.grpc.internal.AbstractReadableBuffer; import io.grpc.internal.ReadableBuffer; - import java.io.EOFException; import java.io.IOException; import java.io.OutputStream; diff --git a/okhttp/src/main/java/io/grpc/okhttp/OkHttpTlsUpgrader.java b/okhttp/src/main/java/io/grpc/okhttp/OkHttpTlsUpgrader.java index d9713a9178a..b98fd20b39a 100644 --- a/okhttp/src/main/java/io/grpc/okhttp/OkHttpTlsUpgrader.java +++ b/okhttp/src/main/java/io/grpc/okhttp/OkHttpTlsUpgrader.java @@ -33,11 +33,9 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; - import io.grpc.okhttp.internal.ConnectionSpec; import io.grpc.okhttp.internal.OkHostnameVerifier; import io.grpc.okhttp.internal.Protocol; - import java.io.IOException; import java.net.Socket; import java.util.Arrays; diff --git a/okhttp/src/main/java/io/grpc/okhttp/OkHttpWritableBuffer.java b/okhttp/src/main/java/io/grpc/okhttp/OkHttpWritableBuffer.java index 7bf3fa05b3d..98013f7ede9 100644 --- a/okhttp/src/main/java/io/grpc/okhttp/OkHttpWritableBuffer.java +++ b/okhttp/src/main/java/io/grpc/okhttp/OkHttpWritableBuffer.java @@ -32,7 +32,6 @@ package io.grpc.okhttp; import io.grpc.internal.WritableBuffer; - import okio.Buffer; class OkHttpWritableBuffer implements WritableBuffer { diff --git a/okhttp/src/main/java/io/grpc/okhttp/OutboundFlowController.java b/okhttp/src/main/java/io/grpc/okhttp/OutboundFlowController.java index b796df9be98..a6f0aae0207 100644 --- a/okhttp/src/main/java/io/grpc/okhttp/OutboundFlowController.java +++ b/okhttp/src/main/java/io/grpc/okhttp/OutboundFlowController.java @@ -38,16 +38,12 @@ import static java.lang.Math.min; import com.google.common.base.Preconditions; - import io.grpc.okhttp.internal.framed.FrameWriter; - -import okio.Buffer; - import java.io.IOException; import java.util.ArrayDeque; import java.util.Queue; - import javax.annotation.Nullable; +import okio.Buffer; /** * Simple outbound flow controller that evenly splits the connection window across all existing diff --git a/okhttp/src/main/java/io/grpc/okhttp/Utils.java b/okhttp/src/main/java/io/grpc/okhttp/Utils.java index d0c75cb8314..5742e8d6058 100644 --- a/okhttp/src/main/java/io/grpc/okhttp/Utils.java +++ b/okhttp/src/main/java/io/grpc/okhttp/Utils.java @@ -32,14 +32,12 @@ package io.grpc.okhttp; import com.google.common.base.Preconditions; - import io.grpc.InternalMetadata; import io.grpc.Metadata; import io.grpc.internal.TransportFrameUtil; import io.grpc.okhttp.internal.CipherSuite; import io.grpc.okhttp.internal.ConnectionSpec; import io.grpc.okhttp.internal.framed.Header; - import java.util.List; /** diff --git a/okhttp/src/test/java/io/grpc/okhttp/OkHttpChannelBuilderTest.java b/okhttp/src/test/java/io/grpc/okhttp/OkHttpChannelBuilderTest.java index 59b9e468818..1034b81d62d 100644 --- a/okhttp/src/test/java/io/grpc/okhttp/OkHttpChannelBuilderTest.java +++ b/okhttp/src/test/java/io/grpc/okhttp/OkHttpChannelBuilderTest.java @@ -36,18 +36,15 @@ import static org.junit.Assert.assertNull; import com.squareup.okhttp.ConnectionSpec; - import io.grpc.NameResolver; import io.grpc.internal.GrpcUtil; - +import java.net.InetSocketAddress; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import java.net.InetSocketAddress; - /** * Tests for {@link OkHttpChannelBuilder}. */ diff --git a/okhttp/src/test/java/io/grpc/okhttp/OkHttpChannelProviderTest.java b/okhttp/src/test/java/io/grpc/okhttp/OkHttpChannelProviderTest.java index dd43ada9981..868cc35237a 100644 --- a/okhttp/src/test/java/io/grpc/okhttp/OkHttpChannelProviderTest.java +++ b/okhttp/src/test/java/io/grpc/okhttp/OkHttpChannelProviderTest.java @@ -36,7 +36,6 @@ import static org.junit.Assert.fail; import io.grpc.ManagedChannelProvider; - import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; diff --git a/okhttp/src/test/java/io/grpc/okhttp/OkHttpClientStreamTest.java b/okhttp/src/test/java/io/grpc/okhttp/OkHttpClientStreamTest.java index 33f7fa96c39..73406327a2b 100644 --- a/okhttp/src/test/java/io/grpc/okhttp/OkHttpClientStreamTest.java +++ b/okhttp/src/test/java/io/grpc/okhttp/OkHttpClientStreamTest.java @@ -47,7 +47,9 @@ import io.grpc.internal.StatsTraceContext; import io.grpc.okhttp.internal.framed.ErrorCode; import io.grpc.okhttp.internal.framed.Header; - +import java.io.InputStream; +import java.util.List; +import java.util.concurrent.atomic.AtomicReference; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -60,10 +62,6 @@ import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -import java.io.InputStream; -import java.util.List; -import java.util.concurrent.atomic.AtomicReference; - @RunWith(JUnit4.class) public class OkHttpClientStreamTest { private static final int MAX_MESSAGE_SIZE = 100; diff --git a/okhttp/src/test/java/io/grpc/okhttp/OkHttpClientTransportTest.java b/okhttp/src/test/java/io/grpc/okhttp/OkHttpClientTransportTest.java index 5143ca28095..a4bd5c7704e 100644 --- a/okhttp/src/test/java/io/grpc/okhttp/OkHttpClientTransportTest.java +++ b/okhttp/src/test/java/io/grpc/okhttp/OkHttpClientTransportTest.java @@ -64,7 +64,6 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; - import io.grpc.Metadata; import io.grpc.MethodDescriptor; import io.grpc.MethodDescriptor.MethodType; @@ -85,21 +84,6 @@ import io.grpc.okhttp.internal.framed.HeadersMode; import io.grpc.okhttp.internal.framed.Settings; import io.grpc.testing.TestMethodDescriptors; - -import okio.Buffer; - -import org.junit.After; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.Timeout; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; -import org.mockito.ArgumentCaptor; -import org.mockito.Matchers; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; - import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.IOException; @@ -115,8 +99,19 @@ import java.util.concurrent.Executors; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; - import javax.annotation.Nullable; +import okio.Buffer; +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.Timeout; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.ArgumentCaptor; +import org.mockito.Matchers; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; /** * Tests for {@link OkHttpClientTransport}. diff --git a/okhttp/src/test/java/io/grpc/okhttp/OkHttpProtocolNegotiatorTest.java b/okhttp/src/test/java/io/grpc/okhttp/OkHttpProtocolNegotiatorTest.java index 969e5b521e3..451931642db 100644 --- a/okhttp/src/test/java/io/grpc/okhttp/OkHttpProtocolNegotiatorTest.java +++ b/okhttp/src/test/java/io/grpc/okhttp/OkHttpProtocolNegotiatorTest.java @@ -41,12 +41,17 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableList; - import io.grpc.okhttp.OkHttpProtocolNegotiator.AndroidNegotiator; import io.grpc.okhttp.OkHttpProtocolNegotiator.AndroidNegotiator.TlsExtensionType; import io.grpc.okhttp.internal.Platform; import io.grpc.okhttp.internal.Protocol; - +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.security.Provider; +import java.security.Security; +import javax.net.ssl.HandshakeCompletedListener; +import javax.net.ssl.SSLSession; +import javax.net.ssl.SSLSocket; import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -56,15 +61,6 @@ import org.junit.runners.JUnit4; import org.mockito.Mockito; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.security.Provider; -import java.security.Security; - -import javax.net.ssl.HandshakeCompletedListener; -import javax.net.ssl.SSLSession; -import javax.net.ssl.SSLSocket; - /** * Tests for {@link OkHttpProtocolNegotiator}. */ diff --git a/okhttp/src/test/java/io/grpc/okhttp/OkHttpReadableBufferTest.java b/okhttp/src/test/java/io/grpc/okhttp/OkHttpReadableBufferTest.java index 9cef89c83c3..d3095afb9f0 100644 --- a/okhttp/src/test/java/io/grpc/okhttp/OkHttpReadableBufferTest.java +++ b/okhttp/src/test/java/io/grpc/okhttp/OkHttpReadableBufferTest.java @@ -33,9 +33,7 @@ import io.grpc.internal.ReadableBuffer; import io.grpc.internal.ReadableBufferTestBase; - import okio.Buffer; - import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/okhttp/src/test/java/io/grpc/okhttp/OkHttpTransportTest.java b/okhttp/src/test/java/io/grpc/okhttp/OkHttpTransportTest.java index 7a46f3cf400..a2226b01143 100644 --- a/okhttp/src/test/java/io/grpc/okhttp/OkHttpTransportTest.java +++ b/okhttp/src/test/java/io/grpc/okhttp/OkHttpTransportTest.java @@ -37,15 +37,13 @@ import io.grpc.internal.ManagedClientTransport; import io.grpc.internal.testing.AbstractTransportTest; import io.grpc.netty.NettyServerBuilder; - +import java.net.InetSocketAddress; import org.junit.After; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import java.net.InetSocketAddress; - /** Unit tests for OkHttp transport. */ @RunWith(JUnit4.class) public class OkHttpTransportTest extends AbstractTransportTest { diff --git a/okhttp/src/test/java/io/grpc/okhttp/OkHttpWritableBufferAllocatorTest.java b/okhttp/src/test/java/io/grpc/okhttp/OkHttpWritableBufferAllocatorTest.java index 49560f3bc9d..10576488470 100644 --- a/okhttp/src/test/java/io/grpc/okhttp/OkHttpWritableBufferAllocatorTest.java +++ b/okhttp/src/test/java/io/grpc/okhttp/OkHttpWritableBufferAllocatorTest.java @@ -36,7 +36,6 @@ import io.grpc.internal.WritableBuffer; import io.grpc.internal.WritableBufferAllocator; import io.grpc.internal.WritableBufferAllocatorTestBase; - import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; diff --git a/okhttp/src/test/java/io/grpc/okhttp/UtilsTest.java b/okhttp/src/test/java/io/grpc/okhttp/UtilsTest.java index d0f78835620..5907fb2fee1 100644 --- a/okhttp/src/test/java/io/grpc/okhttp/UtilsTest.java +++ b/okhttp/src/test/java/io/grpc/okhttp/UtilsTest.java @@ -37,15 +37,13 @@ import io.grpc.okhttp.internal.CipherSuite; import io.grpc.okhttp.internal.ConnectionSpec; import io.grpc.okhttp.internal.TlsVersion; - +import java.util.List; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import java.util.List; - /** * Tests for {@link Utils}. */ diff --git a/protobuf-lite/src/main/java/io/grpc/protobuf/lite/ProtoInputStream.java b/protobuf-lite/src/main/java/io/grpc/protobuf/lite/ProtoInputStream.java index b2e4282f525..f4fe781e4d6 100644 --- a/protobuf-lite/src/main/java/io/grpc/protobuf/lite/ProtoInputStream.java +++ b/protobuf-lite/src/main/java/io/grpc/protobuf/lite/ProtoInputStream.java @@ -35,15 +35,12 @@ import com.google.protobuf.CodedOutputStream; import com.google.protobuf.MessageLite; import com.google.protobuf.Parser; - import io.grpc.Drainable; import io.grpc.KnownLength; - import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; - import javax.annotation.Nullable; /** diff --git a/protobuf-lite/src/main/java/io/grpc/protobuf/lite/ProtoLiteUtils.java b/protobuf-lite/src/main/java/io/grpc/protobuf/lite/ProtoLiteUtils.java index 05db39db7f3..fd8aad5261b 100644 --- a/protobuf-lite/src/main/java/io/grpc/protobuf/lite/ProtoLiteUtils.java +++ b/protobuf-lite/src/main/java/io/grpc/protobuf/lite/ProtoLiteUtils.java @@ -38,7 +38,6 @@ import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.MessageLite; import com.google.protobuf.Parser; - import io.grpc.ExperimentalApi; import io.grpc.KnownLength; import io.grpc.Metadata; @@ -46,7 +45,6 @@ import io.grpc.MethodDescriptor.PrototypeMarshaller; import io.grpc.Status; import io.grpc.internal.GrpcUtil; - import java.io.IOException; import java.io.InputStream; import java.lang.ref.Reference; diff --git a/protobuf-lite/src/test/java/io/grpc/protobuf/lite/ProtoLiteUtilsTest.java b/protobuf-lite/src/test/java/io/grpc/protobuf/lite/ProtoLiteUtilsTest.java index 612300006db..7c88ee92e30 100644 --- a/protobuf-lite/src/test/java/io/grpc/protobuf/lite/ProtoLiteUtilsTest.java +++ b/protobuf-lite/src/test/java/io/grpc/protobuf/lite/ProtoLiteUtilsTest.java @@ -43,25 +43,22 @@ import com.google.protobuf.Enum; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.Type; - import io.grpc.Drainable; import io.grpc.Metadata; import io.grpc.MethodDescriptor.Marshaller; import io.grpc.MethodDescriptor.PrototypeMarshaller; import io.grpc.Status; import io.grpc.StatusRuntimeException; - -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.Arrays; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** Unit tests for {@link ProtoLiteUtils}. */ @RunWith(JUnit4.class) diff --git a/protobuf-nano/src/main/java/io/grpc/protobuf/nano/NanoProtoInputStream.java b/protobuf-nano/src/main/java/io/grpc/protobuf/nano/NanoProtoInputStream.java index 1188324141e..a5375255da4 100644 --- a/protobuf-nano/src/main/java/io/grpc/protobuf/nano/NanoProtoInputStream.java +++ b/protobuf-nano/src/main/java/io/grpc/protobuf/nano/NanoProtoInputStream.java @@ -33,13 +33,10 @@ import com.google.protobuf.nano.CodedOutputByteBufferNano; import com.google.protobuf.nano.MessageNano; - import io.grpc.KnownLength; - import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; - import javax.annotation.Nullable; /** diff --git a/protobuf-nano/src/main/java/io/grpc/protobuf/nano/NanoUtils.java b/protobuf-nano/src/main/java/io/grpc/protobuf/nano/NanoUtils.java index 43c4b107992..47f98b82eaf 100644 --- a/protobuf-nano/src/main/java/io/grpc/protobuf/nano/NanoUtils.java +++ b/protobuf-nano/src/main/java/io/grpc/protobuf/nano/NanoUtils.java @@ -34,10 +34,8 @@ import com.google.common.io.ByteStreams; import com.google.protobuf.nano.CodedInputByteBufferNano; import com.google.protobuf.nano.MessageNano; - import io.grpc.MethodDescriptor.Marshaller; import io.grpc.Status; - import java.io.IOException; import java.io.InputStream; diff --git a/protobuf-nano/src/test/java/io/grpc/protobuf/nano/NanoUtilsTest.java b/protobuf-nano/src/test/java/io/grpc/protobuf/nano/NanoUtilsTest.java index 2a1b3c4a39d..f188781be71 100644 --- a/protobuf-nano/src/test/java/io/grpc/protobuf/nano/NanoUtilsTest.java +++ b/protobuf-nano/src/test/java/io/grpc/protobuf/nano/NanoUtilsTest.java @@ -39,19 +39,16 @@ import com.google.protobuf.nano.InvalidProtocolBufferNanoException; import com.google.protobuf.nano.MessageNano; - import io.grpc.MethodDescriptor.Marshaller; import io.grpc.Status; import io.grpc.StatusRuntimeException; import io.grpc.protobuf.nano.Messages.Message; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** Unit tests for {@link NanoUtils}. */ @RunWith(JUnit4.class) diff --git a/protobuf/src/main/java/io/grpc/protobuf/ProtoUtils.java b/protobuf/src/main/java/io/grpc/protobuf/ProtoUtils.java index 4b0322bd9ac..a49dc8285a0 100644 --- a/protobuf/src/main/java/io/grpc/protobuf/ProtoUtils.java +++ b/protobuf/src/main/java/io/grpc/protobuf/ProtoUtils.java @@ -37,13 +37,11 @@ import com.google.protobuf.util.JsonFormat; import com.google.protobuf.util.JsonFormat.Parser; import com.google.protobuf.util.JsonFormat.Printer; - import io.grpc.ExperimentalApi; import io.grpc.Metadata; import io.grpc.MethodDescriptor.Marshaller; import io.grpc.Status; import io.grpc.protobuf.lite.ProtoLiteUtils; - import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; diff --git a/protobuf/src/test/java/io/grpc/protobuf/ProtoUtilsTest.java b/protobuf/src/test/java/io/grpc/protobuf/ProtoUtilsTest.java index 86d305b393b..540b9923eab 100644 --- a/protobuf/src/test/java/io/grpc/protobuf/ProtoUtilsTest.java +++ b/protobuf/src/test/java/io/grpc/protobuf/ProtoUtilsTest.java @@ -37,20 +37,17 @@ import com.google.common.io.ByteStreams; import com.google.protobuf.Type; - import io.grpc.MethodDescriptor.Marshaller; import io.grpc.Status; import io.grpc.StatusRuntimeException; - +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; - /** Unit tests for {@link ProtoUtils}. */ @RunWith(JUnit4.class) public class ProtoUtilsTest { diff --git a/services/src/main/java/io/grpc/protobuf/service/ProtoReflectionService.java b/services/src/main/java/io/grpc/protobuf/service/ProtoReflectionService.java index 710bf3225ba..89941d87598 100644 --- a/services/src/main/java/io/grpc/protobuf/service/ProtoReflectionService.java +++ b/services/src/main/java/io/grpc/protobuf/service/ProtoReflectionService.java @@ -39,7 +39,6 @@ import com.google.protobuf.Descriptors.FileDescriptor; import com.google.protobuf.Descriptors.MethodDescriptor; import com.google.protobuf.Descriptors.ServiceDescriptor; - import io.grpc.BindableService; import io.grpc.ExperimentalApi; import io.grpc.InternalNotifyOnServerBuild; @@ -58,7 +57,6 @@ import io.grpc.reflection.v1alpha.ServiceResponse; import io.grpc.stub.ServerCallStreamObserver; import io.grpc.stub.StreamObserver; - import java.util.Collections; import java.util.HashMap; import java.util.HashSet; @@ -67,7 +65,6 @@ import java.util.Map; import java.util.Queue; import java.util.Set; - import javax.annotation.Nullable; import javax.annotation.concurrent.GuardedBy; diff --git a/services/src/main/java/io/grpc/services/HealthServiceImpl.java b/services/src/main/java/io/grpc/services/HealthServiceImpl.java index 66b01420788..1229380e759 100644 --- a/services/src/main/java/io/grpc/services/HealthServiceImpl.java +++ b/services/src/main/java/io/grpc/services/HealthServiceImpl.java @@ -38,10 +38,8 @@ import io.grpc.health.v1.HealthCheckResponse.ServingStatus; import io.grpc.health.v1.HealthGrpc; import io.grpc.stub.StreamObserver; - import java.util.Map; import java.util.concurrent.ConcurrentHashMap; - import javax.annotation.Nullable; diff --git a/services/src/test/java/io/grpc/protobuf/service/ProtoReflectionServiceTest.java b/services/src/test/java/io/grpc/protobuf/service/ProtoReflectionServiceTest.java index 7a41b7dbcc3..5c4e8141bd2 100644 --- a/services/src/test/java/io/grpc/protobuf/service/ProtoReflectionServiceTest.java +++ b/services/src/test/java/io/grpc/protobuf/service/ProtoReflectionServiceTest.java @@ -37,7 +37,6 @@ import static org.junit.Assert.fail; import com.google.protobuf.ByteString; - import io.grpc.BindableService; import io.grpc.ManagedChannel; import io.grpc.Server; @@ -64,18 +63,16 @@ import io.grpc.stub.StreamObserver; import io.grpc.testing.StreamRecorder; import io.grpc.util.MutableHandlerRegistry; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Set; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Tests for {@link ProtoReflectionService}. diff --git a/services/src/test/java/io/grpc/services/HealthStatusManagerTest.java b/services/src/test/java/io/grpc/services/HealthStatusManagerTest.java index 7544fd5684b..dfa5eff41e3 100644 --- a/services/src/test/java/io/grpc/services/HealthStatusManagerTest.java +++ b/services/src/test/java/io/grpc/services/HealthStatusManagerTest.java @@ -45,7 +45,6 @@ import io.grpc.health.v1.HealthCheckResponse; import io.grpc.health.v1.HealthGrpc; import io.grpc.stub.StreamObserver; - import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; diff --git a/stub/src/main/java/io/grpc/stub/AbstractStub.java b/stub/src/main/java/io/grpc/stub/AbstractStub.java index 9cb80bff6d7..0c9319fe671 100644 --- a/stub/src/main/java/io/grpc/stub/AbstractStub.java +++ b/stub/src/main/java/io/grpc/stub/AbstractStub.java @@ -41,9 +41,7 @@ import io.grpc.Deadline; import io.grpc.ExperimentalApi; import io.grpc.ManagedChannelBuilder; - import java.util.concurrent.TimeUnit; - import javax.annotation.Nullable; /** diff --git a/stub/src/main/java/io/grpc/stub/ClientCalls.java b/stub/src/main/java/io/grpc/stub/ClientCalls.java index 2826de528b8..877cc25518f 100644 --- a/stub/src/main/java/io/grpc/stub/ClientCalls.java +++ b/stub/src/main/java/io/grpc/stub/ClientCalls.java @@ -36,7 +36,6 @@ import com.google.common.base.Preconditions; import com.google.common.util.concurrent.AbstractFuture; import com.google.common.util.concurrent.ListenableFuture; - import io.grpc.CallOptions; import io.grpc.Channel; import io.grpc.ClientCall; @@ -45,7 +44,6 @@ import io.grpc.Status; import io.grpc.StatusException; import io.grpc.StatusRuntimeException; - import java.util.Iterator; import java.util.NoSuchElementException; import java.util.concurrent.ArrayBlockingQueue; @@ -56,7 +54,6 @@ import java.util.concurrent.LinkedBlockingQueue; import java.util.logging.Level; import java.util.logging.Logger; - import javax.annotation.Nullable; /** diff --git a/stub/src/main/java/io/grpc/stub/MetadataUtils.java b/stub/src/main/java/io/grpc/stub/MetadataUtils.java index 9c561c7fb7a..3b7e7d7f214 100644 --- a/stub/src/main/java/io/grpc/stub/MetadataUtils.java +++ b/stub/src/main/java/io/grpc/stub/MetadataUtils.java @@ -41,7 +41,6 @@ import io.grpc.Metadata; import io.grpc.MethodDescriptor; import io.grpc.Status; - import java.util.concurrent.atomic.AtomicReference; /** diff --git a/stub/src/main/java/io/grpc/stub/StreamObservers.java b/stub/src/main/java/io/grpc/stub/StreamObservers.java index d377453a190..20a6d0d19bd 100644 --- a/stub/src/main/java/io/grpc/stub/StreamObservers.java +++ b/stub/src/main/java/io/grpc/stub/StreamObservers.java @@ -32,9 +32,7 @@ package io.grpc.stub; import com.google.common.base.Preconditions; - import io.grpc.ExperimentalApi; - import java.util.Iterator; /** diff --git a/stub/src/test/java/io/grpc/stub/AbstractStubTest.java b/stub/src/test/java/io/grpc/stub/AbstractStubTest.java index fa7e790ebd7..1300629be4d 100644 --- a/stub/src/test/java/io/grpc/stub/AbstractStubTest.java +++ b/stub/src/test/java/io/grpc/stub/AbstractStubTest.java @@ -36,7 +36,6 @@ import io.grpc.CallOptions; import io.grpc.Channel; - import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/stub/src/test/java/io/grpc/stub/ClientCallsTest.java b/stub/src/test/java/io/grpc/stub/ClientCallsTest.java index 624dd454947..396c0991510 100644 --- a/stub/src/test/java/io/grpc/stub/ClientCallsTest.java +++ b/stub/src/test/java/io/grpc/stub/ClientCallsTest.java @@ -40,7 +40,6 @@ import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; - import io.grpc.CallOptions; import io.grpc.ClientCall; import io.grpc.ManagedChannel; @@ -56,14 +55,6 @@ import io.grpc.stub.ServerCalls.NoopStreamObserver; import io.grpc.stub.ServerCallsTest.IntegerMarshaller; import io.grpc.testing.NoopClientCall; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; -import org.mockito.MockitoAnnotations; - import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; @@ -74,6 +65,12 @@ import java.util.concurrent.Semaphore; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.mockito.MockitoAnnotations; /** * Unit tests for {@link ClientCalls}. diff --git a/stub/src/test/java/io/grpc/stub/ServerCallsTest.java b/stub/src/test/java/io/grpc/stub/ServerCallsTest.java index 1378ef2b187..9527240d152 100644 --- a/stub/src/test/java/io/grpc/stub/ServerCallsTest.java +++ b/stub/src/test/java/io/grpc/stub/ServerCallsTest.java @@ -50,11 +50,6 @@ import io.grpc.Status; import io.grpc.inprocess.InProcessChannelBuilder; import io.grpc.inprocess.InProcessServerBuilder; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.DataInputStream; @@ -69,6 +64,9 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** diff --git a/testing/src/main/java/io/grpc/internal/testing/AbstractClientTransportFactoryTest.java b/testing/src/main/java/io/grpc/internal/testing/AbstractClientTransportFactoryTest.java index ce11d2d83a2..57c0274d928 100644 --- a/testing/src/main/java/io/grpc/internal/testing/AbstractClientTransportFactoryTest.java +++ b/testing/src/main/java/io/grpc/internal/testing/AbstractClientTransportFactoryTest.java @@ -32,12 +32,11 @@ package io.grpc.internal.testing; import io.grpc.internal.ClientTransportFactory; +import java.net.InetSocketAddress; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import java.net.InetSocketAddress; - @RunWith(JUnit4.class) public abstract class AbstractClientTransportFactoryTest { diff --git a/testing/src/main/java/io/grpc/internal/testing/AbstractTransportTest.java b/testing/src/main/java/io/grpc/internal/testing/AbstractTransportTest.java index 9fe1320d096..7fad92173fa 100644 --- a/testing/src/main/java/io/grpc/internal/testing/AbstractTransportTest.java +++ b/testing/src/main/java/io/grpc/internal/testing/AbstractTransportTest.java @@ -56,7 +56,6 @@ import com.google.common.io.ByteStreams; import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; - import io.grpc.Attributes; import io.grpc.Grpc; import io.grpc.Metadata; @@ -73,7 +72,15 @@ import io.grpc.internal.ServerTransport; import io.grpc.internal.ServerTransportListener; import io.grpc.internal.StatsTraceContext; - +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Future; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -87,16 +94,6 @@ import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; - /** Standard unit tests for {@link ClientTransport}s and {@link ServerTransport}s. */ @RunWith(JUnit4.class) public abstract class AbstractTransportTest { diff --git a/testing/src/main/java/io/grpc/internal/testing/StatsTestUtils.java b/testing/src/main/java/io/grpc/internal/testing/StatsTestUtils.java index 199b5bd2ec8..2d1f5985af5 100644 --- a/testing/src/main/java/io/grpc/internal/testing/StatsTestUtils.java +++ b/testing/src/main/java/io/grpc/internal/testing/StatsTestUtils.java @@ -42,16 +42,13 @@ import com.google.instrumentation.stats.StatsContextFactory; import com.google.instrumentation.stats.TagKey; import com.google.instrumentation.stats.TagValue; - import io.grpc.internal.IoUtils; - import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; - import javax.annotation.Nullable; public class StatsTestUtils { diff --git a/testing/src/main/java/io/grpc/testing/DeadlineSubject.java b/testing/src/main/java/io/grpc/testing/DeadlineSubject.java index ba436eb1399..fa7b4f603e0 100644 --- a/testing/src/main/java/io/grpc/testing/DeadlineSubject.java +++ b/testing/src/main/java/io/grpc/testing/DeadlineSubject.java @@ -37,12 +37,9 @@ import com.google.common.truth.ComparableSubject; import com.google.common.truth.FailureStrategy; import com.google.common.truth.SubjectFactory; - import io.grpc.Deadline; - import java.math.BigInteger; import java.util.concurrent.TimeUnit; - import javax.annotation.CheckReturnValue; import javax.annotation.Nullable; diff --git a/testing/src/main/java/io/grpc/testing/GrpcServerRule.java b/testing/src/main/java/io/grpc/testing/GrpcServerRule.java index 8f8ccfc37ac..9fcca658dce 100644 --- a/testing/src/main/java/io/grpc/testing/GrpcServerRule.java +++ b/testing/src/main/java/io/grpc/testing/GrpcServerRule.java @@ -40,12 +40,10 @@ import io.grpc.inprocess.InProcessServerBuilder; import io.grpc.stub.AbstractStub; import io.grpc.util.MutableHandlerRegistry; - -import org.junit.rules.ExternalResource; -import org.junit.rules.TestRule; - import java.util.UUID; import java.util.concurrent.TimeUnit; +import org.junit.rules.ExternalResource; +import org.junit.rules.TestRule; /** * {@code GrpcServerRule} is a JUnit {@link TestRule} that starts an in-process gRPC service with diff --git a/testing/src/main/java/io/grpc/testing/StreamRecorder.java b/testing/src/main/java/io/grpc/testing/StreamRecorder.java index 8a4c4a4e379..847f88a7378 100644 --- a/testing/src/main/java/io/grpc/testing/StreamRecorder.java +++ b/testing/src/main/java/io/grpc/testing/StreamRecorder.java @@ -33,16 +33,13 @@ import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; - import io.grpc.ExperimentalApi; import io.grpc.stub.StreamObserver; - import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; - import javax.annotation.Nullable; /** diff --git a/testing/src/main/java/io/grpc/testing/TestMethodDescriptors.java b/testing/src/main/java/io/grpc/testing/TestMethodDescriptors.java index 29bb24c2773..5f2127a6fe7 100644 --- a/testing/src/main/java/io/grpc/testing/TestMethodDescriptors.java +++ b/testing/src/main/java/io/grpc/testing/TestMethodDescriptors.java @@ -34,7 +34,6 @@ import io.grpc.ExperimentalApi; import io.grpc.MethodDescriptor; import io.grpc.MethodDescriptor.MethodType; - import java.io.ByteArrayInputStream; import java.io.InputStream; diff --git a/testing/src/main/java/io/grpc/testing/TestUtils.java b/testing/src/main/java/io/grpc/testing/TestUtils.java index e4c26c3f312..08737442f63 100644 --- a/testing/src/main/java/io/grpc/testing/TestUtils.java +++ b/testing/src/main/java/io/grpc/testing/TestUtils.java @@ -36,7 +36,6 @@ import io.grpc.ServerCall; import io.grpc.ServerCallHandler; import io.grpc.ServerInterceptor; - import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; @@ -58,7 +57,6 @@ import java.util.Collections; import java.util.List; import java.util.concurrent.atomic.AtomicReference; - import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSocketFactory; import javax.net.ssl.TrustManagerFactory; diff --git a/testing/src/test/java/io/grpc/testing/GrpcServerRuleTest.java b/testing/src/test/java/io/grpc/testing/GrpcServerRuleTest.java index 89171bd07d4..61caec79993 100644 --- a/testing/src/test/java/io/grpc/testing/GrpcServerRuleTest.java +++ b/testing/src/test/java/io/grpc/testing/GrpcServerRuleTest.java @@ -35,20 +35,17 @@ import com.google.protobuf.ByteString; import com.google.protobuf.EmptyProtos; - import io.grpc.ManagedChannel; import io.grpc.Server; import io.grpc.stub.StreamObserver; import io.grpc.testing.integration.Messages; import io.grpc.testing.integration.TestServiceGrpc; - -import org.junit.Rule; -import org.junit.Test; -import org.junit.runners.model.Statement; - import java.util.Collection; import java.util.UUID; import java.util.concurrent.ConcurrentLinkedQueue; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runners.model.Statement; public class GrpcServerRuleTest { diff --git a/thrift/src/main/java/io/grpc/thrift/MessageFactory.java b/thrift/src/main/java/io/grpc/thrift/MessageFactory.java index d2892c5c76f..658a7e88f53 100644 --- a/thrift/src/main/java/io/grpc/thrift/MessageFactory.java +++ b/thrift/src/main/java/io/grpc/thrift/MessageFactory.java @@ -32,7 +32,6 @@ package io.grpc.thrift; import io.grpc.ExperimentalApi; - import org.apache.thrift.TBase; /** diff --git a/thrift/src/main/java/io/grpc/thrift/ThriftInputStream.java b/thrift/src/main/java/io/grpc/thrift/ThriftInputStream.java index bbf8b54a7e2..bf2bf6708ea 100644 --- a/thrift/src/main/java/io/grpc/thrift/ThriftInputStream.java +++ b/thrift/src/main/java/io/grpc/thrift/ThriftInputStream.java @@ -32,20 +32,17 @@ package io.grpc.thrift; import com.google.common.io.ByteStreams; - import io.grpc.Drainable; import io.grpc.KnownLength; import io.grpc.Status; -import org.apache.thrift.TBase; -import org.apache.thrift.TException; -import org.apache.thrift.TSerializer; - import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; - import javax.annotation.Nullable; +import org.apache.thrift.TBase; +import org.apache.thrift.TException; +import org.apache.thrift.TSerializer; /** InputStream for Thrift. */ final class ThriftInputStream extends InputStream implements Drainable, KnownLength { diff --git a/thrift/src/main/java/io/grpc/thrift/ThriftUtils.java b/thrift/src/main/java/io/grpc/thrift/ThriftUtils.java index c2acdc9c09c..b29729ffd79 100644 --- a/thrift/src/main/java/io/grpc/thrift/ThriftUtils.java +++ b/thrift/src/main/java/io/grpc/thrift/ThriftUtils.java @@ -36,14 +36,13 @@ import io.grpc.MethodDescriptor.Marshaller; import io.grpc.Status; import io.grpc.internal.IoUtils; +import java.io.IOException; +import java.io.InputStream; import org.apache.thrift.TBase; import org.apache.thrift.TDeserializer; import org.apache.thrift.TException; import org.apache.thrift.TSerializer; -import java.io.IOException; -import java.io.InputStream; - @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2170") public final class ThriftUtils { diff --git a/thrift/src/test/java/io/grpc/thrift/ThriftUtilsTest.java b/thrift/src/test/java/io/grpc/thrift/ThriftUtilsTest.java index 7b992ae4db5..187741cfbec 100644 --- a/thrift/src/test/java/io/grpc/thrift/ThriftUtilsTest.java +++ b/thrift/src/test/java/io/grpc/thrift/ThriftUtilsTest.java @@ -43,17 +43,16 @@ import io.grpc.Status; import io.grpc.StatusRuntimeException; import io.grpc.internal.IoUtils; -import org.apache.thrift.TException; -import org.apache.thrift.TSerializer; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.util.ArrayList; import java.util.Collections; +import org.apache.thrift.TException; +import org.apache.thrift.TSerializer; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** Unit tests for {@link ThriftUtils}. */ @RunWith(JUnit4.class)