Skip to content

CollectionFactory should create empty EnumSets and EnumMaps [SPR-12533] #17138

@spring-projects-issues

Description

@spring-projects-issues

Sam Brannen opened SPR-12533 and commented

Status Quo

#17089 introduced conversion support for EnumSet and EnumMap in CollectionFactory; however, the newly introduced support contradicts the existing contract for the related methods by creating a copy of the supplied set or map, thereby potentially including elements in the returned collection when the returned collection should in fact be empty.

Deliverables

  1. Refactor createApproximateCollection() so that it returns an empty EnumSet.
  2. Refactor createApproximateMap() so that it returns an empty EnumMap.

Affects: 4.1.3

Issue Links:

Referenced from: commits aec284a

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions