From 7087fcf3ad10987eaa512122c103550e533bf24b 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 17:55:26 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90fix=20sonar=E3=80=91SysDictServiceImpl?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/service/impl/SysDictServiceImpl.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysDictServiceImpl.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysDictServiceImpl.java index 7914ac22..0764f9f9 100644 --- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysDictServiceImpl.java +++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysDictServiceImpl.java @@ -190,7 +190,7 @@ public class SysDictServiceImpl extends ServiceImpl impl //update-end--Author:lvdandan Date:20201204 for:JT-36【online】树形列表bug修改后,还是显示原来值 暂时去掉缓存 public List queryTableDictByKeys(String table, String text, String code, String keys, boolean delNotExist) { if(oConvertUtils.isEmpty(keys)){ - return null; + return Collections.emptyList(); } String[] keyArray = keys.split(","); List dicts = sysDictMapper.queryTableDictByKeys(table, text, code, keyArray); @@ -371,7 +371,7 @@ public class SysDictServiceImpl extends ServiceImpl impl @Override public List queryDictTablePageList(DictQuery query, int pageSize, int pageNo) { - Page page = new Page(pageNo,pageSize,false); + Page page = new Page<>(pageNo,pageSize,false); Page pageList = baseMapper.queryDictTablePageList(page, query); return pageList.getRecords(); } @@ -385,7 +385,7 @@ public class SysDictServiceImpl extends ServiceImpl impl String[] params = dictCode.split(","); if (params.length < 3) { // 字典Code格式不正确 - return null; + return Collections.emptyList(); } //SQL注入校验(只限制非法串改数据库) final String[] sqlInjCheck = {params[0], params[1], params[2]}; @@ -398,7 +398,7 @@ public class SysDictServiceImpl extends ServiceImpl impl ls = this.queryTableDictItemsByCode(params[0], params[1], params[2]); } else { // 字典Code格式不正确 - return null; + return Collections.emptyList(); } } else { //字典表 @@ -415,7 +415,7 @@ public class SysDictServiceImpl extends ServiceImpl impl String condition = null; if (params.length != 3 && params.length != 4) { // 字典Code格式不正确 - return null; + return Collections.emptyList(); } else if (params.length == 4) { condition = params[3]; } @@ -429,7 +429,7 @@ public class SysDictServiceImpl extends ServiceImpl impl return ls; } else { // 字典Code格式不正确 - return null; + return Collections.emptyList(); } }