diff --git a/core/src/main/java/com/alibaba/fastjson2/JSONReaderJSONB.java b/core/src/main/java/com/alibaba/fastjson2/JSONReaderJSONB.java index 914734d2bf..830e696129 100644 --- a/core/src/main/java/com/alibaba/fastjson2/JSONReaderJSONB.java +++ b/core/src/main/java/com/alibaba/fastjson2/JSONReaderJSONB.java @@ -2446,6 +2446,7 @@ public void skipValue() { case BC_TIMESTAMP_MINUTES: case BC_FLOAT: case BC_INT64_INT: + case BC_LOCAL_DATE: offset += 4; return; case BC_FLOAT_INT: diff --git a/core/src/test/java/com/alibaba/fastjson2/issues_2900/Issue2907.java b/core/src/test/java/com/alibaba/fastjson2/issues_2900/Issue2907.java new file mode 100644 index 0000000000..0b4a841cd4 --- /dev/null +++ b/core/src/test/java/com/alibaba/fastjson2/issues_2900/Issue2907.java @@ -0,0 +1,26 @@ +package com.alibaba.fastjson2.issues_2900; + +import com.alibaba.fastjson2.JSONB; +import org.junit.jupiter.api.Test; + +import java.time.LocalDate; + +import static org.junit.jupiter.api.Assertions.assertNotNull; + +public class Issue2907 { + @Test + public void test() { + Bean bean = new Bean(); + bean.date = LocalDate.now(); + byte[] bytes = JSONB.toBytes(bean); + Bean1 bean1 = JSONB.parseObject(bytes, Bean1.class); + assertNotNull(bean1); + } + + public static class Bean { + public LocalDate date; + } + + public static class Bean1 { + } +}