The following issues were found

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

Line: 21

                      Exception error = null;
        try {
            Object obj = JSON.parseObject("{\"@type\":\"com.alibaba.json.bvt.parser.deser.deny.DenyTest6$Model\"}", Object.class, config);
            System.out.println(obj.getClass());
        } catch (JSONException ex) {
            error = ex;
        }
        assertNotNull(error);
    }

            

Reported by PMD.

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

Line: 10

              
public class DenyTest6 extends TestCase {

    public void test_autoTypeDeny() throws Exception {
        ParserConfig config = new ParserConfig();
        assertFalse(config.isAutoTypeSupport());
        config.setAutoTypeSupport(true);
        assertTrue(config.isAutoTypeSupport());
        config.addDeny("com.alibaba.json.bvt.parser.deser.deny.DenyTest6");

            

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 DenyTest6 extends TestCase {

    public void test_autoTypeDeny() throws Exception {
        ParserConfig config = new ParserConfig();
        assertFalse(config.isAutoTypeSupport());
        config.setAutoTypeSupport(true);
        assertTrue(config.isAutoTypeSupport());
        config.addDeny("com.alibaba.json.bvt.parser.deser.deny.DenyTest6");

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 12

              
    public void test_autoTypeDeny() throws Exception {
        ParserConfig config = new ParserConfig();
        assertFalse(config.isAutoTypeSupport());
        config.setAutoTypeSupport(true);
        assertTrue(config.isAutoTypeSupport());
        config.addDeny("com.alibaba.json.bvt.parser.deser.deny.DenyTest6");
        config.setAutoTypeSupport(false);


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 14

                      ParserConfig config = new ParserConfig();
        assertFalse(config.isAutoTypeSupport());
        config.setAutoTypeSupport(true);
        assertTrue(config.isAutoTypeSupport());
        config.addDeny("com.alibaba.json.bvt.parser.deser.deny.DenyTest6");
        config.setAutoTypeSupport(false);

        Exception error = null;
        try {

            

Reported by PMD.

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

Line: 21

                      Exception error = null;
        try {
            Object obj = JSON.parseObject("{\"@type\":\"com.alibaba.json.bvt.parser.deser.deny.DenyTest6$Model\"}", Object.class, config);
            System.out.println(obj.getClass());
        } catch (JSONException ex) {
            error = ex;
        }
        assertNotNull(error);
    }

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 25

                      } catch (JSONException ex) {
            error = ex;
        }
        assertNotNull(error);
    }
    
    public static class Model {

    }

            

Reported by PMD.

Found 'DD'-anomaly for variable 'error' (lines '18'-'23').
Error

Line: 18

                      config.addDeny("com.alibaba.json.bvt.parser.deser.deny.DenyTest6");
        config.setAutoTypeSupport(false);

        Exception error = null;
        try {
            Object obj = JSON.parseObject("{\"@type\":\"com.alibaba.json.bvt.parser.deser.deny.DenyTest6$Model\"}", Object.class, config);
            System.out.println(obj.getClass());
        } catch (JSONException ex) {
            error = ex;

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/serializer/ProxyTest.java
8 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: 16

              
public class ProxyTest extends TestCase {

    public void test_0() throws Exception {
        A a = create(A.class);
        a.setId(123);

        Assert.assertEquals("{\"id\":123}", JSON.toJSONString(a));
    }

            

Reported by PMD.

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

Line: 18

              
    public void test_0() throws Exception {
        A a = create(A.class);
        a.setId(123);

        Assert.assertEquals("{\"id\":123}", JSON.toJSONString(a));
    }

    public static <T> T create(Class<T> classs) throws Exception {

            

Reported by PMD.

A method/constructor should not explicitly throw java.lang.Exception
Design

Line: 23

                      Assert.assertEquals("{\"id\":123}", JSON.toJSONString(a));
    }

    public static <T> T create(Class<T> classs) throws Exception {
        ProxyFactory factory = new ProxyFactory();
        factory.setSuperclass(classs);
        Class clazz = factory.createClass();
        MethodHandler handler = new MethodHandler() {


            

Reported by PMD.

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

Line: 29

                      Class clazz = factory.createClass();
        MethodHandler handler = new MethodHandler() {

            public Object invoke(Object self, Method overridden, Method forwarder, Object[] args) throws Throwable {
                return forwarder.invoke(self, args);
            }
        };
        Object instance = clazz.newInstance();
        ((ProxyObject) instance).setHandler(handler);

            

Reported by PMD.

Found 'DU'-anomaly for variable 'clazz' (lines '26'-'36').
Error

Line: 26

                  public static <T> T create(Class<T> classs) throws Exception {
        ProxyFactory factory = new ProxyFactory();
        factory.setSuperclass(classs);
        Class clazz = factory.createClass();
        MethodHandler handler = new MethodHandler() {

            public Object invoke(Object self, Method overridden, Method forwarder, Object[] args) throws Throwable {
                return forwarder.invoke(self, args);
            }

            

Reported by PMD.

Found 'DU'-anomaly for variable 'clazz' (lines '26'-'36').
Error

Line: 26

                  public static <T> T create(Class<T> classs) throws Exception {
        ProxyFactory factory = new ProxyFactory();
        factory.setSuperclass(classs);
        Class clazz = factory.createClass();
        MethodHandler handler = new MethodHandler() {

            public Object invoke(Object self, Method overridden, Method forwarder, Object[] args) throws Throwable {
                return forwarder.invoke(self, args);
            }

            

Reported by PMD.

Found 'DU'-anomaly for variable 'handler' (lines '27'-'36').
Error

Line: 27

                      ProxyFactory factory = new ProxyFactory();
        factory.setSuperclass(classs);
        Class clazz = factory.createClass();
        MethodHandler handler = new MethodHandler() {

            public Object invoke(Object self, Method overridden, Method forwarder, Object[] args) throws Throwable {
                return forwarder.invoke(self, args);
            }
        };

            

Reported by PMD.

Found 'DU'-anomaly for variable 'handler' (lines '27'-'36').
Error

Line: 27

                      ProxyFactory factory = new ProxyFactory();
        factory.setSuperclass(classs);
        Class clazz = factory.createClass();
        MethodHandler handler = new MethodHandler() {

            public Object invoke(Object self, Method overridden, Method forwarder, Object[] args) throws Throwable {
                return forwarder.invoke(self, args);
            }
        };

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/parser/deser/FieldDeserializerTest5.java
8 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: 10

              

public class FieldDeserializerTest5 extends TestCase {
    public void test_0 () throws Exception {
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33\t}", VO.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33\t}\n\t", VO.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33 }", V1.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33 } ", V1.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33 }\n", V1.class).id);

            

Reported by PMD.

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

Line: 11

              
public class FieldDeserializerTest5 extends TestCase {
    public void test_0 () throws Exception {
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33\t}", VO.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33\t}\n\t", VO.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33 }", V1.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33 } ", V1.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33 }\n", V1.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33 }\t\n", V1.class).id);

            

Reported by PMD.

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

Line: 12

              public class FieldDeserializerTest5 extends TestCase {
    public void test_0 () throws Exception {
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33\t}", VO.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33\t}\n\t", VO.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33 }", V1.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33 } ", V1.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33 }\n", V1.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33 }\t\n", V1.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33L}", V1.class).id);

            

Reported by PMD.

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

Line: 13

                  public void test_0 () throws Exception {
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33\t}", VO.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33\t}\n\t", VO.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33 }", V1.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33 } ", V1.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33 }\n", V1.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33 }\t\n", V1.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33L}", V1.class).id);
    }

            

Reported by PMD.

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

Line: 14

