@@ -160,9 +160,7 @@ public MethodParameter(Constructor<?> constructor, int parameterIndex, int nesti
160
160
* @param containingClass the containing class
161
161
* @since 5.2
162
162
*/
163
- MethodParameter (Executable executable , int parameterIndex ,
164
- @ Nullable Class <?> containingClass ) {
165
-
163
+ MethodParameter (Executable executable , int parameterIndex , @ Nullable Class <?> containingClass ) {
166
164
Assert .notNull (executable , "Executable must not be null" );
167
165
this .executable = executable ;
168
166
this .parameterIndex = validateIndex (executable , parameterIndex );
@@ -488,9 +486,7 @@ public Class<?> getParameterType() {
488
486
if (paramType != null ) {
489
487
return paramType ;
490
488
}
491
- if (this .containingClass != null ) {
492
- paramType = ResolvableType .forMethodParameter (this , null , 1 , null ).resolve ();
493
- }
489
+ paramType = ResolvableType .forMethodParameter (this , null , 1 ).resolve ();
494
490
if (paramType == null ) {
495
491
paramType = computeParameterType ();
496
492
}
@@ -760,7 +756,7 @@ public boolean equals(@Nullable Object other) {
760
756
return false ;
761
757
}
762
758
MethodParameter otherParam = (MethodParameter ) other ;
763
- return (this . containingClass == otherParam .containingClass &&
759
+ return (getContainingClass () == otherParam .getContainingClass () &&
764
760
ObjectUtils .nullSafeEquals (this .typeIndexesPerLevel , otherParam .typeIndexesPerLevel ) &&
765
761
this .nestingLevel == otherParam .nestingLevel &&
766
762
this .parameterIndex == otherParam .parameterIndex &&
@@ -925,11 +921,10 @@ static private Class<?> getReturnType(Method method) {
925
921
KFunction <?> function = ReflectJvmMapping .getKotlinFunction (method );
926
922
if (function != null && function .isSuspend ()) {
927
923
Type paramType = ReflectJvmMapping .getJavaType (function .getReturnType ());
928
- Class <?> paramClass = ResolvableType .forType (paramType ).resolve ();
929
- Assert .notNull (paramClass , "Type " + paramType + "can't be resolved to a class" );
930
- return paramClass ;
924
+ return ResolvableType .forType (paramType ).resolve (method .getReturnType ());
931
925
}
932
926
return method .getReturnType ();
933
927
}
934
928
}
929
+
935
930
}
0 commit comments