diff --git a/core/src/main/java/hudson/model/ViewJob.java b/core/src/main/java/hudson/model/ViewJob.java index 492d6eddd0e4..765843d58189 100644 --- a/core/src/main/java/hudson/model/ViewJob.java +++ b/core/src/main/java/hudson/model/ViewJob.java @@ -60,9 +60,9 @@ public abstract class ViewJob, RunT extends Run< /** * All {@link Run}s. Copy-on-write semantics. */ - protected transient /*almost final*/ RunMap runs = new RunMap<>(); + protected transient volatile /*almost final*/ RunMap runs = new RunMap<>(null, null); - private transient boolean notLoaded = true; + private transient volatile boolean notLoaded = true; /** * If the reloading of runs are in progress (in another thread, diff --git a/core/src/main/java/jenkins/model/lazy/AbstractLazyLoadRunMap.java b/core/src/main/java/jenkins/model/lazy/AbstractLazyLoadRunMap.java index 6ede80cf599e..3b8d2718c478 100644 --- a/core/src/main/java/jenkins/model/lazy/AbstractLazyLoadRunMap.java +++ b/core/src/main/java/jenkins/model/lazy/AbstractLazyLoadRunMap.java @@ -91,7 +91,7 @@ public abstract class AbstractLazyLoadRunMap extends AbstractMap i /** * Used in {@link #all()} to quickly determine if we've already loaded everything. */ - private boolean fullyLoaded; + private volatile boolean fullyLoaded; /** * Currently visible index.