Java 7 try-with-resources

Java 7 multi catch
This commit is contained in:
Jindra Pet��k
2013-06-04 21:35:35 +02:00
parent 855cd13a31
commit 43164625cd
23 changed files with 299 additions and 444 deletions
@@ -2140,10 +2140,10 @@ public class AVM2Code implements Serializable {
public AVM2Code deepCopy() {
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(baos);
oos.writeObject(this);
oos.flush();
oos.close();
try (ObjectOutputStream oos = new ObjectOutputStream(baos)) {
oos.writeObject(this);
oos.flush();
}
ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()));
AVM2Code copy = (AVM2Code) ois.readObject();
ois.close();