From 8fb1c1fa35f3886bf11b50b8f1a46f828b189c24 Mon Sep 17 00:00:00 2001 From: "shaojin.wensj" Date: Fri, 13 May 2022 16:44:41 +0800 Subject: [PATCH] add testcase for issue #235 --- .../alibaba/fastjson2/issues/Issue235.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 core/src/test/java/com/alibaba/fastjson2/issues/Issue235.java diff --git a/core/src/test/java/com/alibaba/fastjson2/issues/Issue235.java b/core/src/test/java/com/alibaba/fastjson2/issues/Issue235.java new file mode 100644 index 0000000000..d93afe9f10 --- /dev/null +++ b/core/src/test/java/com/alibaba/fastjson2/issues/Issue235.java @@ -0,0 +1,28 @@ +package com.alibaba.fastjson2.issues; + +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONArray; +import org.junit.jupiter.api.Test; + +import java.util.List; + +public class Issue235 { + @Test + public void test() { + String json = "[{\r\n" + + " \"namespace\":\"unit07\", \r\n" + + " \"items\":[\"COUNTER13_14.AV\",\r\n" + + " \"COUNTER13_15.AV\"]\r\n" + + "}\r\n" + + "]"; + JSONArray arrays = JSON.parseArray(json); + System.out.println(arrays.size()); + List list = JSON.parseArray(json, TModal.class); + System.out.println(list.size()); + } + + public static class TModal{ + private String namespace; + private List items; + } +}