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

Possible false-positives on LanguageImpl tests caused by copy-paste typo

    Details

      Description

      In the tests for LanguageImpl (see https://github.com/liferay/liferay-portal/blob/2f92cc41a54ed4da2c7303794c2d0f657ebc169e/portal-impl/test/integration/com/liferay/portal/language/LanguageImplTest.java#L65) the test testFormatWithLocaleNull is not testing anything.

      It does:

      String expectedValue = _languageImpl.format(nullableLocale, _LANG_KEY_WITH_ARGUMENT, "31");
      String actualValue = _languageImpl.format(nullableLocale, _LANG_KEY_WITH_ARGUMENT, "31");
      

      instead of the expected:

      String expectedValue = _languageImpl.format(defaultLocale, _LANG_KEY_WITH_ARGUMENT, "31");
      String actualValue = _languageImpl.format(nullableLocale, _LANG_KEY_WITH_ARGUMENT, "31");
      

      Notice the use of nullableLocale where we infer that defaultLocale should be.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              brian.chan Brian Chan
              Reporter:
              pierpaolo.ramon Pier Paolo Ramon
              Participants of an Issue:
              Recent user:
              Jason Pince
              Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                4 years, 21 weeks, 2 days ago

                  Packages

                  Version Package
                  7.0.X EE
                  7.1.X
                  Master