started work on bug3195 with a few FIXME comments

This commit is contained in:
Axel Uhl committed 2015-07-31 10:42:47 +02:00
1 parent d73157ca9d
commit 2b12ef4c51
1 file changed
+2 -2
@@ -49,7 +49,7 @@ public class ShortTimeWindCache {
public void run() {
long oldestToKeep = System.currentTimeMillis() - preserveHowManyMilliseconds;
Pair<Long, Triple<Position, TimePoint, Set<WindSource>>> next;
while ((next = order.pollFirst()) != null && next.getA() < oldestToKeep) {
while ((next = order.pollFirst()) != null && next.getA() < oldestToKeep) { // FIXME don't poll, peek; otherwise if next.getA() >= oldestToKeep then order and cache run inconsistent
cache.remove(next.getB());
}
synchronized (order) {
@@ -71,7 +71,7 @@ public class ShortTimeWindCache {
private void add(Triple<Position, TimePoint, Set<WindSource>> key, WindWithConfidence<com.sap.sse.common.Util.Pair<Position, TimePoint>> wind) {
cache.put(key, wind);
boolean orderEmpty = order.isEmpty();
boolean orderEmpty = order.isEmpty(); // FIXME this should check for timer running or be put into the synchronized block
synchronized (order) {
order.add(new Pair<Long, Triple<Position, TimePoint, Set<WindSource>>>(System.currentTimeMillis(), key));
if (orderEmpty) {