Closed
Description
Hi 👋
I've been recently playing with the https://github.com/RedHatPerf/type-pollution-agent from @franz1981 and found that RabbitListenerAnnotationBeanPostProcessor
- more specifically findListenerAnnotations
- seems to be causing the TOP 3 for us during startup.
3: java.util.ArrayList
Count: 16432
Types:
java.util.List
java.util.Collection
java.lang.Iterable
Traces:
org.springframework.amqp.rabbit.annotation.RabbitListenerAnnotationBeanPostProcessor.findListenerAnnotations(Rabbi
tListenerAnnotationBeanPostProcessor.java:345)
class: java.util.Collection
count: 8123
org.springframework.core.annotation.TypeMappedAnnotations.getAggregates(TypeMappedAnnotations.java:226)
class: java.util.List
count: 7905
...
The method returns Collection
(and has corresponding type cast internally), while it returns a List
really. Everyone else in the traces seems to use largely List
as well (see the next trace e.g.). Even if this is a false-positive in terms of actual type pollution it seems like a simple enough fix to be on the safe side. I'll provide a PR shortly where further discussion can happen, but I needed this issue to stick to the commit convention ;-)
Cheers,
Christoph