The following issues were found

src/test/java/com/alibaba/json/bvt/ChineseSpaceTest.java
7 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 15

               * Created by wenshao on 2016/10/14.
 */
public class ChineseSpaceTest extends TestCase {
    public void test_for_chinese_space() throws Exception {
        Map<String, String> map = Collections.singletonMap("v", " ");
        String json = JSON.toJSONString(map);
        assertEquals("{\"v\":\" \"}", json);

        JSONObject jsonObject = JSON.parseObject(json);

            

Reported by PMD.

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

Line: 15

               * Created by wenshao on 2016/10/14.
 */
public class ChineseSpaceTest extends TestCase {
    public void test_for_chinese_space() throws Exception {
        Map<String, String> map = Collections.singletonMap("v", " ");
        String json = JSON.toJSONString(map);
        assertEquals("{\"v\":\" \"}", json);

        JSONObject jsonObject = JSON.parseObject(json);

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 18

                  public void test_for_chinese_space() throws Exception {
        Map<String, String> map = Collections.singletonMap("v", " ");
        String json = JSON.toJSONString(map);
        assertEquals("{\"v\":\" \"}", json);

        JSONObject jsonObject = JSON.parseObject(json);
        assertEquals(map.get("v"), jsonObject.get("v"));
    }
}

            

Reported by PMD.

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

Line: 21

                      assertEquals("{\"v\":\" \"}", json);

        JSONObject jsonObject = JSON.parseObject(json);
        assertEquals(map.get("v"), jsonObject.get("v"));
    }
}

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 21

                      assertEquals("{\"v\":\" \"}", json);

        JSONObject jsonObject = JSON.parseObject(json);
        assertEquals(map.get("v"), jsonObject.get("v"));
    }
}

            

Reported by PMD.

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

Line: 21

                      assertEquals("{\"v\":\" \"}", json);

        JSONObject jsonObject = JSON.parseObject(json);
        assertEquals(map.get("v"), jsonObject.get("v"));
    }
}

            

Reported by PMD.

Avoid unused imports such as 'java.util.HashMap'
Design

Line: 8

              import junit.framework.TestCase;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by wenshao on 2016/10/14.
 */

            

Reported by PMD.

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

    public void test_for_issue() throws Exception {
        Def def = new Def();
        def.add(new User());
        String defStr = JSON.toJSONString(def);

        Assert.assertEquals("[{}]", defStr);

            

Reported by PMD.

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

Line: 22

                      Assert.assertEquals("[{}]", defStr);
        
        Def _def = JSON.parseObject(defStr, Def.class);
        Assert.assertEquals(User.class, _def.get(0).getClass());
    }
    
    public void test_for_issue_1() throws Exception {
        Def def = new Def();
        def.add(new User());

            

Reported by PMD.

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

Line: 22

                      Assert.assertEquals("[{}]", defStr);
        
        Def _def = JSON.parseObject(defStr, Def.class);
        Assert.assertEquals(User.class, _def.get(0).getClass());
    }
    
    public void test_for_issue_1() throws Exception {
        Def def = new Def();
        def.add(new User());

            

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(User.class, _def.get(0).getClass());
    }
    
    public void test_for_issue_1() throws Exception {
        Def def = new Def();
        def.add(new User());
        String defStr = JSON.toJSONString(def);

        Assert.assertEquals("[{}]", defStr);

            

Reported by PMD.

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

Line: 33

                      Assert.assertEquals("[{}]", defStr);
        
        Def _def = JSON.parseObject(defStr, new TypeReference<Def>() {});
        Assert.assertEquals(User.class, _def.get(0).getClass());
    }

    public static class User {

        String name;

            

Reported by PMD.

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

Line: 36

                      Assert.assertEquals(User.class, _def.get(0).getClass());
    }

    public static class User {

        String name;
        String value;

        public String getName() {

            

Reported by PMD.

Classes implementing Serializable should set a serialVersionUID
Error

Line: 59

              
    }

    public static class Def extends ArrayList<User> {

    }
}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/bug/Issue983.java
7 issues
Unit tests should not contain more than 1 assert(s).
Design

