The following issues were found

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

    public void test_0() throws Exception {
        SerializerFeature[] features = { SerializerFeature.WriteMapNullValue,

        SerializerFeature.WriteEnumUsingToString, SerializerFeature.SortField };

        Entity entity = new Entity();

            

Reported by PMD.

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

Line: 12

              
public class Bug_for_chengchao extends TestCase {

    public void test_0() throws Exception {
        SerializerFeature[] features = { SerializerFeature.WriteMapNullValue,

        SerializerFeature.WriteEnumUsingToString, SerializerFeature.SortField };

        Entity entity = new Entity();

            

Reported by PMD.

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

    public void test_for_issue() throws Exception {
        TypeReference<Respone<User>> type= new TypeReference<Respone<User>>() {};  

        Respone<User> resp = JSON.parseObject("{\"code\":\"\",\"data\":\"\",\"msg\":\"\"}", type);
        Assert.assertNull(resp.data);
    }

            

Reported by PMD.

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

Line: 23

              
        public String code;
        public String msg;
        public T      data;
    }

    public static class User {

    }

            

Reported by PMD.

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

              
public class Bug_for_akvadrako extends TestCase {

    public void testNakedFields() throws Exception {
        Naked naked = new Naked();
        DefaultJSONParser parser = new DefaultJSONParser("{ \"field\": 3 }");
        parser.parseObject(naked);
    }


            

Reported by PMD.

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

Line: 9

              
public class Bug_for_akvadrako extends TestCase {

    public void testNakedFields() throws Exception {
        Naked naked = new Naked();
        DefaultJSONParser parser = new DefaultJSONParser("{ \"field\": 3 }");
        parser.parseObject(naked);
    }


            

Reported by PMD.

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

Line: 12

               * Created by wenshao on 15/02/2017.
 */
public class Issue_for_jiongxiong extends TestCase {
    public void test_for_jiongxiong() throws Exception {
        JSON.parseObject("{\"groupNames\":[\"a\"]}", Model.class);
    }

    public static class Model {
        private Set<String> groupNames;

            

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

               * Created by wenshao on 15/02/2017.
 */
public class Issue_for_jiongxiong extends TestCase {
    public void test_for_jiongxiong() throws Exception {
        JSON.parseObject("{\"groupNames\":[\"a\"]}", Model.class);
    }

    public static class Model {
        private Set<String> groupNames;

            

Reported by PMD.

src/main/java/com/alibaba/fastjson/JSONStreamContext.java
2 issues
Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 11

                  final static int                  StartArray    = 1004;
    final static int                  ArrayValue    = 1005;

    protected final JSONStreamContext parent;

    protected int                     state;

    public JSONStreamContext(JSONStreamContext parent, int state){
        this.parent = parent;

            

Reported by PMD.

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

Line: 13

              
    protected final JSONStreamContext parent;

    protected int                     state;

    public JSONStreamContext(JSONStreamContext parent, int state){
        this.parent = parent;
        this.state = state;
    }

            

Reported by PMD.

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

    public void test_bug() throws Exception {
        DbMediaSource obj = new DbMediaSource();
        obj.setType(DataMediaType.ORACLE);
        
        JSONObject json = (JSONObject) JSON.toJSON(obj);
        Assert.assertEquals("ORACLE", json.get("type"));

            

Reported by PMD.

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

Line: 16

                      obj.setType(DataMediaType.ORACLE);
        
        JSONObject json = (JSONObject) JSON.toJSON(obj);
        Assert.assertEquals("ORACLE", json.get("type"));
    }

    public static class DbMediaSource {

        private DataMediaType type;

            

Reported by PMD.

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

              
public class Bug_for_issue_320 extends TestCase {

    @SuppressWarnings({ "rawtypes", "unchecked" })
    public void test_for_issue() throws Exception {
        Map map = new HashMap();
        map.put(1001L, "aaa");
        
        String text = JSON.toJSONString(map);

            

Reported by PMD.

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

Line: 24

                      Assert.assertEquals("{1001:\"aaa\"}", text);
        
        JSONObject obj = JSON.parseObject(text);
        Assert.assertEquals("aaa", obj.get(1001));
    }

}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/bug/Bug_for_issue_352.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 Bug_for_issue_352 extends TestCase {
    public void test_for_issue() throws Exception {
        VO vo = new VO();
        vo.name = "张三";
        String text = JSON.toJSONString(vo);
        Assert.assertEquals("{\"index\":0,\"名\":\"张三\"}", text);
        VO v1 = JSON.parseObject(text, VO.class);

            

Reported by PMD.

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

Line: 23

                  public static class VO {
        public int index;
        @JSONField(name="名")
        public String name;
    }
}

            

Reported by PMD.

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

              import junit.framework.TestCase;

public class Bug_for_issue_364 extends TestCase {
    public void test_for_issue() throws Exception {
        JSONObject jsonObject = new JSONObject(3, true);
        jsonObject.put("name", "J.K.SAGE");
        jsonObject.put("age", 21);
        jsonObject.put("msg", "Hello!");
        JSONObject cloneObject = (JSONObject) jsonObject.clone();

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 15

                      jsonObject.put("age", 21);
        jsonObject.put("msg", "Hello!");
        JSONObject cloneObject = (JSONObject) jsonObject.clone();
        assertEquals(JSON.toJSONString(jsonObject), JSON.toJSONString(cloneObject));
    }
}

            

Reported by PMD.

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

              import junit.framework.TestCase;

public class Bug_for_issue_372 extends TestCase {
    public void test_for_issue() throws Exception {
        ParserConfig config = new ParserConfig();
        ObjectDeserializer deser = config.getDeserializer(Model.class);
        Assert.assertEquals(JavaBeanDeserializer.class, deser.getClass());
    }
    

            

Reported by PMD.

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

Line: 16

                  public void test_for_issue() throws Exception {
        ParserConfig config = new ParserConfig();
        ObjectDeserializer deser = config.getDeserializer(Model.class);
        Assert.assertEquals(JavaBeanDeserializer.class, deser.getClass());
    }
    
    @JSONType(asm=false)
    public static class Model {
        

            

Reported by PMD.