-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ArC - register synthetic beans for List injection points #21378
Conversation
mkouba
commented
Nov 11, 2021
- unless a matching bean exists
Here's an idea - Improvement ideas:
|
I saw the discussion on Zulip and thought about it for a while. I think it's full of corner cases. The most obvious one: what happens when a bean of type I ended up thinking that this would be best done either using a dedicated type ( |
But this can happen even now. You add a dependency and get a new bean for type
Well, the libraries should not provide beans of type
I have a problem with those names ^. Yes, initially I was thinking about a dedicated type but that's not very convenient. I was also thinking about a special qualifier (e.g. |
Hm, I actually quite like the |
Boom is good (especially in our case, when it fails the build). Silently changing what is injected, not so much.
Fair point... until you consider parametric bean types :-) Here's the Infinispan example I mentioned above: https://github.com/quarkusio/quarkus/blob/2.4.1.Final/extensions/infinispan-client/runtime/src/main/java/io/quarkus/infinispan/client/runtime/InfinispanClientProducer.java#L283 Haha. Yes. It's an advanced case. Sorry, I somehow got into a mode where this kind of crap pop up into my brain almost instantly 😆 |
It does not always fail the build. Think about
Parameterized bean types are OK. What's not OK is to define a bean with bean type
No problem ;-). I will modify the PR and introduce the |
Fair enough. But it would still fail at runtime with ambiguous dependency (where the
Parameterized (
Agree. My point is that it is rather easy to create a bean of type
I don't want to force you to do that, maybe other people will convince you that my objections are crap and should be ignored :-) |
IMHO it would be very unusual for there to be a conflict like we are talking about. Personally I am +1 to this change, as it makes things a lot more intuitive for users. |
Definitely +1 from me. The use of the |
I've just pushed the |
b3b71f8
to
270bb80
Compare
This is great! But I don't know that it will change much for me as I'm using a recorder (to fetch/iterate instances programmatically) rather than using injection. Unless @geoand can prove me wrong, he's been fixing all of my early mistakes. ;) |
Which pieces do you have in mind? I'd be glad to take a look |
+1, this idea sounds good and adding |
Brain dumping to poor @geoand in DMs. Have pity on his 🧠 |
It's all good! :) |
270bb80
to
6e02cca
Compare
This workflow status is outdated as a new workflow run has been triggered. Failing Jobs - Building 6e02cca
Failures⚙️ Native Tests - Windows - hibernate-validator #- Failing: integration-tests/hibernate-validator
📦 integration-tests/hibernate-validator✖ |
6e02cca
to
9269735
Compare
I think that this PR is ready for review now ;-) |
This workflow status is outdated as a new workflow run has been triggered. Failing Jobs - Building 9269735
Full information is available in the Build summary check run. Failures⚙️ JVM Tests - JDK 17 #- Failing: integration-tests/kafka-devservices
📦 integration-tests/kafka-devservices✖
⚙️ Native Tests - Windows - hibernate-validator #- Failing: integration-tests/hibernate-validator
📦 integration-tests/hibernate-validator✖ |
9269735
to
eaf95b6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't say I really understand it, but it seems fine :-)
extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/ArcProcessor.java
Show resolved
Hide resolved
independent-projects/arc/runtime/src/main/java/io/quarkus/arc/Identified.java
Outdated
Show resolved
Hide resolved
extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/ArcProcessor.java
Show resolved
Hide resolved
- annotated with the All qualifier
eaf95b6
to
effffc9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea!
This is too big to be backported post CR1. |
No problem. |