[cdi-dev] [JBoss JIRA] (CDI-726) Deprecate before dropping CDI.setCDIProvider

Romain Manni-Bucau (JIRA) issues at jboss.org
Mon Jun 4 00:38:00 EDT 2018

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

Romain Manni-Bucau commented on CDI-726:

Please Emily stop saying these methods are for OSGi, this is just not true, technically you have at least 2 trivial alternatives to not pollute the spec with unsafe methods and still work in OSGi (once again geronimo and was did it for years so you can xheck not that far ;)). Maybe openliberty got lazy and used that bit it is an openliberty implementation leak in specs which is a very big concern if true.

Concretely this method is a user method (since it is in the spec and whatever any javadoc could state) and is not thread safe and worse, it just doesnt work in general if the user, a framework or a 2nd container calls it after a first one.

> Deprecate before dropping CDI.setCDIProvider
> --------------------------------------------
>                 Key: CDI-726
>                 URL: https://issues.jboss.org/browse/CDI-726
>             Project: CDI Specification Issues
>          Issue Type: Feature Request
>          Components: Java SE Integration
>    Affects Versions: 2.0 .Final
>            Reporter: Romain Manni-Bucau
>            Priority: Blocker
> CDI.setCDIProvider allows to switch the cdi provider at *any* time by *anyone*. This lead to issues integrating multiple libraries doing it + is not a real user facing API, it is actually a server internal.
> Proposal is to deprecate the method, remove its implementation (always throw an IllegalStateException or just do a noop) and finally drop the method after one or two releases since it can't really be used except for very simple apps.

This message was sent by Atlassian JIRA

More information about the cdi-dev mailing list