aboutsummaryrefslogtreecommitdiff
path: root/java/src/test/java/com/google/protobuf/LiteTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/test/java/com/google/protobuf/LiteTest.java')
-rw-r--r--java/src/test/java/com/google/protobuf/LiteTest.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/java/src/test/java/com/google/protobuf/LiteTest.java b/java/src/test/java/com/google/protobuf/LiteTest.java
index 4e1003d9..839694d6 100644
--- a/java/src/test/java/com/google/protobuf/LiteTest.java
+++ b/java/src/test/java/com/google/protobuf/LiteTest.java
@@ -129,8 +129,11 @@ public class LiteTest extends TestCase {
TestAllTypesLite.NestedMessage.newBuilder().setBb(7))
.build();
ObjectOutputStream out = new ObjectOutputStream(baos);
- out.writeObject(expected);
- out.close();
+ try {
+ out.writeObject(expected);
+ } finally {
+ out.close();
+ }
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
ObjectInputStream in = new ObjectInputStream(bais);
TestAllTypesLite actual = (TestAllTypesLite) in.readObject();