Program: 138168
Project: 138168
Buggy source:
/** 
 * Handle the category IndicatorEnum.
 */
private void processCategoryIndicator(){
  List<IndicatorEnum> categoryEnumList=new ArrayList<IndicatorEnum>();
  listCopy(categoryEnumList,flatIndicatorEnumList);
  Iterator<IndicatorEnum> iterator=flatIndicatorEnumList.iterator();
  List<IndicatorEnum> currentCountsChildren=new ArrayList<IndicatorEnum>();
  List<IndicatorEnum> currentBOXChildren=new ArrayList<IndicatorEnum>();
  while (iterator.hasNext()) {
    IndicatorEnum indEnum=iterator.next();
    if (countsEnumChildren.contains(indEnum)) {
      currentCountsChildren.add(indEnum);
      continue;
    }
    if (boxEnumChildren.contains(indEnum)) {
      currentBOXChildren.add(indEnum);
    }
    if ((indEnum != IndicatorEnum.CountsIndicatorEnum) && (indEnum != IndicatorEnum.BoxIIndicatorEnum) && indEnum.hasChildren()) {
      for (      IndicatorEnum childrenEnum : indEnum.getChildren()) {
        categoryEnumList.remove(childrenEnum);
      }
    }
  }
  if (currentCountsChildren.size() == countsEnumChildren.size() && flatIndicatorEnumList.contains(IndicatorEnum.CountsIndicatorEnum)) {
    categoryEnumList.removeAll(currentCountsChildren);
  }
 else {
    categoryEnumList.remove(IndicatorEnum.CountsIndicatorEnum);
  }
  if (currentBOXChildren.size() == boxEnumChildren.size() && flatIndicatorEnumList.contains(IndicatorEnum.BoxIIndicatorEnum)) {
    categoryEnumList.removeAll(currentBOXChildren);
  }
 else {
    categoryEnumList.remove(IndicatorEnum.BoxIIndicatorEnum);
  }
  plainIndicatorUnits=createCategoryIndicatorUnits(categoryEnumList.toArray(new IndicatorEnum[categoryEnumList.size()]));
}

Fixed version (ground truth):
/** 
 * Handle the category IndicatorEnum.
 */
private void processCategoryIndicator(){
  List<IndicatorEnum> categoryEnumList=new ArrayList<IndicatorEnum>();
  listCopy(categoryEnumList,flatIndicatorEnumList);
  Iterator<IndicatorEnum> iterator=flatIndicatorEnumList.iterator();
  List<IndicatorEnum> currentCountsChildren=new ArrayList<IndicatorEnum>();
  List<IndicatorEnum> currentBOXChildren=new ArrayList<IndicatorEnum>();
  while (iterator.hasNext()) {
    IndicatorEnum indEnum=iterator.next();
    if (countsEnumChildren.contains(indEnum)) {
      currentCountsChildren.add(indEnum);
      continue;
    }
    if (boxEnumChildren.contains(indEnum)) {
      currentBOXChildren.add(indEnum);
    }
    if (null != indEnum && (indEnum != IndicatorEnum.CountsIndicatorEnum) && (indEnum != IndicatorEnum.BoxIIndicatorEnum) && indEnum.hasChildren()) {
      for (      IndicatorEnum childrenEnum : indEnum.getChildren()) {
        categoryEnumList.remove(childrenEnum);
      }
    }
  }
  if (currentCountsChildren.size() == countsEnumChildren.size() && flatIndicatorEnumList.contains(IndicatorEnum.CountsIndicatorEnum)) {
    categoryEnumList.removeAll(currentCountsChildren);
  }
 else {
    categoryEnumList.remove(IndicatorEnum.CountsIndicatorEnum);
  }
  if (currentBOXChildren.size() == boxEnumChildren.size() && flatIndicatorEnumList.contains(IndicatorEnum.BoxIIndicatorEnum)) {
    categoryEnumList.removeAll(currentBOXChildren);
  }
 else {
    categoryEnumList.remove(IndicatorEnum.BoxIIndicatorEnum);
  }
  plainIndicatorUnits=createCategoryIndicatorUnits(categoryEnumList.toArray(new IndicatorEnum[categoryEnumList.size()]));
}