[FIXED JENKINS-25655] Incorrect caching from entrySet sometimes caused incorrect results.

Caused a failure in hudson.plugins.promoted_builds.conditions.ManualConditionTest.testManualPromotionProcessViaWebClient when run against 1.580.1.
This commit is contained in:
Jesse Glick committed 2014-11-17 17:48:48 -05:00
1 parent 1568166e76
commit b76e7bf998
3 files changed
+15

No files matched your search

@@ -585,6 +585,8 @@ public abstract class AbstractLazyLoadRunMap<R> extends AbstractMap<Integer,R> i
numberOnDisk = a;
}
entrySet.clearCache();
return unwrap(old);
}
@@ -742,6 +744,8 @@ public abstract class AbstractLazyLoadRunMap<R> extends AbstractMap<Integer,R> i
BuildReference<R> old = copy.byId.remove(getIdOf(run));
this.index = copy;
entrySet.clearCache();
return unwrap(old)!=null;
}
@@ -32,6 +32,10 @@ class LazyLoadRunMapEntrySet<R> extends AbstractSet<Entry<Integer,R>> {
return all;
}
synchronized void clearCache() {
all = null;
}
@Override
public int size() {
return all().size();