[JBoss JIRA] (CDI-573) Review code of CDI class to switch to ServiceLoader
by Antoine Sabot-Durand (JIRA)
[ https://issues.jboss.org/browse/CDI-573?page=com.atlassian.jira.plugin.sy... ]
Antoine Sabot-Durand edited comment on CDI-573 at 12/15/15 11:47 AM:
---------------------------------------------------------------------
PR sent.
Code was simplified relying on JDK {{ServiceLoader}} class.
We could simplify more since the only provider used is the first found (see {{configuredProvider}} initialization in {{getCDIProvider()}} method).
Question is, as we didn't had tests for this code, how can we make sure that the behavior stays the same ?
was (Author: antoinesabot-durand):
PR sent.
Code was simplified relying on JDK ServiceLoader class.
We could simplify more since the only provider used is the first found (see {{configuredProvider}} initialization in {{getCDIProvider()}} method).
Question is, as we didn't had tests for this code, how can we make sure that the behavior stays the same ?
> Review code of CDI class to switch to ServiceLoader
> ---------------------------------------------------
>
> Key: CDI-573
> URL: https://issues.jboss.org/browse/CDI-573
> Project: CDI Specification Issues
> Issue Type: Feature Request
> Components: Concepts
> Affects Versions: 2.0-EDR1
> Reporter: Antoine Sabot-Durand
> Assignee: Antoine Sabot-Durand
> Fix For: 2.0 (proposed)
>
>
> Right now {{CDI}} seems to mimics the JDK service loader mechanism in the the private {{findAllProviders}} method.
> In order to get rid of useless code in the API and to limit compatibility issues with JDK9 and jigsaw, I think we should change this code and use Service Loader instead of doing something similar.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)