Skip to content

Commit

Permalink
Use Kryo to create instances.
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanSweet committed Jul 3, 2015
1 parent df07c66 commit a0cb680
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private void writeExternal (Kryo kryo, Output output, Object object) {

private Object readExternal (Kryo kryo, Input input, Class type) {
try {
Externalizable object = (Externalizable)type.newInstance();
Externalizable object = kryo.newInstance(type);
object.readExternal(getObjectInput(kryo, input));
return object;
} catch (ClassCastException e) {
Expand All @@ -94,10 +94,6 @@ private Object readExternal (Kryo kryo, Input input, Class type) {
throw new KryoException(e);
} catch (IOException e) {
throw new KryoException(e);
} catch (InstantiationException e) {
throw new KryoException(e);
} catch (IllegalAccessException e) {
throw new KryoException(e);
}
}

Expand Down

0 comments on commit a0cb680

Please sign in to comment.