From 4b0e64f81738bd3e3f6c50081dfd869929f760c6 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 11 Mar 2023 10:15:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9F=90=E4=BA=9B=E6=83=85?= =?UTF-8?q?=E5=86=B5=E4=B8=8BContextHolder=E7=9A=84NPE=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=20#225?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/db/DataPermissionDatabaseInterceptor.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionDatabaseInterceptor.java b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionDatabaseInterceptor.java index 5fc4e55d0..f3446b21c 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionDatabaseInterceptor.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionDatabaseInterceptor.java @@ -539,11 +539,11 @@ public class DataPermissionDatabaseInterceptor extends JsqlParserSupport impleme /** * 该 {@link MappedStatement} 对应的规则 */ - private static final ThreadLocal> RULES = new TransmittableThreadLocal<>(); - /** + private static final ThreadLocal> RULES = ThreadLocal.withInitial(Collections::emptyList); /** + * * SQL 是否进行重写 */ - private static final ThreadLocal REWRITE = new TransmittableThreadLocal<>(); + private static final ThreadLocal REWRITE = ThreadLocal.withInitial(() -> Boolean.FALSE); public static void init(List rules) { RULES.set(rules);