chaokunyang commented on issue #2345:
URL: https://github.com/apache/fory/issues/2345#issuecomment-2980938589

   For map and collection serializers, fury use 
`AbstactMapSerializer/AbstactCollectionSerializer` as super class. Considering 
following situation:
   ```java
   class Foo {
     Map<String,Long> map;
     List<String>> list;
   }
   ```
   
   When generating code for `map/list` field, fury will take serializers for 
`map` as `AbstactMapSerializer` and serializer for `list` as 
`AbstactCollectionSerializer`. Not all serializers for `Map/List`  support 
codegen, so `AbstactMapSerializer/AbstactCollectionSerializer` has a method 
`supportCodegen`, which only return true if the serializer does support codegen 
based serialization. 
   
   In such cases, serialization for `map` will be:
   - write map class if not final
   - write map size
   - onCollectionWrite
   - write keys/values using generated code
   
   But if `supportCodegen` returns false, fury will just invoke 
`Serializer.write` for serializaiton. Similiar process for `Collection` 
serialization.
   
   Maybe we should print an warning log instead of just throwing exception. 
Would you like to open a pr for this? @tommyettinger 
   
   For `NullPointerException` issue, let me take some time to reproduce it 


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