The following issues were found

src/test/java/data/media/MediaContentGenDecoder.java
44 issues
The class 'MediaContentGenDecoder' has a Modified Cyclomatic Complexity of 11 (Highest = 29).
Design

Line: 15

              import com.alibaba.fastjson.parser.deserializer.JavaBeanDeserializer;
import com.alibaba.fastjson.parser.deserializer.ObjectDeserializer;

public class MediaContentGenDecoder extends JavaBeanDeserializer implements ObjectDeserializer {
    private char[] media_gen_prefix__ = "\"media\":".toCharArray();
    private char[] images_gen_prefix__ = "\"images\":".toCharArray();
    
    private ObjectDeserializer media_gen_deser__;
    private ObjectDeserializer images_gen_list_item_deser__;

            

Reported by PMD.

The class 'MediaContentGenDecoder' has a Standard Cyclomatic Complexity of 11 (Highest = 29).
Design

Line: 15

              import com.alibaba.fastjson.parser.deserializer.JavaBeanDeserializer;
import com.alibaba.fastjson.parser.deserializer.ObjectDeserializer;

public class MediaContentGenDecoder extends JavaBeanDeserializer implements ObjectDeserializer {
    private char[] media_gen_prefix__ = "\"media\":".toCharArray();
    private char[] images_gen_prefix__ = "\"images\":".toCharArray();
    
    private ObjectDeserializer media_gen_deser__;
    private ObjectDeserializer images_gen_list_item_deser__;

            

Reported by PMD.

Private field 'media_gen_prefix__' could be made final; it is only initialized in the declaration or constructor.
Design

Line: 16

              import com.alibaba.fastjson.parser.deserializer.ObjectDeserializer;

public class MediaContentGenDecoder extends JavaBeanDeserializer implements ObjectDeserializer {
    private char[] media_gen_prefix__ = "\"media\":".toCharArray();
    private char[] images_gen_prefix__ = "\"images\":".toCharArray();
    
    private ObjectDeserializer media_gen_deser__;
    private ObjectDeserializer images_gen_list_item_deser__;
    private Type images_gen_list_item_type__ = data.media.Image.class;

            

Reported by PMD.

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

Line: 16

              import com.alibaba.fastjson.parser.deserializer.ObjectDeserializer;

public class MediaContentGenDecoder extends JavaBeanDeserializer implements ObjectDeserializer {
    private char[] media_gen_prefix__ = "\"media\":".toCharArray();
    private char[] images_gen_prefix__ = "\"images\":".toCharArray();
    
    private ObjectDeserializer media_gen_deser__;
    private ObjectDeserializer images_gen_list_item_deser__;
    private Type images_gen_list_item_type__ = data.media.Image.class;

            

Reported by PMD.

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

Line: 17

              
public class MediaContentGenDecoder extends JavaBeanDeserializer implements ObjectDeserializer {
    private char[] media_gen_prefix__ = "\"media\":".toCharArray();
    private char[] images_gen_prefix__ = "\"images\":".toCharArray();
    
    private ObjectDeserializer media_gen_deser__;
    private ObjectDeserializer images_gen_list_item_deser__;
    private Type images_gen_list_item_type__ = data.media.Image.class;
    

            

Reported by PMD.

Private field 'images_gen_prefix__' could be made final; it is only initialized in the declaration or constructor.
Design

Line: 17

              
public class MediaContentGenDecoder extends JavaBeanDeserializer implements ObjectDeserializer {
    private char[] media_gen_prefix__ = "\"media\":".toCharArray();
    private char[] images_gen_prefix__ = "\"images\":".toCharArray();
    
    private ObjectDeserializer media_gen_deser__;
    private ObjectDeserializer images_gen_list_item_deser__;
    private Type images_gen_list_item_type__ = data.media.Image.class;
    

            

Reported by PMD.

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

Line: 19

                  private char[] media_gen_prefix__ = "\"media\":".toCharArray();
    private char[] images_gen_prefix__ = "\"images\":".toCharArray();
    
    private ObjectDeserializer media_gen_deser__;
    private ObjectDeserializer images_gen_list_item_deser__;
    private Type images_gen_list_item_type__ = data.media.Image.class;
    
