Skip to content

Commit ec7f9df

Browse files
committed
Remove references to Property.
1 parent 6aee118 commit ec7f9df

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

src/main/java/org/springframework/data/mapping/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/mapping/TypedPropertyPaths.java

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
package org.springframework.data.mapping;
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;
@@ -103,12 +103,12 @@ public static <P, T> TypedPropertyPath<T, P> of(TypedPropertyPath<T, P> lambda)
103103

104104
/**
105105
* Value object holding information about a property path segment.
106-
*
106+
*
107107
* @param owner
108108
* @param propertyType
109109
* @param property
110110
*/
111-
record PropertyPathInformation(TypeInformation<?> owner, TypeInformation<?> propertyType, Property property) {
111+
record PropertyPathInformation(TypeInformation<?> owner, TypeInformation<?> propertyType, String property) {
112112

113113
public static PropertyPathInformation ofInvokeVirtual(ClassLoader classLoader, SerializedLambda lambda)
114114
throws ClassNotFoundException {
@@ -142,13 +142,8 @@ public static PropertyPathInformation ofInvokeVirtual(Class<?> owner, String met
142142

143143
TypeInformation<?> fallback = TypeInformation.of(owner).getProperty(propertyName);
144144
if (fallback != null) {
145-
try {
146145
return new PropertyPathInformation(TypeInformation.of(owner), fallback,
147-
Property.of(TypeInformation.of(owner), new PropertyDescriptor(propertyName, method, null)));
148-
} catch (IntrospectionException e) {
149-
throw new IllegalArgumentException(
150-
"Cannot find PropertyDescriptor from method %s.%s".formatted(owner.getName(), methodName), e);
151-
}
146+
propertyName);
152147
}
153148

154149
throw new IllegalArgumentException(
@@ -157,7 +152,7 @@ public static PropertyPathInformation ofInvokeVirtual(Class<?> owner, String met
157152

158153
return new PropertyPathInformation(TypeInformation.of(owner),
159154
TypeInformation.of(ResolvableType.forMethodReturnType(method, owner)),
160-
Property.of(TypeInformation.of(owner), descriptor));
155+
descriptor.getName());
161156
}
162157

163158
public static PropertyPathInformation ofFieldAccess(ClassLoader classLoader, Type ownerType, String name,
@@ -177,7 +172,7 @@ public static PropertyPathInformation ofFieldAccess(Class<?> owner, String field
177172
}
178173

179174
return new PropertyPathInformation(TypeInformation.of(owner),
180-
TypeInformation.of(ResolvableType.forField(field, owner)), Property.of(TypeInformation.of(owner), field));
175+
TypeInformation.of(ResolvableType.forField(field, owner)), field.getName());
181176
}
182177
}
183178

@@ -296,7 +291,7 @@ public TypeInformation<?> getOwningType() {
296291

297292
@Override
298293
public String getSegment() {
299-
return information.property().getName();
294+
return information.property();
300295
}
301296

302297
@Override
@@ -309,6 +304,7 @@ public Iterator<PropertyPath> iterator() {
309304
return list.iterator();
310305
}
311306

307+
@Override
312308
public Stream<PropertyPath> stream() {
313309
return list.stream();
314310
}

0 commit comments

Comments
 (0)