TypeDescriptor.forElementType() does not work for TypeDescriptor obtained via TypeDescriptor.valueOf() [SPR-7390] #12048
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
Jon Kranes opened SPR-7390 and commented
Based on JavaDoc for TypeDescriptor.forElementType(), I expect the expression:
should produce a TypeDescriptor for parameterized List of type String, i.e. java.util.List<String>. However, the implementation for a TypeDescriptor that was not originally constructed from a Field or MethodParameter simply does:
The expected behavior is very useful as there appears to be no other way to programmatically construct a TypeDescriptor for a parameterized collection, without having reference to a Field or MethodParameter object. The workaround is to create or refer to a field or method in some arbitrary class in order to use the Field or MethodParameter constructors, but this is awkward and would be unnecessary if the forElementType worked as expected.
Simple unit test:
Affects: 3.0.3
Issue Links:
The text was updated successfully, but these errors were encountered: