bug 3811: don't re-establish a MarkPassingCalculator in a de-serialized TrackedRaceImpl object;

replicas receive mark passings through UpdateMarkPassing operations

Change-Id: I3045efe9b21ebe5de871270802be663d83a3811a
This commit is contained in:
Axel Uhl committed 2016-07-23 00:42:13 +02:00
1 parent 85ea562c36
commit e6efbcc67e
1 file changed
-13
@@ -295,7 +295,6 @@ public abstract class TrackedRaceImpl extends TrackedRaceWithWindEssentials impl
private transient ConcurrentMap<TimePoint, Future<Wind>> directionFromStartToNextMarkCache;
protected transient MarkPassingCalculator markPassingCalculator;
private final boolean hasMarkPassingCalculator;
private final ConcurrentMap<Mark, GPSFixTrack<Mark, GPSFix>> markTracks;
@@ -546,7 +545,6 @@ public abstract class TrackedRaceImpl extends TrackedRaceWithWindEssentials impl
} else {
markPassingCalculator = null;
}
hasMarkPassingCalculator = useInternalMarkPassingAlgorithm;
sensorTracks = new HashMap<>();
sensorTracksLock = new NamedReentrantReadWriteLock("sensorTracksLock", true);
// now wait until wind loading has at least started; then we know that the serialization lock is safely held by the loader
@@ -650,17 +648,6 @@ public abstract class TrackedRaceImpl extends TrackedRaceWithWindEssentials impl
logger.info("Deserialized race " + getRace().getName());
}
/**
* After the object graph has entirely been re-constructed, create the mark passing calculator if
* the original object had one.
*/
protected Object readResolve() {
if (hasMarkPassingCalculator) {
markPassingCalculator = createMarkPassingCalculator();
}
return this;
}
/**
* When the {@link TrackedRace} object and the {@link RaceDefinition} and in particular its {@link CourseImpl} objects are not
* atomically serialized, inconsistencies may occur during de-serialization. In particular, the tracked race's leg-oriented