Skip to content

String to Enum Interface conversion not working [SPR-12050] #16666

Closed
@spring-projects-issues

Description

@spring-projects-issues

David Haraburda opened SPR-12050 and commented

Given an Enum that implements SomeInterface, GenericConversionService will attempt to use the default StringToEnumConverterFactory, even if a custom converter for String -> SomeInterface is registered. This problem was reported and described in #14326 but wasn't actually fixed. Instead, the "opposite" case of SomeInterface -> String conversion which also wasn't working was fixed.

The original test case attached to #14326 fails on 4.0.6; I have also attached to this JIRA an updated test case based on the original that in addition to demonstrating the described failure also shows a failure when a converter is registered for the base interface of some interface that is implemented by an Enum (i.e., SomeInterface extends SomeBaseInterface).


Affects: 4.0.6

Attachments:

Issue Links:

Referenced from: commits d0e6f0f, c299371

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions