From 118333fefbec358507fda5111b85eb951470be93 Mon Sep 17 00:00:00 2001 From: wenshao Date: Sat, 11 Jan 2025 20:57:46 +0800 Subject: [PATCH] fix compatible error --- .../src/main/java/com/alibaba/fastjson/JSON.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fastjson1-compatible/src/main/java/com/alibaba/fastjson/JSON.java b/fastjson1-compatible/src/main/java/com/alibaba/fastjson/JSON.java index 202f703a2..105fc64be 100644 --- a/fastjson1-compatible/src/main/java/com/alibaba/fastjson/JSON.java +++ b/fastjson1-compatible/src/main/java/com/alibaba/fastjson/JSON.java @@ -2169,9 +2169,8 @@ public static JSONArray parseArray(String str) { JSONFactory.getDefaultObjectReaderProvider(), DEFAULT_PARSER_FEATURE ); - JSONReader reader = JSONReader.of(str, context); - try { + try (JSONReader reader = JSONReader.of(str, context)) { if (reader.nextIfNullOrEmptyString()) { return null; }