From 0b5902b94db4b46f9110acd23599cd4532cc7020 Mon Sep 17 00:00:00 2001 From: Travis Keep Date: Thu, 30 Jan 2014 20:09:46 +0000 Subject: [PATCH] ICU-10646 String -> CharSequence X-SVN-Rev: 35040 --- .../core/src/com/ibm/icu/impl/SimplePatternFormatter.java | 6 +++--- .../classes/core/src/com/ibm/icu/text/MeasureFormat.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) 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 4a523adc3e..9609b933e3 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 @@ -51,7 +51,7 @@ public class SimplePatternFormatter { * @param pattern The string. * @return the new SimplePatternFormatter object. */ - public static SimplePatternFormatter compile(String pattern) { + public static SimplePatternFormatter compile(CharSequence pattern) { PlaceholdersBuilder placeholdersBuilder = new PlaceholdersBuilder(); PlaceholderIdBuilder idBuilder = new PlaceholderIdBuilder(); StringBuilder newPattern = new StringBuilder(); @@ -124,7 +124,7 @@ public class SimplePatternFormatter { /** * Formats the given values. */ - public String format(String... values) { + public String format(CharSequence... values) { return format(new StringBuilder(), null, values).toString(); } @@ -140,7 +140,7 @@ public class SimplePatternFormatter { * @return appendTo */ public StringBuilder format( - StringBuilder appendTo, int[] offsets, String... values) { + StringBuilder appendTo, int[] offsets, CharSequence... values) { if (values.length < placeholderCount) { throw new IllegalArgumentException("Too few values."); } 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 1bfe8bf84f..9a13b598ed 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 @@ -628,7 +628,7 @@ public class MeasureFormat extends UFormat { QuantityFormatter countToFormat = styleToCountToFormat.get(formatWidth); SimplePatternFormatter formatter = countToFormat.getByVariant(keyword); int[] offsets = new int[1]; - formatter.format(appendTo, offsets, formattedNumber.toString()); + formatter.format(appendTo, offsets, formattedNumber); if (offsets[0] != -1) { // there is a number (may not happen with, say, Arabic dual) // Fix field position if (fpos.getBeginIndex() != 0 || fpos.getEndIndex() != 0) {