                      Assert.assertEquals(33, JSON.parseObject("{\"id\":33\t}", VO.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33\t}\n\t", VO.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33 }", V1.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33 } ", V1.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33 }\n", V1.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33 }\t\n", V1.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33L}", V1.class).id);
    }
    

            

Reported by PMD.

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

Line: 15

                      Assert.assertEquals(33, JSON.parseObject("{\"id\":33\t}\n\t", VO.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33 }", V1.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33 } ", V1.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33 }\n", V1.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33 }\t\n", V1.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33L}", V1.class).id);
    }
    
    public static class VO {

            

Reported by PMD.

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

Line: 16

                      Assert.assertEquals(33, JSON.parseObject("{\"id\":33 }", V1.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33 } ", V1.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33 }\n", V1.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33 }\t\n", V1.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33L}", V1.class).id);
    }
    
    public static class VO {
        public int id;

            

Reported by PMD.

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

Line: 17

                      Assert.assertEquals(33, JSON.parseObject("{\"id\":33 } ", V1.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33 }\n", V1.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33 }\t\n", V1.class).id);
        Assert.assertEquals(33, JSON.parseObject("{\"id\":33L}", V1.class).id);
    }
    
    public static class VO {
        public int id;
    }

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/path/extract/JSONPath_extract_3.java
8 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_3 extends TestCase {

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


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 9

              public class JSONPath_extract_3 extends TestCase {

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

    public void test_1() throws Exception {

            

Reported by PMD.

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

Line: 10

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

    public void test_1() throws Exception {
        assertNull(JSONPath.extract(json, "$[1]['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: 14

                                  .toString());
    }

    public void test_1() throws Exception {
        assertNull(JSONPath.extract(json, "$[1]['gender']"));
    }

    public void test_2() throws Exception {
        assertEquals("ben"

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 15

                  }

    public void test_1() throws Exception {
        assertNull(JSONPath.extract(json, "$[1]['gender']"));
    }

    public void test_2() throws Exception {
        assertEquals("ben"
                , JSONPath.extract(json, "$[1]['name']").toString());

            

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

                      assertNull(JSONPath.extract(json, "$[1]['gender']"));
    }

    public void test_2() throws Exception {
        assertEquals("ben"
                , JSONPath.extract(json, "$[1]['name']").toString());
    }

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

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 19

                  }

    public void test_2() throws Exception {
        assertEquals("ben"
                , JSONPath.extract(json, "$[1]['name']").toString());
    }

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

            

Reported by PMD.

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

Line: 20

              
    public void test_2() throws Exception {
        assertEquals("ben"
                , JSONPath.extract(json, "$[1]['name']").toString());
    }

    private static final String json = "[\n" +
            "   {\n" +
            "      \"name\" : \"john\",\n" +

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/parser/deser/InnerClassDeser3.java
8 issues
Unit tests should not contain more than 1 assert(s).
Design

Line: 13

               * Created by wenshao on 25/03/2017.
 */
public class InnerClassDeser3 extends TestCase {
    public void test_for_inner_class() throws Exception {
        Model model = JSON.parseObject("{\"items\":{\"123\":{\"id\":123}}}", Model.class);
        assertNotNull(model.items);
        assertEquals(123, model.items.get("123").id);
    }


            

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

               * Created by wenshao on 25/03/2017.
 */
public class InnerClassDeser3 extends TestCase {
    public void test_for_inner_class() throws Exception {
        Model model = JSON.parseObject("{\"items\":{\"123\":{\"id\":123}}}", Model.class);
        assertNotNull(model.items);
        assertEquals(123, model.items.get("123").id);
    }


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 15

              public class InnerClassDeser3 extends TestCase {
    public void test_for_inner_class() throws Exception {
        Model model = JSON.parseObject("{\"items\":{\"123\":{\"id\":123}}}", Model.class);
        assertNotNull(model.items);
        assertEquals(123, model.items.get("123").id);
    }

    public static class Model {
        public Map<String, Item> items;

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 16

                  public void test_for_inner_class() throws Exception {
        Model model = JSON.parseObject("{\"items\":{\"123\":{\"id\":123}}}", Model.class);
        assertNotNull(model.items);
        assertEquals(123, model.items.get("123").id);
    }

    public static class Model {
        public Map<String, Item> items;


            

Reported by PMD.

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

Line: 16

                  public void test_for_inner_class() throws Exception {
        Model model = JSON.parseObject("{\"items\":{\"123\":{\"id\":123}}}", Model.class);
        assertNotNull(model.items);
        assertEquals(123, model.items.get("123").id);
    }

    public static class Model {
        public Map<String, Item> items;


            

Reported by PMD.

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

Line: 16

                  public void test_for_inner_class() throws Exception {
        Model model = JSON.parseObject("{\"items\":{\"123\":{\"id\":123}}}", Model.class);
        assertNotNull(model.items);
        assertEquals(123, model.items.get("123").id);
    }

    public static class Model {
        public Map<String, Item> items;


            

Reported by PMD.

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

Line: 20

                  }

    public static class Model {
        public Map<String, Item> items;

        public class Item {
            public int id;
        }
    }

            

Reported by PMD.

Avoid unused imports such as 'java.util.List'
Design

Line: 6

              import com.alibaba.fastjson.JSON;
import junit.framework.TestCase;

import java.util.List;
import java.util.Map;

/**
 * Created by wenshao on 25/03/2017.
 */

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/path/JSONPath_field_wildcard_filter_double.java
8 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 JSONPath_field_wildcard_filter_double extends TestCase {

    public void test_list_map_0() throws Exception {
        Map<String, Value> jsonObject = JSON.parseObject(text, new TypeReference<Map<String, Value>>(){}, Feature.OrderedField);

        Collection array = (Collection) JSONPath.eval(jsonObject, "$.*[score>0]");
        assertEquals("[{\"score\":0.8951322155668501},{\"score\":0.7237896928683851},{\"score\":0.3467174233072834}]", JSON.toJSONString(array));
    }

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 18

                      Map<String, Value> jsonObject = JSON.parseObject(text, new TypeReference<Map<String, Value>>(){}, Feature.OrderedField);

        Collection array = (Collection) JSONPath.eval(jsonObject, "$.*[score>0]");
        assertEquals("[{\"score\":0.8951322155668501},{\"score\":0.7237896928683851},{\"score\":0.3467174233072834}]", JSON.toJSONString(array));
    }

    public void test_list_map_1() throws Exception {
        Map<String, Value> jsonObject = JSON.parseObject(text, new TypeReference<Map<String, Value>>(){}, 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: 21

                      assertEquals("[{\"score\":0.8951322155668501},{\"score\":0.7237896928683851},{\"score\":0.3467174233072834}]", JSON.toJSONString(array));
    }

    public void test_list_map_1() throws Exception {
        Map<String, Value> jsonObject = JSON.parseObject(text, new TypeReference<Map<String, Value>>(){}, Feature.OrderedField);

        Collection array = (Collection) JSONPath.eval(jsonObject, "$.*[score<0]");
        assertEquals("[{\"score\":-0.3453003960431523}]", JSON.toJSONString(array));
    }

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 25

                      Map<String, Value> jsonObject = JSON.parseObject(text, new TypeReference<Map<String, Value>>(){}, Feature.OrderedField);

        Collection array = (Collection) JSONPath.eval(jsonObject, "$.*[score<0]");
        assertEquals("[{\"score\":-0.3453003960431523}]", JSON.toJSONString(array));
    }

    public void test_list_map_2() throws Exception {
        Map<String, Value> jsonObject = JSON.parseObject(text, new TypeReference<Map<String, Value>>(){}, 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: 28

                      assertEquals("[{\"score\":-0.3453003960431523}]", JSON.toJSONString(array));
    }

    public void test_list_map_2() throws Exception {
        Map<String, Value> jsonObject = JSON.parseObject(text, new TypeReference<Map<String, Value>>(){}, Feature.OrderedField);

        Collection array = (Collection) JSONPath.eval(jsonObject, "$.*[score=0]");
        assertEquals("[{\"score\":0.0},{\"score\":0.0},{\"score\":0.0},{\"score\":0.0},{\"score\":0.0},{\"score\":0.0},{\"score\":0.0}]", JSON.toJSONString(array));
    }

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 32

                      Map<String, Value> jsonObject = JSON.parseObject(text, new TypeReference<Map<String, Value>>(){}, Feature.OrderedField);

        Collection array = (Collection) JSONPath.eval(jsonObject, "$.*[score=0]");
        assertEquals("[{\"score\":0.0},{\"score\":0.0},{\"score\":0.0},{\"score\":0.0},{\"score\":0.0},{\"score\":0.0},{\"score\":0.0}]", JSON.toJSONString(array));
    }

    public static class Value {
        public double score;
    }

            

Reported by PMD.

The String literal '\t\t\'score\': 0\n' appears 7 times in this file; the first occurrence is on line 41
Error

Line: 41

              
    public static final String text = "{\n" +
            "\t\"risk_sexy_trade_stream_plus\": {\n" +
            "\t\t\"score\": 0\n" +
            "\t},\n" +
            "\t\"chemical_medicine_stream_plus\": {\n" +
            "\t\t\"score\": 0\n" +
            "\t},\n" +
            "\t\"gambling_trade_stream_plus\": {\n" +

            

Reported by PMD.

The String literal '\t},\n' appears 10 times in this file; the first occurrence is on line 42
Error

Line: 42

                  public static final String text = "{\n" +
            "\t\"risk_sexy_trade_stream_plus\": {\n" +
            "\t\t\"score\": 0\n" +
            "\t},\n" +
            "\t\"chemical_medicine_stream_plus\": {\n" +
            "\t\t\"score\": 0\n" +
            "\t},\n" +
            "\t\"gambling_trade_stream_plus\": {\n" +
            "\t\t\"score\": 0\n" +

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/parser/error/ParseErrorTest_9.java
8 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 ParseErrorTest_9 extends TestCase {

    public void test_for_error() throws Exception {
        Exception error = null;
        try {
            JSON.parseObject("{\"value\":33\"}", Model.class);
        } catch (JSONException ex) {
            error = ex;

            

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

                      Assert.assertNotNull(error);
    }
    
    public void test_for_error_2() throws Exception {
        Exception error = null;
        try {
            JSON.parseObject("{\"value\":\"33\"", Model.class);
        } catch (JSONException ex) {
            error = ex;

            

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

                      Assert.assertNotNull(error);
    }
    
    public void test_for_error_3() throws Exception {
        Exception error = null;
        try {
            JSON.parseObject("{\"value\":\"33\",", Model.class);
        } catch (JSONException ex) {
            error = ex;

            

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

                      Assert.assertNotNull(error);
    }
    
    public void test_for_error_4() throws Exception {
        Exception error = null;
        try {
            JSON.parseObject("{\"value\":\"33\"},", Model.class);
        } catch (JSONException ex) {
            error = ex;

            

Reported by PMD.

Found 'DD'-anomaly for variable 'error' (lines '13'-'17').
Error

Line: 13

              public class ParseErrorTest_9 extends TestCase {

    public void test_for_error() throws Exception {
        Exception error = null;
        try {
            JSON.parseObject("{\"value\":33\"}", Model.class);
        } catch (JSONException ex) {
            error = ex;
        }

            

Reported by PMD.

Found 'DD'-anomaly for variable 'error' (lines '23'-'27').
Error

Line: 23

                  }
    
    public void test_for_error_2() throws Exception {
        Exception error = null;
        try {
            JSON.parseObject("{\"value\":\"33\"", Model.class);
        } catch (JSONException ex) {
            error = ex;
        }

            

Reported by PMD.

Found 'DD'-anomaly for variable 'error' (lines '33'-'37').
Error

Line: 33

                  }
    
    public void test_for_error_3() throws Exception {
        Exception error = null;
        try {
            JSON.parseObject("{\"value\":\"33\",", Model.class);
        } catch (JSONException ex) {
            error = ex;
        }

            

Reported by PMD.

Found 'DD'-anomaly for variable 'error' (lines '43'-'47').
Error

Line: 43

                  }
    
    public void test_for_error_4() throws Exception {
        Exception error = null;
        try {
            JSON.parseObject("{\"value\":\"33\"},", Model.class);
        } catch (JSONException ex) {
            error = ex;
        }

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/parser/deser/array/FieldDoubleArrayTest.java
8 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: 10

               * Created by wenshao on 11/01/2017.
 */
public class FieldDoubleArrayTest extends TestCase {
    public void test_intArray() throws Exception {
        Model model = JSON.parseObject("{\"value\":[1,null,3]}", Model.class);
        assertNotNull(model.value);
        assertEquals(3, model.value.length);
        assertEquals(1.0D, model.value[0]);
        assertEquals(0.0D, model.value[1]);

            

Reported by PMD.

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

Line: 10

               * Created by wenshao on 11/01/2017.
 */
public class FieldDoubleArrayTest extends TestCase {
    public void test_intArray() throws Exception {
        Model model = JSON.parseObject("{\"value\":[1,null,3]}", Model.class);
        assertNotNull(model.value);
        assertEquals(3, model.value.length);
        assertEquals(1.0D, model.value[0]);
        assertEquals(0.0D, model.value[1]);

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 12

              public class FieldDoubleArrayTest extends TestCase {
    public void test_intArray() throws Exception {
        Model model = JSON.parseObject("{\"value\":[1,null,3]}", Model.class);
        assertNotNull(model.value);
        assertEquals(3, model.value.length);
        assertEquals(1.0D, model.value[0]);
        assertEquals(0.0D, model.value[1]);
        assertEquals(3.0D, model.value[2]);
    }

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 13

                  public void test_intArray() throws Exception {
        Model model = JSON.parseObject("{\"value\":[1,null,3]}", Model.class);
        assertNotNull(model.value);
        assertEquals(3, model.value.length);
        assertEquals(1.0D, model.value[0]);
        assertEquals(0.0D, model.value[1]);
        assertEquals(3.0D, model.value[2]);
    }


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 14

                      Model model = JSON.parseObject("{\"value\":[1,null,3]}", Model.class);
        assertNotNull(model.value);
        assertEquals(3, model.value.length);
        assertEquals(1.0D, model.value[0]);
        assertEquals(0.0D, model.value[1]);
        assertEquals(3.0D, model.value[2]);
    }

    public static class Model {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 15

                      assertNotNull(model.value);
        assertEquals(3, model.value.length);
        assertEquals(1.0D, model.value[0]);
        assertEquals(0.0D, model.value[1]);
        assertEquals(3.0D, model.value[2]);
    }

    public static class Model {
        public double[] value;

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 16

                      assertEquals(3, model.value.length);
        assertEquals(1.0D, model.value[0]);
        assertEquals(0.0D, model.value[1]);
        assertEquals(3.0D, model.value[2]);
    }

    public static class Model {
        public double[] value;
    }

            

Reported by PMD.

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

Line: 20

                  }

    public static class Model {
        public double[] value;
    }
}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/parser/error/ParseErrorTest_8.java
8 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 ParseErrorTest_8 extends TestCase {

    public void test_for_error() throws Exception {
        Exception error = null;
        try {
            JSON.parseObject("{\"value\":33\"}", Model.class);
        } catch (JSONException ex) {
            error = ex;

            

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

                      Assert.assertNotNull(error);
    }
    
    public void test_for_error_2() throws Exception {
        Exception error = null;
        try {
            JSON.parseObject("{\"value\":\"33\"", Model.class);
        } catch (JSONException ex) {
            error = ex;

            

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

                      Assert.assertNotNull(error);
    }
    
    public void test_for_error_3() throws Exception {
        Exception error = null;
        try {
            JSON.parseObject("{\"value\":\"33\",", Model.class);
        } catch (JSONException ex) {
            error = ex;

            

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

                      Assert.assertNotNull(error);
    }
    
    public void test_for_error_4() throws Exception {
        Exception error = null;
        try {
            JSON.parseObject("{\"value\":\"33\"},", Model.class);
        } catch (JSONException ex) {
            error = ex;

            

Reported by PMD.

Found 'DD'-anomaly for variable 'error' (lines '13'-'17').
Error

Line: 13

              public class ParseErrorTest_8 extends TestCase {

    public void test_for_error() throws Exception {
        Exception error = null;
        try {
            JSON.parseObject("{\"value\":33\"}", Model.class);
        } catch (JSONException ex) {
            error = ex;
        }

            

Reported by PMD.

Found 'DD'-anomaly for variable 'error' (lines '23'-'27').
Error

Line: 23

                  }
    
    public void test_for_error_2() throws Exception {
        Exception error = null;
        try {
            JSON.parseObject("{\"value\":\"33\"", Model.class);
        } catch (JSONException ex) {
            error = ex;
        }

            

Reported by PMD.

Found 'DD'-anomaly for variable 'error' (lines '33'-'37').
Error

Line: 33

                  }
    
    public void test_for_error_3() throws Exception {
        Exception error = null;
        try {
            JSON.parseObject("{\"value\":\"33\",", Model.class);
        } catch (JSONException ex) {
            error = ex;
        }

            

Reported by PMD.

Found 'DD'-anomaly for variable 'error' (lines '43'-'47').
Error

Line: 43

                  }
    
    public void test_for_error_4() throws Exception {
        Exception error = null;
        try {
            JSON.parseObject("{\"value\":\"33\"},", Model.class);
        } catch (JSONException ex) {
            error = ex;
        }

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/writeAsArray/WriteAsArray_Object.java
8 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 WriteAsArray_Object extends TestCase {

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

            

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.getA().getId(), vo2.getA().getId());
        Assert.assertEquals(vo.getA().getName(), vo2.getA().getName());
    }

    private static class VO {


            

Reported by PMD.

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

Line: 26

                      Assert.assertEquals("[[123,\"wenshao\"]]", text);
        
        VO vo2 = JSON.parseObject(text, VO.class, Feature.SupportArrayToBean);
        Assert.assertEquals(vo.getA().getId(), vo2.getA().getId());
        Assert.assertEquals(vo.getA().getName(), vo2.getA().getName());
    }

    private static class VO {


            

Reported by PMD.

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

Line: 26

                      Assert.assertEquals("[[123,\"wenshao\"]]", text);
        
        VO vo2 = JSON.parseObject(text, VO.class, Feature.SupportArrayToBean);
        Assert.assertEquals(vo.getA().getId(), vo2.getA().getId());
        Assert.assertEquals(vo.getA().getName(), vo2.getA().getName());
    }

    private static class VO {


            

Reported by PMD.

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

Line: 27

                      
        VO vo2 = JSON.parseObject(text, VO.class, Feature.SupportArrayToBean);
        Assert.assertEquals(vo.getA().getId(), vo2.getA().getId());
        Assert.assertEquals(vo.getA().getName(), vo2.getA().getName());
    }

    private static class VO {

        private A a;

            

Reported by PMD.

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

Line: 27

                      
        VO vo2 = JSON.parseObject(text, VO.class, Feature.SupportArrayToBean);
        Assert.assertEquals(vo.getA().getId(), vo2.getA().getId());
        Assert.assertEquals(vo.getA().getName(), vo2.getA().getName());
    }

    private static class VO {

        private A a;

            

Reported by PMD.

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

Line: 27

                      
        VO vo2 = JSON.parseObject(text, VO.class, Feature.SupportArrayToBean);
        Assert.assertEquals(vo.getA().getId(), vo2.getA().getId());
        Assert.assertEquals(vo.getA().getName(), vo2.getA().getName());
    }

    private static class VO {

        private A a;

            

Reported by PMD.

The class 'A' is suspected to be a Data Class (WOC=0.000%, NOPA=0, NOAM=4, WMC=4)
Design

Line: 44

              
    }

    private static class A {

        private int    id;
        private String name;

        public int getId() {

            

Reported by PMD.