The following issues were found

src/test/java/com/alibaba/json/bvt/bug/Bug_for_Double2Tag.java
3 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_Double2Tag extends TestCase {
	public void test_double() throws Exception {
		Double2Tag tag = new Double2Tag();
		String str = JSON.toJSONString(tag);
		JSON.parseObject(str, Double2Tag.class);
	}
	

            

Reported by PMD.

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

Line: 8

              import junit.framework.TestCase;

public class Bug_for_Double2Tag extends TestCase {
	public void test_double() throws Exception {
		Double2Tag tag = new Double2Tag();
		String str = JSON.toJSONString(tag);
		JSON.parseObject(str, Double2Tag.class);
	}
	

            

Reported by PMD.

The class 'Double2Tag' is suspected to be a Data Class (WOC=0.000%, NOPA=8, NOAM=16, WMC=17)
Design

Line: 14

              		JSON.parseObject(str, Double2Tag.class);
	}
	
	public static class Double2Tag {
		public String data_time;
		public String data_id;
		public String hour_id;
		public String minute_id;
		public String tag3_id;

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/bug/Bug_for_Issue_534.java
3 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_534 extends TestCase {
    public void test_for_issue() throws Exception {
        Value value = new Value();
        value.aLong = 2459838341588L;
        
        String text = JSON.toJSONString(value);
        Assert.assertEquals("{\"aLong\":2459838341588}", 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: 18

                      Assert.assertEquals("{\"aLong\":2459838341588}", text);
    }
    
    public void test_for_issue_1() throws Exception {
        Long value = 2459838341588L;
        
        String text = JSON.toJSONString(value);
        Assert.assertEquals("2459838341588", text);
    }

            

Reported by PMD.

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

Line: 27

                  
    class Value {

        private Long aLong;

        public Long getaLong() {
            return aLong;
        }


            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/bug/Bug_for_JeryZeng.java
3 issues
System.out.println is used
Design

Line: 10

              
public class Bug_for_JeryZeng extends TestCase {
    public void test_0() throws Exception {
        System.out.println(JSON.parseObject("{123:123,124:true,\"value\":{123:\"abc\"}}"));
    }
}

            

Reported by PMD.

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

Line: 9

              

public class Bug_for_JeryZeng extends TestCase {
    public void test_0() throws Exception {
        System.out.println(JSON.parseObject("{123:123,124:true,\"value\":{123:\"abc\"}}"));
    }
}

            

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

              

public class Bug_for_JeryZeng extends TestCase {
    public void test_0() throws Exception {
        System.out.println(JSON.parseObject("{123:123,124:true,\"value\":{123:\"abc\"}}"));
    }
}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/bug/Bug_for_array.java
3 issues
Overridable method 'setName' called during object construction
Error

Line: 40

              		
		public B  (int id, String name) {
			setId(id);
			setName(name);
		}

		public String getName() {
			return name;
		}

            

Reported by PMD.

System.out.println is used
Design

Line: 14

              		A[] array = new A[] { new B(123, "xxx") };
		
		String text = JSON.toJSONString(array);
		System.out.println(text);
		Assert.assertEquals("[{\"id\":123,\"name\":\"xxx\"}]", text);
	}

	public static class A {
		private int 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: 10

              import com.alibaba.fastjson.JSON;

public class Bug_for_array extends TestCase {
	public void test_array() throws Exception {
		A[] array = new A[] { new B(123, "xxx") };
		
		String text = JSON.toJSONString(array);
		System.out.println(text);
		Assert.assertEquals("[{\"id\":123,\"name\":\"xxx\"}]", text);

            

Reported by PMD.

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

Line: 9

              import junit.framework.TestCase;

public class Bug_for_chengchao_1 extends TestCase {
    public void test_0() throws Exception {
        ParserConfig config = new ParserConfig();
        config.setAutoTypeSupport(true);
        String str = "{\"@type\":\"test.MapDone\",\"data\":{\"@type\":\"test.HiluxDataByOpsmeta\",\"attends\":{\"@type\":\"java.util.HashMap\",\"center.na61\":2},\"datasByOpsmeta\":{\"@type\":\"java.util.HashMap\",{\"@type\":\"test.AppInst\",\"app\":\"wdkhummer\",\"appGroup\":\"wdkhummerhost\",\"env\":\"PUBLISH\",\"hostname\":\"wdkhummer011009059229.na61\",\"idc\":\"na61\",\"ip\":\"11.9.59.229\",\"online\":true}:{\"@type\":\"test.MiddlewareDimData\",\"attends\":{\"@type\":\"java.util.HashMap\"},\"expectAttends\":{\"@type\":\"java.util.HashMap\"},\"logLineCount\":0,\"values\":{}}}}}";
        JSON.parse(str, config, JSON.DEFAULT_PARSER_FEATURE);
    }

            

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

              import junit.framework.TestCase;

public class Bug_for_chengchao_1 extends TestCase {
    public void test_0() throws Exception {
        ParserConfig config = new ParserConfig();
        config.setAutoTypeSupport(true);
        String str = "{\"@type\":\"test.MapDone\",\"data\":{\"@type\":\"test.HiluxDataByOpsmeta\",\"attends\":{\"@type\":\"java.util.HashMap\",\"center.na61\":2},\"datasByOpsmeta\":{\"@type\":\"java.util.HashMap\",{\"@type\":\"test.AppInst\",\"app\":\"wdkhummer\",\"appGroup\":\"wdkhummerhost\",\"env\":\"PUBLISH\",\"hostname\":\"wdkhummer011009059229.na61\",\"idc\":\"na61\",\"ip\":\"11.9.59.229\",\"online\":true}:{\"@type\":\"test.MiddlewareDimData\",\"attends\":{\"@type\":\"java.util.HashMap\"},\"expectAttends\":{\"@type\":\"java.util.HashMap\"},\"logLineCount\":0,\"values\":{}}}}}";
        JSON.parse(str, config, JSON.DEFAULT_PARSER_FEATURE);
    }

            

Reported by PMD.

Avoid unused imports such as 'com.alibaba.fastjson.parser.Feature'
Design

Line: 4

              package com.alibaba.json.bvt.bug;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.parser.Feature;
import com.alibaba.fastjson.parser.ParserConfig;
import junit.framework.TestCase;

public class Bug_for_chengchao_1 extends TestCase {
    public void test_0() throws Exception {

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/bug/Bug_for_divde_zero.java
3 issues
System.out.println is used
Design

Line: 12

                  public void test_divideZero() throws Exception {
        Double d = 1.0D / 0.0D;
        String text = JSON.toJSONString(d);
        System.out.println(text);
    }
}

            

Reported by PMD.

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

Line: 9

              

public class Bug_for_divde_zero extends TestCase {
    public void test_divideZero() throws Exception {
        Double d = 1.0D / 0.0D;
        String text = JSON.toJSONString(d);
        System.out.println(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: 9

              

public class Bug_for_divde_zero extends TestCase {
    public void test_divideZero() throws Exception {
        Double d = 1.0D / 0.0D;
        String text = JSON.toJSONString(d);
        System.out.println(text);
    }
}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/bug/Bug_for_field.java
3 issues
System.out.println is used
Design

Line: 17

                      
        String text = JSON.toJSONString(vo);
        
        System.out.println(text);
    }

    public static class VO {

        @JSONField(name = "ID", serialzeFeatures={SerializerFeature.WriteClassName})

            

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

    public void test_annotation() throws Exception {
        VO vo = new VO();
        vo.setId(123);
        
        String text = JSON.toJSONString(vo);
        

            

Reported by PMD.

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

Line: 11

              
public class Bug_for_field extends TestCase {

    public void test_annotation() throws Exception {
        VO vo = new VO();
        vo.setId(123);
        
        String text = JSON.toJSONString(vo);
        

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/bug/Bug_for_huangchun.java
3 issues
System.out.println is used
Design

Line: 14

                      JSONObject json = new JSONObject();
        json.put("info", "<a href=\"http://www.baidu.com\"> 问题链接 </a> ");
        String text = JSON.toJSONString(json);
        System.out.println(text);
    }
}

            

Reported by PMD.

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

Line: 10

              

public class Bug_for_huangchun extends TestCase {
    public void test_serialize_url() throws Exception {
        JSONObject json = new JSONObject();
        json.put("info", "<a href=\"http://www.baidu.com\"> 问题链接 </a> ");
        String text = JSON.toJSONString(json);
        System.out.println(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: 10

              

public class Bug_for_huangchun extends TestCase {
    public void test_serialize_url() throws Exception {
        JSONObject json = new JSONObject();
        json.put("info", "<a href=\"http://www.baidu.com\"> 问题链接 </a> ");
        String text = JSON.toJSONString(json);
        System.out.println(text);
    }

            

Reported by PMD.

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

    public void test_for_issue() throws Exception {
        Assert.assertTrue(JSON.parseObject("{\"value\":1}", VO.class).value);
        Assert.assertFalse(JSON.parseObject("{\"value\":0}", VO.class).value);
    }

    public static class VO {

            

Reported by PMD.

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

Line: 12

              public class Bug_for_issue_229 extends TestCase {

    public void test_for_issue() throws Exception {
        Assert.assertTrue(JSON.parseObject("{\"value\":1}", VO.class).value);
        Assert.assertFalse(JSON.parseObject("{\"value\":0}", VO.class).value);
    }

    public static class VO {


            

Reported by PMD.

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

Line: 13

              
    public void test_for_issue() throws Exception {
        Assert.assertTrue(JSON.parseObject("{\"value\":1}", VO.class).value);
        Assert.assertFalse(JSON.parseObject("{\"value\":0}", VO.class).value);
    }

    public static class VO {

        private boolean value;

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/bug/Bug_for_issue_316.java
3 issues
JUnit 4 tests that set up tests should use the @Before annotation, JUnit5 tests should use @BeforeEach or @BeforeAll
Design

Line: 14

              import junit.framework.TestCase;

public class Bug_for_issue_316 extends TestCase {
    protected void setUp() throws Exception {
        JSON.defaultTimeZone = TimeZone.getTimeZone("Asia/Shanghai");
        JSON.defaultLocale = Locale.CHINA;
    }
    
    public void test_for_issue() 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: 19

                      JSON.defaultLocale = Locale.CHINA;
    }
    
    public void test_for_issue() throws Exception {
        Model model = new Model();
        model.value = new Timestamp(1460563200000L);
        Assert.assertEquals("{\"value\":1460563200000}", JSON.toJSONString(model));
    }


            

Reported by PMD.

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

Line: 26

                  }

    public static class Model {
        public java.sql.Timestamp value;
    }
}

            

Reported by PMD.