New loop detection algorithm

This commit is contained in:
Jindra Pet��k
2013-06-09 05:59:59 +02:00
parent 66daf6fe8e
commit b8778ba2f1
14 changed files with 896 additions and 642 deletions
@@ -270,9 +270,10 @@ public class Helper {
oos.writeObject(o);
oos.flush();
}
ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()));
Object copy = ois.readObject();
ois.close();
Object copy;
try (ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()))) {
copy = ois.readObject();
}
return copy;
} catch (Exception ex) {
ex.printStackTrace();