Skip to content

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

Closed

Description

@spring-projects-issues

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

Activity

  1. added
    type: bug
    in: web
    on Jan 11, 2019
  2. added this to the 4.2.5 milestone on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: webtype: bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions