diff options
author | Kun Zhang <zhangkun83@users.noreply.github.com> | 2020-03-27 16:04:11 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-27 16:04:11 -0700 |
commit | e28bb1975f50ce7eb8002feffe46e6cb58096dc2 (patch) | |
tree | a3529b549b775f5f86dc159988bc2b0738df105a | |
parent | c7f69c851bbad8ca5be01393f1d793bf3e9ab6b5 (diff) | |
download | grpc-grpc-java-e28bb1975f50ce7eb8002feffe46e6cb58096dc2.tar.gz |
xds: fix lint warnings (#6869)
3 files changed, 4 insertions, 5 deletions
diff --git a/xds/src/main/java/io/grpc/xds/XdsClientWrapperForServerSds.java b/xds/src/main/java/io/grpc/xds/XdsClientWrapperForServerSds.java index 593294eb3..708268333 100644 --- a/xds/src/main/java/io/grpc/xds/XdsClientWrapperForServerSds.java +++ b/xds/src/main/java/io/grpc/xds/XdsClientWrapperForServerSds.java @@ -67,7 +67,7 @@ public final class XdsClientWrapperForServerSds { private EnvoyServerProtoData.Listener curListener; // TODO(sanjaypujare): implement shutting down XdsServer which will need xdsClient reference @SuppressWarnings("unused") - @Nullable private XdsClient xdsClient; + @Nullable private final XdsClient xdsClient; private final int port; private final ScheduledExecutorService timeService; @@ -158,7 +158,7 @@ public final class XdsClientWrapperForServerSds { } private static final class FilterChainComparator implements Comparator<FilterChain> { - private InetSocketAddress localAddress; + private final InetSocketAddress localAddress; private enum Match { NO_MATCH, diff --git a/xds/src/test/java/io/grpc/xds/XdsClientWrapperForServerSdsTest.java b/xds/src/test/java/io/grpc/xds/XdsClientWrapperForServerSdsTest.java index 5fd7bf055..f6d6f8304 100644 --- a/xds/src/test/java/io/grpc/xds/XdsClientWrapperForServerSdsTest.java +++ b/xds/src/test/java/io/grpc/xds/XdsClientWrapperForServerSdsTest.java @@ -137,7 +137,7 @@ public class XdsClientWrapperForServerSdsTest { @Mock private Channel channel; private XdsClientWrapperForServerSds xdsClientWrapperForServerSds; - private DownstreamTlsContext[] tlsContexts = new DownstreamTlsContext[3]; + private final DownstreamTlsContext[] tlsContexts = new DownstreamTlsContext[3]; @Before public void setUp() throws IOException { diff --git a/xds/src/test/java/io/grpc/xds/XdsClientWrapperForServerSdsTestMisc.java b/xds/src/test/java/io/grpc/xds/XdsClientWrapperForServerSdsTestMisc.java index 86b994499..13c451d63 100644 --- a/xds/src/test/java/io/grpc/xds/XdsClientWrapperForServerSdsTestMisc.java +++ b/xds/src/test/java/io/grpc/xds/XdsClientWrapperForServerSdsTestMisc.java @@ -22,7 +22,6 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import static org.mockito.internal.verification.VerificationModeFactory.times; import io.envoyproxy.envoy.api.v2.auth.DownstreamTlsContext; import io.grpc.inprocess.InProcessSocketAddress; @@ -61,7 +60,7 @@ public class XdsClientWrapperForServerSdsTestMisc { @Test public void verifyListenerWatcherRegistered() { - verify(xdsClient, times(1)).watchListenerData(eq(PORT), any(XdsClient.ListenerWatcher.class)); + verify(xdsClient).watchListenerData(eq(PORT), any(XdsClient.ListenerWatcher.class)); } @Test |