-
Notifications
You must be signed in to change notification settings - Fork 78
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
ProcessInjectionPoint clarification for Instance injection points #826
Comments
Without too much thinking about this, it seems to me that observing |
This seems like the only part that would possibly contradict your conclusion, and it reads to me like it relates to the expected values if you inject an The consequence of that would be that if you do @Inject Instance<Foo> fooInstance; then in an extension However, if you had @Dependent
public class Foo {
@Inject InjectionPoint ip;
....
} then for a |
Actually reading the spec for Injection point metadata again, I think it's fairly clear that it's expected that you get a different
The |
So you think no clarification is needed? I am not yet sure what I'd propose as exact wording but I feel like we should at least try to specify that the text under InjectionPoint#getType() references only the case where you inject |
From a technical point of view I don't think a clarification is needed, but if we can find a way of making it easier to read and understand, I think we should. I did try to think about how I would change it, and I ran into a problem of ordering. At the moment we first talk about what I guess we could either:
|
+1, this makes more sense to me although both would work. |
I think the documentation around
ProcessInjectionPoint
and itsgetInjectionPoint()
would deserve a clarification.And possibly for
InjectionPoint#getType()
as well.Currently, it is pretty unclear what will happen if your bean has an injection point with
Instance<X>
and you are trying to observe that.Given following bean with its injection point:
And the following extension with PIP observer:
If you go looking into docs and javadoc, the notable parts are:
ProcessInjectionPoint#getInjectionPoint()
InjectionPoint#getType()
:required type
is basicallyInstance<X>
Few side notes:
ProcessInjectionPoint<T, Instance<Foo>>
as otherwise you are unable to differentiate between classic andInstance
-based injection pointsInstance
injection points - again, for that reason you should IMO be able to observe that directlyInstance<Foo>
.Thoughts?
The text was updated successfully, but these errors were encountered: