Skip to content

Removed deprecated api usages #3218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/java/org/springframework/data/geo/Circle.java
Original file line number Diff line number Diff line change
@@ -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");
5 changes: 2 additions & 3 deletions src/main/java/org/springframework/data/geo/GeoResults.java
Original file line number Diff line number Diff line change
@@ -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 GeoResults(List<? extends GeoResult<T>> results, Metric metric) {
* @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");
4 changes: 2 additions & 2 deletions src/main/java/org/springframework/data/geo/Point.java
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
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;
5 changes: 2 additions & 3 deletions src/main/java/org/springframework/data/geo/Polygon.java
Original file line number Diff line number Diff line change
@@ -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 Polygon(Point x, Point y, Point z, Point... others) {
*
* @param points must not be {@literal null}.
*/
@PersistenceConstructor
@PersistenceCreator
public Polygon(List<? extends Point> points) {

Assert.notNull(points, "Points must not be null");
Original file line number Diff line number Diff line change
@@ -212,7 +212,7 @@ public void setBeanFactory(BeanFactory beanFactory) {
this.beanClassLoader = cbf.getBeanClassLoader();
}

this.retrievalMutex = cbf.getSingletonMutex();
this.retrievalMutex = new Object();
}

defaultRetriever.discoverEntityCallbacks(beanFactory);
Original file line number Diff line number Diff line change
@@ -86,7 +86,7 @@ public QueryMethod(Method method, RepositoryMetadata metadata, ProjectionFactory
this.method = method;
this.unwrappedReturnType = potentiallyUnwrapReturnTypeFor(metadata, method);
this.metadata = metadata;
this.parameters = createParameters(method, metadata.getDomainTypeInformation());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one needs to stay as-is to ease compatibility. We cannot assume that all stores have implemented createParameters(ParametersSource parametersSource).

this.parameters = createParameters(ParametersSource.of(getMetadata(), method));

this.domainClass = Lazy.of(() -> {

Original file line number Diff line number Diff line change
@@ -142,7 +142,12 @@ void capturesContextOnInstantiationException() throws Exception {

} 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);

Original file line number Diff line number Diff line change
@@ -130,7 +130,12 @@ void capturesContextOnInstantiationException() throws Exception {

} 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);