Program: 66361
Project: 66361
Buggy source:
@Override public List<TimeMember> getResult(TimeMember member){
  List<TimeMember> timeMembers=new ArrayList<TimeMember>();
  String[] levelTypes=member.getLevelType();
  int[] values=member.getMemberValue();
  Calendar cal=new GregorianCalendar();
  translateToCal(cal,levelTypes,values);
  timeMembers.add(member);
  int[] tmp;
  for (int i=0; i < offset - 1; i++) {
    if (levelType.equals(TimeMember.TIME_LEVEL_TYPE_YEAR)) {
      cal.add(Calendar.YEAR,-1);
    }
 else     if (levelType.equals(TimeMember.TIME_LEVEL_TYPE_MONTH)) {
      cal.add(Calendar.MONTH,-1);
    }
 else     if (levelType.equals(TimeMember.TIME_LEVEL_TYPE_QUARTER)) {
      cal.add(Calendar.MONTH,-3);
    }
 else     if (levelType.equals(TimeMember.TIME_LEVEL_TYPE_WEEK_OF_MONTH)) {
      cal.add(Calendar.WEEK_OF_YEAR,-1);
    }
 else     if (levelType.equals(TimeMember.TIME_LEVEL_TYPE_WEEK_OF_YEAR)) {
      cal.add(Calendar.WEEK_OF_YEAR,-1);
    }
 else     if (levelType.equals(TimeMember.TIME_LEVEL_TYPE_DAY_OF_MONTH)) {
      cal.add(Calendar.DATE,-1);
    }
 else     if (levelType.equals(TimeMember.TIME_LEVEL_TYPE_DAY_OF_WEEK)) {
      cal.add(Calendar.DATE,-1);
    }
 else     if (levelType.equals(TimeMember.TIME_LEVEL_TYPE_DAY_OF_YEAR)) {
      cal.add(Calendar.DATE,-1);
    }
    tmp=getValueFromCal(cal,levelTypes);
    TimeMember timeMember=new TimeMember(tmp,levelTypes);
    timeMembers.add(timeMember);
  }
  List<TimeMember> newTimeMemebers=new ArrayList<TimeMember>();
  for (int i=timeMembers.size() - 1; i >= 0; i--) {
    newTimeMemebers.add(timeMembers.get(i));
  }
  return newTimeMemebers;
}

Fixed version (ground truth):
public List<TimeMember> getResult(TimeMember member){
  List<TimeMember> timeMembers=new ArrayList<TimeMember>();
  String[] levelTypes=member.getLevelType();
  int[] values=member.getMemberValue();
  Calendar cal=new GregorianCalendar();
  translateToCal(cal,levelTypes,values);
  timeMembers.add(member);
  int[] tmp;
  for (int i=0; i < offset - 1; i++) {
    if (levelType.equals(TimeMember.TIME_LEVEL_TYPE_YEAR)) {
      cal.add(Calendar.YEAR,-1);
    }
 else     if (levelType.equals(TimeMember.TIME_LEVEL_TYPE_MONTH)) {
      cal.add(Calendar.MONTH,-1);
    }
 else     if (levelType.equals(TimeMember.TIME_LEVEL_TYPE_QUARTER)) {
      cal.add(Calendar.MONTH,-3);
    }
 else     if (levelType.equals(TimeMember.TIME_LEVEL_TYPE_WEEK_OF_MONTH)) {
      cal.add(Calendar.WEEK_OF_YEAR,-1);
    }
 else     if (levelType.equals(TimeMember.TIME_LEVEL_TYPE_WEEK_OF_YEAR)) {
      cal.add(Calendar.WEEK_OF_YEAR,-1);
    }
 else     if (levelType.equals(TimeMember.TIME_LEVEL_TYPE_DAY_OF_MONTH)) {
      cal.add(Calendar.DATE,-1);
    }
 else     if (levelType.equals(TimeMember.TIME_LEVEL_TYPE_DAY_OF_WEEK)) {
      cal.add(Calendar.DATE,-1);
    }
 else     if (levelType.equals(TimeMember.TIME_LEVEL_TYPE_DAY_OF_YEAR)) {
      cal.add(Calendar.DATE,-1);
    }
    tmp=getValueFromCal(cal,levelTypes);
    TimeMember timeMember=new TimeMember(tmp,levelTypes);
    timeMembers.add(timeMember);
  }
  List<TimeMember> newTimeMemebers=new ArrayList<TimeMember>();
  for (int i=timeMembers.size() - 1; i >= 0; i--) {
    newTimeMemebers.add(timeMembers.get(i));
  }
  return newTimeMemebers;
}