Skip to content

Default conversion support for EnumSet / EnumMap [SPR-12483] #17089

@spring-projects-issues

Description

@spring-projects-issues

geert opened SPR-12483 and commented

Default converters cannot handle EnumSets. A form object with a EnumSet property throws an exception.

Failed to convert property value of type java.lang.String[] to required type java.util.EnumSet for property typeProjecten; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type java.lang.String[] to type @org.hibernate.validator.constraints.NotEmpty java.util.EnumSet<@org.hibernate.validator.constraints.NotEmpty nl.amc.mb.amcliteratuur.domain.TypeProject> for value {CAT, CONFERENCE}; nested exception is java.lang.IllegalArgumentException: Could not instantiate Collection type: java.util.EnumSet

This issue has been resolved in Spring DATA MongoDB (https://jira.spring.io/browse/DATAMONGO-833). It would be nice if it was solved in Spring Framework itself


Affects: 3.2.12

Issue Links:

Referenced from: commits aec284a, bfbd25a, 7635e7b, fef4cd0

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