提交 45330769 编写于 作者: M mduigou

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
上级 e01da2eb
......@@ -1759,7 +1759,7 @@ public class TreeMap<K,V>
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 class TreeMap<K,V>
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(); }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册