The following issues were found

src/test/java/com/alibaba/json/bvt/serializer/enum_/EnumFieldsTest8.java
6 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 15

              
public class EnumFieldsTest8 extends TestCase {

    public void test_enum() throws Exception {
        Model model = new Model();
        model.t1 = Type.A;
        model.t2 = null;
        
        ValueFilter valueFilter = new ValueFilter() {

            

Reported by PMD.

Assigning an Object to null is a code smell. Consider refactoring.
Error

Line: 18

                  public void test_enum() throws Exception {
        Model model = new Model();
        model.t1 = Type.A;
        model.t2 = null;
        
        ValueFilter valueFilter = new ValueFilter() {

            public Object process(Object object, String name, Object value) {
                return value;

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 41

              
    public static class Model {

        public Type t1;
        public Type t2;
    }

    public static enum Type {
                             A, B, C

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 42

                  public static class Model {

        public Type t1;
        public Type t2;
    }

    public static enum Type {
                             A, B, C
    }

            

Reported by PMD.

Found 'DU'-anomaly for variable 'valueFilter' (lines '20'-'37').
Error

Line: 20

                      model.t1 = Type.A;
        model.t2 = null;
        
        ValueFilter valueFilter = new ValueFilter() {

            public Object process(Object object, String name, Object value) {
                return value;
            }
            

            

Reported by PMD.

Found 'DU'-anomaly for variable 'valueFilter' (lines '20'-'37').
Error

Line: 20

                      model.t1 = Type.A;
        model.t2 = null;
        
        ValueFilter valueFilter = new ValueFilter() {

            public Object process(Object object, String name, Object value) {
                return value;
            }
            

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/serializer/stream/StreamWriterTest_writeString.java
6 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 12

              
public class StreamWriterTest_writeString extends TestCase {

    public void test_0() throws Exception {
        StringWriter out = new StringWriter();

        SerializeWriter writer = new SerializeWriter(out, 10);
        Assert.assertEquals(10, writer.getBufferLength());


            

Reported by PMD.

Avoid instantiating new objects inside loops
Performance

Line: 20

              
        int blockSize = 21;
        for (char ch = 'a'; ch <= 'z'; ++ch) {
            char[] chars = new char[blockSize];
            for (int i = 0; i < blockSize; ++i) {
                chars[i] = ch;
            }
            writer.write(new String(chars), 0, chars.length);
        }

            

Reported by PMD.

Avoid instantiating new objects inside loops
Performance

Line: 24

                          for (int i = 0; i < blockSize; ++i) {
                chars[i] = ch;
            }
            writer.write(new String(chars), 0, chars.length);
        }
        writer.close();

        String text = out.toString();
        Assert.assertEquals(26 * blockSize, text.length());

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 29

                      writer.close();

        String text = out.toString();
        Assert.assertEquals(26 * blockSize, text.length());

        for (int i = 0; i < 26; ++i) {
            for (int j = 0; j < blockSize; ++j) {
                Assert.assertEquals(text.charAt(i * blockSize + j), (char) ('a' + i));
            }

            

Reported by PMD.

Found 'DD'-anomaly for variable 'chars' (lines '20'-'22').
Error

Line: 20

              
        int blockSize = 21;
        for (char ch = 'a'; ch <= 'z'; ++ch) {
            char[] chars = new char[blockSize];
            for (int i = 0; i < blockSize; ++i) {
                chars[i] = ch;
            }
            writer.write(new String(chars), 0, chars.length);
        }

            

Reported by PMD.

Found 'DD'-anomaly for variable 'chars' (lines '22'-'22').
Error

Line: 22

                      for (char ch = 'a'; ch <= 'z'; ++ch) {
            char[] chars = new char[blockSize];
            for (int i = 0; i < blockSize; ++i) {
                chars[i] = ch;
            }
            writer.write(new String(chars), 0, chars.length);
        }
        writer.close();


            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/serializer/stream/StreamWriterTest_writeString1.java
6 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 12

              
public class StreamWriterTest_writeString1 extends TestCase {

    public void test_0() throws Exception {
        StringWriter out = new StringWriter();

        SerializeWriter writer = new SerializeWriter(out, 10);
        Assert.assertEquals(10, writer.getBufferLength());


            

Reported by PMD.

Avoid instantiating new objects inside loops
Performance

Line: 20

              
        int blockSize = 21;
        for (char ch = 'a'; ch <= 'z'; ++ch) {
            char[] chars = new char[blockSize];
            for (int i = 0; i < blockSize; ++i) {
                chars[i] = ch;
            }
            writer.write(new String(chars));
        }

            

Reported by PMD.

Avoid instantiating new objects inside loops
Performance

Line: 24

                          for (int i = 0; i < blockSize; ++i) {
                chars[i] = ch;
            }
            writer.write(new String(chars));
        }
        writer.close();

        String text = out.toString();
        Assert.assertEquals(26 * blockSize, text.length());

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 29

                      writer.close();

        String text = out.toString();
        Assert.assertEquals(26 * blockSize, text.length());

        for (int i = 0; i < 26; ++i) {
            for (int j = 0; j < blockSize; ++j) {
                Assert.assertEquals(text.charAt(i * blockSize + j), (char) ('a' + i));
            }

            

Reported by PMD.

Found 'DD'-anomaly for variable 'chars' (lines '20'-'22').
Error

Line: 20

              
        int blockSize = 21;
        for (char ch = 'a'; ch <= 'z'; ++ch) {
            char[] chars = new char[blockSize];
            for (int i = 0; i < blockSize; ++i) {
                chars[i] = ch;
            }
            writer.write(new String(chars));
        }

            

Reported by PMD.

Found 'DD'-anomaly for variable 'chars' (lines '22'-'22').
Error

Line: 22

                      for (char ch = 'a'; ch <= 'z'; ++ch) {
            char[] chars = new char[blockSize];
            for (int i = 0; i < blockSize; ++i) {
                chars[i] = ch;
            }
            writer.write(new String(chars));
        }
        writer.close();


            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/parser/str/StringTest_01.java
6 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 14

              
public class StringTest_01 extends TestCase {

    public void test_string() throws Exception {
        char[] chars = new char[1024];
        Arrays.fill(chars, '0');
        StringBuilder buf = new StringBuilder();
        buf.append("[\"");
        for (int i = 0; i < 16; ++i) {

            

Reported by PMD.

StringBuffer (or StringBuilder).append is called 2 consecutive times with literals. Use a single append with a single combined String.
Performance

Line: 20

                      StringBuilder buf = new StringBuilder();
        buf.append("[\"");
        for (int i = 0; i < 16; ++i) {
            buf.append("\\\\");
            buf.append("\\\"");
            buf.append(new String(chars));
        }
        buf.append("\"]");
        

            

Reported by PMD.

Avoid instantiating new objects inside loops
Performance

Line: 22

                      for (int i = 0; i < 16; ++i) {
            buf.append("\\\\");
            buf.append("\\\"");
            buf.append(new String(chars));
        }
        buf.append("\"]");
        
        String text = buf.toString();
        JSONArray array = (JSONArray) JSON.parse(text);

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 28

                      
        String text = buf.toString();
        JSONArray array = (JSONArray) JSON.parse(text);
        Assert.assertEquals(1, array.size());
        
        String item = (String) array.get(0);
        Assert.assertEquals(16 * 1024 + 32, item.length());
        
        for (int i = 0; i < 16; ++i) {

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 30

                      JSONArray array = (JSONArray) JSON.parse(text);
        Assert.assertEquals(1, array.size());
        
        String item = (String) array.get(0);
        Assert.assertEquals(16 * 1024 + 32, item.length());
        
        for (int i = 0; i < 16; ++i) {
            Assert.assertTrue(item.charAt(i * 1026) == '\\');
            Assert.assertTrue(item.charAt(i * 1026 + 1) == '\"');

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 31

                      Assert.assertEquals(1, array.size());
        
        String item = (String) array.get(0);
        Assert.assertEquals(16 * 1024 + 32, item.length());
        
        for (int i = 0; i < 16; ++i) {
            Assert.assertTrue(item.charAt(i * 1026) == '\\');
            Assert.assertTrue(item.charAt(i * 1026 + 1) == '\"');
            for (int j = 0; j < 1024; ++j) {

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/path/JSONPath_like.java
6 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 9

              

public class JSONPath_like extends TestCase {
    public void test_like_not_match() throws Exception {
        assertNull(
                JSONPath.read("{\"table\":\"_order_base\"}", "[table LIKE 'order_base%']"));
    }

    public void test_like_not_match_1() throws Exception {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 10

              
public class JSONPath_like extends TestCase {
    public void test_like_not_match() throws Exception {
        assertNull(
                JSONPath.read("{\"table\":\"_order_base\"}", "[table LIKE 'order_base%']"));
    }

    public void test_like_not_match_1() throws Exception {
        assertEquals("{\"table\":\"_order_base\"}",

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 14

                              JSONPath.read("{\"table\":\"_order_base\"}", "[table LIKE 'order_base%']"));
    }

    public void test_like_not_match_1() throws Exception {
        assertEquals("{\"table\":\"_order_base\"}",
                JSONPath.read("{\"table\":\"_order_base\"}", "[table LIKE '_order_base%']").toString());
    }

}

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 15

                  }

    public void test_like_not_match_1() throws Exception {
        assertEquals("{\"table\":\"_order_base\"}",
                JSONPath.read("{\"table\":\"_order_base\"}", "[table LIKE '_order_base%']").toString());
    }

}

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 16

              
    public void test_like_not_match_1() throws Exception {
        assertEquals("{\"table\":\"_order_base\"}",
                JSONPath.read("{\"table\":\"_order_base\"}", "[table LIKE '_order_base%']").toString());
    }

}

            

Reported by PMD.

Avoid unused imports such as 'org.junit.Assert'
Design

Line: 5

              
import com.alibaba.fastjson.JSONPath;
import junit.framework.TestCase;
import org.junit.Assert;


public class JSONPath_like extends TestCase {
    public void test_like_not_match() throws Exception {
        assertNull(

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/parser/deser/deny/DenyTest5.java
6 issues
System.out.println is used
Design

Line: 18

                      Exception error = null;
        try {
            obj = JSON.parseObject("{\"@type\":\"com.mchange.v2.c3p0.impl.PoolBackedDataSourceBase\"}", Object.class, config);
            System.out.println(obj.getClass());
        } catch (JSONException ex) {
            error = ex;
        }
        assertNotNull(error);
    }

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 10

              
public class DenyTest5 extends TestCase {

    public void test_c3p0() throws Exception {
        ParserConfig config = new ParserConfig();
        config.setAutoTypeSupport(true);

        Object obj = null;
        Exception error = null;

            

Reported by PMD.

The initializer for variable 'obj' is never used (overwritten on line 17)
Design

Line: 14

                      ParserConfig config = new ParserConfig();
        config.setAutoTypeSupport(true);

        Object obj = null;
        Exception error = null;
        try {
            obj = JSON.parseObject("{\"@type\":\"com.mchange.v2.c3p0.impl.PoolBackedDataSourceBase\"}", Object.class, config);
            System.out.println(obj.getClass());
        } catch (JSONException ex) {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 22

                      } catch (JSONException ex) {
            error = ex;
        }
        assertNotNull(error);
    }


}

            

Reported by PMD.

Found 'DD'-anomaly for variable 'obj' (lines '14'-'17').
Error

Line: 14

                      ParserConfig config = new ParserConfig();
        config.setAutoTypeSupport(true);

        Object obj = null;
        Exception error = null;
        try {
            obj = JSON.parseObject("{\"@type\":\"com.mchange.v2.c3p0.impl.PoolBackedDataSourceBase\"}", Object.class, config);
            System.out.println(obj.getClass());
        } catch (JSONException ex) {

            

Reported by PMD.

Found 'DD'-anomaly for variable 'error' (lines '15'-'20').
Error

Line: 15

                      config.setAutoTypeSupport(true);

        Object obj = null;
        Exception error = null;
        try {
            obj = JSON.parseObject("{\"@type\":\"com.mchange.v2.c3p0.impl.PoolBackedDataSourceBase\"}", Object.class, config);
            System.out.println(obj.getClass());
        } catch (JSONException ex) {
            error = ex;

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/util/GenericFieldInfoTest.java
6 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 11

               * Created by wenshao on 30/05/2017.
 */
public class GenericFieldInfoTest extends TestCase {
    public void test_generic() throws Exception {
        A a = JSON.parseObject("{\"data\":3}", A4.class);
        assertTrue(a.data instanceof Long);
    }

    public void test_generic_1() throws Exception {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 13

              public class GenericFieldInfoTest extends TestCase {
    public void test_generic() throws Exception {
        A a = JSON.parseObject("{\"data\":3}", A4.class);
        assertTrue(a.data instanceof Long);
    }

    public void test_generic_1() throws Exception {
        A a = JSON.parseObject("{\"data\":3}", new TypeReference<A3<Long>>(){});
        assertEquals(a.data.getClass(), Long.class);

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 16

                      assertTrue(a.data instanceof Long);
    }

    public void test_generic_1() throws Exception {
        A a = JSON.parseObject("{\"data\":3}", new TypeReference<A3<Long>>(){});
        assertEquals(a.data.getClass(), Long.class);
    }

    public static class A <T> {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 18

              
    public void test_generic_1() throws Exception {
        A a = JSON.parseObject("{\"data\":3}", new TypeReference<A3<Long>>(){});
        assertEquals(a.data.getClass(), Long.class);
    }

    public static class A <T> {
        public T data;
    }

            

Reported by PMD.

Potential violation of Law of Demeter (static property access)
Design

Line: 18

              
    public void test_generic_1() throws Exception {
        A a = JSON.parseObject("{\"data\":3}", new TypeReference<A3<Long>>(){});
        assertEquals(a.data.getClass(), Long.class);
    }

    public static class A <T> {
        public T data;
    }

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 22

                  }

    public static class A <T> {
        public T data;
    }

    public static class A1 <T> extends A<T> {

    }

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/parser/deser/DoubleArrayFieldDeserializerTest.java
6 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 11

              
public class DoubleArrayFieldDeserializerTest extends TestCase {

    public void test_0() throws Exception {
        Entity a = JSON.parseObject("{\"values\":[1,2]}", Entity.class);
        Assert.assertTrue(1 == a.getValues()[0]);
        Assert.assertTrue(2 == a.getValues()[1]);
    }


            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 13

              
    public void test_0() throws Exception {
        Entity a = JSON.parseObject("{\"values\":[1,2]}", Entity.class);
        Assert.assertTrue(1 == a.getValues()[0]);
        Assert.assertTrue(2 == a.getValues()[1]);
    }


    public static class Entity {

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 14

                  public void test_0() throws Exception {
        Entity a = JSON.parseObject("{\"values\":[1,2]}", Entity.class);
        Assert.assertTrue(1 == a.getValues()[0]);
        Assert.assertTrue(2 == a.getValues()[1]);
    }


    public static class Entity {


            

Reported by PMD.

Returning 'values' may expose an internal array.
Design

Line: 23

                      public double[] values;

        public double[] getValues() {
            return values;
        }

        public void setValues(double[] values) {
            this.values = values;
        }

            

Reported by PMD.

The user-supplied array 'values' is stored directly.
Design

Line: 26

                          return values;
        }

        public void setValues(double[] values) {
            this.values = values;
        }

    }
}

            

Reported by PMD.

Consider using varargs for methods or constructors which take an array the last parameter.
Design

Line: 26

                          return values;
        }

        public void setValues(double[] values) {
            this.values = values;
        }

    }
}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/parser/deser/list/ListStringFieldTest.java
6 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 14

              
public class ListStringFieldTest extends TestCase {

    public void test_list() throws Exception {
        String text = "[[\"a\",null,\"b\"]]";
        Model model = JSON.parseObject(text, Model.class, Feature.SupportArrayToBean);
        Assert.assertEquals(3, model.values.size());
        Assert.assertEquals("a", model.values.get(0));
        Assert.assertEquals(null, model.values.get(1));

            

Reported by PMD.

Potential violation of Law of Demeter (static property access)
Design

Line: 17

                  public void test_list() throws Exception {
        String text = "[[\"a\",null,\"b\"]]";
        Model model = JSON.parseObject(text, Model.class, Feature.SupportArrayToBean);
        Assert.assertEquals(3, model.values.size());
        Assert.assertEquals("a", model.values.get(0));
        Assert.assertEquals(null, model.values.get(1));
        Assert.assertEquals("b", model.values.get(2));
    }
    

            

Reported by PMD.

Potential violation of Law of Demeter (static property access)
Design

Line: 18

                      String text = "[[\"a\",null,\"b\"]]";
        Model model = JSON.parseObject(text, Model.class, Feature.SupportArrayToBean);
        Assert.assertEquals(3, model.values.size());
        Assert.assertEquals("a", model.values.get(0));
        Assert.assertEquals(null, model.values.get(1));
        Assert.assertEquals("b", model.values.get(2));
    }
    
    public void test_null() throws Exception {

            

Reported by PMD.

Potential violation of Law of Demeter (static property access)
Design

Line: 19

                      Model model = JSON.parseObject(text, Model.class, Feature.SupportArrayToBean);
        Assert.assertEquals(3, model.values.size());
        Assert.assertEquals("a", model.values.get(0));
        Assert.assertEquals(null, model.values.get(1));
        Assert.assertEquals("b", model.values.get(2));
    }
    
    public void test_null() throws Exception {
        String text = "[null]";

            

Reported by PMD.

Potential violation of Law of Demeter (static property access)
Design

Line: 20

                      Assert.assertEquals(3, model.values.size());
        Assert.assertEquals("a", model.values.get(0));
        Assert.assertEquals(null, model.values.get(1));
        Assert.assertEquals("b", model.values.get(2));
    }
    
    public void test_null() throws Exception {
        String text = "[null]";
        Model model = JSON.parseObject(text, Model.class, Feature.SupportArrayToBean);

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 23

                      Assert.assertEquals("b", model.values.get(2));
    }
    
    public void test_null() throws Exception {
        String text = "[null]";
        Model model = JSON.parseObject(text, Model.class, Feature.SupportArrayToBean);
        Assert.assertNull(model.values);
    }


            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/path/extract/JSONPath_extract_4_multi.java
6 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 8

              
public class JSONPath_extract_4_multi extends TestCase {

    public void test_0() throws Exception {
        assertEquals("[\"male\",\"john\"]"
                , JSONPath.extract(json, "$[0]['gender','name']")
                    .toString());
    }
    public void test_1() throws Exception {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 9

              public class JSONPath_extract_4_multi extends TestCase {

    public void test_0() throws Exception {
        assertEquals("[\"male\",\"john\"]"
                , JSONPath.extract(json, "$[0]['gender','name']")
                    .toString());
    }
    public void test_1() throws Exception {
        assertEquals("[\"john\",\"male\"]"

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 10

              
    public void test_0() throws Exception {
        assertEquals("[\"male\",\"john\"]"
                , JSONPath.extract(json, "$[0]['gender','name']")
                    .toString());
    }
    public void test_1() throws Exception {
        assertEquals("[\"john\",\"male\"]"
                , JSONPath.extract(json, "$[0]['name','gender']")

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 13

                              , JSONPath.extract(json, "$[0]['gender','name']")
                    .toString());
    }
    public void test_1() throws Exception {
        assertEquals("[\"john\",\"male\"]"
                , JSONPath.extract(json, "$[0]['name','gender']")
                    .toString());
    }


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 14

                                  .toString());
    }
    public void test_1() throws Exception {
        assertEquals("[\"john\",\"male\"]"
                , JSONPath.extract(json, "$[0]['name','gender']")
                    .toString());
    }

    private static final String json = "[\n" +

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 15

                  }
    public void test_1() throws Exception {
        assertEquals("[\"john\",\"male\"]"
                , JSONPath.extract(json, "$[0]['name','gender']")
                    .toString());
    }

    private static final String json = "[\n" +
            "   {\n" +

            

Reported by PMD.