Program: 68575
Project: 68575
Buggy source:
private List<DataObject> preOrderTraversalDataObjectList(SDODataObject currentDO,ArrayList<DataObject> currentList,boolean countNullObjects,boolean recurse){
  if (currentDO != null) {
    currentList.add(currentDO);
    List instanceProperties=currentDO.getInstanceProperties();
    Property nextProperty=null;
    Object value=null;
    if (recurse) {
      for (int i=0; i < instanceProperties.size(); i++) {
        nextProperty=(Property)instanceProperties.get(i);
        value=currentDO.get(nextProperty);
        boolean recurseHopefullyNotToInfinityPlease=true;
        if (nextProperty.getType() != SDO_CHANGESUMMARY && !nextProperty.getType().isDataType()) {
          if (null != nextProperty.getOpposite()) {
            recurseHopefullyNotToInfinityPlease=false;
          }
          if (nextProperty.isMany()) {
            Object manyItem;
            for (int index=0; index < ((List)value).size(); index++) {
              manyItem=((List)value).get(index);
              if (manyItem != null && manyItem instanceof SDODataObject) {
                preOrderTraversalDataObjectList((SDODataObject)manyItem,currentList,countNullObjects,recurseHopefullyNotToInfinityPlease);
              }
            }
          }
 else {
            if (value != null) {
              preOrderTraversalDataObjectList((SDODataObject)value,currentList,countNullObjects,recurseHopefullyNotToInfinityPlease);
            }
          }
        }
      }
    }
  }
 else {
    if (countNullObjects) {
      currentList.add(currentDO);
    }
  }
  return currentList;
}

Fixed version (ground truth):
private List<DataObject> preOrderTraversalDataObjectList(SDODataObject currentDO,ArrayList<DataObject> currentList,boolean countNullObjects,boolean recurse){
  if (currentDO != null) {
    currentList.add(currentDO);
    List instanceProperties=currentDO.getInstanceProperties();
    SDOProperty nextProperty=null;
    Object value=null;
    if (recurse) {
      for (int i=0; i < instanceProperties.size(); i++) {
        nextProperty=(SDOProperty)instanceProperties.get(i);
        value=currentDO.get(nextProperty);
        boolean recurseHopefullyNotToInfinityPlease=true;
        if (!nextProperty.getType().isChangeSummaryType() && !nextProperty.getType().isDataType()) {
          if (null != nextProperty.getOpposite()) {
            recurseHopefullyNotToInfinityPlease=false;
          }
          if (nextProperty.isMany()) {
            Object manyItem;
            for (int index=0; index < ((List)value).size(); index++) {
              manyItem=((List)value).get(index);
              if (manyItem != null && manyItem instanceof SDODataObject) {
                preOrderTraversalDataObjectList((SDODataObject)manyItem,currentList,countNullObjects,recurseHopefullyNotToInfinityPlease);
              }
            }
          }
 else {
            if (value != null) {
              preOrderTraversalDataObjectList((SDODataObject)value,currentList,countNullObjects,recurseHopefullyNotToInfinityPlease);
            }
          }
        }
      }
    }
  }
 else {
    if (countNullObjects) {
      currentList.add(currentDO);
    }
  }
  return currentList;
}