From cbc2246a37a7f19eb0012f11e5b139b8193baf0b Mon Sep 17 00:00:00 2001 From: Looly Date: Wed, 29 Mar 2023 22:01:24 +0800 Subject: [PATCH] =?UTF-8?q?CollUtil.split=E4=BC=98=E5=8C=96=E5=88=87?= =?UTF-8?q?=E5=89=B2=E5=88=97=E8=A1=A8=E5=8F=82=E6=95=B0=E5=88=A4=E6=96=AD?= =?UTF-8?q?=EF=BC=8C=E9=81=BF=E5=85=8DOOM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 5 +++-- .../test/java/cn/hutool/core/collection/CollUtilTest.java | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a1f91ca1..819af2b13 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,13 +2,14 @@ # 🚀Changelog ------------------------------------------------------------------------------------------------------------- -# 5.8.17.M1 (2023-03-28) +# 5.8.17.M1 (2023-03-29) ### 🐣新特性 * 【core 】 SerializeUtil.deserialize增加白名单类,避免RCE vulnerability(issue#3021@Github) ### 🐞Bug修复 -* 【core 】 CollUtil.split优化切割列表参数判断,避免OOM +* 【core 】 CollUtil.split优化切割列表参数判断,避免OOM(pr#3026@Github) + ------------------------------------------------------------------------------------------------------------- # 5.8.16 (2023-03-26) diff --git a/hutool-core/src/test/java/cn/hutool/core/collection/CollUtilTest.java b/hutool-core/src/test/java/cn/hutool/core/collection/CollUtilTest.java index 058348a74..8160a2a74 100755 --- a/hutool-core/src/test/java/cn/hutool/core/collection/CollUtilTest.java +++ b/hutool-core/src/test/java/cn/hutool/core/collection/CollUtilTest.java @@ -923,6 +923,7 @@ public class CollUtilTest { Assert.assertEquals("bb", distinct.get(1).getName()); } + @SuppressWarnings("ConstantValue") @Test public void unionNullTest() { final List list1 = new ArrayList<>(); @@ -932,6 +933,7 @@ public class CollUtilTest { Assert.assertNotNull(union); } + @SuppressWarnings("ConstantValue") @Test public void unionDistinctNullTest() { final List list1 = new ArrayList<>(); @@ -941,6 +943,7 @@ public class CollUtilTest { Assert.assertNotNull(set); } + @SuppressWarnings({"ConfusingArgumentToVarargsMethod", "ConstantValue"}) @Test public void unionAllNullTest() { final List list1 = new ArrayList<>(); @@ -949,7 +952,7 @@ public class CollUtilTest { final List list = CollUtil.unionAll(list1, list2, list3); Assert.assertNotNull(list); - @SuppressWarnings("ConfusingArgumentToVarargsMethod") final List resList2 = CollUtil.unionAll(null, null, null); + final List resList2 = CollUtil.unionAll(null, null, null); Assert.assertNotNull(resList2); } @@ -998,6 +1001,7 @@ public class CollUtilTest { list.toArray()); } + @SuppressWarnings("ConstantValue") @Test public void intersectionNullTest() { final List list1 = new ArrayList<>();