FULL PRODUCT VERSION :
A DESCRIPTION OF THE PROBLEM :
The field "entrySetView" in java.util.TreeMap$NavigableSubMap is initialized to null. It is never updated to non-null value.
The method entrySet() in AscendingSubMap and DescendingSubMap look like this:
public Set<Map.Entry<K,V>> entrySet() {
EntrySetView es = entrySetView;
return (es != null) ? es : new AscendingEntrySetView();
}
public Set<Map.Entry<K,V>> entrySet() {
EntrySetView es = entrySetView;
return (es != null) ? es : new DescendingEntrySetView();
}
Is this an intention or should it be the following:
public Set<Map.Entry<K,V>> entrySet() {
EntrySetView es = entrySetView;
return (es != null) ? es : (entrySetView = new AscendingEntrySetView());
}
public Set<Map.Entry<K,V>> entrySet() {
EntrySetView es = entrySetView;
return (es != null) ? es : (entrySetView = new DescendingEntrySetView());
}
REPRODUCIBILITY :
This bug can be reproduced always.