Program: 57860
Project: 57860
Buggy source:
/** 
 * Initiates clustering based on the parameters passed. Sends out an event to all affected views upon positive completion to replace their VA.
 * @param tableID ID of the set to cluster
 * @param clusterState
 */
public void startClustering(ClusterConfiguration clusterState){
  ClusterManager clusterManager=new ClusterManager(this);
  ClusterResult result=clusterManager.cluster(clusterState);
  if (clusterState.getClustererType() == ClustererType.DIMENSION_CLUSTERING || clusterState.getClustererType() == ClustererType.BI_CLUSTERING) {
    TempResult dimensionResult=result.getDimensionResult();
    DimensionPerspective dimensionPerspective=clusterState.getTargetDimensionPerspective();
    dimensionPerspective.createVA(dimensionResult.getIndices());
    dimensionPerspective.setClusterSizes(dimensionResult.getClusterSizes());
    dimensionPerspective.setTree(dimensionResult.getTree());
    dimensionPerspective.setSampleElements(dimensionResult.getSampleElements());
    dimensionPerspective.finish();
    eventPublisher.triggerEvent(new DimensionVAUpdateEvent(dataDomainID,dimensionPerspective.getPerspectiveID(),this));
  }
  if (clusterState.getClustererType() == ClustererType.RECORD_CLUSTERING || clusterState.getClustererType() == ClustererType.BI_CLUSTERING) {
    TempResult recordResult=result.getRecordResult();
    RecordPerspective recordPerspective=clusterState.getTargetRecordPerspective();
    recordPerspective.createVA(recordResult.getIndices());
    recordPerspective.setClusterSizes(recordResult.getClusterSizes());
    recordPerspective.setTree(recordResult.getTree());
    recordPerspective.setSampleElements(recordResult.getSampleElements());
    recordPerspective.finish();
    eventPublisher.triggerEvent(new RecordVAUpdateEvent(dataDomainID,recordPerspective.getPerspectiveID(),this));
  }
}

Fixed version (ground truth):
/** 
 * Initiates clustering based on the parameters passed. Sends out an event to all affected views upon positive completion to replace their VA.
 * @param tableID ID of the set to cluster
 * @param clusterState
 */
public void startClustering(ClusterConfiguration clusterState){
  ClusterManager clusterManager=new ClusterManager(this);
  ClusterResult result=clusterManager.cluster(clusterState);
  if (clusterState.getClustererType() == ClustererType.DIMENSION_CLUSTERING || clusterState.getClustererType() == ClustererType.BI_CLUSTERING) {
    PerspectiveInitializationData dimensionResult=result.getDimensionResult();
    DimensionPerspective dimensionPerspective=clusterState.getTargetDimensionPerspective();
    dimensionPerspective.createVA(dimensionResult.getIndices());
    dimensionPerspective.setClusterSizes(dimensionResult.getClusterSizes());
    dimensionPerspective.setTree(dimensionResult.getTree());
    dimensionPerspective.setSampleElements(dimensionResult.getSampleElements());
    dimensionPerspective.finish();
    eventPublisher.triggerEvent(new DimensionVAUpdateEvent(dataDomainID,dimensionPerspective.getPerspectiveID(),this));
  }
  if (clusterState.getClustererType() == ClustererType.RECORD_CLUSTERING || clusterState.getClustererType() == ClustererType.BI_CLUSTERING) {
    PerspectiveInitializationData recordResult=result.getRecordResult();
    RecordPerspective recordPerspective=clusterState.getTargetRecordPerspective();
    recordPerspective.createVA(recordResult.getIndices());
    recordPerspective.setClusterSizes(recordResult.getClusterSizes());
    recordPerspective.setTree(recordResult.getTree());
    recordPerspective.setSampleElements(recordResult.getSampleElements());
    recordPerspective.finish();
    eventPublisher.triggerEvent(new RecordVAUpdateEvent(dataDomainID,recordPerspective.getPerspectiveID(),this));
  }
}