micronaut-projects / micronaut-core

Micronaut Application Framework
http://micronaut.io
Apache License 2.0
6k stars 1.04k forks source link

Injection of map of beans does not work if some of the services are injected by implementation type #10907

Closed musketyr closed 2 weeks ago

musketyr commented 2 weeks ago

Expected Behavior

If a bean has @Named annotation and the bean is injected as map then the name of the bean declared in @Named annotation is aways the key of the service in the map.

Actual Behaviour

If the bean annotated with @Named annotation is also injected by it's implementation type then and the injection happens before the map injection then the key in the map is the default name (lower-camel) instead of the name from @Named.

Steps To Reproduce

please, see the attached project and the test

Environment Information

Java 21

Example Application

https://github.com/musketyr/micronaut-forgotten-compile-static

Version

4.5.0

dstepanov commented 2 weeks ago

I will check