Skip to content

Commit

Permalink
Merge pull request #73 from ec-omikron/register-immutable-list-subtypes
Browse files Browse the repository at this point in the history
Register immutable list subtypes
  • Loading branch information
magro committed Feb 3, 2017
2 parents d34f6f0 + 763e991 commit a1e7989
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ public static void registerSerializers(final Kryo kryo) {

kryo.register(ImmutableList.of().getClass(), serializer);
kryo.register(ImmutableList.of(1).getClass(), serializer);
kryo.register(ImmutableList.of(1,2,3).subList(1, 2).getClass(), serializer);
kryo.register(ImmutableList.of().reverse().getClass(), serializer);
kryo.register(ImmutableList.of(1, 2, 3, 4).subList(1, 3).getClass(), serializer);
kryo.register(ImmutableList.of(1, 2).reverse().getClass(), serializer);

kryo.register(Lists.charactersOf("KryoRocks").getClass(), serializer);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void testRegular() {

@Test( enabled = true )
public void testSubList() {
final ImmutableList<?> obj = ImmutableList.of(3, 4, 5, 6).subList(1, 2);
final ImmutableList<?> obj = ImmutableList.of(3, 4, 5, 6).subList(1, 3);
final byte[] serialized = serialize( _kryo, obj );
final ImmutableList<?> deserialized = deserialize(_kryo, serialized, ImmutableList.class);
assertEquals(deserialized, obj);
Expand Down Expand Up @@ -115,7 +115,7 @@ public void testCopyRegular() {

@Test( enabled = true )
public void testCopySubList() {
final ImmutableList<?> obj = ImmutableList.of(1, 2, 3, 4).subList(1, 2);
final ImmutableList<?> obj = ImmutableList.of(1, 2, 3, 4).subList(1, 3);
final ImmutableList<?> copied = _kryo.copy(obj);
assertSame(copied, obj);
}
Expand Down

0 comments on commit a1e7989

Please sign in to comment.