Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8032842

Locale.filterTags()/lookupTag() methods return lowercased language tags

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8, 9
    • Fix Version/s: 10
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b15
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Description

      Currently the returned language tag(s) from those methods are all in lower case letters. Although language tags/subtags are case inensitive, instead of converting the matching language tag(s) to lowercase, these methods should preserve the case of input language tag(s)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Execute the code below


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      public static void main(String[] args) {
          List<LanguageRange> priorityList = LanguageRange.parse("*-CH");
          List<String> matchingTags = Locale.filterTags(priorityList, List.of("de-CH", "hi-in", "En-GB"),
      FilteringMode.AUTOSELECT_FILTERING);
          System.out.println(matchingTags);
      }
      ---------- END SOURCE ----------

      EXPECTED: "de-CH"
      FOUND: "de-ch"

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              nishjain Nishit Jain
              Reporter:
              naoto Naoto Sato
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: