Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.3-incubating
-
None
Description
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.