fixed order of RawPositionReceiver constructor initialization;

avoiding NPE when listener is fired before lock has been initialized
This commit is contained in:
Axel Uhl committed 2023-08-12 15:16:15 +02:00
1 parent 14a0e5bed1
commit 68bccb8ee0
1 file changed
+1 -1
@@ -71,9 +71,9 @@ public class MaxSpeedCache<ItemType, FixType extends GPSFix> implements GPSTrack
public MaxSpeedCache(GPSFixTrackImpl<ItemType, FixType> track) {
this.track = track;
track.addListener(this);
cache = new HashMap<TimePoint, NavigableSet<Util.Pair<TimePoint, Util.Pair<FixType, Speed>>>>();
lock = new NamedReentrantReadWriteLock(MaxSpeedCache.class.getSimpleName()+" for track of "+track.getTrackedItem(), /* fair */ false);
track.addListener(this);
}
/**