The method ResolvableType.forMethodParameter can be unused in some cases. See #23792.

Comment From: jhoeller

See my comment on the original issue: I intend to go with a simpler check along the lines of the effective behavior in 5.1.x, just checking for a containing class different from the declaring class. I've got this working locally, showing a significant enough performance difference in a microbenchmark.

As for this PR, a specific check for java.lang.Object doesn't seem to be ideal since an unresolved generic can expose its upper bound (which may be any type) as the plain parameter type from reflection. Also, resolving getGenericParameterType can be expensive on its own when just done to prevent some other expensive computation. Overall, restoring behavior along the lines of 5.1.x seems like a good enough compromise. Thanks for the PR, in any case!