Program: 69510
Project: 69510
Buggy source:
private void populateMirror() throws IOException {
  MemberTreeNode parent;
  MemberTreeNode child;
  Object[] preValue=new Object[mirrorLevel];
  Object[] currValue=new Object[mirrorLevel];
  for (int i=0; i < rs.length(); i++) {
    rs.seek(i);
    parent=this.rootNode;
    for (int j=0; j < mirrorLevel; j++) {
      currValue[j]=rs.getLevelKeyValue(j)[0];
    }
    for (int j=0; j < mirrorLevel; j++) {
      if (!isEqualObject(preValue[j],currValue[j])) {
        child=new MemberTreeNode(currValue[j]);
        parent.insertNode(child);
        child.parentNode=parent;
        parent=child;
      }
 else {
        if (parent.childNodesList.size() > 0)         parent=(MemberTreeNode)parent.childNodesList.get(parent.childNodesList.size() - 1);
 else {
          child=new MemberTreeNode(currValue[j]);
          parent.insertNode(child);
          child.parentNode=parent;
          parent=child;
        }
      }
    }
    for (int j=0; j < breakHierarchyList.length; j++) {
      if (!breakHierarchyList[j].contains(rs.getLevelKeyValue(j + mirrorLevel)[0]))       breakHierarchyList[j].add(rs.getLevelKeyValue(j + mirrorLevel)[0]);
    }
    for (int k=0; k < mirrorLevel; k++) {
      preValue[k]=currValue[k];
    }
  }
  this.length=getLength(this.rootNode);
  for (int k=0; k < breakHierarchyList.length; k++) {
    final int sortType=getSortTypeOnMirroredLevel(k + mirrorLevel);
    if (sortType != IDimensionSortDefn.SORT_UNDEFINED) {
      Collections.sort(breakHierarchyList[k],new Comparator(){
        public int compare(        final Object arg0,        final Object arg1){
          if (sortType == IDimensionSortDefn.SORT_ASC)           return ((Comparable)arg0).compareTo(arg1);
 else           return ((Comparable)arg0).compareTo(arg1) * -1;
        }
      }
);
    }
    this.length*=breakHierarchyList[k].size();
  }
}

Fixed version (ground truth):
private void populateMirror() throws IOException {
  MemberTreeNode parent;
  MemberTreeNode child;
  Object[] preValue=new Object[mirrorLevel];
  Object[] currValue=new Object[mirrorLevel];
  for (int i=0; i < rs.length(); i++) {
    rs.seek(i);
    parent=this.rootNode;
    for (int j=0; j < mirrorLevel; j++) {
      currValue[j]=rs.getLevelKeyValue(j)[0];
    }
    for (int j=0; j < mirrorLevel; j++) {
      if (!isEqualObject(preValue[j],currValue[j])) {
        Member member=new Member();
        member.setKeyValues(new Object[]{currValue[j]});
        member.setAttributes(rs.getLevelAttributesValue(j));
        child=new MemberTreeNode(member);
        parent.insertNode(child);
        child.parentNode=parent;
        parent=child;
      }
 else {
        if (parent.childNodesList.size() > 0)         parent=(MemberTreeNode)parent.childNodesList.get(parent.childNodesList.size() - 1);
 else {
          Member member=new Member();
          member.setKeyValues(new Object[]{currValue[j]});
          member.setAttributes(rs.getLevelAttributesValue(j));
          child=new MemberTreeNode(member);
          parent.insertNode(child);
          child.parentNode=parent;
          parent=child;
        }
      }
    }
    for (int j=0; j < breakHierarchyList.length; j++) {
      Member temp=new Member();
      temp.setKeyValues(rs.getLevelKeyValue(j + mirrorLevel));
      if (!breakHierarchyList[j].contains(temp)) {
        Member member=new Member();
        member.setKeyValues(rs.getLevelKeyValue(j + mirrorLevel));
        member.setAttributes(rs.getLevelAttributesValue(j + mirrorLevel));
        breakHierarchyList[j].add(member);
      }
    }
    for (int k=0; k < mirrorLevel; k++) {
      preValue[k]=currValue[k];
    }
  }
  this.length=getLength(this.rootNode);
  for (int k=0; k < breakHierarchyList.length; k++) {
    final int sortType=getSortTypeOnMirroredLevel(k + mirrorLevel);
    if (sortType != IDimensionSortDefn.SORT_UNDEFINED) {
      Collections.sort(breakHierarchyList[k],new Comparator(){
        public int compare(        final Object arg0,        final Object arg1){
          if (sortType == IDimensionSortDefn.SORT_ASC)           return ((Comparable)arg0).compareTo(arg1);
 else           return ((Comparable)arg0).compareTo(arg1) * -1;
        }
      }
);
    }
    this.length*=breakHierarchyList[k].size();
  }
}