Applying suggested fix from Thomas Louis in COLLECTIONS-264 - the clear() and CollectionView.clear() methods were losing the TreeMap's comparator
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@571412 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7c260a6e48
commit
d0df8e55b0
|
@ -357,7 +357,7 @@ public class FastTreeMap extends TreeMap {
|
||||||
public void clear() {
|
public void clear() {
|
||||||
if (fast) {
|
if (fast) {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
map = new TreeMap();
|
map = new TreeMap(map.comparator());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
synchronized (map) {
|
synchronized (map) {
|
||||||
|
@ -580,7 +580,7 @@ public class FastTreeMap extends TreeMap {
|
||||||
public void clear() {
|
public void clear() {
|
||||||
if (fast) {
|
if (fast) {
|
||||||
synchronized (FastTreeMap.this) {
|
synchronized (FastTreeMap.this) {
|
||||||
map = new TreeMap();
|
map = new TreeMap(map.comparator());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
synchronized (map) {
|
synchronized (map) {
|
||||||
|
|
Loading…
Reference in New Issue