Program: 58197
Project: 58197
Buggy source:
private TempResult cluster(ISet set,ClusterState clusterState){
  ArrayList<Integer> indices=new ArrayList<Integer>();
  StringBuffer buffer=new StringBuffer();
  buffer.append("String_Node_Str");
  int iPercentage=1;
  if (clusterState.getClustererType() == EClustererType.CONTENT_CLUSTERING) {
    GeneralManager.get().getEventPublisher().triggerEvent(new RenameProgressBarEvent("String_Node_Str"));
    for (int nr=0; nr < storageVA.size(); nr++) {
      buffer.append("String_Node_Str" + nr + "String_Node_Str");
    }
    buffer.append("String_Node_Str");
    int icnt=0;
    for (    Integer iContentIndex : contentVA) {
      if (bClusteringCanceled == false) {
        int tempPercentage=(int)((float)icnt / contentVA.size() * 100);
        if (iPercentage == tempPercentage) {
          GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(iPercentage,false));
          iPercentage++;
        }
        for (        Integer iStorageIndex : storageVA) {
          buffer.append(set.get(iStorageIndex).getFloat(EDataRepresentation.RAW,iContentIndex) + "String_Node_Str");
        }
        buffer.append("String_Node_Str");
        icnt++;
        processEvents();
      }
 else {
        GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(100,true));
        return null;
      }
    }
  }
 else {
    GeneralManager.get().getEventPublisher().triggerEvent(new RenameProgressBarEvent("String_Node_Str"));
    for (int nr=0; nr < contentVA.size(); nr++) {
      buffer.append("String_Node_Str" + nr + "String_Node_Str");
    }
    buffer.append("String_Node_Str");
    int isto=0;
    for (    Integer iStorageIndex : storageVA) {
      if (bClusteringCanceled == false) {
        int tempPercentage=(int)((float)isto / storageVA.size() * 100);
        if (iPercentage == tempPercentage) {
          GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(iPercentage,false));
          iPercentage++;
        }
        for (        Integer iContentIndex : contentVA) {
          buffer.append(set.get(iStorageIndex).getFloat(EDataRepresentation.RAW,iContentIndex) + "String_Node_Str");
        }
        buffer.append("String_Node_Str");
        isto++;
        processEvents();
      }
 else {
        GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(100,true));
        return null;
      }
    }
  }
  GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(25 * iProgressBarMultiplier + iProgressBarOffsetValue,true));
  if (clusterState.getClustererType() == EClustererType.CONTENT_CLUSTERING)   GeneralManager.get().getEventPublisher().triggerEvent(new RenameProgressBarEvent("String_Node_Str"));
 else   GeneralManager.get().getEventPublisher().triggerEvent(new RenameProgressBarEvent("String_Node_Str"));
  Instances data=null;
  try {
    data=new Instances(new StringReader(buffer.toString()));
  }
 catch (  IOException e1) {
    GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(100,true));
    return null;
  }
  GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(10,false));
  data.setClassIndex(-1);
  try {
    clusterer.buildClusterer(data);
  }
 catch (  Exception e) {
    GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(100,true));
    return null;
  }
  processEvents();
  if (bClusteringCanceled) {
    GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(100,true));
    return null;
  }
  GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(45,false));
  ClusterEvaluation eval=new ClusterEvaluation();
  eval.setClusterer(clusterer);
  try {
    eval.evaluateClusterer(data);
  }
 catch (  Exception e) {
    GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(100,true));
    return null;
  }
  processEvents();
  if (bClusteringCanceled) {
    GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(100,true));
    return null;
  }
  GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(60,false));
  double[] clusterAssignments=eval.getClusterAssignments();
  ArrayList<Double> clusters=new ArrayList<Double>();
  for (int i=0; i < clusterAssignments.length; i++) {
    if (clusters.contains(clusterAssignments[i]) == false)     clusters.add(clusterAssignments[i]);
  }
  Arrays.sort(clusterAssignments);
  for (int i=0; i < data.numInstances(); i++) {
    int temp=0;
    for (    double cluster : clusters) {
      if (clusterAssignments[i] == cluster) {
        indices.add(temp);
        break;
      }
      temp++;
    }
  }
  processEvents();
  if (bClusteringCanceled) {
    GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(100,true));
    return null;
  }
  GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(80,false));
  CNode node=clusterer.m_cobwebTree;
  ClusterNode clusterNode=new ClusterNode(tree,"String_Node_Str",0,true,-1);
  tree.setRootNode(clusterNode);
  CNodeToTree(clusterNode,node,clusterState.getClustererType());
  processEvents();
  if (bClusteringCanceled) {
    GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(100,true));
    return null;
  }
  GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(90,false));
  GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(50 * iProgressBarMultiplier + iProgressBarOffsetValue,true));
  TempResult tempResult=new TempResult();
  tempResult.indices=indices;
  tempResult.tree=tree;
  return tempResult;
}

