Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate mutable aspects of MethodParameter #23385

Closed
philwebb opened this issue Jul 30, 2019 · 2 comments
Closed

Deprecate mutable aspects of MethodParameter #23385

philwebb opened this issue Jul 30, 2019 · 2 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@philwebb
Copy link
Member

philwebb commented Jul 30, 2019

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.

@philwebb philwebb self-assigned this Jul 30, 2019
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jul 30, 2019
@philwebb philwebb added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jul 30, 2019
philwebb added a commit to philwebb/spring-framework that referenced this issue Jul 30, 2019
Deprecate all mutation methods in `MethodParameter` in favor of factory
methods that return a new instance. Existing code that previously relied
on mutation has been updated to use the replacement methods.

Closes spring-projectsgh-23385
@philwebb
Copy link
Member Author

@jhoeller I have a branch here with a fix https://github.com/philwebb/spring-framework/tree/gh-23385. It will need to be rebased when #23352 is committed.

@jhoeller jhoeller added this to the 5.2 RC1 milestone Jul 30, 2019
@jhoeller
Copy link
Contributor

@philwebb This looks alright to me. Feel free to bring a corresponding commit into master ASAP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants