From: Yoshito Umaoka Date: Mon, 27 Mar 2017 19:13:58 +0000 (+0000) Subject: ICU-7467 Added @internal NumberFormat#getPatternForStyle and reverted API signature... X-Git-Tag: release-59-rc~28 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c0007833e1830be11961dd02b5d21b5aceff02ed;p=icu ICU-7467 Added @internal NumberFormat#getPatternForStyle and reverted API signature of NumberFormat#getPattern, so we don't need to change API signature of existing @stable API. X-SVN-Rev: 39944 --- diff --git a/icu4j/main/classes/core/src/com/ibm/icu/impl/number/Parse.java b/icu4j/main/classes/core/src/com/ibm/icu/impl/number/Parse.java index 8e9897ea4bd..ae8d6d91f20 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/impl/number/Parse.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/impl/number/Parse.java @@ -852,7 +852,7 @@ public class Parse { private CurrencyAffixPatterns(ULocale uloc) { // Get the basic currency pattern. - String pattern = NumberFormat.getPattern(uloc, NumberFormat.CURRENCYSTYLE); + String pattern = NumberFormat.getPatternForStyle(uloc, NumberFormat.CURRENCYSTYLE); addPattern(pattern); // Get the currency plural patterns. diff --git a/icu4j/main/classes/core/src/com/ibm/icu/impl/number/formatters/CompactDecimalFormat.java b/icu4j/main/classes/core/src/com/ibm/icu/impl/number/formatters/CompactDecimalFormat.java index f7be488ec8c..ca88b970bd3 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/impl/number/formatters/CompactDecimalFormat.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/impl/number/formatters/CompactDecimalFormat.java @@ -163,9 +163,9 @@ public class CompactDecimalFormat extends Format.BeforeFormat { ULocale uloc = symbols.getULocale(); String pattern; if (fingerprint.compactType == CompactType.CURRENCY) { - pattern = NumberFormat.getPattern(uloc, NumberFormat.CURRENCYSTYLE); + pattern = NumberFormat.getPatternForStyle(uloc, NumberFormat.CURRENCYSTYLE); } else { - pattern = NumberFormat.getPattern(uloc, NumberFormat.NUMBERSTYLE); + pattern = NumberFormat.getPatternForStyle(uloc, NumberFormat.NUMBERSTYLE); } // TODO: Clean this up; avoid the extra object creations. // TODO: Currency may also need to override grouping settings, not just affixes. diff --git a/icu4j/main/classes/core/src/com/ibm/icu/text/NumberFormat.java b/icu4j/main/classes/core/src/com/ibm/icu/text/NumberFormat.java index 80f8d944c00..a6803d34a0a 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/text/NumberFormat.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/text/NumberFormat.java @@ -1462,11 +1462,21 @@ public abstract class NumberFormat extends UFormat { * @param choice the pattern format. * @return the pattern * @stable ICU 3.2 + */ + protected static String getPattern(ULocale forLocale, int choice) { + return getPatternForStyle(forLocale, choice); + } + + /** + * Returns the pattern for the provided locale and choice. + * @param forLocale the locale of the data. + * @param choice the pattern format. + * @return the pattern * @internal * @deprecated This API is ICU internal only. */ @Deprecated - public static String getPattern(ULocale forLocale, int choice) { + public static String getPatternForStyle(ULocale forLocale, int choice) { /* for ISOCURRENCYSTYLE and PLURALCURRENCYSTYLE, * the pattern is the same as the pattern of CURRENCYSTYLE * but by replacing the single currency sign with