-
Bug
-
Resolution: Fixed
-
P3
-
6
-
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.
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.
- relates to
-
JDK-4352744 [Col] RFE: Collator should have getCollationElementIterator methods
-
- Open
-
-
JDK-4146307 [Col] RFE: API: CollationElementIterator should allow subclassing
-
- Open
-