@@ -1219,11 +1219,11 @@ public static ResolvableType forMethodParameter(MethodParameter methodParameter)
12191219 */
12201220 public static ResolvableType forMethodParameter (MethodParameter methodParameter , ResolvableType implementationType ) {
12211221 Assert .notNull (methodParameter , "MethodParameter must not be null" );
1222- implementationType = (implementationType == null ? forType (methodParameter .getContainingClass ()) : implementationType );
1222+ implementationType = (implementationType != null ? implementationType :
1223+ forType (methodParameter .getContainingClass ()));
12231224 ResolvableType owner = implementationType .as (methodParameter .getDeclaringClass ());
1224- return forType (null , new MethodParameterTypeProvider (methodParameter ),
1225- owner .asVariableResolver ()).getNested (methodParameter .getNestingLevel (),
1226- methodParameter .typeIndexesPerLevel );
1225+ return forType (null , new MethodParameterTypeProvider (methodParameter ), owner .asVariableResolver ()).
1226+ getNested (methodParameter .getNestingLevel (), methodParameter .typeIndexesPerLevel );
12271227 }
12281228
12291229 /**
@@ -1241,13 +1241,26 @@ public static ResolvableType forMethodParameter(MethodParameter methodParameter,
12411241 getNested (methodParameter .getNestingLevel (), methodParameter .typeIndexesPerLevel );
12421242 }
12431243
1244+ /**
1245+ * Resolve the top-level parameter type of the given {@code MethodParameter}.
1246+ * @param methodParameter the method parameter to resolve
1247+ * @since 4.1.9
1248+ * @see MethodParameter#setParameterType
1249+ */
1250+ static void resolveMethodParameter (MethodParameter methodParameter ) {
1251+ Assert .notNull (methodParameter , "MethodParameter must not be null" );
1252+ ResolvableType owner = forType (methodParameter .getContainingClass ()).as (methodParameter .getDeclaringClass ());
1253+ methodParameter .setParameterType (
1254+ forType (null , new MethodParameterTypeProvider (methodParameter ), owner .asVariableResolver ()).resolve ());
1255+ }
1256+
12441257 /**
12451258 * Return a {@link ResolvableType} as a array of the specified {@code componentType}.
12461259 * @param componentType the component type
12471260 * @return a {@link ResolvableType} as an array of the specified component type
12481261 */
12491262 public static ResolvableType forArrayComponent (ResolvableType componentType ) {
1250- Assert .notNull (componentType , "componentType must not be null" );
1263+ Assert .notNull (componentType , "Component type must not be null" );
12511264 Class <?> arrayClass = Array .newInstance (componentType .resolve (), 0 ).getClass ();
12521265 return new ResolvableType (arrayClass , null , null , componentType );
12531266 }
0 commit comments