Issue #23352 has shown that the mutable nature of MethodParameter can cause problems. One particularly unusual aspect is that getContainingClass() can change as a side effect of calling GenericTypeResolver.resolveParameterType().
Internally, we don't actually mutate MethodParameter instances that often so it's possible that we could deprecate the mutation methods in favor of calls that return a new instance.
Issue #23352 has shown that the mutable nature of
MethodParametercan cause problems. One particularly unusual aspect is thatgetContainingClass()can change as a side effect of callingGenericTypeResolver.resolveParameterType().Internally, we don't actually mutate
MethodParameterinstances that often so it's possible that we could deprecate the mutation methods in favor of calls that return a new instance.