package com.alibaba.json.bvt.issue_2300;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONPOJOBuilder;
import com.alibaba.fastjson.annotation.JSONType;
import junit.framework.TestCase;
import lombok.Builder;
import lombok.Getter;

public class Issue2346 extends TestCase {
    public void test_for_issue() throws Exception {
        String jsonStr = "{\"age\":1,\"name\":\"aa\"}";
        TestEntity testEntity = JSON.parseObject(jsonStr, TestEntity.class);
        assertEquals(jsonStr, JSON.toJSONString(testEntity));
    }

    @Builder(builderClassName = "TestEntityBuilder")
    @Getter
    @JSONType(builder = TestEntity.TestEntityBuilder.class)
    public static class TestEntity {
        private String name;

        private int age;

        @JSONPOJOBuilder(withPrefix = "")
        public static class TestEntityBuilder{

        }
    }
}
@@ -872,10 +872,1405 @@
  %7D%0A    %7D
+%0A%0A    @JSONType(builder = TestEntity2.TestEntity2Builder.class)%0A    @Getter%0A    public static class TestEntity2 %7B%0A        private String name;%0A%0A        private int age;%0A%0A        @JSONPOJOBuilder(withPrefix = %22www%22)%0A        public static class TestEntity2Builder%7B%0A            private TestEntity2 testEntity2 = new TestEntity2();%0A%0A            public TestEntity2 build()%7B%0A                return testEntity2;%0A            %7D%0A%0A            public TestEntity2Builder wwwAge(int age) %7B%0A                testEntity2.age = age;%0A                return this;%0A            %7D%0A%0A            public TestEntity2Builder wwwName(String name) %7B%0A                testEntity2.name = name;%0A                return this;%0A            %7D%0A        %7D%0A    %7D%0A%0A    @JSONType(builder = TestEntity3.TestEntity3Builder.class)%0A    @Getter%0A    public static class TestEntity3 %7B%0A        private String name;%0A%0A        private int age;%0A%0A        public static class TestEntity3Builder%7B%0A            private TestEntity3 testEntity3 = new TestEntity3();%0A%0A            public TestEntity3 build()%7B%0A                return testEntity3;%0A            %7D%0A%0A            public TestEntity3Builder withAge(int age) %7B%0A                testEntity3.age = age;%0A                return this;%0A            %7D%0A%0A            public TestEntity3Builder withName(String name) %7B%0A                testEntity3.name = name;%0A                return this;%0A            %7D%0A        %7D%0A    %7D
 %0A%7D

add more testcase