|
|
@ -160,9 +160,7 @@ public class MethodParameter { |
|
|
|
* @param containingClass the containing class |
|
|
|
* @param containingClass the containing class |
|
|
|
* @since 5.2 |
|
|
|
* @since 5.2 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
MethodParameter(Executable executable, int parameterIndex, |
|
|
|
MethodParameter(Executable executable, int parameterIndex, @Nullable Class<?> containingClass) { |
|
|
|
@Nullable Class<?> containingClass) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.notNull(executable, "Executable must not be null"); |
|
|
|
Assert.notNull(executable, "Executable must not be null"); |
|
|
|
this.executable = executable; |
|
|
|
this.executable = executable; |
|
|
|
this.parameterIndex = validateIndex(executable, parameterIndex); |
|
|
|
this.parameterIndex = validateIndex(executable, parameterIndex); |
|
|
@ -488,9 +486,7 @@ public class MethodParameter { |
|
|
|
if (paramType != null) { |
|
|
|
if (paramType != null) { |
|
|
|
return paramType; |
|
|
|
return paramType; |
|
|
|
} |
|
|
|
} |
|
|
|
if (this.containingClass != null) { |
|
|
|
paramType = ResolvableType.forMethodParameter(this, null, 1).resolve(); |
|
|
|
paramType = ResolvableType.forMethodParameter(this, null, 1, null).resolve(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (paramType == null) { |
|
|
|
if (paramType == null) { |
|
|
|
paramType = computeParameterType(); |
|
|
|
paramType = computeParameterType(); |
|
|
|
} |
|
|
|
} |
|
|
@ -760,7 +756,7 @@ public class MethodParameter { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
MethodParameter otherParam = (MethodParameter) other; |
|
|
|
MethodParameter otherParam = (MethodParameter) other; |
|
|
|
return (this.containingClass == otherParam.containingClass && |
|
|
|
return (getContainingClass() == otherParam.getContainingClass() && |
|
|
|
ObjectUtils.nullSafeEquals(this.typeIndexesPerLevel, otherParam.typeIndexesPerLevel) && |
|
|
|
ObjectUtils.nullSafeEquals(this.typeIndexesPerLevel, otherParam.typeIndexesPerLevel) && |
|
|
|
this.nestingLevel == otherParam.nestingLevel && |
|
|
|
this.nestingLevel == otherParam.nestingLevel && |
|
|
|
this.parameterIndex == otherParam.parameterIndex && |
|
|
|
this.parameterIndex == otherParam.parameterIndex && |
|
|
@ -925,11 +921,10 @@ public class MethodParameter { |
|
|
|
KFunction<?> function = ReflectJvmMapping.getKotlinFunction(method); |
|
|
|
KFunction<?> function = ReflectJvmMapping.getKotlinFunction(method); |
|
|
|
if (function != null && function.isSuspend()) { |
|
|
|
if (function != null && function.isSuspend()) { |
|
|
|
Type paramType = ReflectJvmMapping.getJavaType(function.getReturnType()); |
|
|
|
Type paramType = ReflectJvmMapping.getJavaType(function.getReturnType()); |
|
|
|
Class<?> paramClass = ResolvableType.forType(paramType).resolve(); |
|
|
|
return ResolvableType.forType(paramType).resolve(method.getReturnType()); |
|
|
|
Assert.notNull(paramClass, "Type " + paramType + "can't be resolved to a class"); |
|
|
|
|
|
|
|
return paramClass; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return method.getReturnType(); |
|
|
|
return method.getReturnType(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|