uuuyuqi commented on PR #16198:
URL: https://github.com/apache/dubbo/pull/16198#issuecomment-4234310965

   @RainYuY You're right that Hessian protocol doesn't have a native byte type 
— byte and int share the same tag. But hessian-lite already handles this 
through `readObject(Class, Class<?>... expectedTypes)`: when 
`CollectionDeserializer` receives expectedTypes, it calls `Number.byteValue()` 
/ `Number.shortValue()` etc. to narrow the type.
   
   The issue was that Dubbo's invocation chain didn't pass generic type info 
down to hessian-lite, so this existing conversion capability was never 
triggered. This fix simply propagates the generic parameter types that are 
already available via reflection, letting hessian-lite's own type narrowing 
logic work as designed. No new conversion logic is introduced.
   
   For nested generics like `List<List<Byte>>`, yes, that's a limitation of 
hessian-lite's `expectedTypes` which only supports one level of type arguments. 
But that's a separate issue and not in scope here — this fix addresses the 
common single-level cases (`List<Byte>`, `Map<String, Byte>`, etc.) which are 
the most frequently encountered.


-- 
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]

Reply via email to