Program: 53125
Project: 53125
Buggy source:
private TargetGraph buildTargetGraphInParallel(final BuckEventBus eventBus,final Cell rootCell,final boolean enableProfiling,Executor executor,final Iterable<BuildTarget> toExplore) throws IOException, InterruptedException, BuildFileParseException {
  final MutableDirectedGraph<TargetNode<?>> graph=new MutableDirectedGraph<>();
  final Map<BuildTarget,TargetNode<?>> index=new HashMap<>();
  ParseEvent.Started parseStart=ParseEvent.started(toExplore);
  eventBus.post(parseStart);
  TargetGraph targetGraph=null;
  try (final ParallelPerBuildState state=new ParallelPerBuildState(permState,marshaller,eventBus,rootCell,enableProfiling)){
    state.startParsing(ImmutableSet.<BuildTarget>builder().addAll(toExplore).build(),new ParserConfig(rootCell.getBuckConfig()),executor);
    final AbstractAcyclicDepthFirstPostOrderTraversal<BuildTarget> traversal=new AbstractAcyclicDepthFirstPostOrderTraversal<BuildTarget>(){
      @Override protected Iterator<BuildTarget> findChildren(      BuildTarget target) throws IOException, InterruptedException {
        TargetNode<?> node;
        try (SimplePerfEvent.Scope scope=getTargetNodeEventScope(eventBus,target)){
          try {
            node=state.getTargetNode(target);
          }
 catch (          BuildFileParseException|BuildTargetException e) {
            throw new RuntimeException(e);
          }
        }
         Set<BuildTarget> deps=Sets.newHashSet();
        for (        BuildTarget dep : node.getDeps()) {
          TargetNode<?> depTargetNode;
          try (SimplePerfEvent.Scope scope=getTargetNodeEventScope(eventBus,dep)){
            try {
              depTargetNode=state.getTargetNode(dep);
            }
 catch (            BuildFileParseException|BuildTargetException|HumanReadableException e) {
              throw new HumanReadableException(e,"String_Node_Str",dep,target,e.getMessage());
            }
          }
           depTargetNode.checkVisibility(target);
          deps.add(dep);
        }
        return deps.iterator();
      }
      @Override protected void onNodeExplored(      BuildTarget target) throws IOException, InterruptedException {
        try {
          TargetNode<?> targetNode=state.getTargetNode(target);
          Preconditions.checkNotNull(targetNode,"String_Node_Str",target);
          graph.addNode(targetNode);
          MoreMaps.putCheckEquals(index,target,targetNode);
          if (target.isFlavored()) {
            BuildTarget unflavoredTarget=BuildTarget.of(target.getUnflavoredBuildTarget());
            MoreMaps.putCheckEquals(index,unflavoredTarget,state.getTargetNode(unflavoredTarget));
          }
          for (          BuildTarget dep : targetNode.getDeps()) {
            graph.addEdge(targetNode,state.getTargetNode(dep));
          }
        }
 catch (        BuildFileParseException|BuildTargetException e) {
          throw new RuntimeException(e);
        }
      }
      @Override protected void onTraversalComplete(      Iterable<BuildTarget> nodesInExplorationOrder){
      }
    }
;
    traversal.traverse(toExplore);
    targetGraph=new TargetGraph(graph,ImmutableMap.copyOf(index));
    return targetGraph;
  }
 catch (  AbstractAcyclicDepthFirstPostOrderTraversal.CycleException e) {
    throw new HumanReadableException(e.getMessage());
  }
 finally {
    eventBus.post(ParseEvent.finished(parseStart,Optional.fromNullable(targetGraph)));
  }
}

Fixed version (ground truth):
private TargetGraph buildTargetGraphInParallel(final BuckEventBus eventBus,final Cell rootCell,final boolean enableProfiling,Executor executor,final Iterable<BuildTarget> toExplore) throws IOException, InterruptedException, BuildFileParseException, BuildTargetException {
  final MutableDirectedGraph<TargetNode<?>> graph=new MutableDirectedGraph<>();
  final Map<BuildTarget,TargetNode<?>> index=new HashMap<>();
  ParseEvent.Started parseStart=ParseEvent.started(toExplore);
  eventBus.post(parseStart);
  TargetGraph targetGraph=null;
  try (final ParallelPerBuildState state=new ParallelPerBuildState(permState,marshaller,eventBus,rootCell,enableProfiling)){
    state.startParsing(ImmutableSet.<BuildTarget>builder().addAll(toExplore).build(),new ParserConfig(rootCell.getBuckConfig()),executor);
    final AbstractAcyclicDepthFirstPostOrderTraversal<BuildTarget> traversal=new AbstractAcyclicDepthFirstPostOrderTraversal<BuildTarget>(){
      @Override protected Iterator<BuildTarget> findChildren(      BuildTarget target) throws IOException, InterruptedException {
        TargetNode<?> node;
        try (SimplePerfEvent.Scope scope=getTargetNodeEventScope(eventBus,target)){
          try {
            node=state.getTargetNode(target);
          }
 catch (          BuildFileParseException|BuildTargetException e) {
            throw new RuntimeException(e);
          }
        }
         Set<BuildTarget> deps=Sets.newHashSet();
        for (        BuildTarget dep : node.getDeps()) {
          TargetNode<?> depTargetNode;
          try (SimplePerfEvent.Scope scope=getTargetNodeEventScope(eventBus,dep)){
            try {
              depTargetNode=state.getTargetNode(dep);
            }
 catch (            BuildFileParseException|BuildTargetException|HumanReadableException e) {
              throw new HumanReadableException(e,"String_Node_Str",dep,target,e.getMessage());
            }
          }
           depTargetNode.checkVisibility(target);
          deps.add(dep);
        }
        return deps.iterator();
      }
      @Override protected void onNodeExplored(      BuildTarget target) throws IOException, InterruptedException {
        try {
          TargetNode<?> targetNode=state.getTargetNode(target);
          Preconditions.checkNotNull(targetNode,"String_Node_Str",target);
          graph.addNode(targetNode);
          MoreMaps.putCheckEquals(index,target,targetNode);
          if (target.isFlavored()) {
            BuildTarget unflavoredTarget=BuildTarget.of(target.getUnflavoredBuildTarget());
            MoreMaps.putCheckEquals(index,unflavoredTarget,state.getTargetNode(unflavoredTarget));
          }
          for (          BuildTarget dep : targetNode.getDeps()) {
            graph.addEdge(targetNode,state.getTargetNode(dep));
          }
        }
 catch (        BuildFileParseException|BuildTargetException e) {
          throw new RuntimeException(e);
        }
      }
      @Override protected void onTraversalComplete(      Iterable<BuildTarget> nodesInExplorationOrder){
      }
    }
;
    traversal.traverse(toExplore);
    targetGraph=new TargetGraph(graph,ImmutableMap.copyOf(index));
    return targetGraph;
  }
 catch (  AbstractAcyclicDepthFirstPostOrderTraversal.CycleException e) {
    throw new HumanReadableException(e.getMessage());
  }
catch (  RuntimeException e) {
    throw propagateRuntimeCause(e);
  }
 finally {
    eventBus.post(ParseEvent.finished(parseStart,Optional.fromNullable(targetGraph)));
  }
}