Fixed version (ground truth):
private TempResult cluster(ISet set,ClusterState clusterState){
  ArrayList<Integer> indices=new ArrayList<Integer>();
  StringBuffer buffer=new StringBuffer();
  buffer.append("String_Node_Str");
  int iPercentage=1;
  if (clusterState.getClustererType() == EClustererType.CONTENT_CLUSTERING) {
    tree=new Tree<ClusterNode>(set.getDataDomain().getContentIDType());
    GeneralManager.get().getEventPublisher().triggerEvent(new RenameProgressBarEvent("String_Node_Str"));
    for (int nr=0; nr < storageVA.size(); nr++) {
      buffer.append("String_Node_Str" + nr + "String_Node_Str");
    }
    buffer.append("String_Node_Str");
    int icnt=0;
    for (    Integer iContentIndex : contentVA) {
      if (bClusteringCanceled == false) {
        int tempPercentage=(int)((float)icnt / contentVA.size() * 100);
        if (iPercentage == tempPercentage) {
          GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(iPercentage,false));
          iPercentage++;
        }
        for (        Integer iStorageIndex : storageVA) {
          buffer.append(set.get(iStorageIndex).getFloat(EDataRepresentation.RAW,iContentIndex) + "String_Node_Str");
        }
        buffer.append("String_Node_Str");
        icnt++;
        processEvents();
      }
 else {
        GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(100,true));
        return null;
      }
    }
  }
 else {
    tree=new Tree<ClusterNode>(set.getDataDomain().getStorageIDType());
    GeneralManager.get().getEventPublisher().triggerEvent(new RenameProgressBarEvent("String_Node_Str"));
    for (int nr=0; nr < contentVA.size(); nr++) {
      buffer.append("String_Node_Str" + nr + "String_Node_Str");
    }
    buffer.append("String_Node_Str");
    int isto=0;
    for (    Integer iStorageIndex : storageVA) {
      if (bClusteringCanceled == false) {
        int tempPercentage=(int)((float)isto / storageVA.size() * 100);
        if (iPercentage == tempPercentage) {
          GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(iPercentage,false));
          iPercentage++;
        }
        for (        Integer iContentIndex : contentVA) {
          buffer.append(set.get(iStorageIndex).getFloat(EDataRepresentation.RAW,iContentIndex) + "String_Node_Str");
        }
        buffer.append("String_Node_Str");
        isto++;
        processEvents();
      }
 else {
        GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(100,true));
        return null;
      }
    }
  }
  GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(25 * iProgressBarMultiplier + iProgressBarOffsetValue,true));
  if (clusterState.getClustererType() == EClustererType.CONTENT_CLUSTERING)   GeneralManager.get().getEventPublisher().triggerEvent(new RenameProgressBarEvent("String_Node_Str"));
 else   GeneralManager.get().getEventPublisher().triggerEvent(new RenameProgressBarEvent("String_Node_Str"));
  Instances data=null;
  try {
    data=new Instances(new StringReader(buffer.toString()));
  }
 catch (  IOException e1) {
    GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(100,true));
    return null;
  }
  GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(10,false));
  data.setClassIndex(-1);
  try {
    clusterer.buildClusterer(data);
  }
 catch (  Exception e) {
    GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(100,true));
    return null;
  }
  processEvents();
  if (bClusteringCanceled) {
    GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(100,true));
    return null;
  }
  GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(45,false));
  ClusterEvaluation eval=new ClusterEvaluation();
  eval.setClusterer(clusterer);
  try {
    eval.evaluateClusterer(data);
  }
 catch (  Exception e) {
    GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(100,true));
    return null;
  }
  processEvents();
  if (bClusteringCanceled) {
    GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(100,true));
    return null;
  }
  GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(60,false));
  double[] clusterAssignments=eval.getClusterAssignments();
  ArrayList<Double> clusters=new ArrayList<Double>();
  for (int i=0; i < clusterAssignments.length; i++) {
    if (clusters.contains(clusterAssignments[i]) == false)     clusters.add(clusterAssignments[i]);
  }
  Arrays.sort(clusterAssignments);
  for (int i=0; i < data.numInstances(); i++) {
    int temp=0;
    for (    double cluster : clusters) {
      if (clusterAssignments[i] == cluster) {
        indices.add(temp);
        break;
      }
      temp++;
    }
  }
  processEvents();
  if (bClusteringCanceled) {
    GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(100,true));
    return null;
  }
  GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(80,false));
  CNode node=clusterer.m_cobwebTree;
  ClusterNode clusterNode=new ClusterNode(tree,"String_Node_Str",0,true,-1);
  tree.setRootNode(clusterNode);
  CNodeToTree(clusterNode,node,clusterState.getClustererType());
  processEvents();
  if (bClusteringCanceled) {
    GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(100,true));
    return null;
  }
  GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(90,false));
  GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(50 * iProgressBarMultiplier + iProgressBarOffsetValue,true));
  TempResult tempResult=new TempResult();
  tempResult.indices=indices;
  tempResult.tree=tree;
  return tempResult;
}