diff --git a/core/src/test/java/com/alibaba/fastjson2/issues_2100/Issue2153.java b/core/src/test/java/com/alibaba/fastjson2/issues_2100/Issue2153.java new file mode 100644 index 0000000000..ad53e9235d --- /dev/null +++ b/core/src/test/java/com/alibaba/fastjson2/issues_2100/Issue2153.java @@ -0,0 +1,49 @@ +package com.alibaba.fastjson2.issues_2100; + +import com.alibaba.fastjson2.JSON; +import lombok.Getter; +import lombok.Setter; +import org.junit.jupiter.api.Test; + +import java.io.Serializable; +import java.util.Date; + +public class Issue2153 { + @Test + public void test() { + String str = "{\"addTime\":1703124696338,\"updateTime\":1703124696338,\"id\":7}"; + User user = JSON.parseObject(str, User.class); + System.out.println(user.toString()); + } + + public interface ID extends Serializable { + Serializable getId(); + } + + public interface Bean extends ID { + @Override + K getId(); + + void setId(K id); + } + + @Getter + @Setter + public static abstract class BaseEntity implements Bean { + Long id; + } + + @Getter + @Setter + public static abstract class TimeBaseEntity extends BaseEntity { + Date addTime; + Date updateTime; + } + + @Getter + @Setter + public static class User extends BaseEntity { + String addr; + Long a, b, c, d, e, f, g; + } +}