The following issues were found

src/test/java/com/alibaba/json/test/performance/case1/GenerateTest.java
3 issues
System.out.println is used
Design

Line: 20

                          json.put("f" + i, i);
        }
        String text = JSON.toJSONString(json, false);
        System.out.println(text);
        FileUtils.writeStringToFile(new File("d:/int_array_1000.json"), text);
    }
}

            

Reported by PMD.

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

Line: 14

              
public class GenerateTest extends TestCase {

    public void testGenInt() throws Exception {
        JSONObject json = new JSONObject(true);
        for (int i = 0; i < 100; ++i) {
            json.put("f" + i, i);
        }
        String text = JSON.toJSONString(json, false);

            

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

    public void testGenInt() throws Exception {
        JSONObject json = new JSONObject(true);
        for (int i = 0; i < 100; ++i) {
            json.put("f" + i, i);
        }
        String text = JSON.toJSONString(json, false);

            

Reported by PMD.

src/test/java/com/alibaba/json/test/benchmark/decode/GroupDecode.java
3 issues
Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 13

              
public class GroupDecode extends BenchmarkCase {

    private String text;

    public GroupDecode(){
        super("GroupDecode");

        try {

            

Reported by PMD.

Ensure that resources like this InputStream object are closed after use
Error

Line: 20

              
        try {
            String resource = "json/group.json";
            InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource);
            text = IOUtils.toString(is);
            is.close();
        } catch (IOException ex) {
            ex.printStackTrace();
        }

            

Reported by PMD.

Avoid printStackTrace(); use a logger call instead.
Design

Line: 24

                          text = IOUtils.toString(is);
            is.close();
        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }

    @Override
    public void execute(Codec codec) throws Exception {

            

Reported by PMD.

src/test/java/com/alibaba/json/test/benchmark/decode/IntArray1000Decode.java
3 issues
Private field 'text' could be made final; it is only initialized in the declaration or constructor.
Design

Line: 8

              
public class IntArray1000Decode extends BenchmarkCase {

    private String text;

    public IntArray1000Decode(){
        super("IntArray1000Decode");

        StringBuilder buf = new StringBuilder();

            

Reported by PMD.

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

Line: 8

              
public class IntArray1000Decode extends BenchmarkCase {

    private String text;

    public IntArray1000Decode(){
        super("IntArray1000Decode");

        StringBuilder buf = new StringBuilder();

            

Reported by PMD.

Avoid appending characters as strings in StringBuffer.append.
Performance

Line: 18

                      buf.append('[');
        for (int i = 0; i < 1000; ++i) {
            if (i != 0) {
                buf.append(",");
            }
            buf.append(i);
        }
        buf.append(']');
        this.text = buf.toString();

            

Reported by PMD.

src/test/java/com/alibaba/json/test/entity/case1/Long_100_Entity.java
3 issues
This class has a bunch of public methods and attributes
Design

Line: 1

              package com.alibaba.json.test.entity.case1;

public class Long_100_Entity {

    private long f0;
    private long f1;
    private long f2;
    private long f3;
    private long f4;

            

Reported by PMD.

The class 'Long_100_Entity' has a total cyclomatic complexity of 200 (highest 1).
Design

Line: 3

              package com.alibaba.json.test.entity.case1;

public class Long_100_Entity {

    private long f0;
    private long f1;
    private long f2;
    private long f3;
    private long f4;

            

Reported by PMD.

Too many fields
Design

Line: 3

              package com.alibaba.json.test.entity.case1;

public class Long_100_Entity {

    private long f0;
    private long f1;
    private long f2;
    private long f3;
    private long f4;

            

Reported by PMD.

src/test/java/oracle/sql/DATE.java
3 issues
Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 8

              
public class DATE {

    private Date date;

    public DATE(Timestamp date){
        long time = date.getTime();
        time = (time  / 1000) * 1000;
        this.date = new Date(time);

            

Reported by PMD.

Private field 'date' could be made final; it is only initialized in the declaration or constructor.
Design

Line: 8

              
public class DATE {

    private Date date;

    public DATE(Timestamp date){
        long time = date.getTime();
        time = (time  / 1000) * 1000;
        this.date = new Date(time);

            

Reported by PMD.

It is somewhat confusing to have a field name matching the declaring class name
Error

Line: 8

              
public class DATE {

    private Date date;

    public DATE(Timestamp date){
        long time = date.getTime();
        time = (time  / 1000) * 1000;
        this.date = new Date(time);

            

Reported by PMD.

src/test/java/com/alibaba/json/test/benchmark/decode/StringArray1000Decode.java
3 issues
Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 8

              
public class StringArray1000Decode extends BenchmarkCase {

    private String text;

    public StringArray1000Decode(){
        super("StringArray1000Decode");

        StringBuilder buf = new StringBuilder();

            

Reported by PMD.

Private field 'text' could be made final; it is only initialized in the declaration or constructor.
Design

Line: 8

              
public class StringArray1000Decode extends BenchmarkCase {

    private String text;

    public StringArray1000Decode(){
        super("StringArray1000Decode");

        StringBuilder buf = new StringBuilder();

            

Reported by PMD.

Avoid appending characters as strings in StringBuffer.append.
Performance

Line: 18

                      buf.append('[');
        for (int i = 0; i < 1000; ++i) {
            if (i != 0) {
                buf.append(",");
            }
            buf.append('"' + Integer.toHexString(i * 100) + '"');
        }
        buf.append(']');
        this.text = buf.toString();

            

Reported by PMD.

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

Line: 24

                      json.put("items", items);
        
        String text = xmlSerializer.write(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: 9

              import net.sf.json.xml.XMLSerializer;

public class JSONLibXmlTest extends TestCase {
    public void test_xml() throws Exception {
        XMLSerializer xmlSerializer = new XMLSerializer();
        
        JSONObject json = new JSONObject();
        json.put("id", 123);
        json.put("name", "jobs");

            

Reported by PMD.

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

Line: 9

              import net.sf.json.xml.XMLSerializer;

public class JSONLibXmlTest extends TestCase {
    public void test_xml() throws Exception {
        XMLSerializer xmlSerializer = new XMLSerializer();
        
        JSONObject json = new JSONObject();
        json.put("id", 123);
        json.put("name", "jobs");

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/writeAsArray/WriteAsArray_string_special.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: 14

              public class WriteAsArray_string_special extends TestCase {

    
    public void test_0() throws Exception {
        Model model = new Model();
        model.name = "a\\bc";
        String text = JSON.toJSONString(model, SerializerFeature.BeanToArray);
        Assert.assertEquals("[\"a\\\\bc\"]", 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: 24

                      Assert.assertEquals(model.name, model2.name);
    }
    
    public void test_1() throws Exception {
        Model model = new Model();
        model.name = "a\\bc\"";
        String text = JSON.toJSONString(model, SerializerFeature.BeanToArray);
        Assert.assertEquals("[\"a\\\\bc\\\"\"]", text);


            

Reported by PMD.

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

Line: 36

              
    public static class Model {

        public String name;

    }
}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/writeAsArray/WriteAsArray_string_special_Reader.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: 17

              public class WriteAsArray_string_special_Reader extends TestCase {

    
    public void test_0() throws Exception {
        Model model = new Model();
        model.name = "a\\bc";
        String text = JSON.toJSONString(model, SerializerFeature.BeanToArray);
        Assert.assertEquals("[\"a\\\\bc\"]", 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: 30

                      reader.close();
    }
    
    public void test_1() throws Exception {
        Model model = new Model();
        model.name = "a\\bc\"";
        String text = JSON.toJSONString(model, SerializerFeature.BeanToArray);
        Assert.assertEquals("[\"a\\\\bc\\\"\"]", text);


            

Reported by PMD.

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

Line: 45

              
    public static class Model {

        public String name;

    }
}

            

Reported by PMD.

src/test/java/com/alibaba/json/test/a/IncomingDataPointBenchmark.java
3 issues
System.out.println is used
Design

Line: 24

                          JSON.parseArray(json, IncomingDataPoint.class);
        }
        long millis = System.currentTimeMillis() - start;
        System.out.println("millis : " + millis);
    }
}

            

Reported by PMD.

All methods are static. Consider using a utility class instead. Alternatively, you could add a private constructor or make the class abstract to silence this warning.
Design

Line: 9

              /**
 * Created by wenshao on 04/08/2017.
 */
public class IncomingDataPointBenchmark {
    static String json = "[[\"DataAdaptor.LbMultiGroupPersonalityDataAdaptor.stddev.aggregate_sum\",\"1501812639932\",\"95.52667633256902\",{\"appName\":\"aladdin\",\"hostIdc\":\"et2\",\"hostunit\":\"CENTER\",\"nodegroup\":\"aladdin_prehost\",\"idc\":\"ET2\",\"agg_version\":\"100\",\"group\":\"DEFAULT\"},\"\",\"\",\"\"]]";

    public static void main(String[] args) throws Exception {
        for (int i = 0; i < 10; ++i) {
            perf();

            

Reported by PMD.

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

Line: 12

              public class IncomingDataPointBenchmark {
    static String json = "[[\"DataAdaptor.LbMultiGroupPersonalityDataAdaptor.stddev.aggregate_sum\",\"1501812639932\",\"95.52667633256902\",{\"appName\":\"aladdin\",\"hostIdc\":\"et2\",\"hostunit\":\"CENTER\",\"nodegroup\":\"aladdin_prehost\",\"idc\":\"ET2\",\"agg_version\":\"100\",\"group\":\"DEFAULT\"},\"\",\"\",\"\"]]";

    public static void main(String[] args) throws Exception {
        for (int i = 0; i < 10; ++i) {
            perf();
        }
    }


            

Reported by PMD.