diff --git a/icu4j/main/classes/core/src/com/ibm/icu/impl/SimplePatternFormatter.java b/icu4j/main/classes/core/src/com/ibm/icu/impl/SimplePatternFormatter.java index f006bfeb4ef..4a523adc3ef 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/impl/SimplePatternFormatter.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/impl/SimplePatternFormatter.java @@ -132,8 +132,10 @@ public class SimplePatternFormatter { * Formats the given values. * * @param appendTo the result appended here. - * @param offsets position of first value in result stored in offfsets[0]; - * second in offsets[1]; third in offsets[2] etc. + * @param offsets position of first value in appendTo stored in offfsets[0]; + * second in offsets[1]; third in offsets[2] etc. An offset of -1 means that the + * corresponding value is not in appendTo. offsets.length and values.length may + * differ. If caller is not interested in offsets, caller may pass null here. * @param values the values * @return appendTo */ diff --git a/icu4j/main/classes/core/src/com/ibm/icu/text/QuantityFormatter.java b/icu4j/main/classes/core/src/com/ibm/icu/text/QuantityFormatter.java index af6e3fab273..e95a1650946 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/text/QuantityFormatter.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/text/QuantityFormatter.java @@ -18,7 +18,6 @@ import com.ibm.icu.impl.SimplePatternFormatter; *

* QuanitityFormatter appears here instead of in com.ibm.icu.impl because it depends on * PluralRules and DecimalFormat. It is package-protected as it is not meant for public use. - * @author rocketman */ class QuantityFormatter { @@ -72,12 +71,6 @@ class QuantityFormatter { return this; } - private void ensureCapacity() { - if (templates == null) { - templates = new SimplePatternFormatter[MAX_INDEX]; - } - } - /** * Builds the new QuantityFormatter and resets this Builder to its initial state. * @return the new QuantityFormatter object. @@ -94,12 +87,17 @@ class QuantityFormatter { } /** - * Resets this builder to its intitial state. + * Resets this builder to its initial state. */ public Builder reset() { templates = null; return this; - + } + + private void ensureCapacity() { + if (templates == null) { + templates = new SimplePatternFormatter[MAX_INDEX]; + } } }