Program: 73891
Project: 73891
Buggy source:
/** 
 * Cluster firings together so that there is no false dependency.
 * @param currentFiring
 * @param clusteredFirings
 * @param searchedFirings
 * @param inputFirings
 * @param inputActors
 * @param outputActors
 * @param outputInputDependence The map form each output firing to a set of input firingsthat its depend on.
 */
private void _clusterFirings(Firing currentFiring,Set clusteredFirings,Set searchedFirings,Set inputFirings,List inputActors,List outputActors,Map outputInputDependence){
  searchedFirings.add(currentFiring);
  Set currentSearchedFirings=new HashSet();
  Set outputFirings=new HashSet();
  _getDependentForwardFiring(currentFiring,outputFirings,currentSearchedFirings,inputActors,outputActors);
  boolean validFiring=true;
  for (  Object outputFiring : outputFirings) {
    Set inputDependentFirings=(Set)outputInputDependence.get(outputFiring);
    Set tmpInputFiring=new HashSet(inputFirings);
    tmpInputFiring.removeAll(inputDependentFirings);
    if (!tmpInputFiring.isEmpty()) {
      validFiring=false;
      break;
    }
  }
  if (validFiring) {
    clusteredFirings.add(currentFiring);
    for (Iterator previousFirings=currentFiring.previousActorFirings.iterator(); previousFirings.hasNext(); ) {
      Firing previousFiring=(Firing)previousFirings.next();
      if (!searchedFirings.contains(previousFiring)) {
        _clusterFirings(previousFiring,clusteredFirings,searchedFirings,inputFirings,inputActors,outputActors,outputInputDependence);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Cluster firings together so that there is no false dependency.
 * @param currentFiring Pointer to current node in the firing graph.
 * @param clusteredFirings The output set of clustered firings.
 * @param searchedFirings The set of searched firing used for searching.
 * @param inputFirings The set of output firings (produce external tokens).
 * @param inputActors The set of actors that consume external tokens.
 * @param outputActors The set of actors that produce external tokens.
 * @param outputInputDependence The map form each output firing to a set of input firingsthat its depend on.
 */
private void _clusterFirings(Firing currentFiring,Set clusteredFirings,Set searchedFirings,Set inputFirings,List inputActors,List outputActors,Map outputInputDependence){
  searchedFirings.add(currentFiring);
  Set currentSearchedFirings=new HashSet();
  Set outputFirings=new HashSet();
  _getDependentForwardFiring(currentFiring,outputFirings,currentSearchedFirings,inputActors,outputActors);
  boolean validFiring=true;
  for (  Object outputFiring : outputFirings) {
    Set inputDependentFirings=(Set)outputInputDependence.get(outputFiring);
    Set tmpInputFiring=new HashSet(inputFirings);
    tmpInputFiring.removeAll(inputDependentFirings);
    if (!tmpInputFiring.isEmpty()) {
      validFiring=false;
      break;
    }
  }
  if (validFiring) {
    clusteredFirings.add(currentFiring);
    for (Iterator previousFirings=currentFiring.previousActorFirings.iterator(); previousFirings.hasNext(); ) {
      Firing previousFiring=(Firing)previousFirings.next();
      if (!searchedFirings.contains(previousFiring)) {
        _clusterFirings(previousFiring,clusteredFirings,searchedFirings,inputFirings,inputActors,outputActors,outputInputDependence);
      }
    }
    for (Iterator nextFirings=currentFiring.nextActorFirings.iterator(); nextFirings.hasNext(); ) {
      Firing nextFiring=(Firing)nextFirings.next();
      if (!searchedFirings.contains(nextFiring)) {
        _clusterFirings(nextFiring,clusteredFirings,searchedFirings,inputFirings,inputActors,outputActors,outputInputDependence);
      }
    }
  }
}