mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
fix sort bug
This commit is contained in:
parent
9d8f00e049
commit
dbc4fd62ce
@ -3,7 +3,7 @@
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
# 5.7.10 (2021-08-18)
|
||||
# 5.7.10 (2021-08-19)
|
||||
|
||||
### 🐣新特性
|
||||
* 【core 】 增加NamingCase类
|
||||
@ -15,6 +15,7 @@
|
||||
* 【core 】 XmlUtil增加append重载(issue#I466Q0@Gitee)
|
||||
* 【poi 】 增加EscapeStrCellSetter(issue#I466ZZ@Gitee)
|
||||
* 【poi 】 ExcelBase增加renameSheet、cloneSheet(issue#I466ZZ@Gitee)
|
||||
* 【core 】 修复MapUtil.sort比较器不一致返回原map的问题(issue#I46AQJ@Gitee)
|
||||
|
||||
### 🐞Bug修复
|
||||
|
||||
|
@ -791,18 +791,15 @@ public class MapUtil {
|
||||
return null;
|
||||
}
|
||||
|
||||
TreeMap<K, V> result;
|
||||
if (map instanceof TreeMap) {
|
||||
// 已经是可排序Map,此时只有比较器一致才返回原map
|
||||
result = (TreeMap<K, V>) map;
|
||||
TreeMap<K, V> result = (TreeMap<K, V>) map;
|
||||
if (null == comparator || comparator.equals(result.comparator())) {
|
||||
return result;
|
||||
}
|
||||
} else {
|
||||
result = newTreeMap(map, comparator);
|
||||
}
|
||||
|
||||
return result;
|
||||
return newTreeMap(map, comparator);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user