Uploaded image for project: 'Tamaya'
  1. Tamaya
  2. TAMAYA-199

DefaultServiceContext.getServices does not return the services as sorted list

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.3-incubating
    • 0.3-incubating
    • Core
    • 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.

      Attachments

        1. TAMAYA-199.patch
          3 kB
          Thomas Liebetraut

        Activity

          People

            anatole Anatole Tresch
            tommie-lie Thomas Liebetraut
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: