Skip to content

Commit 8985b42

Browse files
committed
Remove references to Property.
1 parent 6fb4ffd commit 8985b42

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

src/main/java/org/springframework/data/util/TypedPropertyPath.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ default TypeInformation<?> getOwningType() {
9797

9898
@Override
9999
default String getSegment() {
100-
return TypedPropertyPaths.getPropertyPathInformation(this).property().getName();
100+
return TypedPropertyPaths.getPropertyPathInformation(this).property();
101101
}
102102

103103
@Override

src/main/java/org/springframework/data/util/TypedPropertyPaths.java

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
package org.springframework.data.util;
1717

18-
import java.beans.IntrospectionException;
1918
import java.beans.Introspector;
2019
import java.beans.PropertyDescriptor;
2120
import java.io.IOException;
@@ -37,6 +36,7 @@
3736
import java.util.stream.Stream;
3837

3938
import org.jspecify.annotations.Nullable;
39+
4040
import org.springframework.asm.ClassReader;
4141
import org.springframework.asm.ClassVisitor;
4242
import org.springframework.asm.Label;
@@ -46,7 +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;
5049
import org.springframework.util.ClassUtils;
5150
import org.springframework.util.ConcurrentReferenceHashMap;
5251
import org.springframework.util.ObjectUtils;
@@ -107,7 +106,7 @@ public static <P, T> TypedPropertyPath<T, P> of(TypedPropertyPath<T, P> lambda)
107106
* @param propertyType
108107
* @param property
109108
*/
110-
record PropertyPathInformation(TypeInformation<?> owner, TypeInformation<?> propertyType, Property property) {
109+
record PropertyPathInformation(TypeInformation<?> owner, TypeInformation<?> propertyType, String property) {
111110

112111
public static PropertyPathInformation ofInvokeVirtual(ClassLoader classLoader, SerializedLambda lambda)
113112
throws ClassNotFoundException {
@@ -141,13 +140,8 @@ public static PropertyPathInformation ofInvokeVirtual(Class<?> owner, String met
141140

142141
TypeInformation<?> fallback = TypeInformation.of(owner).getProperty(propertyName);
143142
if (fallback != null) {
144-
try {
145143
return new PropertyPathInformation(TypeInformation.of(owner), fallback,
146-
Property.of(TypeInformation.of(owner), new PropertyDescriptor(propertyName, method, null)));
147-
} catch (IntrospectionException e) {
148-
throw new IllegalArgumentException(
149-
"Cannot find PropertyDescriptor from method %s.%s".formatted(owner.getName(), methodName), e);
150-
}
144+
propertyName);
151145
}
152146

153147
throw new IllegalArgumentException(
@@ -156,7 +150,7 @@ public static PropertyPathInformation ofInvokeVirtual(Class<?> owner, String met
156150

157151
return new PropertyPathInformation(TypeInformation.of(owner),
158152
TypeInformation.of(ResolvableType.forMethodReturnType(method, owner)),
159-
Property.of(TypeInformation.of(owner), descriptor));
153+
descriptor.getName());
160154
}
161155

162156
public static PropertyPathInformation ofFieldAccess(ClassLoader classLoader, Type ownerType, String name,
@@ -176,7 +170,7 @@ public static PropertyPathInformation ofFieldAccess(Class<?> owner, String field
176170
}
177171

178172
return new PropertyPathInformation(TypeInformation.of(owner),
179-
TypeInformation.of(ResolvableType.forField(field, owner)), Property.of(TypeInformation.of(owner), field));
173+
TypeInformation.of(ResolvableType.forField(field, owner)), field.getName());
180174
}
181175
}
182176

@@ -295,7 +289,7 @@ public TypeInformation<?> getOwningType() {
295289

296290
@Override
297291
public String getSegment() {
298-
return information.property().getName();
292+
return information.property();
299293
}
300294

301295
@Override
@@ -308,6 +302,7 @@ public Iterator<PropertyPath> iterator() {
308302
return list.iterator();
309303
}
310304

305+
@Override
311306
public Stream<PropertyPath> stream() {
312307
return list.stream();
313308
}

0 commit comments

Comments
 (0)