cache.put(locale, newCurrency);
countryMap.put(country, code); cache.put(code, newCurrency); } } else { newCurrency = (Currency) cache.get(code);
  public static Currency getInstance (Locale locale)  {    /**     * The new instance must be the only available instance     * for the currency it supports.  We ensure this happens,     * while maintaining a suitable performance level, by     * creating the appropriate object on the first call to     * this method, and returning the cached instance on     * later calls.     */    Currency newCurrency;    /* Attempt to get the currency from the cache */    newCurrency = (Currency) cache.get(locale);    if (newCurrency == null)      {        /* Create the currency for this locale */        newCurrency = new Currency (locale);        /* Cache it */        cache.put(locale, newCurrency);      }    /* Return the instance */    return newCurrency;  }