Program: 6887
Project: 6887
Buggy source:
private void executeFork(final ApplicationSpecification appSpec,WorkflowForkNode fork,final InstantiatorFactory instantiator,final ClassLoader classLoader,final WorkflowToken token) throws Exception {
  ExecutorService executorService=Executors.newFixedThreadPool(fork.getBranches().size());
  CompletionService<Map.Entry<String,WorkflowToken>> completionService=new ExecutorCompletionService<Map.Entry<String,WorkflowToken>>(executorService);
  try {
    for (    final List<WorkflowNode> branch : fork.getBranches()) {
      completionService.submit(new Callable<Map.Entry<String,WorkflowToken>>(){
        @Override public Map.Entry<String,WorkflowToken> call() throws Exception {
          WorkflowToken copiedToken=((BasicWorkflowToken)token).deepCopy();
          executeAll(branch.iterator(),appSpec,instantiator,classLoader,copiedToken);
          return Maps.immutableEntry(branch.toString(),copiedToken);
        }
      }
);
    }
    boolean assignedCounters=false;
    for (int i=0; i < fork.getBranches().size(); i++) {
      try {
        Future<Map.Entry<String,WorkflowToken>> f=completionService.take();
        Map.Entry<String,WorkflowToken> retValue=f.get();
        String branchInfo=retValue.getKey();
        WorkflowToken branchToken=retValue.getValue();
        if (!assignedCounters && branchToken.getMapReduceCounters() != null) {
          ((BasicWorkflowToken)token).setMapReduceCounters(branchToken.getMapReduceCounters());
          assignedCounters=true;
        }
        LOG.info("String_Node_Str",branchInfo,fork);
      }
 catch (      Throwable t) {
        Throwable rootCause=Throwables.getRootCause(t);
        if (rootCause instanceof ExecutionException) {
          LOG.error("String_Node_Str",fork);
          throw (ExecutionException)t;
        }
        if (rootCause instanceof InterruptedException) {
          LOG.error("String_Node_Str");
          break;
        }
        Throwables.propagateIfPossible(t,Exception.class);
        throw Throwables.propagate(t);
      }
    }
  }
  finally {
    executorService.shutdownNow();
    executorService.awaitTermination(Integer.MAX_VALUE,TimeUnit.NANOSECONDS);
  }
}

Fixed version (ground truth):
private void executeFork(final ApplicationSpecification appSpec,WorkflowForkNode fork,final InstantiatorFactory instantiator,final ClassLoader classLoader,final WorkflowToken token) throws Exception {
  ExecutorService executorService=Executors.newFixedThreadPool(fork.getBranches().size(),new ThreadFactoryBuilder().setNameFormat("String_Node_Str").build());
  CompletionService<Map.Entry<String,WorkflowToken>> completionService=new ExecutorCompletionService<Map.Entry<String,WorkflowToken>>(executorService);
  try {
    for (    final List<WorkflowNode> branch : fork.getBranches()) {
      completionService.submit(new Callable<Map.Entry<String,WorkflowToken>>(){
        @Override public Map.Entry<String,WorkflowToken> call() throws Exception {
          WorkflowToken copiedToken=((BasicWorkflowToken)token).deepCopy();
          executeAll(branch.iterator(),appSpec,instantiator,classLoader,copiedToken);
          return Maps.immutableEntry(branch.toString(),copiedToken);
        }
      }
);
    }
    boolean assignedCounters=false;
    for (int i=0; i < fork.getBranches().size(); i++) {
      try {
        Future<Map.Entry<String,WorkflowToken>> f=completionService.take();
        Map.Entry<String,WorkflowToken> retValue=f.get();
        String branchInfo=retValue.getKey();
        WorkflowToken branchToken=retValue.getValue();
        if (!assignedCounters && branchToken.getMapReduceCounters() != null) {
          ((BasicWorkflowToken)token).setMapReduceCounters(branchToken.getMapReduceCounters());
          assignedCounters=true;
        }
        LOG.info("String_Node_Str",branchInfo,fork);
      }
 catch (      Throwable t) {
        Throwable rootCause=Throwables.getRootCause(t);
        if (rootCause instanceof ExecutionException) {
          LOG.error("String_Node_Str",fork);
          throw (ExecutionException)t;
        }
        if (rootCause instanceof InterruptedException) {
          LOG.error("String_Node_Str");
          break;
        }
        Throwables.propagateIfPossible(t,Exception.class);
        throw Throwables.propagate(t);
      }
    }
  }
  finally {
    executorService.shutdownNow();
    executorService.awaitTermination(Integer.MAX_VALUE,TimeUnit.NANOSECONDS);
  }
}