Program: 73630
Project: 73630
Buggy source:
/** 
 * Based on current dimensionCursor position, get current edge info for certain dimensionAxis.
 * @param dimensionAxis
 * @return
 */
private EdgeInfo findCurrentEdgeInfo(int dimensionAxis){
  if (dimensionAxis < 0 || dimensionAxis > this.dimAxis.length) {
    return null;
  }
  EdgeInfo tempEdgeInfo1=null, tempEdgeInfo2=null, edgeInfo=null;
  int endPosition=0;
  for (int index=0; index <= dimensionAxis; index++) {
    if (dimensionAxis == index) {
      if (this.relationMap.relation[index].size() > endPosition && this.dimensionCursorPosition[index] > -1 && this.dimensionCursorPosition[index] + endPosition < this.relationMap.relation[index].size() && (tempEdgeInfo2 == null || this.dimensionCursorPosition[index] + endPosition < tempEdgeInfo2.firstChild)) {
        edgeInfo=(EdgeInfo)this.relationMap.relation[index].get(this.dimensionCursorPosition[index] + endPosition);
      }
 else       if (this.dimensionCursorPosition[index] == -1)       return null;
      break;
    }
 else {
      if (this.dimensionCursorPosition[index] + endPosition < this.relationMap.relation[index].size() && this.dimensionCursorPosition[index] > -1 && this.relationMap.relation[index].size() > endPosition) {
        tempEdgeInfo1=(EdgeInfo)this.relationMap.relation[index].get(this.dimensionCursorPosition[index] + endPosition);
        if (this.dimensionCursorPosition[index] + endPosition + 1 < this.relationMap.relation[index].size()) {
          tempEdgeInfo2=(EdgeInfo)this.relationMap.relation[index].get(this.dimensionCursorPosition[index] + endPosition + 1);
        }
      }
 else       return null;
      if (tempEdgeInfo1 != null) {
        endPosition=tempEdgeInfo1.firstChild;
      }
    }
  }
  return edgeInfo;
}

Fixed version (ground truth):
/** 
 * Based on current dimensionCursor position, get current edge info for certain dimensionAxis.
 * @param dimensionAxis
 * @return
 */
private EdgeInfo findCurrentEdgeInfo(int dimensionAxis){
  if (dimensionAxis < 0 || dimensionAxis > this.dimAxis.length) {
    return null;
  }
  EdgeInfo tempEdgeInfo1=null, tempEdgeInfo2=null, edgeInfo=null;
  int endPosition=0;
  for (int index=0; index <= dimensionAxis; index++) {
    if (dimensionAxis == index) {
      if (this.relationMap.currentRelation[index].size() > endPosition && this.dimensionCursorPosition[index] > -1 && this.dimensionCursorPosition[index] + endPosition < this.relationMap.currentRelation[index].size() && (tempEdgeInfo2 == null || this.dimensionCursorPosition[index] + endPosition < tempEdgeInfo2.firstChild)) {
        edgeInfo=(EdgeInfo)this.relationMap.currentRelation[index].get(this.dimensionCursorPosition[index] + endPosition);
      }
 else       if (this.dimensionCursorPosition[index] == -1)       return null;
      break;
    }
 else {
      if (this.dimensionCursorPosition[index] + endPosition < this.relationMap.currentRelation[index].size() && this.dimensionCursorPosition[index] > -1 && this.relationMap.currentRelation[index].size() > endPosition) {
        tempEdgeInfo1=(EdgeInfo)this.relationMap.currentRelation[index].get(this.dimensionCursorPosition[index] + endPosition);
        if (this.dimensionCursorPosition[index] + endPosition + 1 < this.relationMap.currentRelation[index].size()) {
          tempEdgeInfo2=(EdgeInfo)this.relationMap.currentRelation[index].get(this.dimensionCursorPosition[index] + endPosition + 1);
        }
      }
 else       return null;
      if (tempEdgeInfo1 != null) {
        endPosition=tempEdgeInfo1.firstChild;
      }
    }
  }
  return edgeInfo;
}