Skip to content

Nesting level type index not respected when binding to fields [SPR-8394] #13041

@spring-projects-issues

Description

@spring-projects-issues

Keith Donald opened SPR-8394 and commented

The following test illustrates the problem:

@Test
@Ignore
public void fieldMap() throws Exception {
     // typeIndex handling not currently supported by fields
     TypeDescriptor desc = new TypeDescriptor(getClass().getField("field"));
     assertEquals(Integer.class, desc.getMapKeyTypeDescriptor().getElementType());
     assertEquals(Long.class, desc.getMapValueTypeDescriptor().getElementType());
}
public Map<List<Integer>, List<Long>> field;
junit.framework.AssertionFailedError: expected:<class java.lang.Integer> but was:<class java.lang.Long>
	at junit.framework.Assert.fail(Assert.java:47)

GenericCollectionResolver needs to be enhanced to provide support for this with Fields as its done with MethodParameters.


No further details from SPR-8394

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