ICU-12086 ICU-12165 Currency.getName() param isChoiceFormat can be null, make it so, document, use null in library code
diff --git a/icu4c/source/common/locdspnm.cpp b/icu4c/source/common/locdspnm.cpp
index d590a88..43334f5 100644
--- a/icu4c/source/common/locdspnm.cpp
+++ b/icu4c/source/common/locdspnm.cpp
@@ -853,9 +853,8 @@
         UErrorCode sts = U_ZERO_ERROR;
         UnicodeString ustrValue(value, -1, US_INV);
         int32_t len;
-        UBool isChoice = FALSE;
         const UChar *currencyName = ucurr_getName(ustrValue.getTerminatedBuffer(),
-            locale.getBaseName(), UCURR_LONG_NAME, &isChoice, &len, &sts);
+            locale.getBaseName(), UCURR_LONG_NAME, nullptr /* isChoiceFormat */, &len, &sts);
         if (U_FAILURE(sts)) {
             // Return the value as is on failure
             result = ustrValue;
diff --git a/icu4c/source/common/ucurr.cpp b/icu4c/source/common/ucurr.cpp
index 8117645..dfee3bd 100644
--- a/icu4c/source/common/ucurr.cpp
+++ b/icu4c/source/common/ucurr.cpp
@@ -713,7 +713,9 @@
 
     // We no longer support choice format data in names.  Data should not contain
     // choice patterns.
-    *isChoiceFormat = FALSE;
+    if (isChoiceFormat != NULL) {
+        *isChoiceFormat = FALSE;
+    }
     if (U_SUCCESS(ec2)) {
         U_ASSERT(s != NULL);
         return s;
@@ -1595,10 +1597,9 @@
 {
     U_NAMESPACE_USE
 
-    UBool isChoiceFormat;
     int32_t len;
     const UChar* currname = ucurr_getName(iso, loc, UCURR_SYMBOL_NAME,
-                                          &isChoiceFormat, &len, &ec);
+                                          nullptr /* isChoiceFormat */, &len, &ec);
     if (U_SUCCESS(ec)) {
         result.setTo(currname, len);
     }
diff --git a/icu4c/source/common/unicode/ucurr.h b/icu4c/source/common/unicode/ucurr.h
index a6a9476..f91cc0d 100644
--- a/icu4c/source/common/unicode/ucurr.h
+++ b/icu4c/source/common/unicode/ucurr.h
@@ -159,14 +159,14 @@
  * @param currency null-terminated 3-letter ISO 4217 code
  * @param locale locale in which to display currency
  * @param nameStyle selector for which kind of name to return
- * @param isChoiceFormat fill-in set to TRUE if the returned value
- * is a ChoiceFormat pattern; otherwise it is a static string
+ * @param isChoiceFormat always set to FALSE, or can be NULL;
+ *     display names are static strings;
+ *     since ICU 4.4, ChoiceFormat patterns are no longer supported
  * @param len fill-in parameter to receive length of result
  * @param ec error code
  * @return pointer to display string of 'len' UChars.  If the resource
  * data contains no entry for 'currency', then 'currency' itself is
- * returned.  If *isChoiceFormat is TRUE, then the result is a
- * ChoiceFormat pattern.  Otherwise it is a static string.
+ * returned.
  * @stable ICU 2.6
  */
 U_STABLE const UChar* U_EXPORT2
@@ -183,14 +183,15 @@
  * currency object in the en_US locale is "US dollar" or "US dollars".
  * @param currency null-terminated 3-letter ISO 4217 code
  * @param locale locale in which to display currency
- * @param isChoiceFormat fill-in set to TRUE if the returned value
- * is a ChoiceFormat pattern; otherwise it is a static string
+ * @param isChoiceFormat always set to FALSE, or can be NULL;
+ *     display names are static strings;
+ *     since ICU 4.4, ChoiceFormat patterns are no longer supported
  * @param pluralCount plural count
  * @param len fill-in parameter to receive length of result
  * @param ec error code
  * @return pointer to display string of 'len' UChars.  If the resource
  * data contains no entry for 'currency', then 'currency' itself is
- * returned.  
+ * returned.
  * @stable ICU 4.2
  */
 U_STABLE const UChar* U_EXPORT2
diff --git a/icu4c/source/i18n/number_currencysymbols.cpp b/icu4c/source/i18n/number_currencysymbols.cpp
index 0b79d65..4d6fb2c 100644
--- a/icu4c/source/i18n/number_currencysymbols.cpp
+++ b/icu4c/source/i18n/number_currencysymbols.cpp
@@ -53,13 +53,12 @@
 
 UnicodeString CurrencySymbols::loadSymbol(UCurrNameStyle selector, UErrorCode& status) const {
     const char16_t* isoCode = fCurrency.getISOCurrency();
-    UBool ignoredIsChoiceFormatFillIn = FALSE;
     int32_t symbolLen = 0;
     const char16_t* symbol = ucurr_getName(
             isoCode,
             fLocaleName.data(),
             selector,
-            &ignoredIsChoiceFormatFillIn,
+            nullptr /* isChoiceFormat */,
             &symbolLen,
             &status);
     // If given an unknown currency, ucurr_getName returns the input string, which we can't alias safely!
@@ -82,12 +81,11 @@
 
 UnicodeString CurrencySymbols::getPluralName(StandardPlural::Form plural, UErrorCode& status) const {
     const char16_t* isoCode = fCurrency.getISOCurrency();
-    UBool isChoiceFormat = FALSE;
     int32_t symbolLen = 0;
     const char16_t* symbol = ucurr_getPluralName(
             isoCode,
             fLocaleName.data(),
-            &isChoiceFormat,
+            nullptr /* isChoiceFormat */,
             StandardPlural::getKeyword(plural),
             &symbolLen,
             &status);
diff --git a/icu4c/source/i18n/number_longnames.cpp b/icu4c/source/i18n/number_longnames.cpp
index bd41699..b790ffb 100644
--- a/icu4c/source/i18n/number_longnames.cpp
+++ b/icu4c/source/i18n/number_longnames.cpp
@@ -148,12 +148,11 @@
         if (pattern.isBogus()) {
             continue;
         }
-        UBool isChoiceFormat = FALSE;
         int32_t longNameLen = 0;
         const char16_t *longName = ucurr_getPluralName(
                 currency.getISOCurrency(),
                 locale.getName(),
-                &isChoiceFormat,
+                nullptr /* isChoiceFormat */,
                 StandardPlural::getKeyword(static_cast<StandardPlural::Form>(i)),
                 &longNameLen,
                 &status);
diff --git a/icu4j/main/classes/collate/src/com/ibm/icu/util/GlobalizationPreferences.java b/icu4j/main/classes/collate/src/com/ibm/icu/util/GlobalizationPreferences.java
index cab3bdf..13c9e08 100644
--- a/icu4j/main/classes/collate/src/com/ibm/icu/util/GlobalizationPreferences.java
+++ b/icu4j/main/classes/collate/src/com/ibm/icu/util/GlobalizationPreferences.java
@@ -187,7 +187,7 @@
         if (locales == null) {
             result = guessLocales();
         } else {
-            result = new ArrayList<ULocale>();
+            result = new ArrayList<>();
             result.addAll(locales);
         }
         return result;
@@ -598,7 +598,7 @@
                 Currency temp = new Currency(id);
                 result =temp.getName(locale, type==ID_CURRENCY
                                      ? Currency.LONG_NAME
-                                     : Currency.SYMBOL_NAME, new boolean[1]);
+                                     : Currency.SYMBOL_NAME, null /* isChoiceFormat */);
                 // TODO: have method that doesn't take parameter. Add
                 // function to determine whether string is choice
                 // format.
@@ -815,7 +815,7 @@
      * @provisional This API might change or be removed in a future release.
      */
     protected List<ULocale> processLocales(List<ULocale> inputLocales) {
-        List<ULocale> result = new ArrayList<ULocale>();
+        List<ULocale> result = new ArrayList<>();
         /*
          * Step 1: Relocate later occurrence of more specific locale
          * before earlier occurrence of less specific locale.
@@ -1053,7 +1053,7 @@
      */
     protected List<ULocale> guessLocales() {
         if (implicitLocales == null) {
-            List<ULocale> result = new ArrayList<ULocale>(1);
+            List<ULocale> result = new ArrayList<>(1);
             result.add(ULocale.getDefault());
             implicitLocales = processLocales(result);
         }
@@ -1205,7 +1205,7 @@
     /*
      * Available locales for service types
      */
-    private static final HashMap<ULocale, BitSet> available_locales = new HashMap<ULocale, BitSet>();
+    private static final HashMap<ULocale, BitSet> available_locales = new HashMap<>();
     private static final int
         TYPE_GENERIC = 0,
         TYPE_CALENDAR = 1,
@@ -1274,7 +1274,7 @@
     /** WARNING: All of this data is temporary, until we start importing from CLDR!!!
      *
      */
-    private static final Map<String, String> language_territory_hack_map = new HashMap<String, String>();
+    private static final Map<String, String> language_territory_hack_map = new HashMap<>();
     private static final String[][] language_territory_hack = {
         {"af", "ZA"},
         {"am", "ET"},
@@ -1436,7 +1436,7 @@
         }
     }
 
-    static final Map<String, String> territory_tzid_hack_map = new HashMap<String, String>();
+    static final Map<String, String> territory_tzid_hack_map = new HashMap<>();
     static final String[][] territory_tzid_hack = {
         {"AQ", "Antarctica/McMurdo"},
         {"AR", "America/Buenos_Aires"},
diff --git a/icu4j/main/classes/core/src/com/ibm/icu/impl/number/CustomSymbolCurrency.java b/icu4j/main/classes/core/src/com/ibm/icu/impl/number/CustomSymbolCurrency.java
index bf43ccf..5e73c86 100644
--- a/icu4j/main/classes/core/src/com/ibm/icu/impl/number/CustomSymbolCurrency.java
+++ b/icu4j/main/classes/core/src/com/ibm/icu/impl/number/CustomSymbolCurrency.java
@@ -42,6 +42,9 @@
     @Override
     public String getName(ULocale locale, int nameStyle, boolean[] isChoiceFormat) {
         if (nameStyle == SYMBOL_NAME) {
+            if (isChoiceFormat != null) {
+                isChoiceFormat[0] = false;
+            }
             return symbol1;
         }
         return super.getName(locale, nameStyle, isChoiceFormat);
diff --git a/icu4j/main/classes/core/src/com/ibm/icu/util/Currency.java b/icu4j/main/classes/core/src/com/ibm/icu/util/Currency.java
index af0089f..95e3634 100644
--- a/icu4j/main/classes/core/src/com/ibm/icu/util/Currency.java
+++ b/icu4j/main/classes/core/src/com/ibm/icu/util/Currency.java
@@ -519,6 +519,17 @@
      * given locale.
      * This is a convenient method for
      * getName(ULocale, int, boolean[]);
+     *
+     * @param locale locale in which to display currency
+     * @param nameStyle selector for which kind of name to return.
+     *                  The nameStyle should be SYMBOL_NAME, NARROW_SYMBOL_NAME,
+     *                  or LONG_NAME. Otherwise, throw IllegalArgumentException.
+     * @param isChoiceFormat isChoiceFormat[0] is always set to false, or isChoiceFormat can be null;
+     *     display names are static strings;
+     *     since ICU 4.4, ChoiceFormat patterns are no longer supported
+     * @return display string for this currency.  If the resource data
+     * contains no entry for this currency, then the ISO 4217 code is
+     * returned.
      * @stable ICU 3.2
      */
     public String getName(Locale locale,
@@ -531,19 +542,17 @@
      * Returns the display name for the given currency in the
      * given locale.  For example, the display name for the USD
      * currency object in the en_US locale is "$".
+     *
      * @param locale locale in which to display currency
      * @param nameStyle selector for which kind of name to return.
      *                  The nameStyle should be SYMBOL_NAME, NARROW_SYMBOL_NAME,
      *                  or LONG_NAME. Otherwise, throw IllegalArgumentException.
-     * @param isChoiceFormat fill-in; isChoiceFormat[0] is set to true
-     * if the returned value is a ChoiceFormat pattern; otherwise it
-     * is set to false
+     * @param isChoiceFormat isChoiceFormat[0] is always set to false, or isChoiceFormat can be null;
+     *     display names are static strings;
+     *     since ICU 4.4, ChoiceFormat patterns are no longer supported
      * @return display string for this currency.  If the resource data
      * contains no entry for this currency, then the ISO 4217 code is
-     * returned.  If isChoiceFormat[0] is true, then the result is a
-     * ChoiceFormat pattern.  Otherwise it is a static string. <b>Note:</b>
-     * as of ICU 4.4, choice formats are not used, and the value returned
-     * in isChoiceFormat is always false.
+     * returned.
      * <p>
      * @throws  IllegalArgumentException  if the nameStyle is not SYMBOL_NAME
      *                                    or LONG_NAME.
@@ -573,6 +582,16 @@
     /**
      * Returns the display name for the given currency in the given locale.
      * This is a convenience overload of getName(ULocale, int, String, boolean[]);
+     *
+     * @param locale locale in which to display currency
+     * @param nameStyle selector for which kind of name to return
+     * @param pluralCount plural count string for this locale
+     * @param isChoiceFormat isChoiceFormat[0] is always set to false, or isChoiceFormat can be null;
+     *     display names are static strings;
+     *     since ICU 4.4, ChoiceFormat patterns are no longer supported
+     * @return display string for this currency.  If the resource data
+     * contains no entry for this currency, then the ISO 4217 code is
+     * returned.
      * @stable ICU 4.2
      */
     public String getName(Locale locale, int nameStyle, String pluralCount,
@@ -588,18 +607,16 @@
      * amount is plural is "US dollars", such as in "3.00 US dollars";
      * while the PLURAL_LONG_NAME for the USD currency object when the currency
      * amount is singular is "US dollar", such as in "1.00 US dollar".
+     *
      * @param locale locale in which to display currency
      * @param nameStyle selector for which kind of name to return
      * @param pluralCount plural count string for this locale
-     * @param isChoiceFormat fill-in; isChoiceFormat[0] is set to true
-     * if the returned value is a ChoiceFormat pattern; otherwise it
-     * is set to false
+     * @param isChoiceFormat isChoiceFormat[0] is always set to false, or isChoiceFormat can be null;
+     *     display names are static strings;
+     *     since ICU 4.4, ChoiceFormat patterns are no longer supported
      * @return display string for this currency.  If the resource data
      * contains no entry for this currency, then the ISO 4217 code is
-     * returned.  If isChoiceFormat[0] is true, then the result is a
-     * ChoiceFormat pattern.  Otherwise it is a static string. <b>Note:</b>
-     * as of ICU 4.4, choice formats are not used, and the value returned
-     * in isChoiceFormat is always false.
+     * returned.
      * @throws  IllegalArgumentException  if the nameStyle is not SYMBOL_NAME,
      *                                    LONG_NAME, or PLURAL_LONG_NAME.
      * @stable ICU 4.2
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/DisplayNameTest.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/DisplayNameTest.java
index cd61579..483875d 100644
--- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/DisplayNameTest.java
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/DisplayNameTest.java
@@ -126,7 +126,7 @@
             @Override
             public String get(ULocale loc, String code, Object context) {
                 Currency s = Currency.getInstance(code);
-                return s.getName(loc, ((Integer)context).intValue(), new boolean[1]);
+                return s.getName(loc, ((Integer)context).intValue(), null /* isChoiceFormat */);
             }
         });
         // comment this out, because the zone string information is lost