all: fix lint

This commit is contained in:
ZHANG Dapeng 2019-05-16 15:00:20 -07:00 committed by GitHub
parent ae14c8d061
commit 53f74c62ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 21 deletions

View File

@ -101,7 +101,6 @@ import io.grpc.ServerMethodDefinition;
import io.grpc.Status;
import io.grpc.Status.Code;
import io.grpc.StringMarshaller;
import io.grpc.SynchronizationContext;
import io.grpc.internal.ClientTransportFactory.ClientTransportOptions;
import io.grpc.internal.InternalSubchannel.TransportLogger;
import io.grpc.internal.ManagedChannelImpl.ScParser;
@ -1609,7 +1608,7 @@ public class ManagedChannelImplTest {
ses.shutdownNow();
fail("Should throw");
} catch (UnsupportedOperationException e) {
// exepcted
// expected
}
}
@ -3397,10 +3396,6 @@ public class ManagedChannelImplTest {
@Test
public void nameResolverHelper_emptyConfigSucceeds() {
int defaultPort = 1;
ProxyDetector proxyDetector = GrpcUtil.getDefaultProxyDetector();
SynchronizationContext syncCtx =
new SynchronizationContext(Thread.currentThread().getUncaughtExceptionHandler());
boolean retryEnabled = false;
int maxRetryAttemptsLimit = 2;
int maxHedgedAttemptsLimit = 3;
@ -3423,10 +3418,6 @@ public class ManagedChannelImplTest {
@Test
public void nameResolverHelper_badConfigFails() {
int defaultPort = 1;
ProxyDetector proxyDetector = GrpcUtil.getDefaultProxyDetector();
SynchronizationContext syncCtx =
new SynchronizationContext(Thread.currentThread().getUncaughtExceptionHandler());
boolean retryEnabled = false;
int maxRetryAttemptsLimit = 2;
int maxHedgedAttemptsLimit = 3;
@ -3450,10 +3441,6 @@ public class ManagedChannelImplTest {
@Test
public void nameResolverHelper_noConfigChosen() {
int defaultPort = 1;
ProxyDetector proxyDetector = GrpcUtil.getDefaultProxyDetector();
SynchronizationContext syncCtx =
new SynchronizationContext(Thread.currentThread().getUncaughtExceptionHandler());
boolean retryEnabled = false;
int maxRetryAttemptsLimit = 2;
int maxHedgedAttemptsLimit = 3;

View File

@ -73,9 +73,9 @@ interface LocalityStore {
private final Helper helper;
private final PickerFactory pickerFactory;
private final LoadBalancerProvider loadBalancerProvider;
private Map<Locality, LocalityLbInfo> localityMap = new HashMap<>();
private LoadBalancerProvider loadBalancerProvider;
private ConnectivityState overallState;
LocalityStoreImpl(Helper helper, LoadBalancerRegistry lbRegistry) {

View File

@ -60,7 +60,6 @@ import io.grpc.xds.XdsComms.LbEndpoint;
import io.grpc.xds.XdsComms.Locality;
import io.grpc.xds.XdsComms.LocalityInfo;
import java.net.InetSocketAddress;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
@ -139,7 +138,6 @@ public class XdsLbStateTest {
});
private final StreamRecorder<DiscoveryRequest> streamRecorder = StreamRecorder.create();
private StreamObserver<DiscoveryResponse> responseWriter;
private ManagedChannel channel;
private static final class FakeInterLocalityPickerFactory implements PickerFactory {
@ -182,8 +180,6 @@ public class XdsLbStateTest {
@Override
public StreamObserver<DiscoveryRequest> streamAggregatedResources(
final StreamObserver<DiscoveryResponse> responseObserver) {
responseWriter = responseObserver;
return new StreamObserver<DiscoveryRequest>() {
@Override
@ -295,7 +291,7 @@ public class XdsLbStateTest {
XdsLbState xdsLbState =
new XdsLbState(BALANCER_NAME, null, null, helper, localityStore, adsStreamCallback);
xdsLbState.handleResolvedAddressGroups(
Collections.<EquivalentAddressGroup>emptyList(), Attributes.EMPTY);
ImmutableList.<EquivalentAddressGroup>of(), Attributes.EMPTY);
assertThat(streamRecorder.firstValue().get().getTypeUrl())
.isEqualTo("type.googleapis.com/envoy.api.v2.ClusterLoadAssignment");

View File

@ -129,7 +129,7 @@ public class XdsLoadStatsStoreTest {
private static void assertUpstreamLocalityStatsListsEqual(List<UpstreamLocalityStats> expected,
List<UpstreamLocalityStats> actual) {
assertThat(actual.size()).isEqualTo(expected.size());
assertThat(actual).hasSize(expected.size());
Map<Locality, UpstreamLocalityStats> expectedLocalityStats = new HashMap<>();
for (UpstreamLocalityStats stats : expected) {
expectedLocalityStats.put(stats.getLocality(), stats);