Skip to content

Commit e009417

Browse files
authored
Revert "Fixed the issue of type loss in generalized call cases. (#15562)" (#15571)
This reverts commit ef5bf4a.
1 parent 4034e98 commit e009417

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

dubbo-common/src/main/java/org/apache/dubbo/common/utils/PojoUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ private static Object generalize(Object pojo, Map<Object, Object> history) {
160160
}
161161

162162
if (pojo instanceof LocalDate || pojo instanceof LocalDateTime || pojo instanceof LocalTime) {
163-
return pojo;
163+
return pojo.toString();
164164
}
165165

166166
if (pojo instanceof Class) {

dubbo-common/src/test/java/org/apache/dubbo/common/utils/PojoUtilsTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -772,15 +772,15 @@ void testJava8Time() {
772772

773773
Object localDateTimeGen = PojoUtils.generalize(LocalDateTime.now());
774774
Object localDateTime = PojoUtils.realize(localDateTimeGen, LocalDateTime.class);
775-
assertEquals(localDateTimeGen, localDateTime);
775+
assertEquals(localDateTimeGen, localDateTime.toString());
776776

777777
Object localDateGen = PojoUtils.generalize(LocalDate.now());
778778
Object localDate = PojoUtils.realize(localDateGen, LocalDate.class);
779-
assertEquals(localDateGen, localDate);
779+
assertEquals(localDateGen, localDate.toString());
780780

781781
Object localTimeGen = PojoUtils.generalize(LocalTime.now());
782782
Object localTime = PojoUtils.realize(localTimeGen, LocalTime.class);
783-
assertEquals(localTimeGen, localTime);
783+
assertEquals(localTimeGen, localTime.toString());
784784
}
785785

786786
@Test

0 commit comments

Comments
 (0)