Line: 13

               * Created by wenshao on 10/01/2017.
 */
public class Issue983 extends TestCase {
    public void test_for_issue() throws Exception {
        Map.Entry entry = JSON.parseObject("{\"name\":\"foo\"}", Map.Entry.class);
        assertEquals("name", entry.getKey());
        assertEquals("foo", entry.getValue());
    }
}

            

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

               * Created by wenshao on 10/01/2017.
 */
public class Issue983 extends TestCase {
    public void test_for_issue() throws Exception {
        Map.Entry entry = JSON.parseObject("{\"name\":\"foo\"}", Map.Entry.class);
        assertEquals("name", entry.getKey());
        assertEquals("foo", entry.getValue());
    }
}

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 15

              public class Issue983 extends TestCase {
    public void test_for_issue() throws Exception {
        Map.Entry entry = JSON.parseObject("{\"name\":\"foo\"}", Map.Entry.class);
        assertEquals("name", entry.getKey());
        assertEquals("foo", entry.getValue());
    }
}

            

Reported by PMD.

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

Line: 15

              public class Issue983 extends TestCase {
    public void test_for_issue() throws Exception {
        Map.Entry entry = JSON.parseObject("{\"name\":\"foo\"}", Map.Entry.class);
        assertEquals("name", entry.getKey());
        assertEquals("foo", entry.getValue());
    }
}

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 16

                  public void test_for_issue() throws Exception {
        Map.Entry entry = JSON.parseObject("{\"name\":\"foo\"}", Map.Entry.class);
        assertEquals("name", entry.getKey());
        assertEquals("foo", entry.getValue());
    }
}

            

Reported by PMD.

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

Line: 16

                  public void test_for_issue() throws Exception {
        Map.Entry entry = JSON.parseObject("{\"name\":\"foo\"}", Map.Entry.class);
        assertEquals("name", entry.getKey());
        assertEquals("foo", entry.getValue());
    }
}

            

Reported by PMD.

Avoid unused imports such as 'java.util.AbstractMap'
Design

Line: 6

              import com.alibaba.fastjson.JSON;
import junit.framework.TestCase;

import java.util.AbstractMap;
import java.util.Map;

/**
 * Created by wenshao on 10/01/2017.
 */

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/asm/Huge_200_ClassTest.java
7 issues
This class has a bunch of public methods and attributes
Design

Line: 1

              package com.alibaba.json.bvt.asm;

import com.alibaba.fastjson.JSON;

import junit.framework.TestCase;

public class Huge_200_ClassTest extends TestCase {
    public void test_huge() {
        JSON.parseObject("{}", VO.class);

            

Reported by PMD.

Avoid really long classes.
Design

Line: 7

              
import junit.framework.TestCase;

public class Huge_200_ClassTest extends TestCase {
    public void test_huge() {
        JSON.parseObject("{}", VO.class);
    }

    public static class VO {

            

Reported by PMD.

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

Line: 8

              import junit.framework.TestCase;

public class Huge_200_ClassTest extends TestCase {
    public void test_huge() {
        JSON.parseObject("{}", VO.class);
    }

    public static class VO {


            

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

              import junit.framework.TestCase;

public class Huge_200_ClassTest extends TestCase {
    public void test_huge() {
        JSON.parseObject("{}", VO.class);
    }

    public static class VO {


            

Reported by PMD.

Avoid really long classes.
Design

Line: 12

                      JSON.parseObject("{}", VO.class);
    }

    public static class VO {

        private Integer f000;
        private Integer f001;
        private Integer f002;
        private Integer f003;

            

Reported by PMD.

Too many fields
Design

Line: 12

                      JSON.parseObject("{}", VO.class);
    }

    public static class VO {

        private Integer f000;
        private Integer f001;
        private Integer f002;
        private Integer f003;

            

Reported by PMD.

The class 'VO' has a total cyclomatic complexity of 400 (highest 1).
Design

Line: 12

                      JSON.parseObject("{}", VO.class);
    }

    public static class VO {

        private Integer f000;
        private Integer f001;
        private Integer f002;
        private Integer f003;

            

Reported by PMD.

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

    public void test_for_issue() throws Exception {
        ParserConfig.global.putDeserializer(MyEnum.class, new MyEnumDeser());
        VO entity = JSON.parseObject("{\"myEnum\":\"AA\"}", VO.class);
        Assert.assertEquals(MyEnum.A, entity.myEnum);
    }
    

            

Reported by PMD.

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

Line: 28

                      @Override
        public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName) {
            String text = (String) parser.parse();
            if (text.equals("AA")) {
                return (T) MyEnum.A;
            }
            
            if (text.equals("BB")) {
                return (T) MyEnum.B;

            

Reported by PMD.

Position literals first in String comparisons
Design

Line: 28

                      @Override
        public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName) {
            String text = (String) parser.parse();
            if (text.equals("AA")) {
                return (T) MyEnum.A;
            }
            
            if (text.equals("BB")) {
                return (T) MyEnum.B;

            

Reported by PMD.

Position literals first in String comparisons
Design

Line: 28

                      @Override
        public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName) {
            String text = (String) parser.parse();
            if (text.equals("AA")) {
                return (T) MyEnum.A;
            }
            
            if (text.equals("BB")) {
                return (T) MyEnum.B;

            

Reported by PMD.

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

Line: 32

                              return (T) MyEnum.A;
            }
            
            if (text.equals("BB")) {
                return (T) MyEnum.B;
            }
            return null;
        }


            

Reported by PMD.

Position literals first in String comparisons
Design

Line: 32

                              return (T) MyEnum.A;
            }
            
            if (text.equals("BB")) {
                return (T) MyEnum.B;
            }
            return null;
        }


            

Reported by PMD.

Position literals first in String comparisons
Design

Line: 32

                              return (T) MyEnum.A;
            }
            
            if (text.equals("BB")) {
                return (T) MyEnum.B;
            }
            return null;
        }


            

Reported by PMD.

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

    public void test_seeAlso_dog() throws Exception {
        Dog dog = new Dog();
        dog.dogName = "dog1001";

        String text = JSON.toJSONString(dog, SerializerFeature.WriteClassName);
        Assert.assertEquals("{\"@type\":\"dog\",\"dogName\":\"dog1001\"}", 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: 25

                      Assert.assertEquals(dog.dogName, dog2.dogName);
    }

    public void test_seeAlso_cat() throws Exception {
        Cat cat = new Cat();
        cat.catName = "cat2001";

        String text = JSON.toJSONString(cat, SerializerFeature.WriteClassName);
        Assert.assertEquals("{\"@type\":\"cat\",\"catName\":\"cat2001\"}", 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: 37

                      Assert.assertEquals(cat.catName, cat2.catName);
    }
    
    public void test_seeAlso_tidy() throws Exception {
        Tidy tidy = new Tidy();
        tidy.dogName = "dog2001";
        tidy.tidySpecific = "tidy1001";

        String text = JSON.toJSONString(tidy, SerializerFeature.WriteClassName);

            

Reported by PMD.

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

Line: 56

              
    @JSONType(typeName = "dog", seeAlso={Tidy.class, Labrador.class})
    public static class Dog extends Animal {
        public String dogName;
    }

    @JSONType(typeName = "cat")
    public static class Cat extends Animal {
        public String catName;

            

Reported by PMD.

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

Line: 61

              
    @JSONType(typeName = "cat")
    public static class Cat extends Animal {
        public String catName;
    }

    @JSONType(typeName = "tidy")
    public static class Tidy extends Dog {
        public String tidySpecific;

            

Reported by PMD.

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

Line: 66

              
    @JSONType(typeName = "tidy")
    public static class Tidy extends Dog {
        public String tidySpecific;
    }
    
    @JSONType(typeName = "labrador")
    public static class Labrador extends Dog {
        public String tidySpecific;

            

Reported by PMD.

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

Line: 71

                  
    @JSONType(typeName = "labrador")
    public static class Labrador extends Dog {
        public String tidySpecific;
    }
}

            

Reported by PMD.

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

               */
public class Issue989 extends TestCase {

    public void test_for_issue() throws Exception {
        assertEquals(
                JSON.toJSONString(getMyObject(new HashMap<String, Name>())),
                JSON.toJSONString(getMyObject(new TreeMap<String, Name>()))
        );
    }

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 24

              public class Issue989 extends TestCase {

    public void test_for_issue() throws Exception {
        assertEquals(
                JSON.toJSONString(getMyObject(new HashMap<String, Name>())),
                JSON.toJSONString(getMyObject(new TreeMap<String, Name>()))
        );
    }


            

Reported by PMD.

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

Line: 47

                          for(Map.Entry<String, Name> entry :
                    ((Map<String, Name>)object).entrySet()) {
                Name name = entry.getValue();
                names.put(entry.getKey(), name.getFirst() + ":" + name.getSecond());
            }
            MapSerializer.instance.write(serializer, names, fieldName, JSONObject.class, features);
        }

    }

            

Reported by PMD.

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

Line: 47

                          for(Map.Entry<String, Name> entry :
                    ((Map<String, Name>)object).entrySet()) {
                Name name = entry.getValue();
                names.put(entry.getKey(), name.getFirst() + ":" + name.getSecond());
            }
            MapSerializer.instance.write(serializer, names, fieldName, JSONObject.class, features);
        }

    }

            

Reported by PMD.

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

Line: 49

                              Name name = entry.getValue();
                names.put(entry.getKey(), name.getFirst() + ":" + name.getSecond());
            }
            MapSerializer.instance.write(serializer, names, fieldName, JSONObject.class, features);
        }

    }

    public static class MyObject {

            

Reported by PMD.

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

Line: 69

              
    }

    private static class Name {

        private String first;

        private String second;


            

Reported by PMD.

Avoid unused imports such as 'org.junit.Assert'
Design

Line: 10

              import com.alibaba.fastjson.serializer.MapSerializer;
import com.alibaba.fastjson.serializer.ObjectSerializer;
import junit.framework.TestCase;
import org.junit.Assert;

import java.io.IOException;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.Map;

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/annotation/CustomSerializerTest_enum.java
7 issues
JUnit tests should include assert() or fail()
Design

Line: 17

              
public class CustomSerializerTest_enum extends TestCase {

    public void test_0() throws Exception {
        Model model = new Model();
        model.id = 1001;
        model.orderType = OrderType.PayOrder;
        String text = JSON.toJSONString(model);
//        Assert.assertEquals("{\"id\":1001,\"orderType\":{\"remark\":\"支付订单\",\"value\":1}}", 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: 17

              
public class CustomSerializerTest_enum extends TestCase {

    public void test_0() throws Exception {
        Model model = new Model();
        model.id = 1001;
        model.orderType = OrderType.PayOrder;
        String text = JSON.toJSONString(model);
//        Assert.assertEquals("{\"id\":1001,\"orderType\":{\"remark\":\"支付订单\",\"value\":1}}", text);

            

Reported by PMD.

Avoid unused local variables such as 'text'.
Design

Line: 21

                      Model model = new Model();
        model.id = 1001;
        model.orderType = OrderType.PayOrder;
        String text = JSON.toJSONString(model);
//        Assert.assertEquals("{\"id\":1001,\"orderType\":{\"remark\":\"支付订单\",\"value\":1}}", text);
    }

    public static class Model {
        public int id;

            

Reported by PMD.

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

Line: 26

                  }

    public static class Model {
        public int id;
        public OrderType orderType;
    }

    public static enum OrderType implements JSONSerializable {
                                  PayOrder(1, "支付订单"), //

            

Reported by PMD.

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

Line: 27

              
    public static class Model {
        public int id;
        public OrderType orderType;
    }

    public static enum OrderType implements JSONSerializable {
                                  PayOrder(1, "支付订单"), //
                                  SettleBill(2, "结算单");

            

Reported by PMD.

Avoid unused imports such as 'org.junit.Assert'
Design

Line: 6

              import java.io.IOException;
import java.lang.reflect.Type;

import org.junit.Assert;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.JSONSerializable;
import com.alibaba.fastjson.serializer.JSONSerializer;

            

Reported by PMD.

Found 'DU'-anomaly for variable 'text' (lines '21'-'23').
Error

Line: 21

                      Model model = new Model();
        model.id = 1001;
        model.orderType = OrderType.PayOrder;
        String text = JSON.toJSONString(model);
//        Assert.assertEquals("{\"id\":1001,\"orderType\":{\"remark\":\"支付订单\",\"value\":1}}", text);
    }

    public static class Model {
        public int id;

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/builder/BuilderTest1_private.java
7 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 12

              
public class BuilderTest1_private extends TestCase {
    
    public void test_create() throws Exception {
        VO vo = JSON.parseObject("{\"id\":12304,\"name\":\"ljw\"}", VO.class);
        
        Assert.assertEquals(12304, vo.getId());
        Assert.assertEquals("ljw", vo.getName());
    }

            

Reported by PMD.

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

Line: 15

                  public void test_create() throws Exception {
        VO vo = JSON.parseObject("{\"id\":12304,\"name\":\"ljw\"}", VO.class);
        
        Assert.assertEquals(12304, vo.getId());
        Assert.assertEquals("ljw", vo.getName());
    }

    @JSONType(builder=VOBuilder.class)
    public static class VO {

            

Reported by PMD.

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

Line: 16

                      VO vo = JSON.parseObject("{\"id\":12304,\"name\":\"ljw\"}", VO.class);
        
        Assert.assertEquals(12304, vo.getId());
        Assert.assertEquals("ljw", vo.getName());
    }

    @JSONType(builder=VOBuilder.class)
    public static class VO {
        private int id;

            

Reported by PMD.

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

Line: 21

              
    @JSONType(builder=VOBuilder.class)
    public static class VO {
        private int id;
        private String name;
        
        public int getId() {
            return id;
        }

            

Reported by PMD.

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

Line: 22

                  @JSONType(builder=VOBuilder.class)
    public static class VO {
        private int id;
        private String name;
        
        public int getId() {
            return id;
        }
        

            

Reported by PMD.

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

Line: 35

              
    private static class VOBuilder {

        private VO vo = new VO();

        public VO create() {
            return vo;
        }
        

            

Reported by PMD.

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

Line: 35

              
    private static class VOBuilder {

        private VO vo = new VO();

        public VO create() {
            return vo;
        }
        

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/builder/BuilderTest0_private.java
7 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 12

              
public class BuilderTest0_private extends TestCase {
    
    public void test_0() throws Exception {
        VO vo = JSON.parseObject("{\"id\":12304,\"name\":\"ljw\"}", VO.class);
        
        Assert.assertEquals(12304, vo.getId());
        Assert.assertEquals("ljw", vo.getName());
    }

            

Reported by PMD.

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

Line: 15

                  public void test_0() throws Exception {
        VO vo = JSON.parseObject("{\"id\":12304,\"name\":\"ljw\"}", VO.class);
        
        Assert.assertEquals(12304, vo.getId());
        Assert.assertEquals("ljw", vo.getName());
    }

    @JSONType(builder=VOBuilder.class)
    public static class VO {

            

Reported by PMD.

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

Line: 16

                      VO vo = JSON.parseObject("{\"id\":12304,\"name\":\"ljw\"}", VO.class);
        
        Assert.assertEquals(12304, vo.getId());
        Assert.assertEquals("ljw", vo.getName());
    }

    @JSONType(builder=VOBuilder.class)
    public static class VO {
        private int id;

            

Reported by PMD.

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

Line: 21

              
    @JSONType(builder=VOBuilder.class)
    public static class VO {
        private int id;
        private String name;
        
        public int getId() {
            return id;
        }

            

Reported by PMD.

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

Line: 22

                  @JSONType(builder=VOBuilder.class)
    public static class VO {
        private int id;
        private String name;
        
        public int getId() {
            return id;
        }
        

            

Reported by PMD.

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

Line: 35

              
    private static class VOBuilder {

        private VO vo = new VO();

        public VO build() {
            return vo;
        }
        

            

Reported by PMD.

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

Line: 35

              
    private static class VOBuilder {

        private VO vo = new VO();

        public VO build() {
            return vo;
        }
        

            

Reported by PMD.