You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MaybeInaccessibleMessage deserializes to Message and InaccessibleMessage based on the date field.
You used jackson annotations to define that behavior:
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.EXISTING_PROPERTY,
property = "date",
visible = true,
defaultImpl = Message.class
)
@JsonSubTypes({
@JsonSubTypes.Type(value = InaccessibleMessage.class, name = "0")
})
publicinterfaceMaybeInaccessibleMessageextendsBotApiObject {
}
Unfortunately, jackson implementation of JsonTypeInfo.As.EXISTING_PROPERTY stores every date value that it receives in a Map<String, Deserializer>, with every date number mapped to a different deserializer instance based on the value.
That annotation is mainly designed to take a field value with a low cardinality, and not a value with infinite possible different numbers, like a date.
In an instance with a lot of messages, that can lead to a huge overhead and unnecessary memory allocation / usage.
Please, use a different way to deserialize the MaybeInaccessibleMessage, for example using a custom Deserializer instead of the JsonTypeInfo annotation:
MaybeInaccessibleMessage deserializes to Message and InaccessibleMessage based on the date field.
You used jackson annotations to define that behavior:
Unfortunately, jackson implementation of
JsonTypeInfo.As.EXISTING_PROPERTY
stores everydate
value that it receives in aMap<String, Deserializer>
, with every date number mapped to a different deserializer instance based on the value.That annotation is mainly designed to take a field value with a low cardinality, and not a value with infinite possible different numbers, like a date.
In an instance with a lot of messages, that can lead to a huge overhead and unnecessary memory allocation / usage.
Please, use a different way to deserialize the MaybeInaccessibleMessage, for example using a custom Deserializer instead of the
JsonTypeInfo
annotation:The text was updated successfully, but these errors were encountered: