1515 */ 
1616package  org .springframework .data .util ;
1717
18- import  java .beans .IntrospectionException ;
1918import  java .beans .Introspector ;
2019import  java .beans .PropertyDescriptor ;
2120import  java .io .IOException ;
3736import  java .util .stream .Stream ;
3837
3938import  org .jspecify .annotations .Nullable ;
39+ 
4040import  org .springframework .asm .ClassReader ;
4141import  org .springframework .asm .ClassVisitor ;
4242import  org .springframework .asm .Label ;
4646import  org .springframework .beans .BeanUtils ;
4747import  org .springframework .core .ResolvableType ;
4848import  org .springframework .dao .InvalidDataAccessApiUsageException ;
49- import  org .springframework .data .mapping .model .Property ;
5049import  org .springframework .util .ClassUtils ;
5150import  org .springframework .util .ConcurrentReferenceHashMap ;
5251import  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