-
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
Clarify observability for primitive types #829
Comments
This seems reasonable to me. We probably want to copy https://jakarta.ee/specifications/cdi/4.1/jakarta-cdi-spec-4.1.html#primitive_types_and_null_values to somewhere in the Events chapter. Not sure about |
For the record, I just wrote a test for this that verifies that ArC behaves the same as Weld (that is, both primitive and wrapper observers are notified). |
(Tiny point to @manovotn that I think you want your |
The only additional input I have is: I haven't kept up with Valhalla at all, but suppose there is some kind of future where you could fire a primitive type. Maybe it would be OK to leave this as unspecified behavior to permit such a state of affairs in the future? |
Re Valhalla: generics specialization is still in the distant future, and we're already in a "problem" with bean assignability anyway (we treat primitives and their wrappers as identical), so I wouldn't bother too much about this. Technically, even though I couldn't find this specified anywhere, all implementations of CDI check that the event object is not |
Another note: events cannot be |
Fair enough :-) Thanks! |
The specification does not say what works and what doesn't if there is a combination of primitive and wrapper types between observed type and fired event.
Note that type arguments cannot be primitive and for that reason I will assume that event payload is a wrapper type here:
Assuming the event is fired, which observer(s) should be notified?
IMO, both - which is what Weld currently does. Although the specification does not seem to cover this, nor have I found a TCK test for it.
For completeness a more details, see the weld-dev mailing list where this question was asked - https://lists.jboss.org/archives/list/[email protected]/thread/IDWNDAJLY57OE6MJNNRVW5HSOV3MJLPJ/
The text was updated successfully, but these errors were encountered: