diff options
author | Eric Anderson <ejona@google.com> | 2016-05-20 09:46:46 -0700 |
---|---|---|
committer | Eric Anderson <ejona@google.com> | 2016-05-20 09:46:46 -0700 |
commit | 65dd5db5e3eb72a67c71fa3babcdf6f8199f8cd1 (patch) | |
tree | 24312da5114017f5ce33510881634a075e98c13f /protobuf-lite | |
parent | aa92d6c643cfb264e00f9b009f9633ca83d4b11b (diff) | |
download | grpc-grpc-java-65dd5db5e3eb72a67c71fa3babcdf6f8199f8cd1.tar.gz |
protolite: Use 'unused' variable to avoid CheckReturnValue
Internally toByteArray is annotated with CheckReturnValue, which can
cause a failure during compilation if the value is ignored.
Diffstat (limited to 'protobuf-lite')
-rw-r--r-- | protobuf-lite/src/test/java/io/grpc/protobuf/lite/ProtoLiteUtilsTest.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/protobuf-lite/src/test/java/io/grpc/protobuf/lite/ProtoLiteUtilsTest.java b/protobuf-lite/src/test/java/io/grpc/protobuf/lite/ProtoLiteUtilsTest.java index 918d5657d..53809deeb 100644 --- a/protobuf-lite/src/test/java/io/grpc/protobuf/lite/ProtoLiteUtilsTest.java +++ b/protobuf-lite/src/test/java/io/grpc/protobuf/lite/ProtoLiteUtilsTest.java @@ -87,7 +87,7 @@ public class ProtoLiteUtilsTest { public void testInvalidatedMessage() throws Exception { InputStream is = marshaller.stream(proto); // Invalidates message, and drains all bytes - ByteStreams.toByteArray(is); + byte[] unused = ByteStreams.toByteArray(is); try { ((ProtoInputStream) is).message(); fail("Expected exception"); @@ -190,7 +190,7 @@ public class ProtoLiteUtilsTest { public void testDrainTo_none() throws Exception { byte[] golden = ByteStreams.toByteArray(marshaller.stream(proto)); InputStream is = marshaller.stream(proto); - ByteStreams.toByteArray(is); + byte[] unused = ByteStreams.toByteArray(is); Drainable d = (Drainable) is; ByteArrayOutputStream baos = new ByteArrayOutputStream(); assertEquals(0, d.drainTo(baos)); |