Qualifier on alternative bean - duplicate element error
See original GitHub issueDescribe the bug
I have a bean with annotations:
@ApplicationScoped @MyQualifier("some-value") public class MyBean { .. }
In the tests I have an alternative bean for it with following annotations:
@ApplicationScoped @MyQualifier("some-value") @Alternative @Priority(5) public class TestMyBean extends MyBean { .. }
When running the tests, an IllegalArgumentException happens with: duplicate element @MyQualifier(“some-value”)
When I remove the qualifier from the alternative it works as expected.
Expected behavior
I would expect that the Qualifier annotation can be defined on the alternative bean as it was prior to Quarkus 2.3 (Likely, the change was introduced with https://github.com/quarkusio/quarkus/pull/19759)
Actual behavior
No response
How to Reproduce?
No response
Output of uname -a
or ver
No response
Output of java -version
openjdk version “11.0.10” 2021-01-19 LTS
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.4.1.Final
Build tool (ie. output of mvnw --version
or gradlew --version
)
No response
Additional information
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (5 by maintainers)
I mean it should be ignored if the subtype declares an annotation of the same type… as defined by the CDI spec.
Yes, the IAE comes from the
java.util.Set#of()
method and it was fixed in https://github.com/quarkusio/quarkus/pull/21232 in 2.4.2.Final.