> On Mar 29, 2023, at 00:58, Tatu Saloranta <t...@fasterxml.com> wrote:
> 
> Yes, I think that shows a simple idea that could work as intended (in
> this case, for `String` -valued properties.


Seems to work after creating a child with the canonicalize flag set (the root 
throws and without the flag no actual interning seems to happen).

    private final static CharsToNameCanonicalizer can = CharsToNameCanonicalizer
        .createRoot()
        .makeChild(JsonFactory.Feature.CANONICALIZE_FIELD_NAMES.getMask());

Since there are multiple fields with the custom deserializer applied (thus 
multiple deserializer instances) but I want them to share a string pool, I have 
also made it static. Is this thread-safe? I’m not sure I fully understand the 
parent/child relationship in CharsToNameCanonicalizer...

Also, what’s the expected behavior in case the string pool gets large?

Thanks,
 Viktor

-- 
You received this message because you are subscribed to the Google Groups 
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jackson-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jackson-user/BDF8840C-5BD5-4AA4-8FF9-70255D6A5323%40gmail.com.

Reply via email to