Looks like TreeMap.NavigableSubMap.entrySetView is initialized to null, but it is never updated when an "entry set view" is created by TreeMap.AscendingSubMap.entrySet() or by TreeMap.DescendingSubMap.entrySet().

I think those two methods were intended to be implemented as:

For AscendingSubMap:
       public Set<Map.Entry<K,V>> entrySet() {
           EntrySetView es = entrySetView;
return (es != null) ? es : (entrySetView = new AscendingEntrySetView());
       }
For DescendingSubMap:
       public Set<Map.Entry<K,V>> entrySet() {
           EntrySetView es = entrySetView;
return (es != null) ? es : (entrySetView = new DescendingEntrySetView());

A related question:
Is there a need to explicitly initialize; NavigableSubMap.descendingMapView, NavigableSubMap.entrySetView and NavigableSubMap.navigableKeySetView to null? Aren't they going to be initialized to null by default without requiring an explicit load & store of null?

thanks,

charlie ...
begin:vcard
fn:Charlie Hunt
n:Hunt;Charlie
email;internet:[EMAIL PROTECTED]
tel;work:x47708 or (630) 285-7708
x-mozilla-html:TRUE
version:2.1
end:vcard

Reply via email to