--- a/jdk/src/share/classes/sun/util/locale/LocaleObjectCache.java Tue Jul 12 15:23:23 2011 +0100
+++ b/jdk/src/share/classes/sun/util/locale/LocaleObjectCache.java Tue Jul 12 10:28:37 2011 -0700
@@ -66,14 +66,14 @@
CacheEntry<K, V> newEntry = new CacheEntry<>(key, newVal, queue);
- while (value == null) {
- cleanStaleEntries();
- entry = map.putIfAbsent(key, newEntry);
- if (entry == null) {
+ entry = map.putIfAbsent(key, newEntry);
+ if (entry == null) {
+ value = newVal;
+ } else {
+ value = entry.get();
+ if (value == null) {
+ map.put(key, newEntry);
value = newVal;
- break;
- } else {
- value = entry.get();
}
}
}