diff --git a/icu4j/main/classes/core/src/com/ibm/icu/impl/number/Grouper.java b/icu4j/main/classes/core/src/com/ibm/icu/impl/number/Grouper.java index fee5564de6..add6f66563 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/impl/number/Grouper.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/impl/number/Grouper.java @@ -63,9 +63,9 @@ public class Grouper { return GROUPER_WESTERN; } else if (grouping1 == 3 && grouping2 == 2 && minGrouping == 1) { return GROUPER_INDIC; - } else if (grouping1 == 3 && grouping2 == 3 && minGrouping == 1) { + } else if (grouping1 == 3 && grouping2 == 3 && minGrouping == 2) { return GROUPER_WESTERN_MIN2; - } else if (grouping1 == 3 && grouping2 == 2 && minGrouping == 1) { + } else if (grouping1 == 3 && grouping2 == 2 && minGrouping == 2) { return GROUPER_INDIC_MIN2; } else { return new Grouper(grouping1, grouping2, minGrouping); diff --git a/icu4j/main/classes/core/src/com/ibm/icu/text/MeasureFormat.java b/icu4j/main/classes/core/src/com/ibm/icu/text/MeasureFormat.java index 834d6c51ec..0d950cbc0a 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/text/MeasureFormat.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/text/MeasureFormat.java @@ -1044,7 +1044,7 @@ public class MeasureFormat extends UFormat { case TIME_UNIT_FORMAT: return createTimeUnitFormat(); case CURRENCY_FORMAT: - return new CurrencyFormat(locale); + return MeasureFormat.getCurrencyFormat(locale); default: throw new InvalidObjectException("Unknown subclass: " + subClass); } diff --git a/icu4j/main/classes/core/src/com/ibm/icu/text/TimeUnitFormat.java b/icu4j/main/classes/core/src/com/ibm/icu/text/TimeUnitFormat.java index f8fff0b15f..cd0ef2dd6a 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/text/TimeUnitFormat.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/text/TimeUnitFormat.java @@ -84,19 +84,12 @@ public class TimeUnitFormat extends MeasureFormat { private static final long serialVersionUID = -3707773153184971529L; - // These fields are supposed to be the same as the fields in mf. They - // are here for serialization backward compatibility and to support parsing. + // Unlike MeasureFormat, this class is mutable and allows a new NumberFormat to be set after + // initialization. Keep a second copy of NumberFormat and use it instead of the one from the parent. private NumberFormat format; private ULocale locale; private int style; - // We use this field in lieu of the super class because the super class - // is immutable while this class is mutable. The contents of the super class - // is an empty shell. Every public method of the super class is overridden to - // delegate to this field. Each time this object mutates, it replaces this field with - // a new immutable instance. -// private transient MeasureFormat mf; - private transient Map> timeUnitToCountToPatterns; private transient PluralRules pluralRules; private transient boolean isReady;