    public MediaContentGenDecoder (ParserConfig config, Class clazz) {
        super(config, clazz);

            

Reported by PMD.

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

Line: 20

                  private char[] images_gen_prefix__ = "\"images\":".toCharArray();
    
    private ObjectDeserializer media_gen_deser__;
    private ObjectDeserializer images_gen_list_item_deser__;
    private Type images_gen_list_item_type__ = data.media.Image.class;
    
    public MediaContentGenDecoder (ParserConfig config, Class clazz) {
        super(config, clazz);
        

            

Reported by PMD.

Private field 'images_gen_list_item_type__' could be made final; it is only initialized in the declaration or constructor.
Design

Line: 21

                  
    private ObjectDeserializer media_gen_deser__;
    private ObjectDeserializer images_gen_list_item_deser__;
    private Type images_gen_list_item_type__ = data.media.Image.class;
    
    public MediaContentGenDecoder (ParserConfig config, Class clazz) {
        super(config, clazz);
        
    }

            

Reported by PMD.

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

Line: 21

                  
    private ObjectDeserializer media_gen_deser__;
    private ObjectDeserializer images_gen_list_item_deser__;
    private Type images_gen_list_item_type__ = data.media.Image.class;
    
    public MediaContentGenDecoder (ParserConfig config, Class clazz) {
        super(config, clazz);
        
    }

            

Reported by PMD.

src/test/java/com/alibaba/fastjson/codegen/DeserializerGen.java
44 issues
The class 'DeserializerGen' has a Standard Cyclomatic Complexity of 4 (Highest = 25).
Design

Line: 20

              import com.alibaba.fastjson.util.FieldInfo;
import com.alibaba.fastjson.util.TypeUtils;

public class DeserializerGen extends ClassGen {

    private JavaBeanInfo beanInfo;
    private String              genClassName;

    public DeserializerGen(Class<?> clazz, Appendable out){

            

Reported by PMD.

Possible God Class (WMC=63, ATFD=73, TCC=2.857%)
Design

Line: 20

              import com.alibaba.fastjson.util.FieldInfo;
import com.alibaba.fastjson.util.TypeUtils;

public class DeserializerGen extends ClassGen {

    private JavaBeanInfo beanInfo;
    private String              genClassName;

    public DeserializerGen(Class<?> clazz, Appendable out){

            

Reported by PMD.

The class 'DeserializerGen' has a Modified Cyclomatic Complexity of 4 (Highest = 25).
Design

Line: 20

              import com.alibaba.fastjson.util.FieldInfo;
import com.alibaba.fastjson.util.TypeUtils;

public class DeserializerGen extends ClassGen {

    private JavaBeanInfo beanInfo;
    private String              genClassName;

    public DeserializerGen(Class<?> clazz, Appendable out){

            

Reported by PMD.

This class has too many methods, consider refactoring it.
Design

Line: 20

              import com.alibaba.fastjson.util.FieldInfo;
import com.alibaba.fastjson.util.TypeUtils;

public class DeserializerGen extends ClassGen {

    private JavaBeanInfo beanInfo;
    private String              genClassName;

    public DeserializerGen(Class<?> clazz, Appendable out){

            

Reported by PMD.

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

Line: 22

              
public class DeserializerGen extends ClassGen {

    private JavaBeanInfo beanInfo;
    private String              genClassName;

    public DeserializerGen(Class<?> clazz, Appendable out){
        super(clazz, out);
    }

            

Reported by PMD.

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

Line: 23

              public class DeserializerGen extends ClassGen {

    private JavaBeanInfo beanInfo;
    private String              genClassName;

    public DeserializerGen(Class<?> clazz, Appendable out){
        super(clazz, out);
    }


            

Reported by PMD.

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

Line: 35

                      genClassName = clazz.getSimpleName() + "GenDecoder";

        print("package ");
        print(clazz.getPackage().getName());
        println(";");
        println();

        println("import java.lang.reflect.Type;");
        println();

            

Reported by PMD.

The method genDeserialze() has an NCSS line count of 207
Design

Line: 84

                      print("}");
    }

    protected void genDeserialze() throws IOException {
        if (beanInfo.fields.length == 0) {
            return;
        }

        for (FieldInfo fieldInfo : beanInfo.fields) {

            

Reported by PMD.

Avoid really long methods.
Design

Line: 84

                      print("}");
    }

    protected void genDeserialze() throws IOException {
        if (beanInfo.fields.length == 0) {
            return;
        }

        for (FieldInfo fieldInfo : beanInfo.fields) {

            

Reported by PMD.

The method 'genDeserialze' has a Modified Cyclomatic Complexity of 25.
Design

Line: 84

                      print("}");
    }

    protected void genDeserialze() throws IOException {
        if (beanInfo.fields.length == 0) {
            return;
        }

        for (FieldInfo fieldInfo : beanInfo.fields) {

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/parser/deser/list/ListStringFieldTest_stream_array.java
43 issues
This class has too many methods, consider refactoring it.
Design

Line: 17

              
import junit.framework.TestCase;

public class ListStringFieldTest_stream_array extends TestCase {

    public void test_list() throws Exception {
        String text = "[[\"a\",null,\"b\",\"ab\\\\c\\\"a\"]]";

        JSONReader reader = new JSONReader(new StringReader(text));

            

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: 19

              
public class ListStringFieldTest_stream_array extends TestCase {

    public void test_list() throws Exception {
        String text = "[[\"a\",null,\"b\",\"ab\\\\c\\\"a\"]]";

        JSONReader reader = new JSONReader(new StringReader(text));
        Model model = reader.readObject(Model.class);
        Assert.assertEquals(4, model.values.size());

            

Reported by PMD.

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

Line: 24

              
        JSONReader reader = new JSONReader(new StringReader(text));
        Model model = reader.readObject(Model.class);
        Assert.assertEquals(4, model.values.size());
        Assert.assertEquals("a", model.values.get(0));
        Assert.assertEquals(null, model.values.get(1));
        Assert.assertEquals("b", model.values.get(2));
        Assert.assertEquals("ab\\c\"a", model.values.get(3));
    }

            

Reported by PMD.

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

Line: 25

                      JSONReader reader = new JSONReader(new StringReader(text));
        Model model = reader.readObject(Model.class);
        Assert.assertEquals(4, model.values.size());
        Assert.assertEquals("a", model.values.get(0));
        Assert.assertEquals(null, model.values.get(1));
        Assert.assertEquals("b", model.values.get(2));
        Assert.assertEquals("ab\\c\"a", model.values.get(3));
    }


            

Reported by PMD.

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

Line: 26

                      Model model = reader.readObject(Model.class);
        Assert.assertEquals(4, model.values.size());
        Assert.assertEquals("a", model.values.get(0));
        Assert.assertEquals(null, model.values.get(1));
        Assert.assertEquals("b", model.values.get(2));
        Assert.assertEquals("ab\\c\"a", model.values.get(3));
    }

    public void test_null() throws Exception {

            

Reported by PMD.

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

Line: 27

                      Assert.assertEquals(4, model.values.size());
        Assert.assertEquals("a", model.values.get(0));
        Assert.assertEquals(null, model.values.get(1));
        Assert.assertEquals("b", model.values.get(2));
        Assert.assertEquals("ab\\c\"a", model.values.get(3));
    }

    public void test_null() throws Exception {
        String text = "[null]";

            

Reported by PMD.

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

Line: 28

                      Assert.assertEquals("a", model.values.get(0));
        Assert.assertEquals(null, model.values.get(1));
        Assert.assertEquals("b", model.values.get(2));
        Assert.assertEquals("ab\\c\"a", model.values.get(3));
    }

    public void test_null() throws Exception {
        String text = "[null]";
        JSONReader reader = new JSONReader(new StringReader(text));

            

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: 31

                      Assert.assertEquals("ab\\c\"a", model.values.get(3));
    }

    public void test_null() throws Exception {
        String text = "[null]";
        JSONReader reader = new JSONReader(new StringReader(text));
        Model model = reader.readObject(Model.class);
        Assert.assertNull(model.values);
    }

            

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: 38

                      Assert.assertNull(model.values);
    }

    public void test_empty() throws Exception {
        String text = "[[]]}";
        JSONReader reader = new JSONReader(new StringReader(text));
        Model model = reader.readObject(Model.class);
        Assert.assertEquals(0, model.values.size());
    }

            

Reported by PMD.

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

Line: 42

                      String text = "[[]]}";
        JSONReader reader = new JSONReader(new StringReader(text));
        Model model = reader.readObject(Model.class);
        Assert.assertEquals(0, model.values.size());
    }

    public void test_map_empty() throws Exception {
        String text = "{\"model\":[[]]}";
        JSONReader reader = new JSONReader(new StringReader(text));

            

Reported by PMD.

src/main/java/com/alibaba/fastjson/util/UTF8Decoder.java
43 issues
Possible God Class (WMC=54, ATFD=11, TCC=0.000%)
Design

Line: 33

              /**
 * @deprecated
 */
public class UTF8Decoder extends CharsetDecoder {

    private final static Charset charset = Charset.forName("UTF-8");

    public UTF8Decoder(){
        super(charset, 1.0f, 1.0f);

            

Reported by PMD.

The class 'UTF8Decoder' has a Standard Cyclomatic Complexity of 4 (Highest = 14).
Design

Line: 33

              /**
 * @deprecated
 */
public class UTF8Decoder extends CharsetDecoder {

    private final static Charset charset = Charset.forName("UTF-8");

    public UTF8Decoder(){
        super(charset, 1.0f, 1.0f);

            

Reported by PMD.

The class 'UTF8Decoder' has a Modified Cyclomatic Complexity of 3 (Highest = 14).
Design

Line: 33

              /**
 * @deprecated
 */
public class UTF8Decoder extends CharsetDecoder {

    private final static Charset charset = Charset.forName("UTF-8");

    public UTF8Decoder(){
        super(charset, 1.0f, 1.0f);

            

Reported by PMD.

The method 'malformedN' has a Standard Cyclomatic Complexity of 12.
Design

Line: 72

                      return CoderResult.malformedForLength(n);
    }

    public static CoderResult malformedN(ByteBuffer src, int nb) {
        switch (nb) {
            case 1:
                int b1 = src.get();
                if ((b1 >> 2) == -2) {
                    // 5 bytes 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx

            

Reported by PMD.

The method 'malformedN(ByteBuffer, int)' has a cyclomatic complexity of 21.
Design

Line: 72

                      return CoderResult.malformedForLength(n);
    }

    public static CoderResult malformedN(ByteBuffer src, int nb) {
        switch (nb) {
            case 1:
                int b1 = src.get();
                if ((b1 >> 2) == -2) {
                    // 5 bytes 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx

            

Reported by PMD.

Avoid using Literals in Conditional Statements
Error

Line: 78

                              int b1 = src.get();
                if ((b1 >> 2) == -2) {
                    // 5 bytes 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
                    if (src.remaining() < 4) return CoderResult.UNDERFLOW;
                    return lookupN(src, 5);
                }
                if ((b1 >> 1) == -2) {
                    // 6 bytes 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
                    if (src.remaining() < 5) {

            

Reported by PMD.

Avoid using Literals in Conditional Statements
Error

Line: 83

                              }
                if ((b1 >> 1) == -2) {
                    // 6 bytes 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
                    if (src.remaining() < 5) {
                        return CoderResult.UNDERFLOW;
                    }
                    return lookupN(src, 6);
                }
                return CoderResult.malformedForLength(1);

            

Reported by PMD.

The method 'decodeArrayLoop' has a Standard Cyclomatic Complexity of 14.
Design

Line: 120

                      return (nb == 0 || sl - sp < nb) ? CoderResult.UNDERFLOW : CoderResult.OVERFLOW;
    }

    private CoderResult decodeArrayLoop(ByteBuffer src, CharBuffer dst) {
        // This method is optimized for ASCII input.
        byte[] srcArray = src.array();
        int srcPosition = src.arrayOffset() + src.position();
        int srcLength = src.arrayOffset() + src.limit();


            

Reported by PMD.

The method 'decodeArrayLoop' has a Modified Cyclomatic Complexity of 14.
Design

Line: 120

                      return (nb == 0 || sl - sp < nb) ? CoderResult.UNDERFLOW : CoderResult.OVERFLOW;
    }

    private CoderResult decodeArrayLoop(ByteBuffer src, CharBuffer dst) {
        // This method is optimized for ASCII input.
        byte[] srcArray = src.array();
        int srcPosition = src.arrayOffset() + src.position();
        int srcLength = src.arrayOffset() + src.limit();


            

Reported by PMD.

The method 'decodeArrayLoop(ByteBuffer, CharBuffer)' has a cyclomatic complexity of 20.
Design

Line: 120

                      return (nb == 0 || sl - sp < nb) ? CoderResult.UNDERFLOW : CoderResult.OVERFLOW;
    }

    private CoderResult decodeArrayLoop(ByteBuffer src, CharBuffer dst) {
        // This method is optimized for ASCII input.
        byte[] srcArray = src.array();
        int srcPosition = src.arrayOffset() + src.position();
        int srcLength = src.arrayOffset() + src.limit();


            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/path/BookExtractTest.java
43 issues
This class has too many methods, consider refactoring it.
Design

Line: 13

              import java.io.InputStream;
import java.io.InputStreamReader;

public class BookExtractTest extends TestCase {
    private String json;

    protected void setUp() throws Exception {
        InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("json/book.json");
        InputStreamReader reader = new InputStreamReader(is);

            

Reported by PMD.

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

Line: 14

              import java.io.InputStreamReader;

public class BookExtractTest extends TestCase {
    private String json;

    protected void setUp() throws Exception {
        InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("json/book.json");
        InputStreamReader reader = new InputStreamReader(is);
        json = IOUtils.readAll(reader);

            

Reported by PMD.

JUnit 4 tests that set up tests should use the @Before annotation, JUnit5 tests should use @BeforeEach or @BeforeAll
Design

Line: 16

              public class BookExtractTest extends TestCase {
    private String json;

    protected void setUp() throws Exception {
        InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("json/book.json");
        InputStreamReader reader = new InputStreamReader(is);
        json = IOUtils.readAll(reader);
        IOUtils.close(reader);
    }

            

Reported by PMD.

Ensure that resources like this InputStream object are closed after use
Error

Line: 17

                  private String json;

    protected void setUp() throws Exception {
        InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("json/book.json");
        InputStreamReader reader = new InputStreamReader(is);
        json = IOUtils.readAll(reader);
        IOUtils.close(reader);
    }


            

Reported by PMD.

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

Line: 17

                  private String json;

    protected void setUp() throws Exception {
        InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("json/book.json");
        InputStreamReader reader = new InputStreamReader(is);
        json = IOUtils.readAll(reader);
        IOUtils.close(reader);
    }


            

Reported by PMD.

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

Line: 17

                  private String json;

    protected void setUp() throws Exception {
        InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("json/book.json");
        InputStreamReader reader = new InputStreamReader(is);
        json = IOUtils.readAll(reader);
        IOUtils.close(reader);
    }


            

Reported by PMD.

Ensure that resources like this InputStream object are closed after use
Error

Line: 18

              
    protected void setUp() throws Exception {
        InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("json/book.json");
        InputStreamReader reader = new InputStreamReader(is);
        json = IOUtils.readAll(reader);
        IOUtils.close(reader);
    }

    public void test_0() throws Exception {

            

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

                      IOUtils.close(reader);
    }

    public void test_0() throws Exception {
        assertEquals(4, JSONPath.extract(json, "$..book.length()"));
    }

    public void test_1() throws Exception {
        assertEquals("[\"reference\",\"Nigel Rees\",\"Sayings of the Century\",8.95,\"fiction\",\"Evelyn Waugh\",\"Sword of Honour\",12.99,\"fiction\",\"Herman Melville\",\"Moby Dick\",\"0-553-21311-3\",8.99,\"fiction\",\"J. R. R. Tolkien\",\"The Lord of the Rings\",\"0-395-19395-8\",22.99,\"red\",19.95,10]"

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 24

                  }

    public void test_0() throws Exception {
        assertEquals(4, JSONPath.extract(json, "$..book.length()"));
    }

    public void test_1() throws Exception {
        assertEquals("[\"reference\",\"Nigel Rees\",\"Sayings of the Century\",8.95,\"fiction\",\"Evelyn Waugh\",\"Sword of Honour\",12.99,\"fiction\",\"Herman Melville\",\"Moby Dick\",\"0-553-21311-3\",8.99,\"fiction\",\"J. R. R. Tolkien\",\"The Lord of the Rings\",\"0-395-19395-8\",22.99,\"red\",19.95,10]"
                , JSON.toJSONString(JSONPath.extract(json, "$..*")));

            

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: 27

                      assertEquals(4, JSONPath.extract(json, "$..book.length()"));
    }

    public void test_1() throws Exception {
        assertEquals("[\"reference\",\"Nigel Rees\",\"Sayings of the Century\",8.95,\"fiction\",\"Evelyn Waugh\",\"Sword of Honour\",12.99,\"fiction\",\"Herman Melville\",\"Moby Dick\",\"0-553-21311-3\",8.99,\"fiction\",\"J. R. R. Tolkien\",\"The Lord of the Rings\",\"0-395-19395-8\",22.99,\"red\",19.95,10]"
                , JSON.toJSONString(JSONPath.extract(json, "$..*")));
    }

    public void test_2() throws Exception {

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/writeAsArray/WriteAsArray_int_public.java
42 issues
This class has too many methods, consider refactoring it.
Design

Line: 15

              
import junit.framework.TestCase;

public class WriteAsArray_int_public extends TestCase {

    public void test_0() throws Exception {
        VO vo = new VO();
        vo.setId(123);
        vo.setName("wenshao");

            

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: 17

              
public class WriteAsArray_int_public extends TestCase {

    public void test_0() throws Exception {
        VO vo = new VO();
        vo.setId(123);
        vo.setName("wenshao");

        String text = JSON.toJSONString(vo, SerializerFeature.BeanToArray);

            

Reported by PMD.

The String literal 'wenshao' appears 5 times in this file; the first occurrence is on line 20
Error

Line: 20

                  public void test_0() throws Exception {
        VO vo = new VO();
        vo.setId(123);
        vo.setName("wenshao");

        String text = JSON.toJSONString(vo, SerializerFeature.BeanToArray);
        Assert.assertEquals("[123,\"wenshao\"]", text);
        VO vo2 = JSON.parseObject(text, VO.class, Feature.SupportArrayToBean);
        Assert.assertEquals(vo.getId(), vo2.getId());

            

Reported by PMD.

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

Line: 25

                      String text = JSON.toJSONString(vo, SerializerFeature.BeanToArray);
        Assert.assertEquals("[123,\"wenshao\"]", text);
        VO vo2 = JSON.parseObject(text, VO.class, Feature.SupportArrayToBean);
        Assert.assertEquals(vo.getId(), vo2.getId());
        Assert.assertEquals(vo.getName(), vo2.getName());
    }
    
    public void test_1() throws Exception {
        String text = "[123 ,\"wenshao\"]";

            

Reported by PMD.

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

Line: 26

                      Assert.assertEquals("[123,\"wenshao\"]", text);
        VO vo2 = JSON.parseObject(text, VO.class, Feature.SupportArrayToBean);
        Assert.assertEquals(vo.getId(), vo2.getId());
        Assert.assertEquals(vo.getName(), vo2.getName());
    }
    
    public void test_1() throws Exception {
        String text = "[123 ,\"wenshao\"]";
        VO vo2 = JSON.parseObject(text, VO.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: 29

                      Assert.assertEquals(vo.getName(), vo2.getName());
    }
    
    public void test_1() throws Exception {
        String text = "[123 ,\"wenshao\"]";
        VO vo2 = JSON.parseObject(text, VO.class, Feature.SupportArrayToBean);
        Assert.assertEquals(123, vo2.getId());
        Assert.assertEquals("wenshao", vo2.getName());
    }

            

Reported by PMD.

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

Line: 32

                  public void test_1() throws Exception {
        String text = "[123 ,\"wenshao\"]";
        VO vo2 = JSON.parseObject(text, VO.class, Feature.SupportArrayToBean);
        Assert.assertEquals(123, vo2.getId());
        Assert.assertEquals("wenshao", vo2.getName());
    }
    
    public void test_2() throws Exception {
        String text = "[-123 ,\"wenshao\"]";

            

Reported by PMD.

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

Line: 33

                      String text = "[123 ,\"wenshao\"]";
        VO vo2 = JSON.parseObject(text, VO.class, Feature.SupportArrayToBean);
        Assert.assertEquals(123, vo2.getId());
        Assert.assertEquals("wenshao", vo2.getName());
    }
    
    public void test_2() throws Exception {
        String text = "[-123 ,\"wenshao\"]";
        VO vo2 = JSON.parseObject(text, VO.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: 36

                      Assert.assertEquals("wenshao", vo2.getName());
    }
    
    public void test_2() throws Exception {
        String text = "[-123 ,\"wenshao\"]";
        VO vo2 = JSON.parseObject(text, VO.class, Feature.SupportArrayToBean);
        Assert.assertEquals(-123, vo2.getId());
        Assert.assertEquals("wenshao", vo2.getName());
    }

            

Reported by PMD.

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

Line: 39

                  public void test_2() throws Exception {
        String text = "[-123 ,\"wenshao\"]";
        VO vo2 = JSON.parseObject(text, VO.class, Feature.SupportArrayToBean);
        Assert.assertEquals(-123, vo2.getId());
        Assert.assertEquals("wenshao", vo2.getName());
    }
    
    public void test_1_stream() throws Exception {
        String text = "[123 ,\"wenshao\"]";

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/writeAsArray/WriteAsArray_long_public.java
42 issues
This class has too many methods, consider refactoring it.
Design

Line: 16

              
import junit.framework.TestCase;

public class WriteAsArray_long_public extends TestCase {

    public void test_0() throws Exception {
        VO vo = new VO();
        vo.setId(123);
        vo.setName("wenshao");

            

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: 18

              
public class WriteAsArray_long_public extends TestCase {

    public void test_0() throws Exception {
        VO vo = new VO();
        vo.setId(123);
        vo.setName("wenshao");

        String text = JSON.toJSONString(vo, SerializerFeature.BeanToArray);

            

Reported by PMD.

The String literal 'wenshao' appears 5 times in this file; the first occurrence is on line 21
Error

Line: 21

                  public void test_0() throws Exception {
        VO vo = new VO();
        vo.setId(123);
        vo.setName("wenshao");

        String text = JSON.toJSONString(vo, SerializerFeature.BeanToArray);
        Assert.assertEquals("[123,\"wenshao\"]", text);
        VO vo2 = JSON.parseObject(text, VO.class, Feature.SupportArrayToBean);
        Assert.assertEquals(vo.getId(), vo2.getId());

            

Reported by PMD.

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

Line: 26

                      String text = JSON.toJSONString(vo, SerializerFeature.BeanToArray);
        Assert.assertEquals("[123,\"wenshao\"]", text);
        VO vo2 = JSON.parseObject(text, VO.class, Feature.SupportArrayToBean);
        Assert.assertEquals(vo.getId(), vo2.getId());
        Assert.assertEquals(vo.getName(), vo2.getName());
    }
    
    public void test_1() throws Exception {
        String text = "[123 ,\"wenshao\"]";

            

Reported by PMD.

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

Line: 27

                      Assert.assertEquals("[123,\"wenshao\"]", text);
        VO vo2 = JSON.parseObject(text, VO.class, Feature.SupportArrayToBean);
        Assert.assertEquals(vo.getId(), vo2.getId());
        Assert.assertEquals(vo.getName(), vo2.getName());
    }
    
    public void test_1() throws Exception {
        String text = "[123 ,\"wenshao\"]";
        VO vo2 = JSON.parseObject(text, VO.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: 30

                      Assert.assertEquals(vo.getName(), vo2.getName());
    }
    
    public void test_1() throws Exception {
        String text = "[123 ,\"wenshao\"]";
        VO vo2 = JSON.parseObject(text, VO.class, Feature.SupportArrayToBean);
        Assert.assertEquals(123, vo2.getId());
        Assert.assertEquals("wenshao", vo2.getName());
    }

            

Reported by PMD.

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

Line: 33

                  public void test_1() throws Exception {
        String text = "[123 ,\"wenshao\"]";
        VO vo2 = JSON.parseObject(text, VO.class, Feature.SupportArrayToBean);
        Assert.assertEquals(123, vo2.getId());
        Assert.assertEquals("wenshao", vo2.getName());
    }
    
    public void test_2() throws Exception {
        String text = "[-123 ,\"wenshao\"]";

            

Reported by PMD.

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

Line: 34

                      String text = "[123 ,\"wenshao\"]";
        VO vo2 = JSON.parseObject(text, VO.class, Feature.SupportArrayToBean);
        Assert.assertEquals(123, vo2.getId());
        Assert.assertEquals("wenshao", vo2.getName());
    }
    
    public void test_2() throws Exception {
        String text = "[-123 ,\"wenshao\"]";
        VO vo2 = JSON.parseObject(text, VO.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: 37

                      Assert.assertEquals("wenshao", vo2.getName());
    }
    
    public void test_2() throws Exception {
        String text = "[-123 ,\"wenshao\"]";
        VO vo2 = JSON.parseObject(text, VO.class, Feature.SupportArrayToBean);
        Assert.assertEquals(-123, vo2.getId());
        Assert.assertEquals("wenshao", vo2.getName());
    }

            

Reported by PMD.

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

Line: 40

                  public void test_2() throws Exception {
        String text = "[-123 ,\"wenshao\"]";
        VO vo2 = JSON.parseObject(text, VO.class, Feature.SupportArrayToBean);
        Assert.assertEquals(-123, vo2.getId());
        Assert.assertEquals("wenshao", vo2.getName());
    }
    
    public void test_1_stream() throws Exception {
        String text = "[123 ,\"wenshao\"]";

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/JSON_isValid_0.java
42 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: 7

              import junit.framework.TestCase;

public class JSON_isValid_0 extends TestCase {
    public void test_for_isValid_0() throws Exception {
        assertFalse(JSON.isValid(null));
        assertFalse(JSON.isValid(""));
    }

    public void test_for_isValid_value() throws Exception {

            

Reported by PMD.

Unit tests should not contain more than 1 assert(s).
Design

Line: 7

              import junit.framework.TestCase;

public class JSON_isValid_0 extends TestCase {
    public void test_for_isValid_0() throws Exception {
        assertFalse(JSON.isValid(null));
        assertFalse(JSON.isValid(""));
    }

    public void test_for_isValid_value() throws Exception {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 8

              
public class JSON_isValid_0 extends TestCase {
    public void test_for_isValid_0() throws Exception {
        assertFalse(JSON.isValid(null));
        assertFalse(JSON.isValid(""));
    }

    public void test_for_isValid_value() throws Exception {
        assertTrue(JSON.isValid("null"));

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 9

              public class JSON_isValid_0 extends TestCase {
    public void test_for_isValid_0() throws Exception {
        assertFalse(JSON.isValid(null));
        assertFalse(JSON.isValid(""));
    }

    public void test_for_isValid_value() throws Exception {
        assertTrue(JSON.isValid("null"));
        assertTrue(JSON.isValid("123"));

            

Reported by PMD.

Unit tests should not contain more than 1 assert(s).
Design

Line: 12

                      assertFalse(JSON.isValid(""));
    }

    public void test_for_isValid_value() throws Exception {
        assertTrue(JSON.isValid("null"));
        assertTrue(JSON.isValid("123"));
        assertTrue(JSON.isValid("12.34"));
        assertTrue(JSON.isValid("true"));
        assertTrue(JSON.isValid("false"));

            

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: 12

                      assertFalse(JSON.isValid(""));
    }

    public void test_for_isValid_value() throws Exception {
        assertTrue(JSON.isValid("null"));
        assertTrue(JSON.isValid("123"));
        assertTrue(JSON.isValid("12.34"));
        assertTrue(JSON.isValid("true"));
        assertTrue(JSON.isValid("false"));

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 13

                  }

    public void test_for_isValid_value() throws Exception {
        assertTrue(JSON.isValid("null"));
        assertTrue(JSON.isValid("123"));
        assertTrue(JSON.isValid("12.34"));
        assertTrue(JSON.isValid("true"));
        assertTrue(JSON.isValid("false"));
        assertTrue(JSON.isValid("\"abc\""));

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 14

              
    public void test_for_isValid_value() throws Exception {
        assertTrue(JSON.isValid("null"));
        assertTrue(JSON.isValid("123"));
        assertTrue(JSON.isValid("12.34"));
        assertTrue(JSON.isValid("true"));
        assertTrue(JSON.isValid("false"));
        assertTrue(JSON.isValid("\"abc\""));
    }

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 15

                  public void test_for_isValid_value() throws Exception {
        assertTrue(JSON.isValid("null"));
        assertTrue(JSON.isValid("123"));
        assertTrue(JSON.isValid("12.34"));
        assertTrue(JSON.isValid("true"));
        assertTrue(JSON.isValid("false"));
        assertTrue(JSON.isValid("\"abc\""));
    }


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 16

                      assertTrue(JSON.isValid("null"));
        assertTrue(JSON.isValid("123"));
        assertTrue(JSON.isValid("12.34"));
        assertTrue(JSON.isValid("true"));
        assertTrue(JSON.isValid("false"));
        assertTrue(JSON.isValid("\"abc\""));
    }



            

Reported by PMD.

src/test/java/com/alibaba/json/test/performance/JacksonPageModelParser.java
42 issues
The initializer for variable 'current' is never used (overwritten on line 41)
Design

Line: 34

                      JsonFactory f = new JsonFactory();
        JsonParser parser = f.createJsonParser(content);

        JsonToken current = parser.nextToken(); // move to the start of the
        // object

        String instanceId = getNextTextValue("sid", parser); // get instanceId

        String pageId = getNextTextValue("cid", parser); // get pageId

            

Reported by PMD.

Avoid unused local variables such as 'current'.
Design

Line: 34

                      JsonFactory f = new JsonFactory();
        JsonParser parser = f.createJsonParser(content);

        JsonToken current = parser.nextToken(); // move to the start of the
        // object

        String instanceId = getNextTextValue("sid", parser); // get instanceId

        String pageId = getNextTextValue("cid", parser); // get pageId

            

Reported by PMD.

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

Line: 34

                      JsonFactory f = new JsonFactory();
        JsonParser parser = f.createJsonParser(content);

        JsonToken current = parser.nextToken(); // move to the start of the
        // object

        String instanceId = getNextTextValue("sid", parser); // get instanceId

        String pageId = getNextTextValue("cid", parser); // get pageId

            

Reported by PMD.

The String literal 'cid' appears 5 times in this file; the first occurrence is on line 39
Error

Line: 39

              
        String instanceId = getNextTextValue("sid", parser); // get instanceId

        String pageId = getNextTextValue("cid", parser); // get pageId

        current = parser.nextToken(); // move to field: segments
        assertExpectedFiled(parser.getCurrentName(), "segments", parser.getCurrentLocation());

        PageInstance pageInstance = new PageInstance();

            

Reported by PMD.

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

Line: 41

              
        String pageId = getNextTextValue("cid", parser); // get pageId

        current = parser.nextToken(); // move to field: segments
        assertExpectedFiled(parser.getCurrentName(), "segments", parser.getCurrentLocation());

        PageInstance pageInstance = new PageInstance();
        pageInstance.setCid(pageId);
        pageInstance.setSid(Long.valueOf(instanceId));

            

Reported by PMD.

The value assigned to variable 'current' is never used
Design

Line: 41

              
        String pageId = getNextTextValue("cid", parser); // get pageId

        current = parser.nextToken(); // move to field: segments
        assertExpectedFiled(parser.getCurrentName(), "segments", parser.getCurrentLocation());

        PageInstance pageInstance = new PageInstance();
        pageInstance.setCid(pageId);
        pageInstance.setSid(Long.valueOf(instanceId));

            

Reported by PMD.

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

Line: 42

                      String pageId = getNextTextValue("cid", parser); // get pageId

        current = parser.nextToken(); // move to field: segments
        assertExpectedFiled(parser.getCurrentName(), "segments", parser.getCurrentLocation());

        PageInstance pageInstance = new PageInstance();
        pageInstance.setCid(pageId);
        pageInstance.setSid(Long.valueOf(instanceId));
        pageInstance.setSegments(parseSegments(parser));

            

Reported by PMD.

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

Line: 42

                      String pageId = getNextTextValue("cid", parser); // get pageId

        current = parser.nextToken(); // move to field: segments
        assertExpectedFiled(parser.getCurrentName(), "segments", parser.getCurrentLocation());

        PageInstance pageInstance = new PageInstance();
        pageInstance.setCid(pageId);
        pageInstance.setSid(Long.valueOf(instanceId));
        pageInstance.setSegments(parseSegments(parser));

            

Reported by PMD.

Avoid assignments in operands
Error

Line: 64

              
        assertExpectedJsonToken(current, JsonToken.START_ARRAY, parser.getCurrentLocation());
        List<SegmentInstance> instances = new ArrayList<SegmentInstance>();
        while ((current = parser.nextToken()) != JsonToken.END_ARRAY) {

            assertExpectedJsonToken(current, JsonToken.START_OBJECT, parser.getCurrentLocation());

            String segmentId = getNextTextValue("cid", parser); // get pageId


            

Reported by PMD.

The value assigned to variable 'current' is never used (overwritten on line 76)
Design

Line: 70

              
            String segmentId = getNextTextValue("cid", parser); // get pageId

            current = parser.nextToken(); // move to field: layouts
            assertExpectedFiled(parser.getCurrentName(), "layouts", parser.getCurrentLocation());
            SegmentInstance instance = new SegmentInstance();
            instance.setLayouts(parseLayouts(parser, segmentId));
            instances.add(instance);


            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/path/BookEvalTest.java
41 issues
This class has too many methods, consider refactoring it.
Design

Line: 13

              import java.io.InputStream;
import java.io.InputStreamReader;

public class BookEvalTest extends TestCase {
    private JSONObject root;

    protected void setUp() throws Exception {
        InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("json/book.json");
        InputStreamReader reader = new InputStreamReader(is);

            

Reported by PMD.

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

Line: 14

              import java.io.InputStreamReader;

public class BookEvalTest extends TestCase {
    private JSONObject root;

    protected void setUp() throws Exception {
        InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("json/book.json");
        InputStreamReader reader = new InputStreamReader(is);
        String json = IOUtils.readAll(reader);

            

Reported by PMD.

JUnit 4 tests that set up tests should use the @Before annotation, JUnit5 tests should use @BeforeEach or @BeforeAll
Design

Line: 16

              public class BookEvalTest extends TestCase {
    private JSONObject root;

    protected void setUp() throws Exception {
        InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("json/book.json");
        InputStreamReader reader = new InputStreamReader(is);
        String json = IOUtils.readAll(reader);
        IOUtils.close(reader);


            

Reported by PMD.

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

Line: 17

                  private JSONObject root;

    protected void setUp() throws Exception {
        InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("json/book.json");
        InputStreamReader reader = new InputStreamReader(is);
        String json = IOUtils.readAll(reader);
        IOUtils.close(reader);

        root = (JSONObject) JSON.parse(json, Feature.OrderedField);

            

Reported by PMD.

Ensure that resources like this InputStream object are closed after use
Error

Line: 17

                  private JSONObject root;

    protected void setUp() throws Exception {
        InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("json/book.json");
        InputStreamReader reader = new InputStreamReader(is);
        String json = IOUtils.readAll(reader);
        IOUtils.close(reader);

        root = (JSONObject) JSON.parse(json, Feature.OrderedField);

            

Reported by PMD.

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

Line: 17

                  private JSONObject root;

    protected void setUp() throws Exception {
        InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("json/book.json");
        InputStreamReader reader = new InputStreamReader(is);
        String json = IOUtils.readAll(reader);
        IOUtils.close(reader);

        root = (JSONObject) JSON.parse(json, Feature.OrderedField);

            

Reported by PMD.

Ensure that resources like this InputStream object are closed after use
Error

Line: 18

              
    protected void setUp() throws Exception {
        InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("json/book.json");
        InputStreamReader reader = new InputStreamReader(is);
        String json = IOUtils.readAll(reader);
        IOUtils.close(reader);

        root = (JSONObject) JSON.parse(json, Feature.OrderedField);
    }

            

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: 25

                      root = (JSONObject) JSON.parse(json, Feature.OrderedField);
    }

    public void test_0() throws Exception {
        assertEquals(4, JSONPath.eval(root, "$..book.length()"));
    }

    public void test_1() throws Exception {
        assertEquals("[\"reference\",\"Nigel Rees\",\"Sayings of the Century\",8.95,\"fiction\",\"Evelyn Waugh\",\"Sword of Honour\",12.99,\"fiction\",\"Herman Melville\",\"Moby Dick\",\"0-553-21311-3\",8.99,\"fiction\",\"J. R. R. Tolkien\",\"The Lord of the Rings\",\"0-395-19395-8\",22.99,\"red\",19.95,10]"

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 26

                  }

    public void test_0() throws Exception {
        assertEquals(4, JSONPath.eval(root, "$..book.length()"));
    }

    public void test_1() throws Exception {
        assertEquals("[\"reference\",\"Nigel Rees\",\"Sayings of the Century\",8.95,\"fiction\",\"Evelyn Waugh\",\"Sword of Honour\",12.99,\"fiction\",\"Herman Melville\",\"Moby Dick\",\"0-553-21311-3\",8.99,\"fiction\",\"J. R. R. Tolkien\",\"The Lord of the Rings\",\"0-395-19395-8\",22.99,\"red\",19.95,10]"
                , JSON.toJSONString(JSONPath.eval(root, "$..*")));

            

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: 29

                      assertEquals(4, JSONPath.eval(root, "$..book.length()"));
    }

    public void test_1() throws Exception {
        assertEquals("[\"reference\",\"Nigel Rees\",\"Sayings of the Century\",8.95,\"fiction\",\"Evelyn Waugh\",\"Sword of Honour\",12.99,\"fiction\",\"Herman Melville\",\"Moby Dick\",\"0-553-21311-3\",8.99,\"fiction\",\"J. R. R. Tolkien\",\"The Lord of the Rings\",\"0-395-19395-8\",22.99,\"red\",19.95,10]"
                , JSON.toJSONString(JSONPath.eval(root, "$..*")));
    }

    public void test_2() throws Exception {

            

Reported by PMD.