Program: 42979
Project: 42979
Buggy source:
private void initSerializableClone(final Object orig,final SerializableClass info,final Object clone,final Class<?> cloneClass) throws IOException, ClassNotFoundException {
  final Class<?> objClass=info.getSubjectClass();
  if (!serializabilityChecker.isSerializable(cloneClass)) {
    throw new NotSerializableException(cloneClass.getName());
  }
  final SerializableClass cloneInfo=registry.lookup(cloneClass);
  final Class<?> cloneSuperClass=cloneClass.getSuperclass();
  if (cloneClass != clone(objClass)) {
    initSerializableClone(orig,info,clone,cloneSuperClass);
    if (cloneInfo.hasReadObjectNoData()) {
      cloneInfo.callReadObjectNoData(clone);
    }
    return;
  }
  final Class<?> superClass=objClass.getSuperclass();
  if (serializabilityChecker.isSerializable(superClass) || serializabilityChecker.isSerializable(cloneSuperClass)) {
    initSerializableClone(orig,registry.lookup(superClass),clone,cloneSuperClass);
  }
  if (!serializabilityChecker.isSerializable(objClass)) {
    if (cloneInfo.hasReadObjectNoData()) {
      cloneInfo.callReadObjectNoData(clone);
    }
    return;
  }
  final ClonerPutField fields=new ClonerPutField();
  fields.defineFields(info);
  if (info.hasWriteObject()) {
    final Queue<Step> steps=new ArrayDeque<Step>();
    info.callWriteObject(orig,new StepObjectOutputStream(steps,fields,orig));
    if (cloneInfo.hasReadObject()) {
      cloneInfo.callReadObject(clone,new StepObjectInputStream(steps,fields,clone,cloneInfo));
    }
 else {
      cloneFields(fields);
      storeFields(cloneInfo,clone,fields);
    }
  }
 else {
    prepareFields(orig,fields);
    cloneFields(fields);
    if (cloneInfo.hasReadObject()) {
      cloneInfo.callReadObject(clone,new StepObjectInputStream(new ArrayDeque<Step>(),fields,clone,cloneInfo));
    }
 else {
      storeFields(cloneInfo,clone,fields);
    }
  }
}

Fixed version (ground truth):
private void initSerializableClone(final Object orig,final SerializableClass info,final Object clone,final Class<?> cloneClass) throws IOException, ClassNotFoundException {
  final Class<?> objClass=info.getSubjectClass();
  if (!serializabilityChecker.isSerializable(cloneClass)) {
    throw new NotSerializableException(cloneClass.getName());
  }
  final SerializableClass cloneInfo=registry.lookup(cloneClass);
  final Class<?> cloneSuperClass=cloneClass.getSuperclass();
  if (cloneClass != clone(objClass)) {
    initSerializableClone(orig,info,clone,cloneSuperClass);
    if (cloneInfo.hasReadObjectNoData()) {
      cloneInfo.callReadObjectNoData(clone);
    }
    return;
  }
  final Class<?> superClass=objClass.getSuperclass();
  if (serializabilityChecker.isSerializable(superClass) || serializabilityChecker.isSerializable(cloneSuperClass)) {
    initSerializableClone(orig,registry.lookup(superClass),clone,cloneSuperClass);
  }
  if (!serializabilityChecker.isSerializable(objClass)) {
    if (cloneInfo.hasReadObjectNoData()) {
      cloneInfo.callReadObjectNoData(clone);
    }
    return;
  }
  final ClonerPutField fields=new ClonerPutField();
  fields.defineFields(info);
  if (info.hasWriteObject()) {
    final Queue<Step> steps=new ArrayDeque<Step>();
    final StepObjectOutputStream stepObjectOutputStream=new StepObjectOutputStream(steps,fields,orig);
    info.callWriteObject(orig,stepObjectOutputStream);
    stepObjectOutputStream.flush();
    if (cloneInfo.hasReadObject()) {
      cloneInfo.callReadObject(clone,new StepObjectInputStream(steps,fields,clone,cloneInfo));
    }
 else {
      cloneFields(fields);
      storeFields(cloneInfo,clone,fields);
    }
  }
 else {
    prepareFields(orig,fields);
    cloneFields(fields);
    if (cloneInfo.hasReadObject()) {
      cloneInfo.callReadObject(clone,new StepObjectInputStream(new ArrayDeque<Step>(),fields,clone,cloneInfo));
    }
 else {
      storeFields(cloneInfo,clone,fields);
    }
  }
}