# on deserialization RaceLogImpl resets listener field

This commit is contained in:
Lukas Niemeier
2013-02-23 22:56:38 +01:00
parent 6868f3f6d4
commit 741ecd2878
@@ -1,5 +1,7 @@
package com.sap.sailing.domain.racelog.impl;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.HashSet;
import java.util.Set;
import java.util.logging.Level;
@@ -22,6 +24,14 @@ public class RaceLogImpl extends TrackImpl<RaceLogEvent> implements RaceLog {
super(nameForReadWriteLock);
listeners = new HashSet<RaceLogEventVisitor>();
}
/**
* When deserializing, needs to initialize empty set of listeners.
*/
private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException {
ois.defaultReadObject();
listeners = new HashSet<RaceLogEventVisitor>();
}
@Override
public boolean add(RaceLogEvent event) {