[Col] Doc: CollationElementIterator example assumes Collator.getInstance return type

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 7
    • Affects Version/s: 6
    • Component/s: core-libs
    • b123
    • generic
    • generic
    • Verified

      The following example is in CollationElementIterator and assumes that the Collator.getInstance return type is RuleBasedCollator. This assumption is never valid.

        String testString = "This is a test";
        RuleBasedCollator ruleBasedCollator = (RuleBasedCollator)Collator.getInstance();
        CollationElementIterator collationElementIterator = ruleBasedCollator.getCollationElementIterator(testString);
        int primaryOrder = CollationElementIterator.primaryOrder(collationElementIterator.next());

      The API doc should clarify that it's usable only with RuleBasedCollator. Actually, CollationElementIterator should have never been public.

            Assignee:
            Naoto Sato
            Reporter:
            Masayoshi Okutsu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: