[cdi-dev] [JBoss JIRA] (CDI-733) javax.enterprise.event.Event#select shouldnt use TypeLiteral but Type

Matej Novotny (JIRA) issues at jboss.org
Mon Aug 20 05:59:00 EDT 2018


    [ https://issues.jboss.org/browse/CDI-733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13621320#comment-13621320 ] 

Matej Novotny commented on CDI-733:
-----------------------------------

Just for completeness, Weld also has {{Type}} based select on {{Instance}} - https://github.com/weld/api/blob/3.0.SP4/weld/src/main/java/org/jboss/weld/inject/WeldInstance.java#L119-L134

If we want to add this to the spec, please mind the type safety hazard, in Weld we added [this line|https://github.com/weld/api/blob/3.0.SP4/weld/src/main/java/org/jboss/weld/inject/WeldInstance.java#L122] to ensure that things won't blow up (well, at least not as violently). Invoking type-based select on anything else then {{Object}} will possibly result in an error.

> javax.enterprise.event.Event#select shouldnt use TypeLiteral but Type
> ---------------------------------------------------------------------
>
>                 Key: CDI-733
>                 URL: https://issues.jboss.org/browse/CDI-733
>             Project: CDI Specification Issues
>          Issue Type: Feature Request
>            Reporter: Romain Manni-Bucau
>            Priority: Minor
>
> Goal is to enable a bit more meta programming and in particular instantiation of custom parameterized type of events, currently it requires to go through the bean manager whereas the event would be a natural place to resolve an event.



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the cdi-dev mailing list