}
private static Object perhapsConvertToValue(Object object) {
// TODO this will not work, since various serializable objects (such as WorkspaceStep.Callback) hold references to objects that should be pickled
for (PickleFactory f : (valueFactories == null ? PickleFactory.all() : valueFactories)) {
Pickle v = f.writeReplace(object);
if (v != null) {
return v;
}
}
return object;