From a48e79b03fc8818735d78116a9d94c069b9472fe Mon Sep 17 00:00:00 2001 From: Looly Date: Thu, 3 Nov 2022 22:20:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DTreeBuilder=E4=B8=AD=E4=BD=BF?= =?UTF-8?q?=E7=94=A8HashMap=E5=AF=BC=E8=87=B4=E9=BB=98=E8=AE=A4=E4=B9=B1?= =?UTF-8?q?=E5=BA=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 ++- .../src/main/java/cn/hutool/core/lang/tree/TreeBuilder.java | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f5648a2b..6c9a44e66 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ------------------------------------------------------------------------------------------------------------- -# 5.8.10.M1 (2022-11-02) +# 5.8.10.M1 (2022-11-03) ### 🐣新特性 * 【http 】 HttpResponse增加getFileNameFromDisposition方法(pr#2676@Github) @@ -15,6 +15,7 @@ * 【core 】 修复Partition计算size除数为0报错问题(pr#2677@Github) * 【core 】 由于对于ASCII的编码解码有缺陷,且这种BCD实现并不规范,因此BCD标记为弃用(issue#I5XEC6@Gitee) * 【core 】 修复IoUtil.copyByNIO方法写出时没有flush的问题 +* 【core 】 修复TreeBuilder中使用HashMap导致默认乱序问题(issue#I5Z8C5@Gitee) ------------------------------------------------------------------------------------------------------------- # 5.8.9 (2022-10-22) diff --git a/hutool-core/src/main/java/cn/hutool/core/lang/tree/TreeBuilder.java b/hutool-core/src/main/java/cn/hutool/core/lang/tree/TreeBuilder.java index 7bfc3b00a..c8d20eae4 100755 --- a/hutool-core/src/main/java/cn/hutool/core/lang/tree/TreeBuilder.java +++ b/hutool-core/src/main/java/cn/hutool/core/lang/tree/TreeBuilder.java @@ -7,7 +7,6 @@ import cn.hutool.core.lang.tree.parser.NodeParser; import cn.hutool.core.map.MapUtil; import cn.hutool.core.util.ObjectUtil; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -56,7 +55,7 @@ public class TreeBuilder implements Builder> { public TreeBuilder(E rootId, TreeNodeConfig config) { root = new Tree<>(config); root.setId(rootId); - this.idTreeMap = new HashMap<>(); + this.idTreeMap = new LinkedHashMap<>(); } /**