-
Notifications
You must be signed in to change notification settings - Fork 287
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
dont inherit producers #2903
dont inherit producers #2903
Conversation
possibly related: |
I've tried to write a naive test based on your description and I am not seeing the same issue. What am I missing?
|
FTR the CI failure seems related to your changes, but before we jump into that, I'd like to understand what's the basic scenario where this fails. |
Oops you are right, that works for me, too. However, with a producer field instead of a producer method, it fails, at least for me, and does not without |
Sure, will take a look tomorrow! |
https://jakarta.ee/specifications/cdi/4.0/jakarta-cdi-spec-4.0#alternative_metadata_sources states that the container should call
... field or method respectively. Eventually, I figure, |
Tried the producer field scenario and indeed it looks like there is inheritance happening where it shouldn't.
FTR, I have created a WELD issue to track this - https://issues.redhat.com/browse/WELD-2773 What's puzzling is how is this being caused by the extension invoking |
Hm, right, so the fact we manipulate the annotated type in an extension creates a new AT which ends up having an internal property Surprisingly, discovered ATs use
to determine if the field belongs to them whereas non-discovered instead perform
That's technically all I need to locally fix for the test to pass.
@dev-qnz This rings a bell, I vaguely recall encountering this before and for some reason choosing not to internally use that everywhere. Some of the failing tests you can see in the CI might be a hint; I need to take a deeper look into this. Some of your changes likely trigger a cycle as I am getting this:
|
Also, what got me stuck for a bit is that your tests are: I did some quick and dirty changes to see if they would pass with my single-file change in the other PR and they do. Well, the So basically all other file changes in this PR are not related to the producer inheritance problem itself. |
Alright, thank you for bringing this to my attention 👍 |
I suspect that not inheriting a producer fails in combination with an
@Observes
ProcessAnnotatedType
Extension
.A producer works on its own and also with subclasses around like this
so that only one
Foo
is produced andFoo
resolves.However, in combination with an
@Observes
ProcessAnnotatedType
Extension
like below,Foo
does not any longer resolve successfully even though the@Observes
ProcessAnnotatedType
Extension
did not do any real harm on its own beside its mere existence.