From 3f4e0540db9d5639d50a1e44f1d56a0d03a7014c Mon Sep 17 00:00:00 2001 From: Looly Date: Fri, 19 Mar 2021 11:50:06 +0800 Subject: [PATCH] add re --- CHANGELOG.md | 1 + hutool-core/src/main/java/cn/hutool/core/lang/Validator.java | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c2124f377..5eb030cf1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ # 5.6.2 (2021-03-18) ### 新特性 +* 【core 】 Validator增加车架号(车辆识别码)验证、驾驶证(驾驶证档案编号)的正则校验(pr#280@Gitee) ### Bug修复 ------------------------------------------------------------------------------------------------------------- diff --git a/hutool-core/src/main/java/cn/hutool/core/lang/Validator.java b/hutool-core/src/main/java/cn/hutool/core/lang/Validator.java index 1da6627a9..96f1f1f7e 100644 --- a/hutool-core/src/main/java/cn/hutool/core/lang/Validator.java +++ b/hutool-core/src/main/java/cn/hutool/core/lang/Validator.java @@ -1167,7 +1167,7 @@ public class Validator { * @since 5.6.3 */ public static T validateCarVin(T value, String errorMsg) throws ValidateException { - if (!isCarVin(value)) { + if (false == isCarVin(value)) { throw new ValidateException(errorMsg); } return value; @@ -1196,7 +1196,7 @@ public class Validator { * @since 5.6.3 */ public static T validateCarDrivingLicence(T value, String errorMsg) throws ValidateException { - if (!isCarDrivingLicence(value)) { + if (false == isCarDrivingLicence(value)) { throw new ValidateException(errorMsg); } return value;