mytang0 commented on PR #11448:
URL: https://github.com/apache/dubbo/pull/11448#issuecomment-1415374180

   > 
![image](https://user-images.githubusercontent.com/9292748/216532605-5d81f921-0b55-4ac5-b28b-c4f685f2e28b.png)
   
   Test code: 
   `@SuppressWarnings("unchecked")
       public static void listTest() throws Exception {
           Hessian2Serialization hessian2Serialization = new 
Hessian2Serialization();
   
           ByteArrayOutputStream baos = new ByteArrayOutputStream();
           ObjectOutput objectOutput = hessian2Serialization.serialize(null, 
baos);
   
           // List test
           List<Float> floatList = new ArrayList<>();
           floatList.add(3.5F);
           floatList.add(3.51F);
   
           objectOutput.writeObject(floatList);
           objectOutput.flushBuffer();
           List<Float> list =
               (List<Float>) hessian2Serialization.deserialize(null, new 
ByteArrayInputStream(baos.toByteArray()))
                   .readObject(List.class, new TypeReference<List<Float>>() {
                   }.getType());
       }
   
       @SuppressWarnings("unchecked")
       public static void mapTest() throws Exception {
           Hessian2Serialization hessian2Serialization = new 
Hessian2Serialization();
   
           ByteArrayOutputStream baos = new ByteArrayOutputStream();
           ObjectOutput objectOutput = hessian2Serialization.serialize(null, 
baos);
   
           // Map test
           HashMap<String, Float> floatMap = new HashMap<>();
           floatMap.put("a", 3.50F);
           floatMap.put("b", 3.54F);
   
           objectOutput.writeObject(floatMap);
           objectOutput.flushBuffer();
           Map<String, Float> map =
               hessian2Serialization.deserialize(null, new 
ByteArrayInputStream(baos.toByteArray()))
                   .readObject(Map.class, new TypeReference<Map<String, 
Float>>() {
                   }.getType());
       }`
   
   
   I tested the deserialization of Map locally and it was ok.  
   Dubbo 3.1 branch, in hessian-lite version 3.2.13 the map deserializer should 
be MapDeserializer. Not sure which version of AbstractMapDeserializer is in the 
error stack?


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