ICU-6536 Created a workaround method allowing the cache to be reset.

X-SVN-Rev: 24583
This commit is contained in:
Brian Rower 2008-09-16 19:57:40 +00:00
parent 5097c3c3c1
commit be0227c676

View file

@ -306,6 +306,21 @@ public abstract class UResourceBundle extends ResourceBundle{
// Cache for ResourceBundle instantiation
private static ICUCache BUNDLE_CACHE = new SimpleCache();
/*
* A HACK!!!!!
* Currently if a resourcebundle with fallback turned ON is added to the cache
* and then a getBundleInstance() is called for a bundle with fallback turned OFF
* it will actually search the cache for any bundle of the same locale
* regaurdless of fallback status. This method has been created so that if
* The calling method KNOWS that instances of the other fallback state may be in the
* cache, the calling method may call this method to clear out the cache.
*/
public static void resetBundleCache()
{
//TODO figure a way around this method(see method comment)
BUNDLE_CACHE = null;
}
private static void addToCache(ResourceCacheKey key, UResourceBundle b) {
BUNDLE_CACHE.put(key, b);
}