diff --git a/core/reflection.jvm/src/kotlin/reflect/jvm/internal/ReflectProperties.java b/core/reflection.jvm/src/kotlin/reflect/jvm/internal/ReflectProperties.java index 78eb274343b..57d097217fa 100644 --- a/core/reflection.jvm/src/kotlin/reflect/jvm/internal/ReflectProperties.java +++ b/core/reflection.jvm/src/kotlin/reflect/jvm/internal/ReflectProperties.java @@ -46,7 +46,7 @@ public class ReflectProperties { // A delegate for a lazy property, whose initializer may be invoked multiple times including simultaneously from different threads public static class LazyVal extends Val { private final Function0 initializer; - private Object value = null; + private volatile Object value = null; public LazyVal(@NotNull Function0 initializer) { this.initializer = initializer; @@ -70,7 +70,7 @@ public class ReflectProperties { // including simultaneously from different threads public static class LazySoftVal extends Val { private final Function0 initializer; - private SoftReference value = null; + private volatile SoftReference value = null; public LazySoftVal(@Nullable T initialValue, @NotNull Function0 initializer) { this.initializer = initializer;