Brandon Zeeb opened SPR-11369 and commented
The GenericConversionService has a private static class ConverterCacheKey which is used to map source and target TypeDescriptors to a GenericConverter. This class is used to aggregate the hashCodes of two TypeDescriptors (source and target).
The current TypeDescriptor hashCode only looks at the bare Java Class<?>, which is fine for primitives and none collection types. In the case of Collections types with generics, only using the bare Java type of the Collection makes it impossible to register two Converters with the same target collection type.
ie:
- Converter<String, Set<String>>
- Converter<String, Set<Integer>>
The field resolvableType contains information on both the Collection type and it's generic types. Perhaps this field should be used instead?
I have rated this priority initially as "Critical" given it is not possible to register Converters with the same Collection type that differ on generic types, which is a blocker in our applications. We need this to work, and would prefer not to only accept Collection<String>.
No further details from SPR-11369