ghostly72 commented on issue #11157: URL: https://github.com/apache/dubbo/issues/11157#issuecomment-3711566529
hi, I added a check for early type-validation inside `PojoUtils.realize()` to fix the case where List<String> fields were being deserialized as List<Integer>, leading to ClassCastException at runtime. The fix works for that specific case (now throws illegalargumentexception early), but it broke existing tests like: ``` Map<String, Object> map = PojoUtils.generalize(person); PojoUtils.realize(map, Person.class); ``` here the framework intentionally converts a person to/from a map. So when Dubbo tries to realize a person object into a hashmap(or vice versa), my check says: “person is not a hashmap, so throw exception”. suggestions on how best to handle this without breaking existing behavior? also if this approach fundamentally conflicts with Dubbo’s design, I'll close this PR, do let me know -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
