all: fix minor lint warnings

This commit is contained in:
Carl Mastrangelo 2017-07-17 17:21:07 -07:00 committed by GitHub
parent e14fc404f0
commit 84fce477c2
4 changed files with 11 additions and 11 deletions

View File

@ -57,7 +57,7 @@ final class DnsNameResolver extends NameResolver {
private static final Logger logger = Logger.getLogger(DnsNameResolver.class.getName());
private static final boolean isJndiAvailable = jndiAvailable();
private static final boolean JNDI_AVAILABLE = jndiAvailable();
@VisibleForTesting
static boolean enableJndi = false;
@ -224,7 +224,7 @@ final class DnsNameResolver extends NameResolver {
private DelegateResolver pickDelegateResolver() {
JdkResolver jdkResolver = new JdkResolver();
if (isJndiAvailable && enableJndi) {
if (JNDI_AVAILABLE && enableJndi) {
return new CompositeResolver(jdkResolver, new JndiResolver());
}
return jdkResolver;

View File

@ -26,7 +26,7 @@ import org.junit.runners.JUnit4;
/** Unit tests for {@link Attributes}. */
@RunWith(JUnit4.class)
public class AttributesTest {
private static Attributes.Key<String> YOLO_KEY = Attributes.Key.of("yolo");
private static final Attributes.Key<String> YOLO_KEY = Attributes.Key.of("yolo");
@Test
public void buildAttributes() {
@ -38,10 +38,10 @@ public class AttributesTest {
@Test
public void duplicates() {
Attributes attrs = Attributes.newBuilder()
.set(YOLO_KEY, "To be?")
.set(YOLO_KEY, "Or not to be?")
.set(Attributes.Key.of("yolo"), "I'm not a duplicate")
.build();
.set(YOLO_KEY, "To be?")
.set(YOLO_KEY, "Or not to be?")
.set(Attributes.Key.of("yolo"), "I'm not a duplicate")
.build();
assertSame("Or not to be?", attrs.get(YOLO_KEY));
assertEquals(2, attrs.keys().size());
}

View File

@ -20,7 +20,7 @@ import java.io.InputStream;
/** Marshalls decimal-encoded integers. */
public class IntegerMarshaller implements MethodDescriptor.Marshaller<Integer> {
public static IntegerMarshaller INSTANCE = new IntegerMarshaller();
public static final IntegerMarshaller INSTANCE = new IntegerMarshaller();
@Override
public InputStream stream(Integer value) {

View File

@ -34,15 +34,15 @@ public class CustomHeaderServer {
private static final Logger logger = Logger.getLogger(CustomHeaderServer.class.getName());
/* The port on which the server should run */
private static final int port = 50051;
private static final int PORT = 50051;
private Server server;
private void start() throws IOException {
server = ServerBuilder.forPort(port)
server = ServerBuilder.forPort(PORT)
.addService(ServerInterceptors.intercept(new GreeterImpl(), new HeaderServerInterceptor()))
.build()
.start();
logger.info("Server started, listening on " + port);
logger.info("Server started, listening on " + PORT);
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {