diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/SpringDataEclipseStoreLazy.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/SpringDataEclipseStoreLazy.java index 984540bf..182d2990 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/SpringDataEclipseStoreLazy.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/SpringDataEclipseStoreLazy.java @@ -17,6 +17,7 @@ import java.lang.reflect.Field; import java.util.Objects; +import java.util.concurrent.locks.ReentrantLock; import java.util.function.Consumer; import org.eclipse.serializer.collections.HashEnum; @@ -67,7 +68,7 @@ static SpringDataEclipseStoreLazy.Default buildWithLazy(final Lazy laz * * @param the type of the lazily referenced element */ - @SuppressWarnings({"java:S2065"}) + @SuppressWarnings({"java:S2065", "PMD.AvoidSynchronizedStatement"}) final class Default implements SpringDataEclipseStoreLazy { private T objectToBeWrapped; @@ -76,6 +77,7 @@ final class Default implements SpringDataEclipseStoreLazy private transient ObjectSwizzling loader; private transient WorkingCopier copier; private transient boolean isStored; + private final transient ReentrantLock usageMarksLock = new ReentrantLock(); private final transient HashEnum usageMarks = HashEnum.New(); private Default(final Lazy lazySubject)