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

RequestPartMethodArgumentResolver should defensively handle MethodParameter nesting level and java.util.Optional access [SPR-13850] #18423

Closed
spring-projects-issues opened this issue Jan 7, 2016 · 0 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jan 7, 2016

Juergen Hoeller opened SPR-13850 and commented

RequestPartMethodArgumentResolver contains a conditional code path with a Optional.ofNullable call. While this will work in most pre-Java-8 environments as well, it's fragile in debug environments, in particular on the IBM JVM. We should defensively delegate to an inner class with the actual Optional reference, like we do in other places.

Also, RequestPartMethodArgumentResolver modifies the nesting level of a potentially cached MethodParameter instance. This should be avoided in favor of temporary nested type access or a MethodParameter clone.


Affects: 4.2.4

Issue Links:

Referenced from: commits 3779fe9, a58eee6, b4f33ad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants