Flush readonly map together with shared on SerializerCache.flush() - #3791
Conversation
|
I would need to have some kind of indication of an observed problem to change something that seems to have been working for a decade now... :) That is, without a test I don't think I'd want to merge this. I am also not sure what the problem would be: subtypes are not really relevant here as the cache is keyed by actual type, not supertype. |
|
Actually, looking at this again, this makes sense. And while it'd be nice to have tests I don't think they are essential after all. |
SerializerCache.flush()
|
Thanks for merging this. I am really sorry for late answer, forgot about this. After creating the issue I realized it did not help with my original problem anyway (there was a need to make Jackson rebuild polymorphic serializers, after serializer was used before new subclasses where registered). I fixed that problem by changing application. The change makes some sense, but flushing serializers may still not work:
Combined makes me think maybe there's still something to do. I am not sure now what is the purpose of the method - to really make Jackson recreate serializers (potentially with new logic) or just to free memory (maybe then javadoc update is needed). |
|
@vdaniloff Ok thank you for additional information. I am also not sure how useful this method really is; it generally is better to just create a new But as to original intent I am pretty sure it's about saving memory and not so much new functionality. |
Without these flushing the cache may be not enough - for example if a new subtype for existing interface is added by a new provider, serialization cache will still return old serializer for an interface.