Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-111254

Higher ranking ResourceBundleLoaders ignored by LanguageExtender

Details

    • 4
    • Regression Bug
    • LPP-37333

    Description

      When using Provide-Capability directives to register aggregating ResourceBundleLoader services, the service.ranking in the directive is incorrectly used by  ServiceTrackerResourceBundleLoader.

      Its internal ServiceTracker filters use the service.ranking to achieve an ordering, which is necessary. However this unfortunately has the side-effect of missing some ResourceBundleLoaders altogether. Specifically those with a higher service.ranking .

      By example, if you are have two directives as follows...

      liferay.resource.bundle;\ bundle.symbolic.name=A;\ resource.bundle.aggregate=(bundle.symbolic.name=A),(bundle.symbolic.name=B);\ service.ranking=1;\ servlet.context.name=some-context
      liferay.resource.bundle;\ bundle.symbolic.name=B;\ resource.bundle.aggregate=(bundle.symbolic.name=C),(bundle.symbolic.name=B);\ service.ranking=2

      ... then attempt to retrieve a language key through obtaining a ResourceBundleLoader as follows ...

      ResourceBundleLoaderUtil.ResourceBundleLoaderUtil.getResourceBundleLoaderByServletContextName("some-context"

      .... then it would actually not consider keys in module C.

      I have attached an integration test which can be used to verify the fix.  Please note that the regression is likely to surface in 7.2.x also if/when LPS-110482 is backported.

      Attachments

        Issue Links

          Activity

            People

              team-core-infrastructure Product Team Core Infrastructure
              stian.sigvartsen Stian Sigvartsen
              Felipe Lins Felipe Lins
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                1 year, 38 weeks, 3 days ago

                Packages

                  Version Package