]> granicus.if.org Git - icu/commitdiff
ICU-13461 Fixing conditional in Grouper.java (this is J-only code, so an ICU4C fix...
authorShane Carr <shane@unicode.org>
Tue, 6 Feb 2018 23:38:29 +0000 (23:38 +0000)
committerShane Carr <shane@unicode.org>
Tue, 6 Feb 2018 23:38:29 +0000 (23:38 +0000)
X-SVN-Rev: 40846

icu4j/main/classes/core/src/com/ibm/icu/impl/number/Grouper.java
icu4j/main/classes/core/src/com/ibm/icu/text/MeasureFormat.java
icu4j/main/classes/core/src/com/ibm/icu/text/TimeUnitFormat.java

index fee5564de6029b60c6fed0acc61db8a4395221d5..add6f66563cae268dd2a91515b791f3a1747ab4a 100644 (file)
@@ -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);
index 834d6c51ec9adfe9c36f3129b392d33133ce2423..0d950cbc0a3fe0cebed95be7f6c2df3debb02fe7 100644 (file)
@@ -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);
             }
index f8fff0b15f38ded6b29ea66db859fd23a2899986..cd0ef2dd6aaefece8c77ba2af8fab689edea679c 100644 (file)
@@ -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<TimeUnit, Map<String, Object[]>> timeUnitToCountToPatterns;
     private transient PluralRules pluralRules;
     private transient boolean isReady;