Program: 7799
Project: 7799
Buggy source:
private ProcessSpecificationFactory processSpecificationFactory(final QueueReaderFactory queueReaderFactory,final QueueClientFactory queueClientFactory,final String flowletName,final Table<Node,String,Set<QueueSpecification>> queueSpecs,final ImmutableList.Builder<QueueConsumerSupplier> queueConsumerSupplierBuilder,final SchemaCache schemaCache){
  return new ProcessSpecificationFactory(){
    @Override public <T>ProcessSpecification create(    Set<String> inputNames,    Schema schema,    TypeToken<T> dataType,    ProcessMethod method,    ConsumerConfig consumerConfig,    int batchSize){
      List<QueueReader> queueReaders=Lists.newLinkedList();
      for (      Map.Entry<Node,Set<QueueSpecification>> entry : queueSpecs.column(flowletName).entrySet()) {
        for (        QueueSpecification queueSpec : entry.getValue()) {
          final QueueName queueName=queueSpec.getQueueName();
          if (queueSpec.getInputSchema().equals(schema) && (inputNames.contains(queueName.getSimpleName()) || inputNames.contains(FlowletDefinition.ANY_INPUT))) {
            int numGroups=(entry.getKey().getType() == FlowletConnection.Type.STREAM) ? -1 : getNumGroups(Iterables.concat(queueSpecs.row(entry.getKey()).values()),queueName);
            QueueConsumerSupplier consumerSupplier=new QueueConsumerSupplier(queueClientFactory,queueName,consumerConfig,numGroups);
            queueConsumerSupplierBuilder.add(consumerSupplier);
            queueReaders.add(queueReaderFactory.create(consumerSupplier,batchSize));
          }
        }
      }
      if (!inputNames.isEmpty() && queueReaders.isEmpty()) {
        return null;
      }
      return new ProcessSpecification<T>(new RoundRobinQueueReader(queueReaders),createInputDatumDecoder(dataType,schema,schemaCache),method);
    }
  }
;
}

Fixed version (ground truth):
private ProcessSpecificationFactory processSpecificationFactory(final DataFabricFacade dataFabricFacade,final QueueReaderFactory queueReaderFactory,final String flowletName,final Table<Node,String,Set<QueueSpecification>> queueSpecs,final ImmutableList.Builder<QueueConsumerSupplier> queueConsumerSupplierBuilder,final SchemaCache schemaCache){
  return new ProcessSpecificationFactory(){
    @Override public <T>ProcessSpecification create(    Set<String> inputNames,    Schema schema,    TypeToken<T> dataType,    ProcessMethod method,    ConsumerConfig consumerConfig,    int batchSize){
      List<QueueReader> queueReaders=Lists.newLinkedList();
      for (      Map.Entry<Node,Set<QueueSpecification>> entry : queueSpecs.column(flowletName).entrySet()) {
        for (        QueueSpecification queueSpec : entry.getValue()) {
          final QueueName queueName=queueSpec.getQueueName();
          if (queueSpec.getInputSchema().equals(schema) && (inputNames.contains(queueName.getSimpleName()) || inputNames.contains(FlowletDefinition.ANY_INPUT))) {
            int numGroups=(entry.getKey().getType() == FlowletConnection.Type.STREAM) ? -1 : getNumGroups(Iterables.concat(queueSpecs.row(entry.getKey()).values()),queueName);
            QueueConsumerSupplier consumerSupplier=new QueueConsumerSupplier(dataFabricFacade,queueName,consumerConfig,numGroups);
            queueConsumerSupplierBuilder.add(consumerSupplier);
            queueReaders.add(queueReaderFactory.create(consumerSupplier,batchSize));
          }
        }
      }
      if (!inputNames.isEmpty() && queueReaders.isEmpty()) {
        return null;
      }
      return new ProcessSpecification<T>(new RoundRobinQueueReader(queueReaders),createInputDatumDecoder(dataType,schema,schemaCache),method);
    }
  }
;
}