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 202f703a28..105fc64be2 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; }