Collator PRIMARY strength example is incomplete

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: 26
    • Component/s: core-libs

      The java.text.Collator class specification gives the following,

       * The following shows how both case and accents could be ignored for
       * US English.
       * {@snippet lang=java :
       * // Get the Collator for US English and set its strength to PRIMARY
       * Collator usCollator = Collator.getInstance(Locale.US);
       * usCollator.setStrength(Collator.PRIMARY);
       * if (usCollator.compare("abc", "ABC") == 0) {
       * System.out.println("Strings are equivalent");
       * }
       * }

      That is, the wording implies the example will ignore case and accents. In reality, it only ignores case. We should update the example to reflect the wording.

            Assignee:
            Justin Lu
            Reporter:
            Justin Lu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: