diff options
Diffstat (limited to 'java/test/Ice/serialize/AllTests.java')
-rw-r--r-- | java/test/Ice/serialize/AllTests.java | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/java/test/Ice/serialize/AllTests.java b/java/test/Ice/serialize/AllTests.java index 61940783a66..212acc0893c 100644 --- a/java/test/Ice/serialize/AllTests.java +++ b/java/test/Ice/serialize/AllTests.java @@ -65,8 +65,15 @@ public class AllTests byte[] bytes = initial.getStruct1(); ByteArrayInputStream bais = new ByteArrayInputStream(bytes); Ice.ObjectInputStream ois = new Ice.ObjectInputStream(communicator, bais); - Struct1 s = (Struct1)ois.readObject(); - checkStruct1(s); + try + { + Struct1 s = (Struct1)ois.readObject(); + checkStruct1(s); + } + finally + { + ois.close(); + } } catch(Throwable ex) { @@ -81,8 +88,15 @@ public class AllTests byte[] bytes = initial.getBase(); ByteArrayInputStream bais = new ByteArrayInputStream(bytes); Ice.ObjectInputStream ois = new Ice.ObjectInputStream(communicator, bais); - Base b = (Base)ois.readObject(); - checkBase(b); + try + { + Base b = (Base) ois.readObject(); + checkBase(b); + } + finally + { + ois.close(); + } } catch(Throwable ex) { @@ -97,9 +111,16 @@ public class AllTests byte[] bytes = initial.getEx(); ByteArrayInputStream bais = new ByteArrayInputStream(bytes); Ice.ObjectInputStream ois = new Ice.ObjectInputStream(communicator, bais); - Ex ex = (Ex)ois.readObject(); - checkStruct1(ex.s); - checkBase(ex.b); + try + { + Ex ex = (Ex)ois.readObject(); + checkStruct1(ex.s); + checkBase(ex.b); + } + finally + { + ois.close(); + } } catch(Throwable ex) { |