The following issues were found

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

    public void test_0() throws Exception {
        String text = "{\"FH2\\\"\u0005\\v\u0010\u000e\u0011\u0000\":0,\"alipa9_login\":0,\"alipay_login\":14164,\"durex\":317,\"intl.datasky\":0,\"taobao_refund\":880}";

        JSONObject obj = JSONObject.parseObject(text);
        Assert.assertNotNull(obj);
        Assert.assertEquals(0, obj.get("FH2\"\u0005\u000B\u0010\u000e\u0011\u0000"));

            

Reported by PMD.

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

Line: 16

              
        JSONObject obj = JSONObject.parseObject(text);
        Assert.assertNotNull(obj);
        Assert.assertEquals(0, obj.get("FH2\"\u0005\u000B\u0010\u000e\u0011\u0000"));

    }

}

            

Reported by PMD.

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

    public void test_for_issue() throws Exception {
        Group group = new Group();
        group.setId(0L);
        group.setNAME("admin");
        group.setAUTHORITY("administrors");


            

Reported by PMD.

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

Line: 22

                      Assert.assertEquals("{\"ID\":0,\"nAME\":\"admin\"}", json);
    }

    public static class Group {

        @JSONField(name = "ID")
        private Long   id;
        private String NAME;
        @JSONField(serialize = false, deserialize = false)

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/bug/Bug_for_hmy8.java
2 issues
JUnit tests should include assert() or fail()
Design

Line: 11

              
public class Bug_for_hmy8 extends TestCase {

    public void test_ser() throws Exception {
        IEventDto dto = new IEventDto();
        dto.getEventList().add(new IEvent());
        
        JSON.toJSONString(dto);
    }

            

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

              
public class Bug_for_hmy8 extends TestCase {

    public void test_ser() throws Exception {
        IEventDto dto = new IEventDto();
        dto.getEventList().add(new IEvent());
        
        JSON.toJSONString(dto);
    }

            

Reported by PMD.

src/main/java/com/alibaba/fastjson/support/geo/GeometryCollection.java
2 issues
Private field 'geometries' could be made final; it is only initialized in the declaration or constructor.
Design

Line: 12

               */
@JSONType(typeName = "GeometryCollection", orders = {"type", "bbox", "geometries"})
public class GeometryCollection extends Geometry {
    private List<Geometry> geometries = new ArrayList<Geometry>();

    public GeometryCollection() {
        super("GeometryCollection");
    }


            

Reported by PMD.

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

Line: 12

               */
@JSONType(typeName = "GeometryCollection", orders = {"type", "bbox", "geometries"})
public class GeometryCollection extends Geometry {
    private List<Geometry> geometries = new ArrayList<Geometry>();

    public GeometryCollection() {
        super("GeometryCollection");
    }


            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/bug/Bug_for_dongqi.java
2 issues
System.out.print is used
Design

Line: 17

                  public void test_bug() throws Exception {
        Map<String, Object> obj = new HashMap<String,Object>();
        obj.put("value", ";\r\n3、ž 公");
        System.out.print(JSON.toJSONString(obj));
        Assert.assertEquals("{\"value\":\";\\r\\n3、\\u009E 公\"}", JSON.toJSONString(obj));
    }
}

            

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

              

public class Bug_for_dongqi extends TestCase {
    public void test_bug() throws Exception {
        Map<String, Object> obj = new HashMap<String,Object>();
        obj.put("value", ";\r\n3、ž 公");
        System.out.print(JSON.toJSONString(obj));
        Assert.assertEquals("{\"value\":\";\\r\\n3、\\u009E 公\"}", JSON.toJSONString(obj));
    }

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/bug/Issue784.java
2 issues
JUnit tests should include assert() or fail()
Design

Line: 10

               * Created by wenshao on 16/8/24.
 */
public class Issue784 extends TestCase {
    public void test_for_issue() throws Exception {
        JSON.parse("[{\"args\":[\"150\",\"change\",{\"timeStamp\":1471595047319,\"value\":\"\"},{\"attrs\":{\"value\":\"\"}}],\"method\":\"fireEvent\"}]");
    }
}

            

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

               * Created by wenshao on 16/8/24.
 */
public class Issue784 extends TestCase {
    public void test_for_issue() throws Exception {
        JSON.parse("[{\"args\":[\"150\",\"change\",{\"timeStamp\":1471595047319,\"value\":\"\"},{\"attrs\":{\"value\":\"\"}}],\"method\":\"fireEvent\"}]");
    }
}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/bug/Bug_for_issue_232.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

              import junit.framework.TestCase;

public class Bug_for_issue_232 extends TestCase {
    public void test_for_issue() throws Exception {
        String source = "{\"code\": 0, \"data\": {\"country\": \"China\", \"country_id\": \"CN\", \"area\": \"East China\", \"area_id\": \"300000\", \"region\": \"Jiangsu Province \",\" region_id \":\" 320000 \",\" city \":\" Nanjing \",\" city_id \":\" 320100 \",\" county \":\" \",\" county_id \":\" - 1 \",\" isp \":\" China Unicom \",\" isp_id \":\" 100026 \",\" ip \":\" 58.240.65.50 \"}}";
        JSONObject object = JSONObject.parseObject (source);
        Assert.assertEquals(0, object.getIntValue("code"));
    }
}

            

Reported by PMD.

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

Line: 13

                  public void test_for_issue() throws Exception {
        String source = "{\"code\": 0, \"data\": {\"country\": \"China\", \"country_id\": \"CN\", \"area\": \"East China\", \"area_id\": \"300000\", \"region\": \"Jiangsu Province \",\" region_id \":\" 320000 \",\" city \":\" Nanjing \",\" city_id \":\" 320100 \",\" county \":\" \",\" county_id \":\" - 1 \",\" isp \":\" China Unicom \",\" isp_id \":\" 100026 \",\" ip \":\" 58.240.65.50 \"}}";
        JSONObject object = JSONObject.parseObject (source);
        Assert.assertEquals(0, object.getIntValue("code"));
    }
}

            

Reported by PMD.

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

    public void test_for_issue() throws Exception {
        V1 vo = new V1();
        vo.units = EnumSet.of(TimeUnit.DAYS, TimeUnit.HOURS);

        String text = JSON.toJSONString(vo);
        Assert.assertEquals("{\"units\":[\"HOURS\",\"DAYS\"]}", 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: 26

                      Assert.assertEquals(vo.units, vo1.units);
    }
    
    public void test_for_issue_private() throws Exception {
        VO vo = new VO();
        vo.units = EnumSet.of(TimeUnit.DAYS, TimeUnit.HOURS);

        String text = JSON.toJSONString(vo);
        Assert.assertEquals("{\"units\":[\"HOURS\",\"DAYS\"]}", text);

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/bug/Bug_for_issue_269.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: 13

              
public class Bug_for_issue_269 extends TestCase {

    public void test_for_issue() throws Exception {
        String text = "{\"value\":\"2014-10-09T03:07:07.000Z\"}";
        VO vo = JSON.parseObject(text, VO.class);
        Assert.assertEquals(1412824027000L, vo.value.getTime());
    }


            

Reported by PMD.

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

Line: 16

                  public void test_for_issue() throws Exception {
        String text = "{\"value\":\"2014-10-09T03:07:07.000Z\"}";
        VO vo = JSON.parseObject(text, VO.class);
        Assert.assertEquals(1412824027000L, vo.value.getTime());
    }

    public static class VO {

        private Date value;

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/bug/Bug_for_issue_273.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: 8

              import junit.framework.TestCase;

public class Bug_for_issue_273 extends TestCase {
    public void test_for_issue() throws Exception {
        JSON.parseObject("{\"value\":\"\0x16\0x26\"}");
    }
    
    public static class VO {
        public String value;

            

Reported by PMD.

JUnit tests should include assert() or fail()
Design

Line: 8

              import junit.framework.TestCase;

public class Bug_for_issue_273 extends TestCase {
    public void test_for_issue() throws Exception {
        JSON.parseObject("{\"value\":\"\0x16\0x26\"}");
    }
    
    public static class VO {
        public String value;

            

Reported by PMD.