From 700d3001cf43e940ec4e7ff119551085d7a3b6e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E7=90=A6=E6=B6=9B?= Date: Wed, 8 Mar 2023 15:45:16 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90fix=20sonar=E3=80=91CommonUtils?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/jero/common/util/CommonUtils.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/util/CommonUtils.java b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/util/CommonUtils.java index c886d28c..b16a52e5 100644 --- a/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/util/CommonUtils.java +++ b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/util/CommonUtils.java @@ -97,10 +97,7 @@ public class CommonUtils { return false; }else{ Matcher m = ZHONGWEN_PATTERN.matcher(str); - if (m.find()) { - return true; - } - return false; + return m.find(); } } @@ -256,8 +253,7 @@ public class CommonUtils { */ public static boolean limitFileSuffix(String fileName,String[] fileSuffixLimits){ final List fileNameList = Arrays.asList(fileSuffixLimits); - boolean isExists = fileNameList.stream().anyMatch(name -> fileName.substring(0,fileName.lastIndexOf('.')).contains(name)||fileName.substring(fileName.lastIndexOf('.')).equals(name)); - return isExists; + return fileNameList.stream().anyMatch(name -> fileName.substring(0,fileName.lastIndexOf('.')).contains(name)||fileName.substring(fileName.lastIndexOf('.')).equals(name)); } /** * RSA 使用私钥解密