Locale defaultLocale = Locale.getDefault(); if (defaultLocale != lastDefaultLocale) { resourceBundleCache = new HashMap(); lastDefaultLocale = defaultLocale; } HashMap cache = (HashMap) resourceBundleCache.get(classLoader); StringBuffer sb = new StringBuffer(60); sb.append(baseName).append('_').append(locale); String name = sb.toString();  if (cache == null) { cache = new HashMap(); resourceBundleCache.put(classLoader, cache); } else if (cache.containsKey(name)) { Reference ref = (Reference) cache.get(name);     if (ref == null) throw new MissingResourceException("Bundle " + baseName + " not found", baseName, ""); else { ResourceBundle rb = (ResourceBundle) ref.get(); if (rb != null) {   return rb; }   } }    ResourceBundle baseBundle = tryBundle(baseName, emptyLocale, classLoader, null, cache);      ResourceBundle bundle = tryLocalBundle(baseName, locale, classLoader, baseBundle, cache); if (bundle == baseBundle && !locale.equals(defaultLocale)) { bundle = tryLocalBundle(baseName, defaultLocale, classLoader, baseBundle, cache);    if (bundle == null) cache.put(name, null); else cache.put(name, new SoftReference(bundle)); }  if (bundle == null) throw new MissingResourceException("Bundle " + baseName + " not found", baseName, "");  return bundle;
return getBundle(baseName, Locale.getDefault(), security.getCallingClassLoader());
  public static final synchronized ResourceBundle getBundle    (String baseName, Locale locale, ClassLoader classLoader)  {    // This implementation searches the bundle in the reverse direction    // and builds the parent chain on the fly.    Locale defaultLocale = Locale.getDefault();    if (defaultLocale != lastDefaultLocale)      {	resourceBundleCache = new HashMap();	lastDefaultLocale = defaultLocale;      }    HashMap cache = (HashMap) resourceBundleCache.get(classLoader);    StringBuffer sb = new StringBuffer(60);    sb.append(baseName).append('_').append(locale);    String name = sb.toString();    if (cache == null)      {        cache = new HashMap();        resourceBundleCache.put(classLoader, cache);      }    else if (cache.containsKey(name))      {	Reference ref = (Reference) cache.get(name);	// If REF is null, that means that we added a `null' value to	// the hash map.  That means we failed to find the bundle	// previously, and we cached that fact.  The JDK does this, so	// it must be ok.	if (ref == null)	  throw new MissingResourceException("Bundle " + baseName					     + " not found",					     baseName, "");	else	  {	    ResourceBundle rb = (ResourceBundle) ref.get();	    if (rb != null)	      {		// RB should already have the right parent, except if		// something very strange happened.		return rb;	      }	    // If RB is null, then we previously found it but it was	    // collected.  So we try again.	  }      }    // It is ok if this returns null.  We aren't required to have the    // base bundle.    ResourceBundle baseBundle = tryBundle(baseName, emptyLocale,                                          classLoader, null, cache);    // Now use our locale, followed by the default locale.  We only    // need to try the default locale if our locale is different, and    // if our locale failed to yield a result other than the base    // bundle.    ResourceBundle bundle = tryLocalBundle(baseName, locale,                                           classLoader, baseBundle, cache);    if (bundle == baseBundle && !locale.equals(defaultLocale))      {	bundle = tryLocalBundle(baseName, defaultLocale,				classLoader, baseBundle, cache);	// We need to record that the argument locale maps to the	// bundle we just found.  If we didn't find a bundle, record	// that instead.	if (bundle == null)	  cache.put(name, null);	else	  cache.put(name, new SoftReference(bundle));      }    if (bundle == null)      throw new MissingResourceException("Bundle " + baseName + " not found",					 baseName, "");    return bundle;  }