Skip to content

Commit 4123aa5

Browse files
committed
Post-rebase.
1 parent 2c33170 commit 4123aa5

File tree

6 files changed

+16
-18
lines changed

6 files changed

+16
-18
lines changed

src/main/java/org/springframework/data/mapping/TypedPropertyPath.java renamed to src/main/java/org/springframework/data/core/TypedPropertyPath.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.springframework.data.mapping;
16+
package org.springframework.data.core;
1717

1818
import java.io.Serializable;
1919
import java.util.Collections;
2020
import java.util.Iterator;
2121

2222
import org.jspecify.annotations.Nullable;
23-
import org.springframework.data.util.TypeInformation;
2423

2524
/**
2625
* Type-safe representation of a property path expressed through method references.
@@ -32,13 +31,13 @@
3231
* <p>
3332
* Typed property paths can be created directly they are accepted used or conveniently using the static factory method
3433
* {@link #of(TypedPropertyPath)} with method references:
35-
*
34+
*
3635
* <pre class="code">
3736
* PropertyPath.of(Person::getName);
3837
* </pre>
39-
*
38+
*
4039
* Property paths can be composed to navigate nested properties using {@link #then(TypedPropertyPath)}:
41-
*
40+
*
4241
* <pre class="code">
4342
* PropertyPath.of(Person::getAddress).then(Address::getCountry).then(Country::getName);
4443
* </pre>
@@ -56,7 +55,7 @@
5655
* <p>
5756
* Note that using lambda expressions requires bytecode analysis of the declaration site classes and therefore presence
5857
* of their class files.
59-
*
58+
*
6059
* @param <T> the owning type of the property path segment, but typically the root type for composed property paths.
6160
* @param <P> the property value type at this path segment.
6261
* @author Mark Paluch

src/main/java/org/springframework/data/mapping/TypedPropertyPaths.java renamed to src/main/java/org/springframework/data/core/TypedPropertyPaths.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.springframework.data.mapping;
16+
package org.springframework.data.core;
1717

1818
import java.beans.Introspector;
1919
import java.beans.PropertyDescriptor;
@@ -46,8 +46,6 @@
4646
import org.springframework.beans.BeanUtils;
4747
import org.springframework.core.ResolvableType;
4848
import org.springframework.dao.InvalidDataAccessApiUsageException;
49-
import org.springframework.data.mapping.model.Property;
50-
import org.springframework.data.util.TypeInformation;
5149
import org.springframework.util.ClassUtils;
5250
import org.springframework.util.ConcurrentReferenceHashMap;
5351
import org.springframework.util.ObjectUtils;
@@ -59,7 +57,7 @@
5957
class TypedPropertyPaths {
6058

6159
private static final Map<ClassLoader, Map<Object, PropertyPathInformation>> lambdas = new WeakHashMap<>();
62-
private static final Map<ClassLoader, Map<TypedPropertyPath, ResolvedTypedPropertyPath<?, ?>>> resolved = new WeakHashMap<>();
60+
private static final Map<ClassLoader, Map<TypedPropertyPath<?, ?>, ResolvedTypedPropertyPath<?, ?>>> resolved = new WeakHashMap<>();
6361

6462
/**
6563
* Retrieve {@link PropertyPathInformation} for a given {@link TypedPropertyPath}.
@@ -92,7 +90,7 @@ public static <P, T> TypedPropertyPath<T, P> of(TypedPropertyPath<T, P> lambda)
9290
return lambda;
9391
}
9492

95-
Map<TypedPropertyPath, ResolvedTypedPropertyPath<?, ?>> cache;
93+
Map<TypedPropertyPath<?, ?>, ResolvedTypedPropertyPath<?, ?>> cache;
9694
synchronized (resolved) {
9795
cache = resolved.computeIfAbsent(lambda.getClass().getClassLoader(), k -> new ConcurrentReferenceHashMap<>());
9896
}
@@ -168,7 +166,7 @@ public static PropertyPathInformation ofFieldAccess(Class<?> owner, String field
168166

169167
Field field = ReflectionUtils.findField(owner, fieldName, fieldType);
170168
if (field == null) {
171-
throw new IllegalArgumentException("Field %s.%s() not found".formatted(owner.getName(), field));
169+
throw new IllegalArgumentException("Field %s.%s() not found".formatted(owner.getName(), fieldName));
172170
}
173171

174172
return new PropertyPathInformation(TypeInformation.of(owner),

src/main/java/org/springframework/data/domain/ExampleMatcher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
import org.jspecify.annotations.Nullable;
2727

28-
import org.springframework.data.util.TypedPropertyPath;
28+
import org.springframework.data.core.TypedPropertyPath;
2929
import org.springframework.lang.CheckReturnValue;
3030
import org.springframework.lang.Contract;
3131
import org.springframework.util.Assert;

src/main/java/org/springframework/data/domain/Sort.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929

3030
import org.jspecify.annotations.Nullable;
3131

32+
import org.springframework.data.core.PropertyPath;
33+
import org.springframework.data.core.TypedPropertyPath;
3234
import org.springframework.data.util.MethodInvocationRecorder;
3335
import org.springframework.data.util.MethodInvocationRecorder.Recorded;
34-
import org.springframework.data.util.PropertyPath;
3536
import org.springframework.data.util.Streamable;
36-
import org.springframework.data.util.TypedPropertyPath;
3737
import org.springframework.lang.CheckReturnValue;
3838
import org.springframework.lang.Contract;
3939
import org.springframework.util.Assert;
@@ -797,7 +797,7 @@ public String toString() {
797797
* @author Oliver Gierke
798798
* @since 2.2
799799
* @soundtrack The Intersphere - Linger (The Grand Delusion)
800-
* @deprecated since 4.1 in favor of {@link Sort#by(org.springframework.data.util.TypedPropertyPath...)}
800+
* @deprecated since 4.1 in favor of {@link Sort#by(org.springframework.data.core.TypedPropertyPath...)}
801801
*/
802802
@Deprecated(since = "4.1")
803803
public static class TypedSort<T> extends Sort {

src/test/java/org/springframework/data/mapping/TypedPropertyPathUnitTests.java renamed to src/test/java/org/springframework/data/core/TypedPropertyPathUnitTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.springframework.data.mapping;
16+
package org.springframework.data.core;
1717

1818
import static org.assertj.core.api.Assertions.*;
1919

src/test/java/org/springframework/data/domain/SortUnitTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@
2121
import java.util.Collection;
2222

2323
import org.junit.jupiter.api.Test;
24+
25+
import org.springframework.data.core.TypedPropertyPath;
2426
import org.springframework.data.domain.Sort.Direction;
2527
import org.springframework.data.domain.Sort.Order;
2628
import org.springframework.data.geo.Circle;
2729
import org.springframework.data.mapping.Person;
28-
import org.springframework.data.util.TypedPropertyPath;
2930

3031
/**
3132
* Unit test for {@link Sort}.

0 commit comments

Comments
 (0)