mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-22 13:45:42 +00:00
# on deserialization RaceLogImpl resets listener field
This commit is contained in:
+10
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user