From dd3de5f84bcbf0c13ad60df0c3feb9d564727447 Mon Sep 17 00:00:00 2001 From: hengyunabc Date: Mon, 18 Apr 2022 13:13:48 +0800 Subject: [PATCH] fix InaccessibleObjectException in jdk17. #4077 --- src/main/java/com/alibaba/fastjson/util/TypeUtils.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/com/alibaba/fastjson/util/TypeUtils.java b/src/main/java/com/alibaba/fastjson/util/TypeUtils.java index cc1ea4ef09..0fb8964193 100644 --- a/src/main/java/com/alibaba/fastjson/util/TypeUtils.java +++ b/src/main/java/com/alibaba/fastjson/util/TypeUtils.java @@ -38,7 +38,6 @@ import java.lang.reflect.*; import java.math.BigDecimal; import java.math.BigInteger; -import java.security.AccessControlException; import java.sql.Clob; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -2553,7 +2552,7 @@ static void setAccessible(AccessibleObject obj) { } try { obj.setAccessible(true); - } catch (AccessControlException error) { + } catch (Throwable error) { setAccessibleEnable = false; } }