-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: bugA general bugA general bug
Milestone
Description
Oliver Drotbohm opened SPR-12589 and commented
In case the ConversionService used in the ObjectToOptionalConverter is a FormattingConversionService, a ParserConverter will be used for the String to object conversion. For empty String instances this will immediately return null from convert(…) which then causes an exception as the ObjectToOptionalConverter passes it to Optional.of(…).
Here's a sample scenario:
String someMethod(@RequestParam Optional<Point> location) { … }Now imagine we have a Formatter registered to turn a request parameter String into a Point. If now a request ?location= (no value) is triggered, the scenario described above kicks in.
Affects: 4.1.4
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: bugA general bugA general bug