Removed deprecated api usage.

Closes #3218
This commit is contained in:
mipo256
2024-12-09 14:46:30 +03:00
committed by Mark Paluch
parent 3f543c2152
commit c1ec988e7f
7 changed files with 21 additions and 13 deletions

View File

@@ -15,7 +15,7 @@
*/
package org.springframework.data.geo;
import org.springframework.data.annotation.PersistenceConstructor;
import org.springframework.data.annotation.PersistenceCreator;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
@@ -40,7 +40,7 @@ public class Circle implements Shape {
* @param center must not be {@literal null}.
* @param radius must not be {@literal null} and it's value greater or equal to zero.
*/
@PersistenceConstructor
@PersistenceCreator
public Circle(Point center, Distance radius) {
Assert.notNull(center, "Center point must not be null");

View File

@@ -15,13 +15,12 @@
*/
package org.springframework.data.geo;
import java.io.Serializable;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import org.springframework.data.annotation.PersistenceConstructor;
import org.springframework.data.annotation.PersistenceCreator;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
@@ -67,7 +66,7 @@ public class GeoResults<T> implements Iterable<GeoResult<T>>, Serializable {
* @param results must not be {@literal null}.
* @param averageDistance must not be {@literal null}.
*/
@PersistenceConstructor
@PersistenceCreator
public GeoResults(List<? extends GeoResult<T>> results, Distance averageDistance) {
Assert.notNull(results, "Results must not be null");

View File

@@ -18,7 +18,7 @@ package org.springframework.data.geo;
import java.io.Serializable;
import java.util.Locale;
import org.springframework.data.annotation.PersistenceConstructor;
import org.springframework.data.annotation.PersistenceCreator;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
@@ -43,7 +43,7 @@ public class Point implements Serializable {
* @param x
* @param y
*/
@PersistenceConstructor
@PersistenceCreator
public Point(double x, double y) {
this.x = x;
this.y = y;

View File

@@ -15,14 +15,13 @@
*/
package org.springframework.data.geo;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import org.springframework.data.annotation.PersistenceConstructor;
import org.springframework.data.annotation.PersistenceCreator;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
@@ -67,7 +66,7 @@ public class Polygon implements Iterable<Point>, Shape {
*
* @param points must not be {@literal null}.
*/
@PersistenceConstructor
@PersistenceCreator
public Polygon(List<? extends Point> points) {
Assert.notNull(points, "Points must not be null");

View File

@@ -212,7 +212,7 @@ class EntityCallbackDiscoverer {
this.beanClassLoader = cbf.getBeanClassLoader();
}
this.retrievalMutex = cbf.getSingletonMutex();
this.retrievalMutex = new Object();
}
defaultRetriever.discoverEntityCallbacks(beanFactory);

View File

@@ -142,7 +142,12 @@ class ClassGeneratingEntityInstantiatorUnitTests<P extends PersistentProperty<P>
} catch (MappingInstantiationException o_O) {
assertThat(o_O.getConstructor()).hasValue(constructor);
assertThat(o_O.getEntityCreator()
.map(it -> (PreferredConstructor) it)
.map(PreferredConstructor::getConstructor))
.isPresent()
.hasValue(constructor);
assertThat(o_O.getConstructorArguments()).isEqualTo(parameters);
assertThat(o_O.getEntityType()).hasValue(Sample.class);

View File

@@ -130,7 +130,12 @@ class ReflectionEntityInstantiatorUnitTests<P extends PersistentProperty<P>> {
} catch (MappingInstantiationException o_O) {
assertThat(o_O.getConstructor()).hasValue(constructor);
assertThat(o_O.getEntityCreator()
.map(it -> (PreferredConstructor) it)
.map(PreferredConstructor::getConstructor))
.isPresent()
.hasValue(constructor);
assertThat(o_O.getConstructorArguments()).isEqualTo(parameters);
assertThat(o_O.getEntityType()).hasValue(Sample.class);