Autowiring of generic beans with array types is broken since 6.2.0-M1 #33535
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: regression
A bug that is also a regression
Milestone
Affects: 6.2.0-SNAPSHOT. It starts on 6.2.0-M1
Let's start with a MRE:
Here a bean is registered as
GenericClass<?>
. Later it is autowired as a dependency of other beans. It works when a dependency is defined asGenericClass<Object>
but doesn't work for arrays. I'm usingbyte[]
as an example, but any array won't work includingObject
arrays. I suppose it's a bug as this example works on earlier versions.An example when it might be important
Spring boot registers
KafkaTemplate<?,?>
bean as it can be seen in KafkaAutoConfiguration. When used it's declared with concrete generic parameters defined by used key and value serializers. Value serializerorg.apache.kafka.common.serialization.ByteArraySerializer
works with byte arrays, so requires the second generic parameter to bebyte[]
.The text was updated successfully, but these errors were encountered: