CollUtil.split优化切割列表参数判断,避免OOM

This commit is contained in:
Looly 2023-03-29 22:01:24 +08:00
parent 1c6c15df07
commit cbc2246a37
2 changed files with 8 additions and 3 deletions

View File

@ -2,13 +2,14 @@
# 🚀Changelog
-------------------------------------------------------------------------------------------------------------
# 5.8.17.M1 (2023-03-28)
# 5.8.17.M1 (2023-03-29)
### 🐣新特性
* 【core 】 SerializeUtil.deserialize增加白名单类避免RCE vulnerabilityissue#3021@Github
### 🐞Bug修复
* 【core 】 CollUtil.split优化切割列表参数判断避免OOM
* 【core 】 CollUtil.split优化切割列表参数判断避免OOMpr#3026@Github
-------------------------------------------------------------------------------------------------------------
# 5.8.16 (2023-03-26)

View File

@ -923,6 +923,7 @@ public class CollUtilTest {
Assert.assertEquals("bb", distinct.get(1).getName());
}
@SuppressWarnings("ConstantValue")
@Test
public void unionNullTest() {
final List<String> list1 = new ArrayList<>();
@ -932,6 +933,7 @@ public class CollUtilTest {
Assert.assertNotNull(union);
}
@SuppressWarnings("ConstantValue")
@Test
public void unionDistinctNullTest() {
final List<String> list1 = new ArrayList<>();
@ -941,6 +943,7 @@ public class CollUtilTest {
Assert.assertNotNull(set);
}
@SuppressWarnings({"ConfusingArgumentToVarargsMethod", "ConstantValue"})
@Test
public void unionAllNullTest() {
final List<String> list1 = new ArrayList<>();
@ -949,7 +952,7 @@ public class CollUtilTest {
final List<String> list = CollUtil.unionAll(list1, list2, list3);
Assert.assertNotNull(list);
@SuppressWarnings("ConfusingArgumentToVarargsMethod") final List<String> resList2 = CollUtil.unionAll(null, null, null);
final List<String> 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<String> list1 = new ArrayList<>();