Program: 69212
Project: 69212
Buggy source:
public static MemberTreeNode[] getDateTimeNodes(String[][] types,Object dateTimeValue,int index){
  String[] dateTypes=new String[types.length - index];
  for (int i=index; i < types.length; i++) {
    dateTypes[i - index]=getTimeType(types[i][0]);
  }
  MemberTreeNode[] secondsNode=null;
  MemberTreeNode[] minutesNode=null;
  MemberTreeNode[] hoursNode=null;
  MemberTreeNode[] dayOfYearNode=null;
  MemberTreeNode[] dayOfMonthNode=null;
  MemberTreeNode[] dayOfWeekNode=null;
  MemberTreeNode[] monthNode=null;
  MemberTreeNode[] parent=null;
  List temp=new ArrayList();
  List parentList=new ArrayList();
  for (int i=0; i < dateTypes.length; i++) {
    temp.clear();
    if (DATE_TIME_LEVEL_TYPE_SECOND.equals(dateTypes[i])) {
      if (parentList.size() > 0) {
        for (int t=0; t < parentList.size(); t++) {
          MemberTreeNode[] nodes=(MemberTreeNode[])parentList.get(t);
          for (int j=0; j < nodes.length; j++) {
            secondsNode=createSecond();
            nodes[j].addAllNodes(secondsNode);
            temp.add(secondsNode);
          }
        }
        parentList.clear();
        parentList.addAll(temp);
      }
 else {
        secondsNode=createSecond();
        parent=secondsNode;
        parentList.clear();
        parentList.add(secondsNode);
      }
    }
 else     if (DATE_TIME_LEVEL_TYPE_MINUTE.equals(dateTypes[i])) {
      if (parentList.size() > 0) {
        for (int t=0; t < parentList.size(); t++) {
          MemberTreeNode[] nodes=(MemberTreeNode[])parentList.get(t);
          for (int j=0; j < nodes.length; j++) {
            minutesNode=createMinute();
            nodes[j].addAllNodes(minutesNode);
            temp.add(minutesNode);
          }
        }
        parentList.clear();
        parentList.addAll(temp);
      }
 else {
        minutesNode=createMinute();
        parent=minutesNode;
        parentList.clear();
        parentList.add(minutesNode);
      }
    }
 else     if (DATE_TIME_LEVEL_TYPE_HOUR.equals(dateTypes[i])) {
      if (parentList.size() > 0) {
        for (int t=0; t < parentList.size(); t++) {
          MemberTreeNode[] nodes=(MemberTreeNode[])parentList.get(t);
          for (int j=0; j < nodes.length; j++) {
            hoursNode=createHour();
            nodes[j].addAllNodes(hoursNode);
            temp.add(hoursNode);
          }
        }
        parentList.clear();
        parentList.addAll(temp);
      }
 else {
        hoursNode=createHour();
        parent=hoursNode;
        parentList.clear();
        parentList.add(hoursNode);
      }
    }
 else     if (DATE_TIME_LEVEL_TYPE_DAY_OF_YEAR.equals(dateTypes[i])) {
      int year=getCalendar((Date)dateTimeValue).get(Calendar.YEAR);
      if (parentList.size() > 0) {
        for (int t=0; t < parentList.size(); t++) {
          MemberTreeNode[] nodes=(MemberTreeNode[])parentList.get(t);
          for (int j=0; j < nodes.length; j++) {
            dayOfYearNode=createDayOfYearNode(year);
            nodes[j].addAllNodes(dayOfYearNode);
            temp.add(dayOfYearNode);
          }
        }
        parentList.clear();
        parentList.addAll(temp);
      }
 else {
        dayOfYearNode=createDayOfYearNode(year);
        parent=dayOfYearNode;
        parentList.clear();
        parentList.add(dayOfYearNode);
      }
    }
 else     if (DATE_TIME_LEVEL_TYPE_DAY_OF_MONTH.equals(dateTypes[i])) {
      int year=getCalendar((Date)dateTimeValue).get(Calendar.YEAR);
      int month=getCalendar((Date)dateTimeValue).get(Calendar.MONTH);
      boolean isUnderMonthHierarchy=false;
      if (i > 0)       isUnderMonthHierarchy=isDayMonth(dateTypes[i - 1]);
      if (parentList.size() > 0) {
        for (int t=0; t < parentList.size(); t++) {
          MemberTreeNode[] nodes=(MemberTreeNode[])parentList.get(t);
          for (int j=0; j < nodes.length; j++) {
            if (isUnderMonthHierarchy)             dayOfMonthNode=createDayOfMonth(year,((Integer)nodes[j].key).intValue());
 else             dayOfMonthNode=createDayOfMonth(year,month + 1);
            nodes[j].addAllNodes(dayOfMonthNode);
            temp.add(dayOfMonthNode);
          }
        }
        parentList.clear();
        parentList.addAll(temp);
      }
 else {
        dayOfMonthNode=createDayOfMonth(year,month + 1);
        parent=dayOfMonthNode;
        parentList.clear();
        parentList.add(dayOfMonthNode);
      }
    }
 else     if (DATE_TIME_LEVEL_TYPE_DAY_OF_WEEK.equals(dateTypes[i])) {
      if (parentList.size() > 0) {
        for (int t=0; t < parentList.size(); t++) {
          MemberTreeNode[] nodes=(MemberTreeNode[])parentList.get(t);
          for (int j=0; j < nodes.length; j++) {
            dayOfWeekNode=createDayOfWeek();
            nodes[j].addAllNodes(dayOfWeekNode);
            temp.add(dayOfWeekNode);
          }
        }
        parentList.clear();
        parentList.addAll(temp);
      }
 else {
        dayOfWeekNode=createDayOfWeek();
        parent=dayOfWeekNode;
        parentList.clear();
        parentList.add(dayOfWeekNode);
      }
    }
 else     if (DATE_TIME_LEVEL_TYPE_MONTH.equals(dateTypes[i])) {
      if (isQuarterMonth(dateTypes)) {
        for (int t=0; t < parentList.size(); t++) {
          MemberTreeNode[] nodes=(MemberTreeNode[])parentList.get(t);
          for (int k=0; k < nodes.length; k++) {
            monthNode=createQuarterMonthNode(k);
            nodes[k].addAllNodes(monthNode);
            temp.add(monthNode);
          }
        }
        parentList.clear();
        parentList.addAll(temp);
      }
 else {
        monthNode=createMonthNode();
        parent=monthNode;
        parentList.add(parent);
      }
    }
 else     if (DATE_TIME_LEVEL_TYPE_QUARTER.equals(dateTypes[i])) {
      parent=createQuarterNode();
      parentList.add(parent);
    }
  }
  return parent;
}

