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 2016/11/19 19:33:58 UTC

[jira] [Commented] (TAMAYA-199) DefaultServiceContext.getServices does not return the services as sorted list

    [ https://issues.apache.org/jira/browse/TAMAYA-199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15679745#comment-15679745 ] 

Philipp Ottlinger commented on TAMAYA-199:
------------------------------------------

[~tommie-lie] thanks for your bug report and the patch. In order to properly license your contribution we need to make sure, that you signed a license agreement. Did you do that already? What's your apache login/username? Thanks :-)

> DefaultServiceContext.getServices does not return the services as sorted list
> -----------------------------------------------------------------------------
>
>                 Key: TAMAYA-199
>                 URL: https://issues.apache.org/jira/browse/TAMAYA-199
>             Project: Tamaya
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 0.3-incubating
>            Reporter: Thomas Liebetraut
>         Attachments: TAMAYA-199.patch
>
>
> At some places in the code, for instance in tamaya-formats, {{ConfigurationFormats.getFormats()}} the code relies on a list of loaded services to be sorted by priority.
> This is an assumption that is wrong and results in {{ConfigurationFormats.getFormats()}} to violate its documentation. The formats are in the order that the ServiceLoader found them, not sorted by priority.
> While the documentation of {{DefaultServiceContext.getServices}} does not explicitly state an order, I think it would make most sense to sort the list there. If a service client doesn't care about the order, an ordered list won't be a problem, but if a client cares about the order (like in tamaya-formats), it doesn't have to implement the sorting over and over again.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)