The following issues were found

src/test/java/com/alibaba/json/bvt/path/JSONPath_map_size.java
2 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

              import junit.framework.TestCase;

public class JSONPath_map_size extends TestCase {
    public void test_list_size() throws Exception {
        Assert.assertEquals(0, JSONPath.eval(Collections.emptyMap(), "$.size"));
    }

    public void test_list_size1() throws Exception {
        Assert.assertEquals(0, JSONPath.eval(Collections.emptyMap(), "$.size()"));

            

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

                      Assert.assertEquals(0, JSONPath.eval(Collections.emptyMap(), "$.size"));
    }

    public void test_list_size1() throws Exception {
        Assert.assertEquals(0, JSONPath.eval(Collections.emptyMap(), "$.size()"));
    }
}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/parser/deser/awt/PointDeserializerTest2.java
2 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 PointDeserializerTest2 extends TestCase {
    public void test_error_3() throws Exception {
        Exception error = null;
        try {
            JSON.parseObject("{\"z\":44}", Point.class);
        } catch (JSONException ex) {
            error = ex;

            

Reported by PMD.

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

Line: 15

              
public class PointDeserializerTest2 extends TestCase {
    public void test_error_3() throws Exception {
        Exception error = null;
        try {
            JSON.parseObject("{\"z\":44}", Point.class);
        } catch (JSONException ex) {
            error = ex;
        }

            

Reported by PMD.

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

    public void test_remove() throws Exception {
        Map<String, Object> root = new HashMap<String, Object>();
        root.put("name", "wenshao");
        root.put("salary", 1234567890);
        Assert.assertTrue(JSONPath.remove(root, "/name"));
        Assert.assertEquals(1, root.size());

            

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

                      Assert.assertFalse(JSONPath.remove(root, "/name"));
    }

    public void test_remove_list() throws Exception {
        List<Object> root = new ArrayList<Object>();
        root.add("wenshao");
        root.add(1234567890);
        
        Assert.assertTrue(JSONPath.remove(root, "/0"));

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/path/JSONPath_set_test3.java
2 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_set_test3 extends TestCase {
    
    public void test_jsonpath_leve_1() throws Exception {
        Map<String, Object> root = new HashMap<String, Object>();
        
        JSONPath.set(root, "/id", 1001);
        
        Assert.assertEquals(1001, JSONPath.eval(root, "/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: 22

                      Assert.assertEquals(1001, JSONPath.eval(root, "/id"));
    }

    public void test_jsonpath() throws Exception {
        Map<String, Object> root = new HashMap<String, Object>();
        
        JSONPath.set(root, "/a/b/id", 1001);
        
        Assert.assertEquals(1001, JSONPath.eval(root, "a/b/id"));

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/path/JSONPath_toString.java
2 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

              import junit.framework.TestCase;

public class JSONPath_toString extends TestCase {
    public void test_toJSONString() throws Exception {
        Model model = new Model();
        model.path = new JSONPath("$");
        String text = JSON.toJSONString(model);
        Assert.assertEquals("{\"path\":\"$\"}", text);
        

            

Reported by PMD.

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

Line: 21

                  }

    public static class Model {
        public JSONPath path;
    }
}

            

Reported by PMD.

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

    public void test_special() throws Exception {
        String x = "{\"10.0.0.1\":{\"region\":\"xxx\"}}";
        Object o = JSON.parse(x);
        Assert.assertTrue(JSONPath.contains(o, "$.10\\.0\\.0\\.1"));
        Assert.assertEquals("{\"region\":\"xxx\"}", JSONPath.eval(o, "$.10\\.0\\.0\\.1").toString());
        Assert.assertTrue(JSONPath.contains(o, "$.10\\.0\\.0\\.1.region"));

            

Reported by PMD.

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

Line: 16

                      String x = "{\"10.0.0.1\":{\"region\":\"xxx\"}}";
        Object o = JSON.parse(x);
        Assert.assertTrue(JSONPath.contains(o, "$.10\\.0\\.0\\.1"));
        Assert.assertEquals("{\"region\":\"xxx\"}", JSONPath.eval(o, "$.10\\.0\\.0\\.1").toString());
        Assert.assertTrue(JSONPath.contains(o, "$.10\\.0\\.0\\.1.region"));
        Assert.assertEquals("xxx", JSONPath.eval(o, "$.10\\.0\\.0\\.1.region"));
    }

}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/parser/deser/asm/TestASM_long.java
2 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 TestASM_long extends TestCase {

    public void test_asm() throws Exception {
        V0 v = new V0();
        String text = JSON.toJSONString(v);
        V0 v1 = JSON.parseObject(text, V0.class);
        
        Assert.assertEquals(v.getI(), v1.getI());

            

Reported by PMD.

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

Line: 15

                      String text = JSON.toJSONString(v);
        V0 v1 = JSON.parseObject(text, V0.class);
        
        Assert.assertEquals(v.getI(), v1.getI());
    }

    public static class V0 {

        private long i = 12;

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/parser/deser/asm/TestASM_int.java
2 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 TestASM_int extends TestCase {

    public void test_asm() throws Exception {
        V0 v = new V0();
        String text = JSON.toJSONString(v);
        V0 v1 = JSON.parseObject(text, V0.class);
        
        Assert.assertEquals(v.getI(), v1.getI());

            

Reported by PMD.

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

Line: 15

                      String text = JSON.toJSONString(v);
        V0 v1 = JSON.parseObject(text, V0.class);
        
        Assert.assertEquals(v.getI(), v1.getI());
    }

    public static class V0 {

        private int i = 12;

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/parser/deser/asm/TestASM_float.java
2 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 TestASM_float extends TestCase {

    public void test_asm() throws Exception {
        V0 v = new V0();
        String text = JSON.toJSONString(v);
        V0 v1 = JSON.parseObject(text, V0.class);
        
        Assert.assertTrue(v.getValue() == v1.getValue());

            

Reported by PMD.

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

Line: 16

                      String text = JSON.toJSONString(v);
        V0 v1 = JSON.parseObject(text, V0.class);
        
        Assert.assertTrue(v.getValue() == v1.getValue());
    }

    public static class V0 {

        private float value = 32.5F;

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/parser/deser/asm/TestASM_double.java
2 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 TestASM_double extends TestCase {

    public void test_asm() throws Exception {
        V0 v = new V0();
        String text = JSON.toJSONString(v);
        V0 v1 = JSON.parseObject(text, V0.class);
        
        Assert.assertTrue(v.getValue() == v1.getValue());

            

Reported by PMD.

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

Line: 15

                      String text = JSON.toJSONString(v);
        V0 v1 = JSON.parseObject(text, V0.class);
        
        Assert.assertTrue(v.getValue() == v1.getValue());
    }

    public static class V0 {

        private double value = 32.5F;

            

Reported by PMD.