From 3a9669007057b0520511aa72d5e73f6f13f21aa6 Mon Sep 17 00:00:00 2001 From: chinabugotech Date: Mon, 1 Dec 2025 02:38:50 +0000 Subject: [PATCH 1/3] update CHANGELOG.md. Signed-off-by: chinabugotech --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 743be9d778..0dc189d4b4 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # 🚀Changelog +# 5.8.43 +### 🐣新特性 +### 🐞Bug修复 ------------------------------------------------------------------------------------------------------------- # 5.8.42(2025-11-28) From 4656e8d3ec8977b0ab550795e2d41828e9995c8f Mon Sep 17 00:00:00 2001 From: chinabugotech Date: Mon, 1 Dec 2025 02:39:11 +0000 Subject: [PATCH 2/3] update CHANGELOG.md. Signed-off-by: chinabugotech --- CHANGELOG.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dc189d4b4..743be9d778 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,5 @@ # 🚀Changelog -# 5.8.43 -### 🐣新特性 -### 🐞Bug修复 ------------------------------------------------------------------------------------------------------------- # 5.8.42(2025-11-28) From 328ce925baeeff144c8cff71062f650295011c91 Mon Sep 17 00:00:00 2001 From: zhaokk51820 Date: Wed, 24 Dec 2025 16:02:05 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix(ThreadUtil):=20=E4=BF=AE=E5=A4=8D=20get?= =?UTF-8?q?MainThread()=20=E5=9C=A8=20JDK=2025=20=E4=B8=AD=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=20null=20=E7=9A=84=E9=97=AE=E9=A2=98=20=E5=85=B7?= =?UTF-8?q?=E4=BD=93issues=E5=9C=B0=E5=9D=80=E4=B8=BA=EF=BC=9Ahttps://gite?= =?UTF-8?q?e.com/chinabugotech/hutool/issues/IDF4HN"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/cn/hutool/core/thread/ThreadUtil.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hutool-core/src/main/java/cn/hutool/core/thread/ThreadUtil.java b/hutool-core/src/main/java/cn/hutool/core/thread/ThreadUtil.java index 3547ed6d77..888e1728d3 100644 --- a/hutool-core/src/main/java/cn/hutool/core/thread/ThreadUtil.java +++ b/hutool-core/src/main/java/cn/hutool/core/thread/ThreadUtil.java @@ -25,6 +25,8 @@ import java.util.function.Supplier; * @author luxiaolei */ public class ThreadUtil { + /** 主线程名称 **/ + public static final String MAIN_THREAD_NAME = "main"; /** * 新建一个线程池,默认的策略如下: @@ -551,7 +553,7 @@ public class ThreadUtil { */ public static Thread getMainThread() { for (Thread thread : getThreads()) { - if (thread.getId() == 1) { + if (MAIN_THREAD_NAME.equals(thread.getName())) { return thread; } }