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

ServiceContextManager picks second available service provider even if the ordinal is lower

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.3-incubating
    • 0.4-incubating
    • Core
    • None

    Description

      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

       

      Attachments

        Issue Links

          Activity

            People

              pottlinger Philipp Ottlinger
              wlieurance William Lieurance
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: