Thomas Liebetraut created TAMAYA-199:
----------------------------------------

             Summary: 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


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)

Reply via email to