Skip to content

Commit

Permalink
Merge pull request #97 from elrodro83/patch-1
Browse files Browse the repository at this point in the history
Fix for #96
  • Loading branch information
magro committed Oct 21, 2018
2 parents 57e38d0 + 74d83a2 commit 2baa088
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ public void write(final Kryo kryo, final Output output, final Object object) {
final SynchronizedCollection collection = SynchronizedCollection.valueOfType( object.getClass() );
// the ordinal could be replaced by s.th. else (e.g. a explicitely managed "id")
output.writeInt( collection.ordinal(), true );
kryo.writeClassAndObject( output, collection.sourceCollectionField.get( object ) );
synchronized (object) {
kryo.writeClassAndObject( output, collection.sourceCollectionField.get( object ) );
}
} catch ( final RuntimeException e ) {
// Don't eat and wrap RuntimeExceptions because the ObjectBuffer.write...
// handles SerializationException specifically (resizing the buffer)...
Expand Down

0 comments on commit 2baa088

Please sign in to comment.