Skip to content

Commit e28bb19

Browse files
authored
xds: fix lint warnings (grpc#6869)
1 parent c7f69c8 commit e28bb19

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

xds/src/main/java/io/grpc/xds/XdsClientWrapperForServerSds.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public final class XdsClientWrapperForServerSds {
6767
private EnvoyServerProtoData.Listener curListener;
6868
// TODO(sanjaypujare): implement shutting down XdsServer which will need xdsClient reference
6969
@SuppressWarnings("unused")
70-
@Nullable private XdsClient xdsClient;
70+
@Nullable private final XdsClient xdsClient;
7171
private final int port;
7272
private final ScheduledExecutorService timeService;
7373

@@ -158,7 +158,7 @@ public DownstreamTlsContext getDownstreamTlsContext(Channel channel) {
158158
}
159159

160160
private static final class FilterChainComparator implements Comparator<FilterChain> {
161-
private InetSocketAddress localAddress;
161+
private final InetSocketAddress localAddress;
162162

163163
private enum Match {
164164
NO_MATCH,

xds/src/test/java/io/grpc/xds/XdsClientWrapperForServerSdsTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public static Iterable<Object[]> data() {
137137
@Mock private Channel channel;
138138

139139
private XdsClientWrapperForServerSds xdsClientWrapperForServerSds;
140-
private DownstreamTlsContext[] tlsContexts = new DownstreamTlsContext[3];
140+
private final DownstreamTlsContext[] tlsContexts = new DownstreamTlsContext[3];
141141

142142
@Before
143143
public void setUp() throws IOException {

xds/src/test/java/io/grpc/xds/XdsClientWrapperForServerSdsTestMisc.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import static org.mockito.ArgumentMatchers.eq;
2323
import static org.mockito.Mockito.verify;
2424
import static org.mockito.Mockito.when;
25-
import static org.mockito.internal.verification.VerificationModeFactory.times;
2625

2726
import io.envoyproxy.envoy.api.v2.auth.DownstreamTlsContext;
2827
import io.grpc.inprocess.InProcessSocketAddress;
@@ -61,7 +60,7 @@ public void setUp() throws IOException {
6160

6261
@Test
6362
public void verifyListenerWatcherRegistered() {
64-
verify(xdsClient, times(1)).watchListenerData(eq(PORT), any(XdsClient.ListenerWatcher.class));
63+
verify(xdsClient).watchListenerData(eq(PORT), any(XdsClient.ListenerWatcher.class));
6564
}
6665

6766
@Test

0 commit comments

Comments
 (0)