The following issues were found

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/array/FieldIntArrayTest.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 FieldIntArrayTest 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 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 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 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]);
    }

    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(2, 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(2, 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/FieldFloatArrayTest2.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 FieldFloatArrayTest2 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.0f, model.value[0]);
        assertEquals(0.0f, 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 FieldFloatArrayTest2 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.0f, model.value[0]);
        assertEquals(0.0f, model.value[1]);

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 12

              public class FieldFloatArrayTest2 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.0f, model.value[0]);
        assertEquals(0.0f, model.value[1]);
        assertEquals(3.0f, 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.0f, model.value[0]);
        assertEquals(0.0f, model.value[1]);
        assertEquals(3.0f, 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.0f, model.value[0]);
        assertEquals(0.0f, model.value[1]);
        assertEquals(3.0f, 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.0f, model.value[0]);
        assertEquals(0.0f, model.value[1]);
        assertEquals(3.0f, model.value[2]);
    }

    public static class Model {
        public float[] value;

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 16

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

    public static class Model {
        public float[] 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 float[] value;
    }
}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/parser/deser/array/FieldFloatArrayTest.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 FieldFloatArrayTest extends TestCase {
    public void test_intArray() throws Exception {
        Model model = JSON.parseObject("{\"value\":[1,2.1,-0.3]}", Model.class);
        assertNotNull(model.value);
        assertEquals(3, model.value.length);
        assertEquals(1f, model.value[0]);
        assertEquals(2.1f, 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 FieldFloatArrayTest extends TestCase {
    public void test_intArray() throws Exception {
        Model model = JSON.parseObject("{\"value\":[1,2.1,-0.3]}", Model.class);
        assertNotNull(model.value);
        assertEquals(3, model.value.length);
        assertEquals(1f, model.value[0]);
        assertEquals(2.1f, model.value[1]);

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 12

              public class FieldFloatArrayTest extends TestCase {
    public void test_intArray() throws Exception {
        Model model = JSON.parseObject("{\"value\":[1,2.1,-0.3]}", Model.class);
        assertNotNull(model.value);
        assertEquals(3, model.value.length);
        assertEquals(1f, model.value[0]);
        assertEquals(2.1f, model.value[1]);
        assertEquals(-0.3f, 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.1,-0.3]}", Model.class);
        assertNotNull(model.value);
        assertEquals(3, model.value.length);
        assertEquals(1f, model.value[0]);
        assertEquals(2.1f, model.value[1]);
        assertEquals(-0.3f, model.value[2]);
    }


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 14

                      Model model = JSON.parseObject("{\"value\":[1,2.1,-0.3]}", Model.class);
        assertNotNull(model.value);
        assertEquals(3, model.value.length);
        assertEquals(1f, model.value[0]);
        assertEquals(2.1f, model.value[1]);
        assertEquals(-0.3f, 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(1f, model.value[0]);
        assertEquals(2.1f, model.value[1]);
        assertEquals(-0.3f, model.value[2]);
    }

    public static class Model {
        public float[] value;

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 16

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

    public static class Model {
        public float[] 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 float[] value;
    }
}

            

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/FieldDoubleArrayTest.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 FieldDoubleArrayTest 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.0D, model.value[0]);
        assertEquals(0.0D, 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 FieldDoubleArrayTest 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.0D, model.value[0]);
        assertEquals(0.0D, model.value[1]);

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 12

              public class FieldDoubleArrayTest 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.0D, model.value[0]);
        assertEquals(0.0D, model.value[1]);
        assertEquals(3.0D, 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.0D, model.value[0]);
        assertEquals(0.0D, model.value[1]);
        assertEquals(3.0D, 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.0D, model.value[0]);
        assertEquals(0.0D, model.value[1]);
        assertEquals(3.0D, 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.0D, model.value[0]);
        assertEquals(0.0D, model.value[1]);
        assertEquals(3.0D, model.value[2]);
    }

    public static class Model {
        public double[] value;

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 16

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

    public static class Model {
        public double[] 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 double[] 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/typeRef/TypeReferenceTest13.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: 12

               * Created by wenshao on 09/02/2017.
 */
public class TypeReferenceTest13 extends TestCase {
    public void test_typeRef() throws Exception {
        String json = "{\"result\":{}}";
        for (int i = 0; i < 100; ++i) {
            {
                SearchResult<ResultItem, CountFacet> searchResult = parseSearchResult(
                        json, ResultItem.class, CountFacet.class);

            

Reported by PMD.

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

Line: 12

               * Created by wenshao on 09/02/2017.
 */
public class TypeReferenceTest13 extends TestCase {
    public void test_typeRef() throws Exception {
        String json = "{\"result\":{}}";
        for (int i = 0; i < 100; ++i) {
            {
                SearchResult<ResultItem, CountFacet> searchResult = parseSearchResult(
                        json, ResultItem.class, CountFacet.class);

            

Reported by PMD.

Avoid unused local variables such as 'searchResult'.
Design

Line: 16

                      String json = "{\"result\":{}}";
        for (int i = 0; i < 100; ++i) {
            {
                SearchResult<ResultItem, CountFacet> searchResult = parseSearchResult(
                        json, ResultItem.class, CountFacet.class);
            }
            {
                SearchResult<ResultItem1, CountFacet1> searchResult = parseSearchResult(
                        json, ResultItem1.class, CountFacet1.class);

            

Reported by PMD.

Avoid unused local variables such as 'searchResult'.
Design

Line: 20

                                      json, ResultItem.class, CountFacet.class);
            }
            {
                SearchResult<ResultItem1, CountFacet1> searchResult = parseSearchResult(
                        json, ResultItem1.class, CountFacet1.class);
            }
        }
    }


            

Reported by PMD.

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

Line: 50

              
    }

    public static class SearchResult<I, F> extends BaseResult {

        /**
         * 大的结果对象,包含结果数据、耗时、数量统计等信息
         */
        @JSONField(name = "result")

            

Reported by PMD.

Found 'DU'-anomaly for variable 'json' (lines '13'-'24').
Error

Line: 13

               */
public class TypeReferenceTest13 extends TestCase {
    public void test_typeRef() throws Exception {
        String json = "{\"result\":{}}";
        for (int i = 0; i < 100; ++i) {
            {
                SearchResult<ResultItem, CountFacet> searchResult = parseSearchResult(
                        json, ResultItem.class, CountFacet.class);
            }

            

Reported by PMD.

Found 'DU'-anomaly for variable 'searchResult' (lines '16'-'24').
Error

Line: 16

                      String json = "{\"result\":{}}";
        for (int i = 0; i < 100; ++i) {
            {
                SearchResult<ResultItem, CountFacet> searchResult = parseSearchResult(
                        json, ResultItem.class, CountFacet.class);
            }
            {
                SearchResult<ResultItem1, CountFacet1> searchResult = parseSearchResult(
                        json, ResultItem1.class, CountFacet1.class);

            

Reported by PMD.

Found 'DD'-anomaly for variable 'searchResult' (lines '16'-'16').
Error

Line: 16

                      String json = "{\"result\":{}}";
        for (int i = 0; i < 100; ++i) {
            {
                SearchResult<ResultItem, CountFacet> searchResult = parseSearchResult(
                        json, ResultItem.class, CountFacet.class);
            }
            {
                SearchResult<ResultItem1, CountFacet1> searchResult = parseSearchResult(
                        json, ResultItem1.class, CountFacet1.class);

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/issue_1500/Issue1558.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: 11

              import java.io.Serializable;

public class Issue1558 extends TestCase {
    public void test_for_issue() throws Exception {
        ParserConfig config = new ParserConfig();
        config.setAutoTypeSupport(true);
        String text = "{\"id\": \"439a3213-e734-4bf3-9870-2c471f43d651\", \"instance\": \"v1\", \"interface\": \"com.xxx.aplan.UICommands\", \"method\": \"start\", \"params\": [\"tony\"], \"@type\": \"com.alibaba.json.bvt.issue_1500.Issue1558$Request\"}";

        JSON.parseObject(text, Request.class, config);

            

Reported by PMD.

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

Line: 11

              import java.io.Serializable;

public class Issue1558 extends TestCase {
    public void test_for_issue() throws Exception {
        ParserConfig config = new ParserConfig();
        config.setAutoTypeSupport(true);
        String text = "{\"id\": \"439a3213-e734-4bf3-9870-2c471f43d651\", \"instance\": \"v1\", \"interface\": \"com.xxx.aplan.UICommands\", \"method\": \"start\", \"params\": [\"tony\"], \"@type\": \"com.alibaba.json.bvt.issue_1500.Issue1558$Request\"}";

        JSON.parseObject(text, Request.class, config);

            

Reported by PMD.

Classes implementing Serializable should set a serialVersionUID
Error

Line: 20

                  }

    @JSONType
    public static class Request implements Serializable {
        private String id;
        private String instance;
        private String _interface;
        private String method;
        private Object[] params;

            

Reported by PMD.

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

Line: 20

                  }

    @JSONType
    public static class Request implements Serializable {
        private String id;
        private String instance;
        private String _interface;
        private String method;
        private Object[] params;

            

Reported by PMD.

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

Line: 23

                  public static class Request implements Serializable {
        private String id;
        private String instance;
        private String _interface;
        private String method;
        private Object[] params;
        public String getId() {
            return id;
        }

            

Reported by PMD.

Returning 'params' may expose an internal array.
Design

Line: 51

                          this.method = method;
        }
        public Object[] getParams() {
            return params;
        }
        public void setParams(Object[] params) {
            this.params = params;
        }
    }

            

Reported by PMD.

The user-supplied array 'params' is stored directly.
Design

Line: 53

                      public Object[] getParams() {
            return params;
        }
        public void setParams(Object[] params) {
            this.params = params;
        }
    }
}

            

Reported by PMD.

Consider using varargs for methods or constructors which take an array the last parameter.
Design

Line: 53

                      public Object[] getParams() {
            return params;
        }
        public void setParams(Object[] params) {
            this.params = params;
        }
    }
}

            

Reported by PMD.

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

Line: 14

               */
public class TypeReferenceTest12 extends TestCase {

    public void test_same() throws Exception {
        ParameterizedType type1 = getType(Integer.class);
        ParameterizedType type2 = getType();

        assertEquals(type1.getRawType(), type2.getRawType());
        assertSame(type1.getRawType(), type2.getRawType());

            

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

    public void test_same() throws Exception {
        ParameterizedType type1 = getType(Integer.class);
        ParameterizedType type2 = getType();

        assertEquals(type1.getRawType(), type2.getRawType());
        assertSame(type1.getRawType(), type2.getRawType());

            

Reported by PMD.

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

Line: 18

                      ParameterizedType type1 = getType(Integer.class);
        ParameterizedType type2 = getType();

        assertEquals(type1.getRawType(), type2.getRawType());
        assertSame(type1.getRawType(), type2.getRawType());
    }

    <T> ParameterizedType getType(Type type) {
        return (ParameterizedType)new TypeReference<Model<T>>(type) {}.getType();

            

Reported by PMD.

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

Line: 18

                      ParameterizedType type1 = getType(Integer.class);
        ParameterizedType type2 = getType();

        assertEquals(type1.getRawType(), type2.getRawType());
        assertSame(type1.getRawType(), type2.getRawType());
    }

    <T> ParameterizedType getType(Type type) {
        return (ParameterizedType)new TypeReference<Model<T>>(type) {}.getType();

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 18

                      ParameterizedType type1 = getType(Integer.class);
        ParameterizedType type2 = getType();

        assertEquals(type1.getRawType(), type2.getRawType());
        assertSame(type1.getRawType(), type2.getRawType());
    }

    <T> ParameterizedType getType(Type type) {
        return (ParameterizedType)new TypeReference<Model<T>>(type) {}.getType();

            

Reported by PMD.

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

Line: 19

                      ParameterizedType type2 = getType();

        assertEquals(type1.getRawType(), type2.getRawType());
        assertSame(type1.getRawType(), type2.getRawType());
    }

    <T> ParameterizedType getType(Type type) {
        return (ParameterizedType)new TypeReference<Model<T>>(type) {}.getType();
    }

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 19

                      ParameterizedType type2 = getType();

        assertEquals(type1.getRawType(), type2.getRawType());
        assertSame(type1.getRawType(), type2.getRawType());
    }

    <T> ParameterizedType getType(Type type) {
        return (ParameterizedType)new TypeReference<Model<T>>(type) {}.getType();
    }

            

Reported by PMD.

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

Line: 19

                      ParameterizedType type2 = getType();

        assertEquals(type1.getRawType(), type2.getRawType());
        assertSame(type1.getRawType(), type2.getRawType());
    }

    <T> ParameterizedType getType(Type type) {
        return (ParameterizedType)new TypeReference<Model<T>>(type) {}.getType();
    }

            

Reported by PMD.