Skip to content

ConversionService does not support Map to Object [SPR-6476] #11142

@spring-projects-issues

Description

@spring-projects-issues

Lance Arlaus opened SPR-6476 and commented

DefaultConversionService does not support converting a Map to an Object

The expectation is to return the original object unchanged (a no-op conversion).
Instead, null is returned.

@Test
public void testMapToObjectConversionBug() {
     final DefaultConversionService conversionService = new DefaultConversionService();
     final Map<Object, Object> raw = new HashMap<Object, Object>();
     raw.put("key", "value");
     final Object converted = conversionService.convert(raw, Object.class);
          Assert.assertSame(raw, converted);
}

Affects: 3.0 RC2

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