abhinav-phi opened a new pull request, #13770:
URL: https://github.com/apache/maven/pull/13770
Fixes #13752.
`Map<String, T>` injection used `Collectors.toMap` without a merge function,
so duplicate `@Named` qualifiers failed with the JDK's raw `Duplicate key`
error whose values were lambda identities:
```
java.lang.IllegalStateException: Duplicate key legacy (attempted merging
values ...Lambda...)
```
Collect bindings first and throw `DIException` naming the duplicate key and
both binding origins before compiling them:
```
Duplicate bindings for key @Named("legacy") ...:
- ...FirstDispatcher...
- ...SecondDispatcher...
Remove one of the conflicting bindings or use distinct @Named qualifiers.
```
Adds a regression test covering duplicate `@Named` bindings.
Tests: `mvn -B -pl impl/maven-di -am test` -> 48 tests pass;
`spotless:check` and `checkstyle:check` clean.
I have read the [I CLA](https://www.apache.org/licenses/icla.pdf) and agree
to the terms. (If the bot requires a signed ICLA on file, it may need to be
verified separately.)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]