From 3bb6708eeec56c479525018b0bad5f3c42b04f67 Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Mon, 26 Mar 2018 16:17:45 -0700 Subject: services: Specify serialVersionUID for the dummy SocketAddress This fixes a serial warning that breaks the build when building _without_ ErrorProne. I have no clue why _disabling_ ErrorProne makes the warning pop up, but whatever, the warning is legit. I also gave it a name, since the anonymous $1 seems weird if we're providing a serialVersionUID. Not to say we're actually supporting serializing this object. But if we ever see a serialized form show up in the future, having a more clear name would make it obvious what it is. --- services/src/main/java/io/grpc/services/BinaryLog.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'services') diff --git a/services/src/main/java/io/grpc/services/BinaryLog.java b/services/src/main/java/io/grpc/services/BinaryLog.java index 34ce04403..c57c534da 100644 --- a/services/src/main/java/io/grpc/services/BinaryLog.java +++ b/services/src/main/java/io/grpc/services/BinaryLog.java @@ -81,7 +81,7 @@ final class BinaryLog implements ServerInterceptor, ClientInterceptor { @VisibleForTesting static final byte[] dumyCallId = new byte[16]; @VisibleForTesting - static final SocketAddress DUMMY_SOCKET = new SocketAddress() { }; + static final SocketAddress DUMMY_SOCKET = new DummySocketAddress(); @VisibleForTesting static final boolean DUMMY_IS_COMPRESSED = false; @@ -619,4 +619,8 @@ final class BinaryLog implements ServerInterceptor, ClientInterceptor { static int flagsForMessage(boolean compressed) { return compressed ? 1 : 0; } + + private static class DummySocketAddress extends SocketAddress { + private static final long serialVersionUID = 0; + } } -- cgit v1.2.3