mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
CollUtil.subtract增加空判定
This commit is contained in:
parent
2857c0af65
commit
9db9648539
@ -2,11 +2,12 @@
|
|||||||
# 🚀Changelog
|
# 🚀Changelog
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
# 5.8.29(2024-06-02)
|
# 5.8.29(2024-06-04)
|
||||||
|
|
||||||
### 🐣新特性
|
### 🐣新特性
|
||||||
* 【core 】 DateUtil增加offsetYear方法
|
* 【core 】 DateUtil增加offsetYear方法
|
||||||
* 【core 】 ListUtil增加move方法(issue#3603@Github)
|
* 【core 】 ListUtil增加move方法(issue#3603@Github)
|
||||||
|
* 【core 】 CollUtil.subtract增加空判定(issue#3605@Github)
|
||||||
|
|
||||||
### 🐞Bug修复
|
### 🐞Bug修复
|
||||||
* 【core 】 修复AnnotationUtil可能的空指针错误
|
* 【core 】 修复AnnotationUtil可能的空指针错误
|
||||||
|
@ -361,6 +361,10 @@ public class CollUtil {
|
|||||||
* @return 单差集
|
* @return 单差集
|
||||||
*/
|
*/
|
||||||
public static <T> Collection<T> subtract(Collection<T> coll1, Collection<T> coll2) {
|
public static <T> Collection<T> subtract(Collection<T> coll1, Collection<T> coll2) {
|
||||||
|
if(isEmpty(coll1) || isEmpty(coll2)){
|
||||||
|
return coll1;
|
||||||
|
}
|
||||||
|
|
||||||
Collection<T> result = ObjectUtil.clone(coll1);
|
Collection<T> result = ObjectUtil.clone(coll1);
|
||||||
try {
|
try {
|
||||||
if (null == result) {
|
if (null == result) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user