Fixed version (ground truth):
public static MemberTreeNode[] getDateTimeNodes(String[][] types,Object dateTimeValue,int index){
  String[] dateTypes=new String[types.length - index];
  for (int i=index; i < types.length; i++) {
    dateTypes[i - index]=getTimeType(types[i][0]);
  }
  MemberTreeNode[] secondsNode=null;
  MemberTreeNode[] minutesNode=null;
  MemberTreeNode[] hoursNode=null;
  MemberTreeNode[] dayOfYearNode=null;
  MemberTreeNode[] dayOfMonthNode=null;
  MemberTreeNode[] dayOfWeekNode=null;
  MemberTreeNode[] monthNode=null;
  MemberTreeNode[] parent=null;
  List temp=new ArrayList();
  List parentList=new ArrayList();
  for (int i=0; i < dateTypes.length; i++) {
    temp.clear();
    if (DATE_TIME_LEVEL_TYPE_SECOND.equals(dateTypes[i])) {
      if (parentList.size() > 0) {
        for (int t=0; t < parentList.size(); t++) {
          MemberTreeNode[] nodes=(MemberTreeNode[])parentList.get(t);
          for (int j=0; j < nodes.length; j++) {
            secondsNode=createSecond();
            nodes[j].addAllNodes(secondsNode);
            temp.add(secondsNode);
          }
        }
        parentList.clear();
        parentList.addAll(temp);
      }
 else {
        secondsNode=createSecond();
        parent=secondsNode;
        parentList.clear();
        parentList.add(secondsNode);
      }
    }
 else     if (DATE_TIME_LEVEL_TYPE_MINUTE.equals(dateTypes[i])) {
      if (parentList.size() > 0) {
        for (int t=0; t < parentList.size(); t++) {
          MemberTreeNode[] nodes=(MemberTreeNode[])parentList.get(t);
          for (int j=0; j < nodes.length; j++) {
            minutesNode=createMinute();
            nodes[j].addAllNodes(minutesNode);
            temp.add(minutesNode);
          }
        }
        parentList.clear();
        parentList.addAll(temp);
      }
 else {
        minutesNode=createMinute();
        parent=minutesNode;
        parentList.clear();
        parentList.add(minutesNode);
      }
    }
 else     if (DATE_TIME_LEVEL_TYPE_HOUR.equals(dateTypes[i])) {
      if (parentList.size() > 0) {
        for (int t=0; t < parentList.size(); t++) {
          MemberTreeNode[] nodes=(MemberTreeNode[])parentList.get(t);
          for (int j=0; j < nodes.length; j++) {
            hoursNode=createHour();
            nodes[j].addAllNodes(hoursNode);
            temp.add(hoursNode);
          }
        }
        parentList.clear();
        parentList.addAll(temp);
      }
 else {
        hoursNode=createHour();
        parent=hoursNode;
        parentList.clear();
        parentList.add(hoursNode);
      }
    }
 else     if (DATE_TIME_LEVEL_TYPE_DAY_OF_YEAR.equals(dateTypes[i])) {
      int year=getCalendar((Date)dateTimeValue).get(Calendar.YEAR);
      if (parentList.size() > 0) {
        for (int t=0; t < parentList.size(); t++) {
          MemberTreeNode[] nodes=(MemberTreeNode[])parentList.get(t);
          for (int j=0; j < nodes.length; j++) {
            dayOfYearNode=createDayOfYearNode(year);
            nodes[j].addAllNodes(dayOfYearNode);
            temp.add(dayOfYearNode);
          }
        }
        parentList.clear();
        parentList.addAll(temp);
      }
 else {
        dayOfYearNode=createDayOfYearNode(year);
        parent=dayOfYearNode;
        parentList.clear();
        parentList.add(dayOfYearNode);
      }
    }
 else     if (DATE_TIME_LEVEL_TYPE_DAY_OF_MONTH.equals(dateTypes[i])) {
      int year=getCalendar((Date)dateTimeValue).get(Calendar.YEAR);
      int month=getCalendar((Date)dateTimeValue).get(Calendar.MONTH);
      boolean isUnderMonthHierarchy=false;
      if (i > 0)       isUnderMonthHierarchy=isDayMonth(dateTypes[i - 1]);
      if (parentList.size() > 0) {
        for (int t=0; t < parentList.size(); t++) {
          MemberTreeNode[] nodes=(MemberTreeNode[])parentList.get(t);
          for (int j=0; j < nodes.length; j++) {
            if (isUnderMonthHierarchy)             dayOfMonthNode=createDayOfMonth(year,((Integer)nodes[j].key).intValue());
 else             dayOfMonthNode=createDayOfMonth(year,month + 1);
            nodes[j].addAllNodes(dayOfMonthNode);
            temp.add(dayOfMonthNode);
          }
        }
        parentList.clear();
        parentList.addAll(temp);
      }
 else {
        dayOfMonthNode=createDayOfMonth(year,month + 1);
        parent=dayOfMonthNode;
        parentList.clear();
        parentList.add(dayOfMonthNode);
      }
    }
 else     if (DATE_TIME_LEVEL_TYPE_DAY_OF_WEEK.equals(dateTypes[i])) {
      if (parentList.size() > 0) {
        for (int t=0; t < parentList.size(); t++) {
          MemberTreeNode[] nodes=(MemberTreeNode[])parentList.get(t);
          for (int j=0; j < nodes.length; j++) {
            dayOfWeekNode=createDayOfWeek();
            nodes[j].addAllNodes(dayOfWeekNode);
            temp.add(dayOfWeekNode);
          }
        }
        parentList.clear();
        parentList.addAll(temp);
      }
 else {
        dayOfWeekNode=createDayOfWeek();
        parent=dayOfWeekNode;
        parentList.clear();
        parentList.add(dayOfWeekNode);
      }
    }
 else     if (DATE_TIME_LEVEL_TYPE_MONTH.equals(dateTypes[i])) {
      if (isQuarterMonth(dateTypes)) {
        for (int t=0; t < parentList.size(); t++) {
          MemberTreeNode[] nodes=(MemberTreeNode[])parentList.get(t);
          for (int k=0; k < nodes.length; k++) {
            monthNode=createQuarterMonthNode(k);
            nodes[k].addAllNodes(monthNode);
            temp.add(monthNode);
          }
        }
        parentList.clear();
        parentList.addAll(temp);
      }
 else {
        monthNode=createMonthNode();
        parent=monthNode;
        parentList.add(parent);
      }
    }
 else     if (DATE_TIME_LEVEL_TYPE_QUARTER.equals(dateTypes[i])) {
      parent=createQuarterNode();
      parentList.add(parent);
    }
  }
  for (int i=0; i < parent.length; i++) {
    ((Member)parent[i].key).setAttributes(new Object[]{dateTimeValue});
  }
  return parent;
}