This can happen if a serializer queries the size of a collection/map, and later sees less or more number of elements than previously queried. This can happen if the collection was concurrently modified between querying the size of it, and actually serializing the elements.
The getDifferenceCount() method can be used to check the relation whether less or more elements have been encountered.
public | SerializationConcurrentModificationException( Creates a new instance with the given difference count. |
public int | Gets the difference count relative to the expected serialization count. |
If the returned count is positive, it means that the serializer encountered less elements than expected. The returned number of elements were missing from the serialized collection.
If the number is negative, it means that the collections had more elements in the collection compared to the previously reported size. Negative numbers may not be accurate, meaning that there may be more elements than the negative result reports. E.g. if this method reports -1, then there may be more than one unserialized elements than just 1.