* @exception NullPointerException if <code>locale</code> is null
* @since 1.7
*/
public String getDisplayName(Locale locale) {
try {
OpenListResourceBundle bundle = LocaleData.getCurrencyNames(locale);
String result = null;
String bundleKey = currencyCode.toLowerCase(Locale.ROOT);
// Check whether a provider can provide an implementation that's closer
// to the requested locale than what the Java runtime itself can provide.
LocaleServiceProviderPool pool =
LocaleServiceProviderPool.getPool(CurrencyNameProvider.class);
if (pool.hasProviders()) {
result = pool.getLocalizedObject(
CurrencyNameGetter.INSTANCE,
locale, bundleKey, bundle, currencyCode, DISPLAYNAME);
}
if (result == null) {
result = bundle.getString(bundleKey);
}
if (result != null) {
return result;
}