} catch (IllegalArgumentException exception) {  } }  throw new IllegalArgumentException("The currency code, " + currencyCode + ", is not supported."); }
  public static Currency getInstance(String currencyCode)  {    Locale[] allLocales;        /*      * Throw a null pointer exception explicitly if currencyCode is null.     * One is not thrown otherwise.  It results in an IllegalArgumentException.      */    if (currencyCode == null)      {        throw new NullPointerException("The supplied currency code is null.");      }    Currency newCurrency = (Currency) cache.get(currencyCode);    if (newCurrency == null)      {	/* Get all locales */	allLocales = Locale.getAvailableLocales();	/* Loop through each locale, looking for the code */    for (int i = 0;i < allLocales.length; i++)      {	    try	      {	Currency testCurrency = getInstance (allLocales[i]);		if (testCurrency != null &&	    testCurrency.getCurrencyCode().equals(currencyCode))		  {	  return testCurrency;      }	      }	    catch (IllegalArgumentException exception)	      {		/* Ignore locales without valid countries */	      }	  }    /*      * If we get this far, the code is not supported by any of     * our locales.     */    throw new IllegalArgumentException("The currency code, " + currencyCode +                                       ", is not supported.");  }    else      {	return newCurrency;      }  }