if (bundle != null) cache.put(localizedName, new SoftReference(bundle));
if (foundBundle != null) cache.put(localizedName, new SoftReference(foundBundle));
  private static final ResourceBundle tryBundle(String localizedName,						Locale locale,						ClassLoader classloader,						ResourceBundle bundle,						HashMap cache)  {    {      // First look into the cache.      // XXX We should remove cleared references from the cache.      Reference ref = (Reference) cache.get(localizedName);      if (ref != null)	{	  ResourceBundle rb = (ResourceBundle) ref.get();	  if (rb != null)	    // rb should already have the right parent, except if	    // something very strange happened.	    return rb;	}    }    try      {	java.io.InputStream is;	if (classloader == null)	  is = ClassLoader.getSystemResourceAsStream	    (localizedName.replace('.', '/') + ".properties");	else	  is = classloader.getResourceAsStream	    (localizedName.replace('.', '/') + ".properties");	if (is != null)	  {	    ResourceBundle rb = new PropertyResourceBundle(is);	    rb.parent = bundle;	    rb.locale = locale;	    bundle = rb;	  }      }    catch (java.io.IOException ex)      {      }    try      {	Class rbClass;	if (classloader == null)	  rbClass = Class.forName(localizedName);	else	  rbClass = classloader.loadClass(localizedName);	ResourceBundle rb = (ResourceBundle) rbClass.newInstance();	rb.parent = bundle;	rb.locale = locale;	bundle = rb;      }    catch (ClassNotFoundException ex)      {      }    catch (IllegalAccessException ex)      {      }    catch (InstantiationException ex)      {	// ignore them all	// XXX should we also ignore ClassCastException?      }    // Put the bundle in the cache    if (bundle != null)      cache.put(localizedName, new SoftReference(bundle));    return bundle;  }