Program: 58695
Project: 58695
Buggy source:
private ArrayList<Integer> getAl(ArrayList<Integer> alExamples,ArrayList<Integer> count,ArrayList<Integer> idxExamples,int[] idx,EClustererType eClustererType){
  ArrayList<Integer> indexes=new ArrayList<Integer>();
  IVirtualArray contentVA=set.getVA(iVAIdContent);
  IVirtualArray storageVA=set.getVA(iVAIdStorage);
  int counter=0;
  int idxCnt=0;
  if (eClustererType == EClustererType.GENE_CLUSTERING) {
    for (    Integer example : alExamples) {
      for (      Integer icontent : contentVA) {
        if (idx[contentVA.get(icontent)] == example) {
          indexes.add(icontent);
          count.set(counter,count.get(counter) + 1);
        }
        if (example == contentVA.get(icontent)) {
          idxExamples.add(contentVA.get(example));
          idxCnt=0;
        }
        idxCnt++;
      }
      counter++;
    }
  }
 else {
    for (    Integer example : alExamples) {
      for (      Integer icontent : storageVA) {
        if (idx[storageVA.get(icontent)] == example) {
          indexes.add(icontent);
          count.set(counter,count.get(counter) + 1);
        }
        if (example == storageVA.get(icontent)) {
          idxExamples.add(storageVA.get(example));
          idxCnt=0;
        }
        idxCnt++;
      }
      counter++;
    }
  }
  return indexes;
}

Fixed version (ground truth):
/** 
 * Function returns an array list with ordered indexes out of the VA after clustering. Additionally the indexes of the examples (cluster representatives) will be determined.
 * @param alExamples array list containing the indexes of the examples (cluster representatives) determined by the cluster algorithm
 * @param alClusterSizes array list which will be filled with the sizes of each cluster
 * @param idxExamples array list containing indexes of examples in the VA
 * @param idx cluster result determined by affinity propagation
 * @param eClustererType the cluster type
 * @return An array list with indexes in the VA
 */
private ArrayList<Integer> getAl(ArrayList<Integer> alExamples,ArrayList<Integer> alClusterSizes,ArrayList<Integer> idxExamples,int[] idx,EClustererType eClustererType){
  ArrayList<Integer> indexes=new ArrayList<Integer>();
  IVirtualArray contentVA=set.getVA(iVAIdContent);
  IVirtualArray storageVA=set.getVA(iVAIdStorage);
  int counter=0;
  int idxCnt=0;
  ArrayList<Integer> alIndexListContent=contentVA.getIndexList();
  ArrayList<Integer> alIndexListStorage=storageVA.getIndexList();
  if (eClustererType == EClustererType.GENE_CLUSTERING) {
    for (    Integer example : alExamples) {
      for (int index=0; index < alIndexListContent.size(); index++) {
        if (idx[index] == example) {
          indexes.add(alIndexListContent.get(index));
          alClusterSizes.set(counter,alClusterSizes.get(counter) + 1);
        }
        if (example == index) {
          idxExamples.add(contentVA.get(example));
          idxCnt=0;
        }
        idxCnt++;
      }
      counter++;
    }
  }
 else {
    for (    Integer example : alExamples) {
      for (int index=0; index < alIndexListStorage.size(); index++) {
        if (idx[index] == example) {
          indexes.add(alIndexListStorage.get(index));
          alClusterSizes.set(counter,alClusterSizes.get(counter) + 1);
        }
        if (example == index) {
          idxExamples.add(storageVA.get(example));
          idxCnt=0;
        }
        idxCnt++;
      }
      counter++;
    }
  }
  return indexes;
}