changeset 6192:bf6ceb6b8f80

7175464: entrySetView field is never updated in NavigableSubMap Summary: The method entrySet() in AscendingSubMap and DescendingSubMap failed to cache the entrySetView. Reviewed-by: alanb, psandoz
author mduigou
date Thu, 29 Nov 2012 14:07:47 -0800
parents d91e6cb1da41
children 75cb07a7b622
files src/share/classes/java/util/TreeMap.java
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/util/TreeMap.java	Thu Nov 29 17:03:52 2012 +0000
+++ b/src/share/classes/java/util/TreeMap.java	Thu Nov 29 14:07:47 2012 -0800
@@ -1759,7 +1759,7 @@
 
         public Set<Map.Entry<K,V>> entrySet() {
             EntrySetView es = entrySetView;
-            return (es != null) ? es : new AscendingEntrySetView();
+            return (es != null) ? es : (entrySetView = new AscendingEntrySetView());
         }
 
         TreeMap.Entry<K,V> subLowest()       { return absLowest(); }
@@ -1840,7 +1840,7 @@
 
         public Set<Map.Entry<K,V>> entrySet() {
             EntrySetView es = entrySetView;
-            return (es != null) ? es : new DescendingEntrySetView();
+            return (es != null) ? es : (entrySetView = new DescendingEntrySetView());
         }
 
         TreeMap.Entry<K,V> subLowest()       { return absHighest(); }