if (cachedField.generics != null) serializer.setGenerics(kryo, cachedField.generics);
if (cachedField.canBeNull)
kryo.writeObjectOrNull(outputChunked, value, serializer);
else {
if (value == null) {
throw new KryoException("Field value is null but canBeNull is false: " + cachedField + " ("
+ object.getClass().getName() + ")");
}
kryo.writeObject(outputChunked, value, serializer);
}
}
outputChunked.endChunks();
} catch (IllegalAccessException ex) {
throw new KryoException("Error accessing field: " + cachedField + " (" + object.getClass().getName() + ")", ex);
} catch (KryoException ex) {
ex.addTrace(cachedField + " (" + object.getClass().getName() + ")");
throw ex;
} catch (RuntimeException runtimeEx) {
KryoException ex = new KryoException(runtimeEx);
ex.addTrace(cachedField + " (" + object.getClass().getName() + ")");
throw ex;
}
}
}