Object value = null;
Class concreteType = cachedField.fieldClass;
Serializer serializer = cachedField.serializer;
if (concreteType == null) {
Registration registration = kryo.readClass(input);
if (registration != null) { // Else value is null.
if (serializer == null) serializer = registration.getSerializer();
value = kryo.readObject(input, registration.getType(), serializer);
}
} else {
if (serializer == null) cachedField.serializer = serializer = kryo.getSerializer(concreteType);
if (cachedField.canBeNull)
value = kryo.readObjectOrNull(input, concreteType, serializer);