Dear ICU team & users,
I would like to propose the following API for:
ICU 78Please provide feedback by:
next Wednesday, 2025-07-09 (more if anything is controversial)
BreakIterator b1 = BreakIterator.getWordInstance(locale);
BreakIterator b2 = (BreakIterator) b1.clone();
Meaning that we can return the proper type from clone, eliminating the need for casting.
public Object clone() { ... }
// Using it requires cast
Foo foo = (Foo) oldFoo.clone();
class Foo implements Cloneable {
public Foo clone() { ... }
// Using it does not require cast anymore
Foo foo = oldFoo.clone();
I would like to propose the following changes for ICU 78:
- Identify ALL ICU4J classes that implement a clone() method returning an Object and change these methods to return the class type. (47 classes, see design doc)
- Mark all such classes as implementing Cloneable.
- Remove all existing casts related to clone() calls.
Design document: