Program: 20168
Project: 20168
Buggy source:
/** 
 * Executes the algorithm on the graph set earlier by setGraph()
 */
public void run(){
  boolean needHaircut=params.isHaircutNeeded();
  double minSize=params.getMinSize();
  double minDensity=params.getMinDensity();
  double haircutThreshold=params.getHaircutThreshold();
  NodeSetList result=new NodeSetList();
  HashSet<NodeSet> addedNodeSets=new HashSet<NodeSet>();
  SeedGenerator seedGenerator=params.getSeedGenerator();
  seedGenerator.setGraph(graph);
  int step=0;
  int numExpectedSeeds=seedGenerator.size();
  monitor.setStatus("String_Node_Str");
  monitor.setPercentCompleted(0);
  SeedIterator it=seedGenerator.iterator();
  while (it.hasNext()) {
    MutableNodeSet cluster=it.next();
    ClusterGrowthProcess growthProcess=new GreedyClusterGrowthProcess(cluster,minDensity);
    while (!shouldStop && growthProcess.step())     ;
    if (shouldStop)     return;
    if (cluster.size() < minSize)     continue;
    if (cluster.getDensity() < minDensity)     continue;
    if (needHaircut)     cluster.haircut(haircutThreshold);
    NodeSet frozenCluster=cluster.freeze();
    cluster=null;
    if (!addedNodeSets.contains(frozenCluster)) {
      result.add(frozenCluster);
      addedNodeSets.add(frozenCluster);
      it.processFoundCluster(frozenCluster);
    }
    step++;
    if (step > numExpectedSeeds) {
      monitor.setPercentCompleted(-1);
    }
 else {
      monitor.setPercentCompleted(100 * step / numExpectedSeeds);
    }
  }
  monitor.setPercentCompleted(100);
  addedNodeSets.clear();
  addedNodeSets=null;
  if (params.getMergingMethod() != null && !params.getMergingMethod().equals("String_Node_Str")) {
    monitor.setPercentCompleted(0);
    monitor.setStatus("String_Node_Str");
    result=result.mergeOverlapping(params.getMergingMethod(),params.getOverlapThreshold(),monitor);
    monitor.setPercentCompleted(100);
  }
  this.result=result;
}

Fixed version (ground truth):
/** 
 * Executes the algorithm on the graph set earlier by setGraph()
 */
public void run(){
  boolean needHaircut=params.isHaircutNeeded();
  double minSize=params.getMinSize();
  double minDensity=params.getMinDensity();
  double haircutThreshold=params.getHaircutThreshold();
  NodeSetList result=new NodeSetList();
  HashSet<NodeSet> addedNodeSets=new HashSet<NodeSet>();
  SeedGenerator seedGenerator=params.getSeedGenerator();
  seedGenerator.setGraph(graph);
  int step=0;
  int numExpectedSeeds=seedGenerator.size();
  monitor.setStatus("String_Node_Str");
  monitor.setPercentCompleted(0);
  SeedIterator it=seedGenerator.iterator();
  while (it.hasNext()) {
    MutableNodeSet cluster=it.next();
    ClusterGrowthProcess growthProcess=new GreedyClusterGrowthProcess(cluster,minDensity);
    while (!shouldStop && growthProcess.step())     ;
    if (shouldStop)     return;
    if (needHaircut)     cluster.haircut(haircutThreshold);
    if (cluster.size() < minSize)     continue;
    if (cluster.getDensity() < minDensity)     continue;
    NodeSet frozenCluster=cluster.freeze();
    cluster=null;
    if (!addedNodeSets.contains(frozenCluster)) {
      result.add(frozenCluster);
      addedNodeSets.add(frozenCluster);
      it.processFoundCluster(frozenCluster);
    }
    step++;
    if (step > numExpectedSeeds) {
      monitor.setPercentCompleted(-1);
    }
 else {
      monitor.setPercentCompleted(100 * step / numExpectedSeeds);
    }
  }
  monitor.setPercentCompleted(100);
  addedNodeSets.clear();
  addedNodeSets=null;
  if (params.getMergingMethod() != null && !params.getMergingMethod().equals("String_Node_Str")) {
    monitor.setPercentCompleted(0);
    monitor.setStatus("String_Node_Str");
    result=result.mergeOverlapping(params.getMergingMethod(),params.getOverlapThreshold(),monitor);
    monitor.setPercentCompleted(100);
  }
  this.result=result;
}