Program: 73623
Project: 73623
Buggy source:
/** 
 * get the end row index for the certain dimension cursor.
 * @param dimAxisIndex
 * @return
 */
int getEdgeEnd(int dimAxisIndex){
  if (this.relationMap.mirrorStartPosition == 0) {
    EdgeInfo edgeInfo=findCurrentEdgeInfo(dimAxisIndex);
    if (edgeInfo == null)     return -1;
    int endPosition=edgeInfo.firstChild;
    int index=this.relationMap.relation[dimAxisIndex].indexOf(edgeInfo);
    if (index < this.relationMap.relation[dimAxisIndex].size() - 1) {
      EdgeInfo nextEdgeInfo=(EdgeInfo)this.relationMap.relation[dimAxisIndex].get(index + 1);
      EdgeInfo nextOuterEdgeInfo=this.findOuterMostChildEdgeInfo(dimAxisIndex,nextEdgeInfo);
      endPosition=nextOuterEdgeInfo.firstChild - 1;
    }
 else {
      endPosition=this.relationMap.traverseLength - 1;
    }
    return endPosition;
  }
 else {
    if (!this.dimAxis[dimAxisIndex].isMirrored()) {
      EdgeInfo edgeInfo=findCurrentEdgeInfo(dimAxisIndex);
      int index=this.relationMap.relation[dimAxisIndex].indexOf(edgeInfo);
      if (index < this.relationMap.relation[dimAxisIndex].size() - 1) {
        EdgeInfo nextEdgeInfo=(EdgeInfo)this.relationMap.relation[dimAxisIndex].get(index + 1);
        int start=findOuterMostChildEdgeInfoIndex(dimAxisIndex,nextEdgeInfo);
        if (relationMap.mirrorStartPosition > 0)         for (int i=relationMap.mirrorStartPosition; i < this.dimAxis.length; i++) {
          start=start * this.relationMap.mirrorLength[i];
        }
        return start - 1;
      }
 else {
        return this.relationMap.traverseLength - 1;
      }
    }
 else {
      int start=caculateOffset(dimAxisIndex,false);
      if (start < 0)       return start;
      if (dimAxisIndex == this.dimAxis.length - 1) {
        start+=this.dimensionCursorPosition[dimAxisIndex] + 1;
      }
      return start - 1;
    }
  }
}

Fixed version (ground truth):
/** 
 * get the end row index for the certain dimension cursor.
 * @param dimAxisIndex
 * @return
 */
int getEdgeEnd(int dimAxisIndex){
  if (this.relationMap.mirrorStartPosition == 0) {
    EdgeInfo edgeInfo=findCurrentEdgeInfo(dimAxisIndex);
    if (edgeInfo == null)     return -1;
    int endPosition=edgeInfo.firstChild;
    int index=this.relationMap.currentRelation[dimAxisIndex].indexOf(edgeInfo);
    if (index < this.relationMap.currentRelation[dimAxisIndex].size() - 1) {
      EdgeInfo nextEdgeInfo=(EdgeInfo)this.relationMap.currentRelation[dimAxisIndex].get(index + 1);
      EdgeInfo nextOuterEdgeInfo=this.findOuterMostChildEdgeInfo(dimAxisIndex,nextEdgeInfo);
      endPosition=nextOuterEdgeInfo.firstChild - 1;
    }
 else {
      endPosition=this.relationMap.traverseLength - 1;
    }
    return endPosition;
  }
 else {
    if (!this.dimAxis[dimAxisIndex].isMirrored()) {
      EdgeInfo edgeInfo=findCurrentEdgeInfo(dimAxisIndex);
      int index=this.relationMap.currentRelation[dimAxisIndex].indexOf(edgeInfo);
      if (index < this.relationMap.currentRelation[dimAxisIndex].size() - 1) {
        EdgeInfo nextEdgeInfo=(EdgeInfo)this.relationMap.currentRelation[dimAxisIndex].get(index + 1);
        int start=findOuterMostChildEdgeInfoIndex(dimAxisIndex,nextEdgeInfo);
        if (relationMap.mirrorStartPosition > 0)         for (int i=relationMap.mirrorStartPosition; i < this.dimAxis.length; i++) {
          start=start * this.relationMap.mirrorLength[i];
        }
        return start - 1;
      }
 else {
        return this.relationMap.traverseLength - 1;
      }
    }
 else {
      int start=caculateOffset(dimAxisIndex,false);
      if (start < 0)       return start;
      if (dimAxisIndex == this.dimAxis.length - 1) {
        start+=this.dimensionCursorPosition[dimAxisIndex] + 1;
      }
      return start - 1;
    }
  }
}