From d03b0c8aff50aee72cd5ea153eed69897bddc49d 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:46:54 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90fix=20sonar=E3=80=91Swagger2Config?= =?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/config/Swagger2Config.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/config/Swagger2Config.java b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/config/Swagger2Config.java index c1975069..0dd4f537 100644 --- a/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/config/Swagger2Config.java +++ b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/config/Swagger2Config.java @@ -117,7 +117,7 @@ public class Swagger2Config implements WebMvcConfigurer { * 新增 securityContexts 保持登录状态 */ private List securityContexts() { - return new ArrayList( + return new ArrayList<>( Collections.singleton(SecurityContext.builder() .securityReferences(defaultAuth()) .forPaths(PathSelectors.regex("^(?!auth).*$")) @@ -129,7 +129,7 @@ public class Swagger2Config implements WebMvcConfigurer { AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything"); AuthorizationScope[] authorizationScopes = new AuthorizationScope[1]; authorizationScopes[0] = authorizationScope; - return new ArrayList( + return new ArrayList<>( Collections.singleton(new SecurityReference(CommonConstant.X_ACCESS_TOKEN, authorizationScopes))); }