You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tamaya.apache.org by "Philipp Ottlinger (JIRA)" <ji...@apache.org> on 2018/02/05 20:52:02 UTC

[jira] [Resolved] (TAMAYA-326) ServiceContextManager picks second available service provider even if the ordinal is lower

     [ https://issues.apache.org/jira/browse/TAMAYA-326?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Philipp Ottlinger resolved TAMAYA-326.
--------------------------------------
       Resolution: Fixed
         Assignee: Philipp Ottlinger
    Fix Version/s: 0.4-incubating

Thanks for the contribution.

> ServiceContextManager picks second available service provider even if the ordinal is lower
> ------------------------------------------------------------------------------------------
>
>                 Key: TAMAYA-326
>                 URL: https://issues.apache.org/jira/browse/TAMAYA-326
>             Project: Tamaya
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 0.3-incubating
>            Reporter: William Lieurance
>            Assignee: Philipp Ottlinger
>            Priority: Major
>             Fix For: 0.4-incubating
>
>
> While adding some test coverage on the api, I found that org.apache.tamaya.spi.ServiceContextManager has a bug as it searches for the default service provider in loadDefaultServiceProvider.  Namely, the "highestOrdinal" is not set after the first service provider is found, so any following service provider with an ordinal higher than 0 will be used, even if that ordinal is lower than the first one's.
> I modified the test ServiceContext to demonstrate the bug, as well as fixed the logic on my branch in github.  Note that if you run the tests against the ServiceContextManager as-is, they will fail.
> https://github.com/peculater/incubator-tamaya/commit/320d018566b5f32afecb79d33109e3c4606ba782 is the commit
> [https://github.com/peculater/incubator-tamaya/tree/TAMAYA-326] is the branch
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)