diff --git a/src/main/java/org/springframework/data/mapping/model/InstantiationAwarePropertyAccessor.java b/src/main/java/org/springframework/data/mapping/model/InstantiationAwarePropertyAccessor.java index 32012de9d..f29ee04a3 100644 --- a/src/main/java/org/springframework/data/mapping/model/InstantiationAwarePropertyAccessor.java +++ b/src/main/java/org/springframework/data/mapping/model/InstantiationAwarePropertyAccessor.java @@ -74,6 +74,7 @@ public class InstantiationAwarePropertyAccessor implements PersistentProperty * @param bean must not be {@literal null}. * @param accessorFunction must not be {@literal null}. * @param instantiators must not be {@literal null}. + * @since 2.4 */ public InstantiationAwarePropertyAccessor(T bean, Function> accessorFunction, EntityInstantiators instantiators) { @@ -117,7 +118,7 @@ public class InstantiationAwarePropertyAccessor implements PersistentProperty String.format(NO_CONSTRUCTOR_PARAMETER, property.getName(), constructor.getConstructor())); } - constructor.getParameters().stream().forEach(it -> { + constructor.getParameters().forEach(it -> { if (it.getName() == null) { throw new IllegalStateException( diff --git a/src/test/java/org/springframework/data/mapping/InstantiationAwarePersistentPropertyAccessorUnitTests.java b/src/test/java/org/springframework/data/mapping/InstantiationAwarePersistentPropertyAccessorUnitTests.java index b7da2b4af..02194a357 100644 --- a/src/test/java/org/springframework/data/mapping/InstantiationAwarePersistentPropertyAccessorUnitTests.java +++ b/src/test/java/org/springframework/data/mapping/InstantiationAwarePersistentPropertyAccessorUnitTests.java @@ -20,9 +20,9 @@ import static org.assertj.core.api.Assertions.*; import lombok.Value; import org.junit.jupiter.api.Test; -import org.springframework.data.convert.EntityInstantiators; import org.springframework.data.mapping.context.SampleMappingContext; import org.springframework.data.mapping.context.SamplePersistentProperty; +import org.springframework.data.mapping.model.EntityInstantiators; import org.springframework.data.mapping.model.InstantiationAwarePropertyAccessor; /** @@ -31,10 +31,10 @@ import org.springframework.data.mapping.model.InstantiationAwarePropertyAccessor * @author Oliver Drotbohm * @author Mark Paluch */ -public class InstantiationAwarePersistentPropertyAccessorUnitTests { +class InstantiationAwarePersistentPropertyAccessorUnitTests { @Test // DATACMNS-1639 - public void shouldCreateNewInstance() { + void shouldCreateNewInstance() { EntityInstantiators instantiators = new EntityInstantiators(); SampleMappingContext context = new SampleMappingContext(); @@ -52,7 +52,7 @@ public class InstantiationAwarePersistentPropertyAccessorUnitTests { } @Test // DATACMNS-1768 - public void shouldSetMultipleProperties() { + void shouldSetMultipleProperties() { EntityInstantiators instantiators = new EntityInstantiators(); SampleMappingContext context = new SampleMappingContext();