Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The generalized call does not support the serialization and deserialization of LocalTime, LocalDate & LocalDateTime #10631

Closed
1 task done
wuwen5 opened this issue Sep 16, 2022 · 0 comments · Fixed by #10638
Labels
type/bug Bugs to being fixed

Comments

@wuwen5
Copy link
Contributor

wuwen5 commented Sep 16, 2022

  • I have searched the issues of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: 2.7.x,3.x
  • Operating System version: mac os
  • Java version: 1.8

Steps to reproduce this issue

@Bean
public GenericService testApi() {
    ReferenceConfig<GenericService> config = new ReferenceConfig<>();
    config.setInterface("com.xxx.TestApi");
    config.setGeneric("true");
    //...
    return config.get()
}


@Autowired
private TestApi testApi;

@Test
void testLocaDateTime() {
    Person obj = testApi.testApiQueryMethod();
}

image

Unit testing for reproducible problems

    @Test
    public void testJava8Time() {
        
        Object localDateTimeGen = PojoUtils.generalize(LocalDateTime.now());
        Object localDateTime = PojoUtils.realize(localDateTimeGen, LocalDateTime.class);
        assertEquals(localDateTimeGen, localDateTime.toString());

        Object localDateGen = PojoUtils.generalize(LocalDate.now());
        Object localDate = PojoUtils.realize(localDateGen, LocalDate.class);
        assertEquals(localDateGen, localDate.toString());

        Object localTimeGen = PojoUtils.generalize(LocalTime.now());
        Object localTime = PojoUtils.realize(localTimeGen, LocalTime.class);
        assertEquals(localTimeGen, localTime.toString());
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Bugs to being fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant