Program: 155337
Project: 155337
Buggy source:
/** 
 * Deep clones this EveObject, unique-ifying its object hierarchy as necessary. This method is called by the interpreter to implement the magic auto deep cloning at the interpreter level. At the interpreter level, everything is automatically deep cloned. But to save memory, we only want to deep clone when necessary and use the same references for everything else.
 */
public void deepClone(){
  EveObject eo=this;
  Deque<String> fieldNames=new ArrayDeque<String>();
  while (eo.objectParent != null) {
    String fieldName=eo.objectParent.getFieldName(eo);
    if (fieldName == null) {
      if (eo.objectParent.getType() == EveType.DICT) {
        fieldName="String_Node_Str" + eo.objectParent.getDictKey(eo);
      }
 else       if (eo.objectParent.getType() == EveType.LIST) {
        fieldName="String_Node_Str" + eo.objectParent.getIndex(eo);
      }
    }
    fieldNames.addFirst(fieldName);
    eo=eo.objectParent;
  }
  while (!fieldNames.isEmpty()) {
    String fieldName=fieldNames.pop();
    EveObject field=null;
    String key=null;
    int index=-1;
    if (fieldName.startsWith("String_Node_Str")) {
      key=fieldName.substring("String_Node_Str".length());
      field=eo.getDictValue(key);
    }
 else     if (fieldName.startsWith("String_Node_Str")) {
      index=Integer.parseInt(fieldName.substring("String_Node_Str".length()));
      field=eo.getIndexedProperty(index);
    }
 else {
      field=eo.getField(fieldName);
    }
    if (field.isMarkedForClone()) {
      field=field.eventlessClone();
      field.setMarkedForClone(false);
    }
    field.objectParent=eo;
    if (fieldName.startsWith("String_Node_Str")) {
      eo.putDictValue(key,field);
    }
 else     if (fieldName.startsWith("String_Node_Str")) {
      eo.setIndexedProperty(index,field);
      eo.putField(fieldName,field);
    }
 else {
      eo.putField(fieldName,field);
    }
    eo=field;
  }
  this.setMarkedForClone(false);
}

Fixed version (ground truth):
/** 
 * Deep clones this EveObject, unique-ifying its object hierarchy as necessary. This method is called by the interpreter to implement the magic auto deep cloning at the interpreter level. At the interpreter level, everything is automatically deep cloned. But to save memory, we only want to deep clone when necessary and use the same references for everything else.
 */
public void deepClone(){
  EveObject eo=this;
  Deque<String> fieldNames=new ArrayDeque<String>();
  while (eo.objectParent != null) {
    String fieldName=eo.objectParent.getFieldName(eo);
    if (fieldName == null) {
      fieldName=eo.objectParent.getDynamicFieldName(eo);
      if (fieldName != null) {
        fieldName="String_Node_Str" + fieldName;
      }
 else       if (eo.objectParent.getType() == EveType.DICT) {
        fieldName="String_Node_Str" + eo.objectParent.getDictKey(eo);
      }
 else       if (eo.objectParent.getType() == EveType.LIST) {
        fieldName="String_Node_Str" + eo.objectParent.getIndex(eo);
      }
    }
    fieldNames.addFirst(fieldName);
    eo=eo.objectParent;
  }
  while (!fieldNames.isEmpty()) {
    String fieldName=fieldNames.pop();
    EveObject field=null;
    String key=null;
    int index=-1;
    if (fieldName.startsWith("String_Node_Str")) {
      fieldName=fieldName.substring("String_Node_Str".length());
      EveObject getter=eo.getField(fieldName);
      if (getter != null && getter.hasField("String_Node_Str")) {
        field=getter.getField("String_Node_Str").invokeSelf(eo);
      }
      fieldName="String_Node_Str" + fieldName;
    }
 else     if (fieldName.startsWith("String_Node_Str")) {
      key=fieldName.substring("String_Node_Str".length());
      field=eo.getDictValue(key);
    }
 else     if (fieldName.startsWith("String_Node_Str")) {
      index=Integer.parseInt(fieldName.substring("String_Node_Str".length()));
      field=eo.getIndexedProperty(index);
    }
 else {
      field=eo.getField(fieldName);
    }
    if (field.isMarkedForClone()) {
      field=field.eventlessClone();
      field.setMarkedForClone(false);
    }
    field.objectParent=eo;
    if (fieldName.startsWith("String_Node_Str")) {
      fieldName=fieldName.substring("String_Node_Str".length());
      EveObject setter=eo.getField(fieldName);
      if (setter != null && setter.hasField("String_Node_Str")) {
        setter.getField("String_Node_Str").invokeSetter(eo,field);
      }
    }
 else     if (fieldName.startsWith("String_Node_Str")) {
      eo.putDictValue(key,field);
    }
 else     if (fieldName.startsWith("String_Node_Str")) {
      eo.setIndexedProperty(index,field);
    }
 else {
      eo.putField(fieldName,field);
    }
    eo=field;
  }
  this.setMarkedForClone(false);
}