Program: 58782
Project: 58782
Buggy source:
public Integer cluster(Integer iVAIdContent,Integer iVAIdStorage,ClusterState clusterState){
  Integer VAId=0;
  if (bIsNumerical == true && bIsSetHomogeneous == true) {
    IClusterer clusterer;
    Shell shell=new Shell();
    MessageBox messageBox=new MessageBox(shell,SWT.OK | SWT.CANCEL);
    messageBox.setText("String_Node_Str");
    messageBox.setMessage("String_Node_Str");
    int iNrElem=0;
    if (clusterState.getClustererType() == EClustererType.GENE_CLUSTERING)     iNrElem=getVA(iVAIdContent).size();
 else     iNrElem=getVA(iVAIdStorage).size();
    if (iNrElem > 1000) {
      if (messageBox.open() == SWT.CANCEL)       return -1;
      shell.close();
    }
switch (clusterState.getClustererAlgo()) {
case TREE_CLUSTERER:
      if (clusterState.getClustererType() == EClustererType.GENE_CLUSTERING)       clusterer=new TreeClusterer(getVA(iVAIdContent).size());
 else       if (clusterState.getClustererType() == EClustererType.EXPERIMENTS_CLUSTERING)       clusterer=new TreeClusterer(getVA(iVAIdStorage).size());
 else       if (clusterState.getClustererType() == EClustererType.BI_CLUSTERING) {
        System.out.println("String_Node_Str");
        clusterer=new TreeClusterer(getVA(iVAIdContent).size());
      }
 else       return -1;
    VAId=clusterer.getSortedVAId(this,iVAIdContent,iVAIdStorage,clusterState);
  break;
case COBWEB_CLUSTERER:
clusterer=new HierarchicalClusterer(0);
VAId=clusterer.getSortedVAId(this,iVAIdContent,iVAIdStorage,clusterState);
break;
case AFFINITY_PROPAGATION:
if (clusterState.getClustererType() == EClustererType.GENE_CLUSTERING) clusterer=new AffinityClusterer(getVA(iVAIdContent).size());
 else if (clusterState.getClustererType() == EClustererType.EXPERIMENTS_CLUSTERING) clusterer=new AffinityClusterer(getVA(iVAIdStorage).size());
 else if (clusterState.getClustererType() == EClustererType.BI_CLUSTERING) {
System.out.println("String_Node_Str");
clusterer=new AffinityClusterer(getVA(iVAIdContent).size());
}
 else return -1;
VAId=clusterer.getSortedVAId(this,iVAIdContent,iVAIdStorage,clusterState);
break;
case KMEANS_CLUSTERER:
clusterer=new KMeansClusterer(0);
VAId=clusterer.getSortedVAId(this,iVAIdContent,iVAIdStorage,clusterState);
break;
}
if (VAId == -1) {
messageBox=new MessageBox(new Shell(),SWT.OK);
messageBox.setText("String_Node_Str");
messageBox.setMessage("String_Node_Str");
messageBox.open();
return -1;
}
IVirtualArray virtualArray=getVA(VAId);
if (clusterState.getClustererAlgo() == EClustererAlgo.AFFINITY_PROPAGATION || clusterState.getClustererAlgo() == EClustererAlgo.KMEANS_CLUSTERER) {
IGroupList groupList=new GroupList(virtualArray.size());
ArrayList<Integer> examples=getAlExamples();
int cnt=0;
for (Integer iter : getAlClusterSizes()) {
Group temp=new Group(iter,false,examples.get(cnt),ESelectionType.NORMAL);
groupList.append(temp);
cnt++;
}
virtualArray.setGroupList(groupList);
}
hashSetVAs.put(virtualArray.getID(),virtualArray);
return VAId;
}
 else {
System.out.println("String_Node_Str");
return -1;
}
}

Fixed version (ground truth):
public Integer cluster(Integer iVAIdContent,Integer iVAIdStorage,ClusterState clusterState){
  Integer VAId=0;
  if (bIsNumerical == true && bIsSetHomogeneous == true) {
    IClusterer clusterer;
switch (clusterState.getClustererAlgo()) {
case TREE_CLUSTERER:
      if (clusterState.getClustererType() == EClustererType.GENE_CLUSTERING)       clusterer=new TreeClusterer(getVA(iVAIdContent).size());
 else       if (clusterState.getClustererType() == EClustererType.EXPERIMENTS_CLUSTERING)       clusterer=new TreeClusterer(getVA(iVAIdStorage).size());
 else       if (clusterState.getClustererType() == EClustererType.BI_CLUSTERING) {
        System.out.println("String_Node_Str");
        clusterer=new TreeClusterer(getVA(iVAIdContent).size());
      }
 else       return -1;
    VAId=clusterer.getSortedVAId(this,iVAIdContent,iVAIdStorage,clusterState);
  break;
case COBWEB_CLUSTERER:
clusterer=new HierarchicalClusterer(0);
VAId=clusterer.getSortedVAId(this,iVAIdContent,iVAIdStorage,clusterState);
break;
case AFFINITY_PROPAGATION:
if (clusterState.getClustererType() == EClustererType.GENE_CLUSTERING) clusterer=new AffinityClusterer(getVA(iVAIdContent).size());
 else if (clusterState.getClustererType() == EClustererType.EXPERIMENTS_CLUSTERING) clusterer=new AffinityClusterer(getVA(iVAIdStorage).size());
 else if (clusterState.getClustererType() == EClustererType.BI_CLUSTERING) {
System.out.println("String_Node_Str");
clusterer=new AffinityClusterer(getVA(iVAIdContent).size());
}
 else return -1;
VAId=clusterer.getSortedVAId(this,iVAIdContent,iVAIdStorage,clusterState);
break;
case KMEANS_CLUSTERER:
clusterer=new KMeansClusterer(0);
VAId=clusterer.getSortedVAId(this,iVAIdContent,iVAIdStorage,clusterState);
break;
}
if (VAId == -1) {
return -1;
}
IVirtualArray virtualArray=getVA(VAId);
if (clusterState.getClustererAlgo() == EClustererAlgo.AFFINITY_PROPAGATION || clusterState.getClustererAlgo() == EClustererAlgo.KMEANS_CLUSTERER) {
IGroupList groupList=new GroupList(virtualArray.size());
ArrayList<Integer> examples=getAlExamples();
int cnt=0;
for (Integer iter : getAlClusterSizes()) {
Group temp=new Group(iter,false,examples.get(cnt),ESelectionType.NORMAL);
groupList.append(temp);
cnt++;
}
virtualArray.setGroupList(groupList);
}
hashSetVAs.put(virtualArray.getID(),virtualArray);
return VAId;
}
 else {
System.out.println("String_Node_Str");
return -1;
}
}