diff --git a/CHANGELOG.md b/CHANGELOG.md index d7e304bf7..58fd22d36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ------------------------------------------------------------------------------------------------------------- -# 5.6.6 (2021-05-22) +# 5.6.6 (2021-05-24) ### 🐣新特性 * 【cron 】 增加时间轮简单实现 @@ -13,6 +13,7 @@ * 【core 】 FileUtil.isEmpty不存在时返回true(issue#1582@Github) * 【core 】 PhoneUtil增加中国澳门和中国台湾手机号校检方法(pr#331@Gitee) * 【db 】 分页查询,自定义sql查询,添加参数(pr#332@Gitee) +* 【core 】 IdCardUtil.isValidCard增加非空判断 ### 🐞Bug修复 * 【core 】 修复XmlUtil中omitXmlDeclaration参数无效问题(issue#1581@Github) diff --git a/hutool-core/src/main/java/cn/hutool/core/collection/ListUtil.java b/hutool-core/src/main/java/cn/hutool/core/collection/ListUtil.java index cf751759f..a2165839a 100644 --- a/hutool-core/src/main/java/cn/hutool/core/collection/ListUtil.java +++ b/hutool-core/src/main/java/cn/hutool/core/collection/ListUtil.java @@ -494,10 +494,11 @@ public class ListUtil { } /** - * 获取一个空List + * 获取一个空List,这个空List不可变 * * @param 元素类型 * @return 空的List + * @see Collections#emptyList() * @since 5.2.6 */ public static List empty() { diff --git a/hutool-core/src/main/java/cn/hutool/core/util/IdcardUtil.java b/hutool-core/src/main/java/cn/hutool/core/util/IdcardUtil.java index f2f5fb59c..f5499f46f 100644 --- a/hutool-core/src/main/java/cn/hutool/core/util/IdcardUtil.java +++ b/hutool-core/src/main/java/cn/hutool/core/util/IdcardUtil.java @@ -153,6 +153,10 @@ public class IdcardUtil { * @return 是否有效 */ public static boolean isValidCard(String idCard) { + if(StrUtil.isBlank(idCard)){ + return false; + } + idCard = idCard.trim(); int length = idCard.length(); switch (length) {