From 4224e864610897694ecc0a6a897b06c4fed38b2b Mon Sep 17 00:00:00 2001 From: Looly Date: Tue, 5 Nov 2024 17:58:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=89=80=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E7=9A=84ObjectUtil#defaultIfNull=E9=81=BF=E5=85=8D=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E5=88=9B=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 ++- .../cn/hutool/core/swing/clipboard/ClipboardMonitor.java | 5 +---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 33e729169..12a79a2a5 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ # 🚀Changelog ------------------------------------------------------------------------------------------------------------- -# 5.8.33(2024-10-30) +# 5.8.33(2024-11-05) ### 🐣新特性 * 【core 】 SyncFinisher增加setExecutorService方法(issue#IANKQ1@Gitee) @@ -19,6 +19,7 @@ * 【core 】 PropDesc.isTransientForGet使用className,避免Android下类找不到问题(issue#IB0JP5@Gitee) * 【core 】 优化NumberUtil.count(pr#3772@Github) * 【crypto 】 SM2.signHex改名为signHexFromHex,原名标记废弃,避免歧义(issue#IB0NVY@Gitee) +* 【all 】 优化所调用的ObjectUtil#defaultIfNull避免重复创建(pr#1274@Gitee) ### 🐞Bug修复 * 【json 】 修复JSONConfig.setDateFormat设置后toBean无效问题(issue#3713@Github) diff --git a/hutool-core/src/main/java/cn/hutool/core/swing/clipboard/ClipboardMonitor.java b/hutool-core/src/main/java/cn/hutool/core/swing/clipboard/ClipboardMonitor.java index 91234939b..040fecfcb 100755 --- a/hutool-core/src/main/java/cn/hutool/core/swing/clipboard/ClipboardMonitor.java +++ b/hutool-core/src/main/java/cn/hutool/core/swing/clipboard/ClipboardMonitor.java @@ -142,10 +142,7 @@ public enum ClipboardMonitor implements ClipboardOwner, Runnable, Closeable { if (isRunning) { // 继续监听 - clipboard.setContents( - ObjectUtil.defaultIfNull(transferable, - () -> ObjectUtil.defaultIfNull(newContents, contents)), - this); + clipboard.setContents(ObjectUtil.defaultIfNull(transferable, ObjectUtil.defaultIfNull(newContents, contents)), this); } }