The following issues were found

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

	public void test_codec() throws Exception {
		V0 v = new V0();
		v.setValue(1001L);

		String text = JSON.toJSONString(v);


            

Reported by PMD.

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

Line: 21

              
		V0 v1 = JSON.parseObject(text, V0.class);

		Assert.assertEquals(v1.getValue(), v.getValue());
	}

	public void test_codec_null() throws Exception {
		V0 v = new V0();


            

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(v1.getValue(), v.getValue());
	}

	public void test_codec_null() throws Exception {
		V0 v = new V0();

		SerializeConfig mapping = new SerializeConfig();
		mapping.setAsmEnable(false);


            

Reported by PMD.

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

Line: 36

              
		V0 v1 = JSON.parseObject(text, V0.class);

		Assert.assertEquals(v1.getValue(), v.getValue());
	}

	public void test_codec_null_asm() throws Exception {
		V0 v = new V0();


            

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

              		Assert.assertEquals(v1.getValue(), v.getValue());
	}

	public void test_codec_null_asm() throws Exception {
		V0 v = new V0();

		SerializeConfig mapping = new SerializeConfig();
		mapping.setAsmEnable(true);


            

Reported by PMD.

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

Line: 55

              		V0 v1 = JSON.parseObject(text, V0.class, config,
				JSON.DEFAULT_PARSER_FEATURE);

		Assert.assertEquals(v1.getValue(), v.getValue());
	}

	public void test_codec_null_1() throws Exception {
		V0 v = new V0();


            

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

              		Assert.assertEquals(v1.getValue(), v.getValue());
	}

	public void test_codec_null_1() throws Exception {
		V0 v = new V0();

		SerializeConfig mapping = new SerializeConfig();
		mapping.setAsmEnable(false);


            

Reported by PMD.

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

Line: 71

              
		V0 v1 = JSON.parseObject(text, V0.class);

		Assert.assertEquals(123, v1.getValue());
	}

	public static class V0 {

		private long value = 123L;

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/parser/deser/array/FieldIntArrayTest2.java
8 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

               * Created by wenshao on 11/01/2017.
 */
public class FieldIntArrayTest2 extends TestCase {
    public void test_intArray() throws Exception {
        Model model = JSON.parseObject("{\"value\":[1,null,3]}", Model.class);
        assertNotNull(model.value);
        assertEquals(3, model.value.length);
        assertEquals(1, model.value[0]);
        assertEquals(0, model.value[1]);

            

Reported by PMD.

Unit tests should not contain more than 1 assert(s).
Design

Line: 10

               * Created by wenshao on 11/01/2017.
 */
public class FieldIntArrayTest2 extends TestCase {
    public void test_intArray() throws Exception {
        Model model = JSON.parseObject("{\"value\":[1,null,3]}", Model.class);
        assertNotNull(model.value);
        assertEquals(3, model.value.length);
        assertEquals(1, model.value[0]);
        assertEquals(0, model.value[1]);

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 12

              public class FieldIntArrayTest2 extends TestCase {
    public void test_intArray() throws Exception {
        Model model = JSON.parseObject("{\"value\":[1,null,3]}", Model.class);
        assertNotNull(model.value);
        assertEquals(3, model.value.length);
        assertEquals(1, model.value[0]);
        assertEquals(0, model.value[1]);
        assertEquals(3, model.value[2]);
    }

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 13

                  public void test_intArray() throws Exception {
        Model model = JSON.parseObject("{\"value\":[1,null,3]}", Model.class);
        assertNotNull(model.value);
        assertEquals(3, model.value.length);
        assertEquals(1, model.value[0]);
        assertEquals(0, model.value[1]);
        assertEquals(3, model.value[2]);
    }


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 14

                      Model model = JSON.parseObject("{\"value\":[1,null,3]}", Model.class);
        assertNotNull(model.value);
        assertEquals(3, model.value.length);
        assertEquals(1, model.value[0]);
        assertEquals(0, model.value[1]);
        assertEquals(3, model.value[2]);
    }

    public static class Model {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 15

                      assertNotNull(model.value);
        assertEquals(3, model.value.length);
        assertEquals(1, model.value[0]);
        assertEquals(0, model.value[1]);
        assertEquals(3, model.value[2]);
    }

    public static class Model {
        public int[] value;

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 16

                      assertEquals(3, model.value.length);
        assertEquals(1, model.value[0]);
        assertEquals(0, model.value[1]);
        assertEquals(3, model.value[2]);
    }

    public static class Model {
        public int[] value;
    }

            

Reported by PMD.

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

Line: 20

                  }

    public static class Model {
        public int[] value;
    }
}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/parser/deser/array/FieldByteArrayTest.java
8 issues
Unit tests should not contain more than 1 assert(s).
Design

Line: 10

               * Created by wenshao on 11/01/2017.
 */
public class FieldByteArrayTest extends TestCase {
    public void test_intArray() throws Exception {
        Model model = JSON.parseObject("{\"value\":[1,null,3]}", Model.class);
        assertNotNull(model.value);
        assertEquals(3, model.value.length);
        assertEquals(1, model.value[0]);
        assertEquals(0, model.value[1]);

            

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 11/01/2017.
 */
public class FieldByteArrayTest extends TestCase {
    public void test_intArray() throws Exception {
        Model model = JSON.parseObject("{\"value\":[1,null,3]}", Model.class);
        assertNotNull(model.value);
        assertEquals(3, model.value.length);
        assertEquals(1, model.value[0]);
        assertEquals(0, model.value[1]);

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 12

              public class FieldByteArrayTest extends TestCase {
    public void test_intArray() throws Exception {
        Model model = JSON.parseObject("{\"value\":[1,null,3]}", Model.class);
        assertNotNull(model.value);
        assertEquals(3, model.value.length);
        assertEquals(1, model.value[0]);
        assertEquals(0, model.value[1]);
        assertEquals(3, model.value[2]);
    }

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 13

                  public void test_intArray() throws Exception {
        Model model = JSON.parseObject("{\"value\":[1,null,3]}", Model.class);
        assertNotNull(model.value);
        assertEquals(3, model.value.length);
        assertEquals(1, model.value[0]);
        assertEquals(0, model.value[1]);
        assertEquals(3, model.value[2]);
    }


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 14

                      Model model = JSON.parseObject("{\"value\":[1,null,3]}", Model.class);
        assertNotNull(model.value);
        assertEquals(3, model.value.length);
        assertEquals(1, model.value[0]);
        assertEquals(0, model.value[1]);
        assertEquals(3, model.value[2]);
    }

    public static class Model {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 15

                      assertNotNull(model.value);
        assertEquals(3, model.value.length);
        assertEquals(1, model.value[0]);
        assertEquals(0, model.value[1]);
        assertEquals(3, model.value[2]);
    }

    public static class Model {
        public byte[] value;

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 16

                      assertEquals(3, model.value.length);
        assertEquals(1, model.value[0]);
        assertEquals(0, model.value[1]);
        assertEquals(3, model.value[2]);
    }

    public static class Model {
        public byte[] value;
    }

            

Reported by PMD.

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

Line: 20

                  }

    public static class Model {
        public byte[] value;
    }
}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/util/Base64Test.java
8 issues
Unit tests should not contain more than 1 assert(s).
Design

Line: 7

              import junit.framework.TestCase;

public class Base64Test extends TestCase {
    public void test_base64() throws Exception {
        String str = "阿里巴巴網絡有限公司主要通過旗下三個交易市場協助世界各地數以百萬計的買家和供應商從事網上生意,包括:集中服務全球進出口商的國際交易市場(www.alibaba.com);集中國內貿易的中國交易市場(www.1688.com);以及在國際交易市場上的全球批發交易平台(www.aliexpress.com),為規模較小、需要小批量貨物快速付運的買家提供服務。更多>>";

        byte[] bytes = str.getBytes("UTF8");
        String base64Str = com.alibaba.json.test.Base64.encodeToString(bytes, 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: 7

              import junit.framework.TestCase;

public class Base64Test extends TestCase {
    public void test_base64() throws Exception {
        String str = "阿里巴巴網絡有限公司主要通過旗下三個交易市場協助世界各地數以百萬計的買家和供應商從事網上生意,包括:集中服務全球進出口商的國際交易市場(www.alibaba.com);集中國內貿易的中國交易市場(www.1688.com);以及在國際交易市場上的全球批發交易平台(www.aliexpress.com),為規模較小、需要小批量貨物快速付運的買家提供服務。更多>>";

        byte[] bytes = str.getBytes("UTF8");
        String base64Str = com.alibaba.json.test.Base64.encodeToString(bytes, false);


            

Reported by PMD.

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

Line: 10

                  public void test_base64() throws Exception {
        String str = "阿里巴巴網絡有限公司主要通過旗下三個交易市場協助世界各地數以百萬計的買家和供應商從事網上生意,包括:集中服務全球進出口商的國際交易市場(www.alibaba.com);集中國內貿易的中國交易市場(www.1688.com);以及在國際交易市場上的全球批發交易平台(www.aliexpress.com),為規模較小、需要小批量貨物快速付運的買家提供服務。更多>>";

        byte[] bytes = str.getBytes("UTF8");
        String base64Str = com.alibaba.json.test.Base64.encodeToString(bytes, false);

        {
            byte[] bytes2 = Base64.decodeFast(base64Str);
            assertEquals(str, new String(bytes2, "UTF8"));

            

Reported by PMD.

The String literal 'UTF8' appears 4 times in this file; the first occurrence is on line 10
Error

Line: 10

                  public void test_base64() throws Exception {
        String str = "阿里巴巴網絡有限公司主要通過旗下三個交易市場協助世界各地數以百萬計的買家和供應商從事網上生意,包括:集中服務全球進出口商的國際交易市場(www.alibaba.com);集中國內貿易的中國交易市場(www.1688.com);以及在國際交易市場上的全球批發交易平台(www.aliexpress.com),為規模較小、需要小批量貨物快速付運的買家提供服務。更多>>";

        byte[] bytes = str.getBytes("UTF8");
        String base64Str = com.alibaba.json.test.Base64.encodeToString(bytes, false);

        {
            byte[] bytes2 = Base64.decodeFast(base64Str);
            assertEquals(str, new String(bytes2, "UTF8"));

            

Reported by PMD.

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

Line: 11

                      String str = "阿里巴巴網絡有限公司主要通過旗下三個交易市場協助世界各地數以百萬計的買家和供應商從事網上生意,包括:集中服務全球進出口商的國際交易市場(www.alibaba.com);集中國內貿易的中國交易市場(www.1688.com);以及在國際交易市場上的全球批發交易平台(www.aliexpress.com),為規模較小、需要小批量貨物快速付運的買家提供服務。更多>>";

        byte[] bytes = str.getBytes("UTF8");
        String base64Str = com.alibaba.json.test.Base64.encodeToString(bytes, false);

        {
            byte[] bytes2 = Base64.decodeFast(base64Str);
            assertEquals(str, new String(bytes2, "UTF8"));
        }

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 15

              
        {
            byte[] bytes2 = Base64.decodeFast(base64Str);
            assertEquals(str, new String(bytes2, "UTF8"));
        }

        {
            byte[] bytes2 = Base64.decodeFast(base64Str, 0, base64Str.length());
            assertEquals(str, new String(bytes2, "UTF8"));

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 20

              
        {
            byte[] bytes2 = Base64.decodeFast(base64Str, 0, base64Str.length());
            assertEquals(str, new String(bytes2, "UTF8"));
        }

        {
            byte[] bytes2 = Base64.decodeFast(base64Str.toCharArray(), 0, base64Str.length());
            assertEquals(str, new String(bytes2, "UTF8"));

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 25

              
        {
            byte[] bytes2 = Base64.decodeFast(base64Str.toCharArray(), 0, base64Str.length());
            assertEquals(str, new String(bytes2, "UTF8"));
        }
    }
}

            

Reported by PMD.

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

    public void test_null() throws Exception {
        Entity value = JSON.parseObject("{value:null}", Entity.class);
        Assert.assertNull(value.getValue());
    }

    public void test_empty() throws Exception {

            

Reported by PMD.

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

Line: 15

              
    public void test_null() throws Exception {
        Entity value = JSON.parseObject("{value:null}", Entity.class);
        Assert.assertNull(value.getValue());
    }

    public void test_empty() throws Exception {
        Entity value = JSON.parseObject("{value:[]}", Entity.class);
        Assert.assertEquals(0, value.getValue().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: 18

                      Assert.assertNull(value.getValue());
    }

    public void test_empty() throws Exception {
        Entity value = JSON.parseObject("{value:[]}", Entity.class);
        Assert.assertEquals(0, value.getValue().size());
    }

    private static class Entity {

            

Reported by PMD.

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

Line: 20

              
    public void test_empty() throws Exception {
        Entity value = JSON.parseObject("{value:[]}", Entity.class);
        Assert.assertEquals(0, value.getValue().size());
    }

    private static class Entity {

        private TreeSet value;

            

Reported by PMD.

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

Line: 20

              
    public void test_empty() throws Exception {
        Entity value = JSON.parseObject("{value:[]}", Entity.class);
        Assert.assertEquals(0, value.getValue().size());
    }

    private static class Entity {

        private TreeSet value;

            

Reported by PMD.

Avoid using implementation types like 'TreeSet'; use the interface instead
Design

Line: 25

              
    private static class Entity {

        private TreeSet value;

        public TreeSet getValue() {
            return value;
        }


            

Reported by PMD.

Avoid using implementation types like 'TreeSet'; use the interface instead
Design

Line: 27

              
        private TreeSet value;

        public TreeSet getValue() {
            return value;
        }

        public void setValue(TreeSet value) {
            this.value = value;

            

Reported by PMD.

Avoid using implementation types like 'TreeSet'; use the interface instead
Design

Line: 31

                          return value;
        }

        public void setValue(TreeSet value) {
            this.value = value;
        }
    }
}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/parser/deser/array/FieldIntArrayTest_private.java
8 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

               * Created by wenshao on 11/01/2017.
 */
public class FieldIntArrayTest_private extends TestCase {
    public void test_intArray() throws Exception {
        Model model = JSON.parseObject("{\"value\":[1,2,3]}", Model.class);
        assertNotNull(model.value);
        assertEquals(3, model.value.length);
        assertEquals(1, model.value[0]);
        assertEquals(2, model.value[1]);

            

Reported by PMD.

Unit tests should not contain more than 1 assert(s).
Design

Line: 10

               * Created by wenshao on 11/01/2017.
 */
public class FieldIntArrayTest_private extends TestCase {
    public void test_intArray() throws Exception {
        Model model = JSON.parseObject("{\"value\":[1,2,3]}", Model.class);
        assertNotNull(model.value);
        assertEquals(3, model.value.length);
        assertEquals(1, model.value[0]);
        assertEquals(2, model.value[1]);

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 12

              public class FieldIntArrayTest_private extends TestCase {
    public void test_intArray() throws Exception {
        Model model = JSON.parseObject("{\"value\":[1,2,3]}", Model.class);
        assertNotNull(model.value);
        assertEquals(3, model.value.length);
        assertEquals(1, model.value[0]);
        assertEquals(2, model.value[1]);
        assertEquals(3, model.value[2]);
    }

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 13

                  public void test_intArray() throws Exception {
        Model model = JSON.parseObject("{\"value\":[1,2,3]}", Model.class);
        assertNotNull(model.value);
        assertEquals(3, model.value.length);
        assertEquals(1, model.value[0]);
        assertEquals(2, model.value[1]);
        assertEquals(3, model.value[2]);
    }


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 14

                      Model model = JSON.parseObject("{\"value\":[1,2,3]}", Model.class);
        assertNotNull(model.value);
        assertEquals(3, model.value.length);
        assertEquals(1, model.value[0]);
        assertEquals(2, model.value[1]);
        assertEquals(3, model.value[2]);
    }

    private static class Model {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 15

                      assertNotNull(model.value);
        assertEquals(3, model.value.length);
        assertEquals(1, model.value[0]);
        assertEquals(2, model.value[1]);
        assertEquals(3, model.value[2]);
    }

    private static class Model {
        public int[] value;

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 16

                      assertEquals(3, model.value.length);
        assertEquals(1, model.value[0]);
        assertEquals(2, model.value[1]);
        assertEquals(3, model.value[2]);
    }

    private static class Model {
        public int[] value;
    }

            

Reported by PMD.

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

Line: 20

                  }

    private static class Model {
        public int[] value;
    }
}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/issue_3000/Issue3031.java
8 issues
System.out.println is used
Design

Line: 9

              public class Issue3031 extends TestCase {
    public void test_for_issue() throws Exception {
        String str = "{\"success\":true,\"message\":null,\"data\":[{\"tblId\":78,\"partId\":104,\"values\":[\"p001\",\"q001\"],\"dbName\":\"db001\",\"tableName\":\"tbl001\",\"createTime\":1582293531,\"lastAccessTime\":1,\"sd\":{\"sdId\":182,\"cdId\":181,\"cols\":[{\"name\":\"col1\",\"type\":\"string\",\"comment\":null},{\"name\":\"col2\",\"type\":\"int\",\"comment\":\"col2\"},{\"name\":\"col3\",\"type\":\"boolean\",\"comment\":null}],\"location\":\"oss://temp/jianghu/db001/tbl001\",\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"compressed\":true,\"numBuckets\":2,\"serdeInfo\":{\"serdeId\":182,\"name\":null,\"serializationLib\":\"org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe\",\"parameters\":{\"field.delim\":\"\\t\",\"serialization.format\":\"\\t\"}},\"bucketCols\":[\"col1\"],\"sortCols\":[{\"col\":\"col1\",\"order\":0}],\"parameters\":{},\"skewedInfo\":{\"skewedColNames\":[\"col1\",\"col3\"],\"skewedColValues\":[[\"2\",\"1\"],[\"3\",\"2\"]],\"skewedColValueLocationMaps\":{}},\"storedAsSubDirectories\":false},\"parameters\":{\"totalSize\":\"0\",\"numRows\":\"-1\",\"rawDataSize\":\"-1\",\"COLUMN_STATS_ACCURATE\":\"false\",\"numFiles\":\"0\",\"transient_lastDdlTime\":\"1582293531\"},\"parametersSize\":6},{\"tblId\":78,\"partId\":105,\"values\":[\"p001\",\"q002\"],\"dbName\":\"db001\",\"tableName\":\"tbl001\",\"createTime\":1582293531,\"lastAccessTime\":1,\"sd\":{\"sdId\":183,\"cdId\":181,\"cols\":[{\"name\":\"col1\",\"type\":\"string\",\"comment\":null},{\"name\":\"col2\",\"type\":\"int\",\"comment\":\"col2\"},{\"name\":\"col3\",\"type\":\"boolean\",\"comment\":null}],\"location\":\"oss://temp/jianghu/db001/tbl001\",\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"compressed\":true,\"numBuckets\":2,\"serdeInfo\":{\"serdeId\":183,\"name\":null,\"serializationLib\":\"org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe\",\"parameters\":{\"field.delim\":\"\\t\",\"serialization.format\":\"\\t\"}},\"bucketCols\":[\"col1\"],\"sortCols\":[{\"col\":\"col1\",\"order\":0}],\"parameters\":{},\"skewedInfo\":{\"skewedColNames\":[\"col1\",\"col3\"],\"skewedColValues\":[[\"2\",\"1\"],[\"3\",\"2\"]],\"skewedColValueLocationMaps\":{}},\"storedAsSubDirectories\":false},\"parameters\":{\"totalSize\":\"0\",\"numRows\":\"-1\",\"rawDataSize\":\"-1\",\"COLUMN_STATS_ACCURATE\":\"false\",\"numFiles\":\"0\",\"transient_lastDdlTime\":\"1582293531\",\"$ref\":\"$[0].parameters\"},\"parametersSize\":7},{\"tblId\":78,\"partId\":106,\"values\":[\"p002\",\"q002\"],\"dbName\":\"db001\",\"tableName\":\"tbl001\",\"createTime\":1582293531,\"lastAccessTime\":1,\"sd\":{\"sdId\":184,\"cdId\":181,\"cols\":[{\"name\":\"col1\",\"type\":\"string\",\"comment\":null},{\"name\":\"col2\",\"type\":\"int\",\"comment\":\"col2\"},{\"name\":\"col3\",\"type\":\"boolean\",\"comment\":null}],\"location\":\"oss://temp/jianghu/db001/tbl001\",\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"compressed\":true,\"numBuckets\":2,\"serdeInfo\":{\"serdeId\":184,\"name\":null,\"serializationLib\":\"org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe\",\"parameters\":{\"field.delim\":\"\\t\",\"serialization.format\":\"\\t\"}},\"bucketCols\":[\"col1\"],\"sortCols\":[{\"col\":\"col1\",\"order\":0}],\"parameters\":{},\"skewedInfo\":{\"skewedColNames\":[\"col1\",\"col3\"],\"skewedColValues\":[[\"2\",\"1\"],[\"3\",\"2\"]],\"skewedColValueLocationMaps\":{}},\"storedAsSubDirectories\":false},\"parameters\":{\"totalSize\":\"0\",\"numRows\":\"-1\",\"rawDataSize\":\"-1\",\"COLUMN_STATS_ACCURATE\":\"false\",\"numFiles\":\"0\",\"transient_lastDdlTime\":\"1582293531\",\"$ref\":\"$[0].parameters\"},\"parametersSize\":7}]}";
        System.out.println(str);
        ResultData obj = JSON.parseObject(str, ResultData.class);
    }

    public static class ResultData
    {

            

Reported by PMD.

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

Line: 7

              import junit.framework.TestCase;

public class Issue3031 extends TestCase {
    public void test_for_issue() throws Exception {
        String str = "{\"success\":true,\"message\":null,\"data\":[{\"tblId\":78,\"partId\":104,\"values\":[\"p001\",\"q001\"],\"dbName\":\"db001\",\"tableName\":\"tbl001\",\"createTime\":1582293531,\"lastAccessTime\":1,\"sd\":{\"sdId\":182,\"cdId\":181,\"cols\":[{\"name\":\"col1\",\"type\":\"string\",\"comment\":null},{\"name\":\"col2\",\"type\":\"int\",\"comment\":\"col2\"},{\"name\":\"col3\",\"type\":\"boolean\",\"comment\":null}],\"location\":\"oss://temp/jianghu/db001/tbl001\",\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"compressed\":true,\"numBuckets\":2,\"serdeInfo\":{\"serdeId\":182,\"name\":null,\"serializationLib\":\"org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe\",\"parameters\":{\"field.delim\":\"\\t\",\"serialization.format\":\"\\t\"}},\"bucketCols\":[\"col1\"],\"sortCols\":[{\"col\":\"col1\",\"order\":0}],\"parameters\":{},\"skewedInfo\":{\"skewedColNames\":[\"col1\",\"col3\"],\"skewedColValues\":[[\"2\",\"1\"],[\"3\",\"2\"]],\"skewedColValueLocationMaps\":{}},\"storedAsSubDirectories\":false},\"parameters\":{\"totalSize\":\"0\",\"numRows\":\"-1\",\"rawDataSize\":\"-1\",\"COLUMN_STATS_ACCURATE\":\"false\",\"numFiles\":\"0\",\"transient_lastDdlTime\":\"1582293531\"},\"parametersSize\":6},{\"tblId\":78,\"partId\":105,\"values\":[\"p001\",\"q002\"],\"dbName\":\"db001\",\"tableName\":\"tbl001\",\"createTime\":1582293531,\"lastAccessTime\":1,\"sd\":{\"sdId\":183,\"cdId\":181,\"cols\":[{\"name\":\"col1\",\"type\":\"string\",\"comment\":null},{\"name\":\"col2\",\"type\":\"int\",\"comment\":\"col2\"},{\"name\":\"col3\",\"type\":\"boolean\",\"comment\":null}],\"location\":\"oss://temp/jianghu/db001/tbl001\",\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"compressed\":true,\"numBuckets\":2,\"serdeInfo\":{\"serdeId\":183,\"name\":null,\"serializationLib\":\"org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe\",\"parameters\":{\"field.delim\":\"\\t\",\"serialization.format\":\"\\t\"}},\"bucketCols\":[\"col1\"],\"sortCols\":[{\"col\":\"col1\",\"order\":0}],\"parameters\":{},\"skewedInfo\":{\"skewedColNames\":[\"col1\",\"col3\"],\"skewedColValues\":[[\"2\",\"1\"],[\"3\",\"2\"]],\"skewedColValueLocationMaps\":{}},\"storedAsSubDirectories\":false},\"parameters\":{\"totalSize\":\"0\",\"numRows\":\"-1\",\"rawDataSize\":\"-1\",\"COLUMN_STATS_ACCURATE\":\"false\",\"numFiles\":\"0\",\"transient_lastDdlTime\":\"1582293531\",\"$ref\":\"$[0].parameters\"},\"parametersSize\":7},{\"tblId\":78,\"partId\":106,\"values\":[\"p002\",\"q002\"],\"dbName\":\"db001\",\"tableName\":\"tbl001\",\"createTime\":1582293531,\"lastAccessTime\":1,\"sd\":{\"sdId\":184,\"cdId\":181,\"cols\":[{\"name\":\"col1\",\"type\":\"string\",\"comment\":null},{\"name\":\"col2\",\"type\":\"int\",\"comment\":\"col2\"},{\"name\":\"col3\",\"type\":\"boolean\",\"comment\":null}],\"location\":\"oss://temp/jianghu/db001/tbl001\",\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"compressed\":true,\"numBuckets\":2,\"serdeInfo\":{\"serdeId\":184,\"name\":null,\"serializationLib\":\"org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe\",\"parameters\":{\"field.delim\":\"\\t\",\"serialization.format\":\"\\t\"}},\"bucketCols\":[\"col1\"],\"sortCols\":[{\"col\":\"col1\",\"order\":0}],\"parameters\":{},\"skewedInfo\":{\"skewedColNames\":[\"col1\",\"col3\"],\"skewedColValues\":[[\"2\",\"1\"],[\"3\",\"2\"]],\"skewedColValueLocationMaps\":{}},\"storedAsSubDirectories\":false},\"parameters\":{\"totalSize\":\"0\",\"numRows\":\"-1\",\"rawDataSize\":\"-1\",\"COLUMN_STATS_ACCURATE\":\"false\",\"numFiles\":\"0\",\"transient_lastDdlTime\":\"1582293531\",\"$ref\":\"$[0].parameters\"},\"parametersSize\":7}]}";
        System.out.println(str);
        ResultData obj = JSON.parseObject(str, ResultData.class);
    }


            

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

              import junit.framework.TestCase;

public class Issue3031 extends TestCase {
    public void test_for_issue() throws Exception {
        String str = "{\"success\":true,\"message\":null,\"data\":[{\"tblId\":78,\"partId\":104,\"values\":[\"p001\",\"q001\"],\"dbName\":\"db001\",\"tableName\":\"tbl001\",\"createTime\":1582293531,\"lastAccessTime\":1,\"sd\":{\"sdId\":182,\"cdId\":181,\"cols\":[{\"name\":\"col1\",\"type\":\"string\",\"comment\":null},{\"name\":\"col2\",\"type\":\"int\",\"comment\":\"col2\"},{\"name\":\"col3\",\"type\":\"boolean\",\"comment\":null}],\"location\":\"oss://temp/jianghu/db001/tbl001\",\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"compressed\":true,\"numBuckets\":2,\"serdeInfo\":{\"serdeId\":182,\"name\":null,\"serializationLib\":\"org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe\",\"parameters\":{\"field.delim\":\"\\t\",\"serialization.format\":\"\\t\"}},\"bucketCols\":[\"col1\"],\"sortCols\":[{\"col\":\"col1\",\"order\":0}],\"parameters\":{},\"skewedInfo\":{\"skewedColNames\":[\"col1\",\"col3\"],\"skewedColValues\":[[\"2\",\"1\"],[\"3\",\"2\"]],\"skewedColValueLocationMaps\":{}},\"storedAsSubDirectories\":false},\"parameters\":{\"totalSize\":\"0\",\"numRows\":\"-1\",\"rawDataSize\":\"-1\",\"COLUMN_STATS_ACCURATE\":\"false\",\"numFiles\":\"0\",\"transient_lastDdlTime\":\"1582293531\"},\"parametersSize\":6},{\"tblId\":78,\"partId\":105,\"values\":[\"p001\",\"q002\"],\"dbName\":\"db001\",\"tableName\":\"tbl001\",\"createTime\":1582293531,\"lastAccessTime\":1,\"sd\":{\"sdId\":183,\"cdId\":181,\"cols\":[{\"name\":\"col1\",\"type\":\"string\",\"comment\":null},{\"name\":\"col2\",\"type\":\"int\",\"comment\":\"col2\"},{\"name\":\"col3\",\"type\":\"boolean\",\"comment\":null}],\"location\":\"oss://temp/jianghu/db001/tbl001\",\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"compressed\":true,\"numBuckets\":2,\"serdeInfo\":{\"serdeId\":183,\"name\":null,\"serializationLib\":\"org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe\",\"parameters\":{\"field.delim\":\"\\t\",\"serialization.format\":\"\\t\"}},\"bucketCols\":[\"col1\"],\"sortCols\":[{\"col\":\"col1\",\"order\":0}],\"parameters\":{},\"skewedInfo\":{\"skewedColNames\":[\"col1\",\"col3\"],\"skewedColValues\":[[\"2\",\"1\"],[\"3\",\"2\"]],\"skewedColValueLocationMaps\":{}},\"storedAsSubDirectories\":false},\"parameters\":{\"totalSize\":\"0\",\"numRows\":\"-1\",\"rawDataSize\":\"-1\",\"COLUMN_STATS_ACCURATE\":\"false\",\"numFiles\":\"0\",\"transient_lastDdlTime\":\"1582293531\",\"$ref\":\"$[0].parameters\"},\"parametersSize\":7},{\"tblId\":78,\"partId\":106,\"values\":[\"p002\",\"q002\"],\"dbName\":\"db001\",\"tableName\":\"tbl001\",\"createTime\":1582293531,\"lastAccessTime\":1,\"sd\":{\"sdId\":184,\"cdId\":181,\"cols\":[{\"name\":\"col1\",\"type\":\"string\",\"comment\":null},{\"name\":\"col2\",\"type\":\"int\",\"comment\":\"col2\"},{\"name\":\"col3\",\"type\":\"boolean\",\"comment\":null}],\"location\":\"oss://temp/jianghu/db001/tbl001\",\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"compressed\":true,\"numBuckets\":2,\"serdeInfo\":{\"serdeId\":184,\"name\":null,\"serializationLib\":\"org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe\",\"parameters\":{\"field.delim\":\"\\t\",\"serialization.format\":\"\\t\"}},\"bucketCols\":[\"col1\"],\"sortCols\":[{\"col\":\"col1\",\"order\":0}],\"parameters\":{},\"skewedInfo\":{\"skewedColNames\":[\"col1\",\"col3\"],\"skewedColValues\":[[\"2\",\"1\"],[\"3\",\"2\"]],\"skewedColValueLocationMaps\":{}},\"storedAsSubDirectories\":false},\"parameters\":{\"totalSize\":\"0\",\"numRows\":\"-1\",\"rawDataSize\":\"-1\",\"COLUMN_STATS_ACCURATE\":\"false\",\"numFiles\":\"0\",\"transient_lastDdlTime\":\"1582293531\",\"$ref\":\"$[0].parameters\"},\"parametersSize\":7}]}";
        System.out.println(str);
        ResultData obj = JSON.parseObject(str, ResultData.class);
    }


            

Reported by PMD.

Avoid unused local variables such as 'obj'.
Design

Line: 10

                  public void test_for_issue() throws Exception {
        String str = "{\"success\":true,\"message\":null,\"data\":[{\"tblId\":78,\"partId\":104,\"values\":[\"p001\",\"q001\"],\"dbName\":\"db001\",\"tableName\":\"tbl001\",\"createTime\":1582293531,\"lastAccessTime\":1,\"sd\":{\"sdId\":182,\"cdId\":181,\"cols\":[{\"name\":\"col1\",\"type\":\"string\",\"comment\":null},{\"name\":\"col2\",\"type\":\"int\",\"comment\":\"col2\"},{\"name\":\"col3\",\"type\":\"boolean\",\"comment\":null}],\"location\":\"oss://temp/jianghu/db001/tbl001\",\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"compressed\":true,\"numBuckets\":2,\"serdeInfo\":{\"serdeId\":182,\"name\":null,\"serializationLib\":\"org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe\",\"parameters\":{\"field.delim\":\"\\t\",\"serialization.format\":\"\\t\"}},\"bucketCols\":[\"col1\"],\"sortCols\":[{\"col\":\"col1\",\"order\":0}],\"parameters\":{},\"skewedInfo\":{\"skewedColNames\":[\"col1\",\"col3\"],\"skewedColValues\":[[\"2\",\"1\"],[\"3\",\"2\"]],\"skewedColValueLocationMaps\":{}},\"storedAsSubDirectories\":false},\"parameters\":{\"totalSize\":\"0\",\"numRows\":\"-1\",\"rawDataSize\":\"-1\",\"COLUMN_STATS_ACCURATE\":\"false\",\"numFiles\":\"0\",\"transient_lastDdlTime\":\"1582293531\"},\"parametersSize\":6},{\"tblId\":78,\"partId\":105,\"values\":[\"p001\",\"q002\"],\"dbName\":\"db001\",\"tableName\":\"tbl001\",\"createTime\":1582293531,\"lastAccessTime\":1,\"sd\":{\"sdId\":183,\"cdId\":181,\"cols\":[{\"name\":\"col1\",\"type\":\"string\",\"comment\":null},{\"name\":\"col2\",\"type\":\"int\",\"comment\":\"col2\"},{\"name\":\"col3\",\"type\":\"boolean\",\"comment\":null}],\"location\":\"oss://temp/jianghu/db001/tbl001\",\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"compressed\":true,\"numBuckets\":2,\"serdeInfo\":{\"serdeId\":183,\"name\":null,\"serializationLib\":\"org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe\",\"parameters\":{\"field.delim\":\"\\t\",\"serialization.format\":\"\\t\"}},\"bucketCols\":[\"col1\"],\"sortCols\":[{\"col\":\"col1\",\"order\":0}],\"parameters\":{},\"skewedInfo\":{\"skewedColNames\":[\"col1\",\"col3\"],\"skewedColValues\":[[\"2\",\"1\"],[\"3\",\"2\"]],\"skewedColValueLocationMaps\":{}},\"storedAsSubDirectories\":false},\"parameters\":{\"totalSize\":\"0\",\"numRows\":\"-1\",\"rawDataSize\":\"-1\",\"COLUMN_STATS_ACCURATE\":\"false\",\"numFiles\":\"0\",\"transient_lastDdlTime\":\"1582293531\",\"$ref\":\"$[0].parameters\"},\"parametersSize\":7},{\"tblId\":78,\"partId\":106,\"values\":[\"p002\",\"q002\"],\"dbName\":\"db001\",\"tableName\":\"tbl001\",\"createTime\":1582293531,\"lastAccessTime\":1,\"sd\":{\"sdId\":184,\"cdId\":181,\"cols\":[{\"name\":\"col1\",\"type\":\"string\",\"comment\":null},{\"name\":\"col2\",\"type\":\"int\",\"comment\":\"col2\"},{\"name\":\"col3\",\"type\":\"boolean\",\"comment\":null}],\"location\":\"oss://temp/jianghu/db001/tbl001\",\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"compressed\":true,\"numBuckets\":2,\"serdeInfo\":{\"serdeId\":184,\"name\":null,\"serializationLib\":\"org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe\",\"parameters\":{\"field.delim\":\"\\t\",\"serialization.format\":\"\\t\"}},\"bucketCols\":[\"col1\"],\"sortCols\":[{\"col\":\"col1\",\"order\":0}],\"parameters\":{},\"skewedInfo\":{\"skewedColNames\":[\"col1\",\"col3\"],\"skewedColValues\":[[\"2\",\"1\"],[\"3\",\"2\"]],\"skewedColValueLocationMaps\":{}},\"storedAsSubDirectories\":false},\"parameters\":{\"totalSize\":\"0\",\"numRows\":\"-1\",\"rawDataSize\":\"-1\",\"COLUMN_STATS_ACCURATE\":\"false\",\"numFiles\":\"0\",\"transient_lastDdlTime\":\"1582293531\",\"$ref\":\"$[0].parameters\"},\"parametersSize\":7}]}";
        System.out.println(str);
        ResultData obj = JSON.parseObject(str, ResultData.class);
    }

    public static class ResultData
    {
        private boolean success;

            

Reported by PMD.

Avoid unused private fields such as 'success'.
Design

Line: 15

              
    public static class ResultData
    {
        private boolean success;
        private String message;
        private Object data;
    }
}

            

Reported by PMD.

Avoid unused private fields such as 'message'.
Design

Line: 16

                  public static class ResultData
    {
        private boolean success;
        private String message;
        private Object data;
    }
}

            

Reported by PMD.

Avoid unused private fields such as 'data'.
Design

Line: 17

                  {
        private boolean success;
        private String message;
        private Object data;
    }
}

            

Reported by PMD.

Found 'DU'-anomaly for variable 'obj' (lines '10'-'11').
Error

Line: 10

                  public void test_for_issue() throws Exception {
        String str = "{\"success\":true,\"message\":null,\"data\":[{\"tblId\":78,\"partId\":104,\"values\":[\"p001\",\"q001\"],\"dbName\":\"db001\",\"tableName\":\"tbl001\",\"createTime\":1582293531,\"lastAccessTime\":1,\"sd\":{\"sdId\":182,\"cdId\":181,\"cols\":[{\"name\":\"col1\",\"type\":\"string\",\"comment\":null},{\"name\":\"col2\",\"type\":\"int\",\"comment\":\"col2\"},{\"name\":\"col3\",\"type\":\"boolean\",\"comment\":null}],\"location\":\"oss://temp/jianghu/db001/tbl001\",\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"compressed\":true,\"numBuckets\":2,\"serdeInfo\":{\"serdeId\":182,\"name\":null,\"serializationLib\":\"org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe\",\"parameters\":{\"field.delim\":\"\\t\",\"serialization.format\":\"\\t\"}},\"bucketCols\":[\"col1\"],\"sortCols\":[{\"col\":\"col1\",\"order\":0}],\"parameters\":{},\"skewedInfo\":{\"skewedColNames\":[\"col1\",\"col3\"],\"skewedColValues\":[[\"2\",\"1\"],[\"3\",\"2\"]],\"skewedColValueLocationMaps\":{}},\"storedAsSubDirectories\":false},\"parameters\":{\"totalSize\":\"0\",\"numRows\":\"-1\",\"rawDataSize\":\"-1\",\"COLUMN_STATS_ACCURATE\":\"false\",\"numFiles\":\"0\",\"transient_lastDdlTime\":\"1582293531\"},\"parametersSize\":6},{\"tblId\":78,\"partId\":105,\"values\":[\"p001\",\"q002\"],\"dbName\":\"db001\",\"tableName\":\"tbl001\",\"createTime\":1582293531,\"lastAccessTime\":1,\"sd\":{\"sdId\":183,\"cdId\":181,\"cols\":[{\"name\":\"col1\",\"type\":\"string\",\"comment\":null},{\"name\":\"col2\",\"type\":\"int\",\"comment\":\"col2\"},{\"name\":\"col3\",\"type\":\"boolean\",\"comment\":null}],\"location\":\"oss://temp/jianghu/db001/tbl001\",\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"compressed\":true,\"numBuckets\":2,\"serdeInfo\":{\"serdeId\":183,\"name\":null,\"serializationLib\":\"org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe\",\"parameters\":{\"field.delim\":\"\\t\",\"serialization.format\":\"\\t\"}},\"bucketCols\":[\"col1\"],\"sortCols\":[{\"col\":\"col1\",\"order\":0}],\"parameters\":{},\"skewedInfo\":{\"skewedColNames\":[\"col1\",\"col3\"],\"skewedColValues\":[[\"2\",\"1\"],[\"3\",\"2\"]],\"skewedColValueLocationMaps\":{}},\"storedAsSubDirectories\":false},\"parameters\":{\"totalSize\":\"0\",\"numRows\":\"-1\",\"rawDataSize\":\"-1\",\"COLUMN_STATS_ACCURATE\":\"false\",\"numFiles\":\"0\",\"transient_lastDdlTime\":\"1582293531\",\"$ref\":\"$[0].parameters\"},\"parametersSize\":7},{\"tblId\":78,\"partId\":106,\"values\":[\"p002\",\"q002\"],\"dbName\":\"db001\",\"tableName\":\"tbl001\",\"createTime\":1582293531,\"lastAccessTime\":1,\"sd\":{\"sdId\":184,\"cdId\":181,\"cols\":[{\"name\":\"col1\",\"type\":\"string\",\"comment\":null},{\"name\":\"col2\",\"type\":\"int\",\"comment\":\"col2\"},{\"name\":\"col3\",\"type\":\"boolean\",\"comment\":null}],\"location\":\"oss://temp/jianghu/db001/tbl001\",\"inputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat\",\"outputFormat\":\"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\",\"compressed\":true,\"numBuckets\":2,\"serdeInfo\":{\"serdeId\":184,\"name\":null,\"serializationLib\":\"org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe\",\"parameters\":{\"field.delim\":\"\\t\",\"serialization.format\":\"\\t\"}},\"bucketCols\":[\"col1\"],\"sortCols\":[{\"col\":\"col1\",\"order\":0}],\"parameters\":{},\"skewedInfo\":{\"skewedColNames\":[\"col1\",\"col3\"],\"skewedColValues\":[[\"2\",\"1\"],[\"3\",\"2\"]],\"skewedColValueLocationMaps\":{}},\"storedAsSubDirectories\":false},\"parameters\":{\"totalSize\":\"0\",\"numRows\":\"-1\",\"rawDataSize\":\"-1\",\"COLUMN_STATS_ACCURATE\":\"false\",\"numFiles\":\"0\",\"transient_lastDdlTime\":\"1582293531\",\"$ref\":\"$[0].parameters\"},\"parametersSize\":7}]}";
        System.out.println(str);
        ResultData obj = JSON.parseObject(str, ResultData.class);
    }

    public static class ResultData
    {
        private boolean success;

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/issue_1600/Issue1603_map.java
8 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 java.util.*;

public class Issue1603_map extends TestCase {
    public void test_emptyMap() throws Exception {
        Model_1 m = JSON.parseObject("{\"values\":{\"a\":1001}}", Model_1.class);
        assertEquals(0, m.values.size());
    }

    public void test_unmodifiableMap() throws Exception {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 11

              public class Issue1603_map extends TestCase {
    public void test_emptyMap() throws Exception {
        Model_1 m = JSON.parseObject("{\"values\":{\"a\":1001}}", Model_1.class);
        assertEquals(0, m.values.size());
    }

    public void test_unmodifiableMap() throws Exception {
        Model_2 m = JSON.parseObject("{\"values\":{\"a\":1001}}", Model_2.class);
        assertEquals(0, m.values.size());

            

Reported by PMD.

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

Line: 11

              public class Issue1603_map extends TestCase {
    public void test_emptyMap() throws Exception {
        Model_1 m = JSON.parseObject("{\"values\":{\"a\":1001}}", Model_1.class);
        assertEquals(0, m.values.size());
    }

    public void test_unmodifiableMap() throws Exception {
        Model_2 m = JSON.parseObject("{\"values\":{\"a\":1001}}", Model_2.class);
        assertEquals(0, m.values.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: 14

                      assertEquals(0, m.values.size());
    }

    public void test_unmodifiableMap() throws Exception {
        Model_2 m = JSON.parseObject("{\"values\":{\"a\":1001}}", Model_2.class);
        assertEquals(0, m.values.size());
    }

    public static class Model_1 {

            

Reported by PMD.

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

Line: 16

              
    public void test_unmodifiableMap() throws Exception {
        Model_2 m = JSON.parseObject("{\"values\":{\"a\":1001}}", Model_2.class);
        assertEquals(0, m.values.size());
    }

    public static class Model_1 {
        public final Map<String, Object> values = Collections.emptyMap();
    }

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 16

              
    public void test_unmodifiableMap() throws Exception {
        Model_2 m = JSON.parseObject("{\"values\":{\"a\":1001}}", Model_2.class);
        assertEquals(0, m.values.size());
    }

    public static class Model_1 {
        public final Map<String, Object> values = Collections.emptyMap();
    }

            

Reported by PMD.

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

Line: 20

                  }

    public static class Model_1 {
        public final Map<String, Object> values = Collections.emptyMap();
    }

    public static class Model_2 {
        public final Map<String, Object> values = Collections.unmodifiableMap(new HashMap<String, Object>());
    }

            

Reported by PMD.

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

Line: 24

                  }

    public static class Model_2 {
        public final Map<String, Object> values = Collections.unmodifiableMap(new HashMap<String, Object>());
    }

}

            

Reported by PMD.

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

    public void test_min() throws Exception {
        V0 v = new V0();
        v.setValue(Long.MIN_VALUE);

        String text = JSON.toJSONString(v);


            

Reported by PMD.

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

Line: 24

              
        JSONReader reader = new JSONReader(new StringReader(text));
        V0 v1 = reader.readObject(V0.class);
        Assert.assertEquals(v1.getValue(), v.getValue());
        reader.close();
    }
    
    public void test_max() throws Exception {
        V0 v = new V0();

            

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

                      reader.close();
    }
    
    public void test_max() throws Exception {
        V0 v = new V0();
        v.setValue(Long.MIN_VALUE);

        String text = JSON.toJSONString(v);


            

Reported by PMD.

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

Line: 37

                      JSONReader reader = new JSONReader(new StringReader(text));
        V0 v1 = reader.readObject(V0.class);

        Assert.assertEquals(v1.getValue(), v.getValue());
    }
    
    public void test_min_array() throws Exception {
        V0 v = new V0();
        v.setValue(Long.MIN_VALUE);

            

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

                      Assert.assertEquals(v1.getValue(), v.getValue());
    }
    
    public void test_min_array() throws Exception {
        V0 v = new V0();
        v.setValue(Long.MIN_VALUE);

        String text = JSON.toJSONString(v, SerializerFeature.BeanToArray);


            

Reported by PMD.

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

Line: 49

                      JSONReader reader = new JSONReader(new StringReader(text), Feature.SupportArrayToBean);
        V0 v1 = reader.readObject(V0.class);

        Assert.assertEquals(v1.getValue(), v.getValue());
    }
    
    public void test_max_array() throws Exception {
        V0 v = new V0();
        v.setValue(Long.MIN_VALUE);

            

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

                      Assert.assertEquals(v1.getValue(), v.getValue());
    }
    
    public void test_max_array() throws Exception {
        V0 v = new V0();
        v.setValue(Long.MIN_VALUE);

        String text = JSON.toJSONString(v, SerializerFeature.BeanToArray);


            

Reported by PMD.

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

Line: 61

                      JSONReader reader = new JSONReader(new StringReader(text), Feature.SupportArrayToBean);
        V0 v1 = reader.readObject(V0.class);

        Assert.assertEquals(v.getValue(), v1.getValue());
    }

    public static class V0 {

        private Long value;

            

Reported by PMD.

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

    public void test_min() throws Exception {
        V0 v = new V0();
        v.setValue(Long.MIN_VALUE);

        String text = JSON.toJSONString(v);


            

Reported by PMD.

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

Line: 22

              
        V0 v1 = JSON.parseObject(text, V0.class);

        Assert.assertEquals(v1.getValue(), v.getValue());
    }
    
    public void test_max() throws Exception {
        V0 v = new V0();
        v.setValue(Long.MIN_VALUE);

            

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

                      Assert.assertEquals(v1.getValue(), v.getValue());
    }
    
    public void test_max() throws Exception {
        V0 v = new V0();
        v.setValue(Long.MIN_VALUE);

        String text = JSON.toJSONString(v);


            

Reported by PMD.

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

Line: 33

              
        V0 v1 = JSON.parseObject(text, V0.class);

        Assert.assertEquals(v1.getValue(), v.getValue());
    }
    
    public void test_min_array() throws Exception {
        V0 v = new V0();
        v.setValue(Long.MIN_VALUE);

            

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

                      Assert.assertEquals(v1.getValue(), v.getValue());
    }
    
    public void test_min_array() throws Exception {
        V0 v = new V0();
        v.setValue(Long.MIN_VALUE);

        String text = JSON.toJSONString(v, SerializerFeature.BeanToArray);


            

Reported by PMD.

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

Line: 44

              
        V0 v1 = JSON.parseObject(text, V0.class, Feature.SupportArrayToBean);

        Assert.assertEquals(v1.getValue(), v.getValue());
    }
    
    public void test_max_array() throws Exception {
        V0 v = new V0();
        v.setValue(Long.MIN_VALUE);

            

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

                      Assert.assertEquals(v1.getValue(), v.getValue());
    }
    
    public void test_max_array() throws Exception {
        V0 v = new V0();
        v.setValue(Long.MIN_VALUE);

        String text = JSON.toJSONString(v, SerializerFeature.BeanToArray);


            

Reported by PMD.

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

Line: 55

              
        V0 v1 = JSON.parseObject(text, V0.class, Feature.SupportArrayToBean);

        Assert.assertEquals(v1.getValue(), v.getValue());
    }

    private static class V0 {

        private Long value;

            

Reported by PMD.