[cdi-dev] [JBoss JIRA] (CDI-395) Public fields in extensions should not be allowed

Martin Kouba (JIRA) jira-events at lists.jboss.org
Mon Nov 25 05:56:06 EST 2013


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

Martin Kouba commented on CDI-395:
----------------------------------

I think only non-static public fields should be disallowed, see also CDI-244.
                
> Public fields in extensions should not be allowed
> -------------------------------------------------
>
>                 Key: CDI-395
>                 URL: https://issues.jboss.org/browse/CDI-395
>             Project: CDI Specification Issues
>          Issue Type: Clarification
>          Components: Portable Extensions
>    Affects Versions: 1.1.PFD
>            Reporter: Marko Lukša
>              Labels: cdi-1.1-mr
>
> Since the container must provide an @ApplicationScoped bean for every extension and since a proxy must be injected into injection points requesting this bean, it should be clear that extensions should not be allowed to have public fields. The spec doesn't specify this explicitly, but it should - like it does for non-dependent managed beans.
> The container should treat this as a definition error, otherwise people may end up accessing these public fields of extensions and getting weird errors.
> See also WELD-1474

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the cdi-dev mailing list