nus-yam/ex-repair huggingface dataset:
Program: 7713
Project: 7713
Buggy source:
@PUT @Path("String_Node_Str") public void create(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String destination){
  GatewayMetricsHelperWrapper helper=new GatewayMetricsHelperWrapper(new MetricsHelper(this.getClass(),cMetrics,Constants.Gateway.GATEWAY_PREFIX + NAME),gatewayMetrics);
  helper.setMethod("String_Node_Str");
  helper.setScope(destination);
  String accountId=authenticate(request,responder,helper);
  if (accountId == null) {
    return;
  }
  if (!isId(destination)) {
    LOG.trace("String_Node_Str",destination);
    responder.sendStatus(HttpResponseStatus.BAD_REQUEST);
    helper.finish(BadRequest);
    return;
  }
  Stream stream=new Stream(destination);
  stream.setName(destination);
  try {
    Stream existingStream=metadataService.getStream(accountId,stream.getId());
    if (existingStream != null) {
      metadataService.createStream(accountId,stream);
    }
  }
 catch (  Exception e) {
    LOG.trace("String_Node_Str",destination,e);
    responder.sendStatus(HttpResponseStatus.INTERNAL_SERVER_ERROR);
    return;
  }
  responder.sendStatus(HttpResponseStatus.OK);
  helper.finish(Success);
}

Fixed version (ground truth):
@PUT @Path("String_Node_Str") public void create(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String destination){
  GatewayMetricsHelperWrapper helper=new GatewayMetricsHelperWrapper(new MetricsHelper(this.getClass(),cMetrics,Constants.Gateway.GATEWAY_PREFIX + NAME),gatewayMetrics);
  helper.setMethod("String_Node_Str");
  helper.setScope(destination);
  String accountId=authenticate(request,responder,helper);
  if (accountId == null) {
    return;
  }
  if (!isId(destination)) {
    LOG.trace("String_Node_Str",destination);
    responder.sendStatus(HttpResponseStatus.BAD_REQUEST);
    helper.finish(BadRequest);
    return;
  }
  Stream stream=new Stream(destination);
  stream.setName(destination);
  try {
    Stream existingStream=metadataService.getStream(accountId,stream.getId());
    if (existingStream == null) {
      metadataService.createStream(accountId,stream);
    }
  }
 catch (  Exception e) {
    LOG.trace("String_Node_Str",destination,e);
    responder.sendStatus(HttpResponseStatus.INTERNAL_SERVER_ERROR);
    return;
  }
  responder.sendStatus(HttpResponseStatus.OK);
  helper.finish(Success);
}
Program: 7714
Project: 7714
Buggy source:
@Override public void run(){
  LOG.info("String_Node_Str");
  Futures.getUnchecked(Services.chainStart(zkClientService,kafkaClientService,metricsCollectionService));
  LOG.info("String_Node_Str" + name);
  controller=injector.getInstance(getProgramClass()).run(program,programOpts);
  final SettableFuture<ProgramController.State> state=SettableFuture.create();
  controller.addListener(new AbstractListener(){
    @Override public void stopped(){
      state.set(ProgramController.State.STOPPED);
    }
    @Override public void error(    Throwable cause){
      LOG.error("String_Node_Str",cause);
      state.set(ProgramController.State.ERROR);
    }
  }
,MoreExecutors.sameThreadExecutor());
  LOG.info("String_Node_Str",Futures.getUnchecked(state));
}

Fixed version (ground truth):
@Override public void run(){
  LOG.info("String_Node_Str");
  Futures.getUnchecked(Services.chainStart(zkClientService,kafkaClientService,metricsCollectionService));
  LOG.info("String_Node_Str",name);
  controller=injector.getInstance(getProgramClass()).run(program,programOpts);
  final SettableFuture<ProgramController.State> state=SettableFuture.create();
  controller.addListener(new AbstractListener(){
    @Override public void stopped(){
      state.set(ProgramController.State.STOPPED);
    }
    @Override public void error(    Throwable cause){
      LOG.error("String_Node_Str",cause);
      state.set(ProgramController.State.ERROR);
    }
  }
,MoreExecutors.sameThreadExecutor());
  LOG.info("String_Node_Str",Futures.getUnchecked(state));
}
Program: 7715
Project: 7715
Buggy source:
@Override public void stop(){
  try {
    LOG.info("String_Node_Str" + name);
    controller.stop().get();
    LOG.info("String_Node_Str" + name);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e,e);
    throw Throwables.propagate(e);
  }
 finally {
    LOG.info("String_Node_Str");
    Futures.getUnchecked(Services.chainStop(metricsCollectionService,kafkaClientService,zkClientService));
  }
}

Fixed version (ground truth):
@Override public void stop(){
  try {
    LOG.info("String_Node_Str",name);
    controller.stop().get();
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e,e);
    throw Throwables.propagate(e);
  }
}
Program: 7716
Project: 7716
Buggy source:
public ExecutorThreadPool(){
  executor=Executors.newFixedThreadPool(MAX_THREAD_POOL_SIZE);
}

Fixed version (ground truth):
public ExecutorThreadPool(){
  executor=Executors.newFixedThreadPool(MAX_THREAD_POOL_SIZE,Threads.createDaemonThreadFactory("String_Node_Str"));
}
Program: 7717
Project: 7717
Buggy source:
private void startListen(Service service){
  service.addListener(new ServiceListenerAdapter(){
    @Override public void running(){
      InetSocketAddress endpoint=driver.getServiceEndpoint();
      cancelAnnounce=serviceAnnouncer.announce(serviceName,endpoint.getPort());
      LOG.info("String_Node_Str",serviceName,endpoint);
      started();
    }
    @Override public void terminated(    Service.State from){
      cancelAnnounce.cancel();
      stop();
    }
    @Override public void failed(    Service.State from,    Throwable failure){
      cancelAnnounce.cancel();
      error(failure);
    }
  }
,Threads.SAME_THREAD_EXECUTOR);
}

Fixed version (ground truth):
private void startListen(Service service){
  service.addListener(new ServiceListenerAdapter(){
    @Override public void running(){
      InetSocketAddress endpoint=driver.getServiceEndpoint();
      cancelAnnounce=serviceAnnouncer.announce(serviceName,endpoint.getPort());
      LOG.info("String_Node_Str",serviceName,endpoint);
      started();
    }
    @Override public void terminated(    Service.State from){
      LOG.info("String_Node_Str",from,serviceName);
      cancelAnnounce.cancel();
      LOG.info("String_Node_Str",serviceName);
      stop();
    }
    @Override public void failed(    Service.State from,    Throwable failure){
      LOG.info("String_Node_Str",from,serviceName,failure);
      cancelAnnounce.cancel();
      LOG.info("String_Node_Str",serviceName);
      error(failure);
    }
  }
,Threads.SAME_THREAD_EXECUTOR);
}
Program: 7718
Project: 7718
Buggy source:
@Override public void failed(Service.State from,Throwable failure){
  cancelAnnounce.cancel();
  error(failure);
}

Fixed version (ground truth):
@Override public void failed(Service.State from,Throwable failure){
  LOG.info("String_Node_Str",from,serviceName,failure);
  cancelAnnounce.cancel();
  LOG.info("String_Node_Str",serviceName);
  error(failure);
}
Program: 7719
Project: 7719
Buggy source:
@Override public void terminated(Service.State from){
  cancelAnnounce.cancel();
  stop();
}

Fixed version (ground truth):
@Override public void terminated(Service.State from){
  LOG.info("String_Node_Str",from,serviceName);
  cancelAnnounce.cancel();
  LOG.info("String_Node_Str",serviceName);
  stop();
}
Program: 7720
Project: 7720
Buggy source:
/** 
 * Configures the AppFabricService pre-start.
 */
@Override protected void startUp() throws Exception {
  executor=Executors.newFixedThreadPool(THREAD_COUNT);
  schedulerService.start();
  InetSocketAddress socketAddress=new InetSocketAddress(hostname,port);
  InetAddress address=socketAddress.getAddress();
  if (address.isAnyLocalAddress()) {
    address=InetAddress.getLocalHost();
  }
  final InetSocketAddress finalSocketAddress=new InetSocketAddress(address,port);
  discoveryService.register(new Discoverable(){
    @Override public String getName(){
      return Constants.Service.APP_FABRIC;
    }
    @Override public InetSocketAddress getSocketAddress(){
      return finalSocketAddress;
    }
  }
);
  TThreadedSelectorServer.Args options=new TThreadedSelectorServer.Args(new TNonblockingServerSocket(socketAddress)).executorService(executor).processor(new AppFabricService.Processor<AppFabricService.Iface>(service)).workerThreads(THREAD_COUNT);
  options.maxReadBufferBytes=Constants.Thrift.DEFAULT_MAX_READ_BUFFER;
  server=new TThreadedSelectorServer(options);
}

Fixed version (ground truth):
/** 
 * Configures the AppFabricService pre-start.
 */
@Override protected void startUp() throws Exception {
  executor=Executors.newFixedThreadPool(THREAD_COUNT,Threads.createDaemonThreadFactory("String_Node_Str"));
  schedulerService.start();
  InetSocketAddress socketAddress=new InetSocketAddress(hostname,port);
  InetAddress address=socketAddress.getAddress();
  if (address.isAnyLocalAddress()) {
    address=InetAddress.getLocalHost();
  }
  final InetSocketAddress finalSocketAddress=new InetSocketAddress(address,port);
  discoveryService.register(new Discoverable(){
    @Override public String getName(){
      return Constants.Service.APP_FABRIC;
    }
    @Override public InetSocketAddress getSocketAddress(){
      return finalSocketAddress;
    }
  }
);
  TThreadedSelectorServer.Args options=new TThreadedSelectorServer.Args(new TNonblockingServerSocket(socketAddress)).executorService(executor).processor(new AppFabricService.Processor<AppFabricService.Iface>(service)).workerThreads(THREAD_COUNT);
  options.maxReadBufferBytes=Constants.Thrift.DEFAULT_MAX_READ_BUFFER;
  server=new TThreadedSelectorServer(options);
}
Program: 7721
Project: 7721
Buggy source:
@Override public ProgramController run(Program program,ProgramOptions options){
  ApplicationSpecification appSpec=program.getSpecification();
  Preconditions.checkNotNull(appSpec,"String_Node_Str");
  Type processorType=program.getType();
  Preconditions.checkNotNull(processorType,"String_Node_Str");
  Preconditions.checkArgument(processorType == Type.WORKFLOW,"String_Node_Str");
  WorkflowSpecification workflowSpec=appSpec.getWorkflows().get(program.getName());
  Preconditions.checkNotNull(workflowSpec,"String_Node_Str",program.getName());
  LOG.info("String_Node_Str" + program.getName() + "String_Node_Str"+ workflowSpec.getName());
  String runtimeArgs=new Gson().toJson(options.getUserArguments());
  WeavePreparer preparer=weaveRunner.prepare(new WorkflowWeaveApplication(program,workflowSpec,hConfFile,cConfFile)).addLogHandler(new PrinterLogHandler(new PrintWriter(System.out))).withArguments(workflowSpec.getName(),String.format("String_Node_Str",RunnableOptions.JAR),program.getJarLocation().getName()).withArguments(workflowSpec.getName(),String.format("String_Node_Str",RunnableOptions.RUNTIME_ARGS),runtimeArgs);
  WeaveController controller=preparer.start();
  ProgramResourceReporter resourceReporter=new DistributedResourceReporter(program,metricsCollectionService,controller);
  return new WorkflowWeaveProgramController(program.getName(),preparer.start(),resourceReporter).startListen();
}

Fixed version (ground truth):
@Override public ProgramController run(Program program,ProgramOptions options){
  ApplicationSpecification appSpec=program.getSpecification();
  Preconditions.checkNotNull(appSpec,"String_Node_Str");
  Type processorType=program.getType();
  Preconditions.checkNotNull(processorType,"String_Node_Str");
  Preconditions.checkArgument(processorType == Type.WORKFLOW,"String_Node_Str");
  WorkflowSpecification workflowSpec=appSpec.getWorkflows().get(program.getName());
  Preconditions.checkNotNull(workflowSpec,"String_Node_Str",program.getName());
  LOG.info("String_Node_Str" + program.getName() + "String_Node_Str"+ workflowSpec.getName());
  String runtimeArgs=new Gson().toJson(options.getUserArguments());
  WeavePreparer preparer=weaveRunner.prepare(new WorkflowWeaveApplication(program,workflowSpec,hConfFile,cConfFile)).addLogHandler(new PrinterLogHandler(new PrintWriter(System.out))).withArguments(workflowSpec.getName(),String.format("String_Node_Str",RunnableOptions.JAR),program.getJarLocation().getName()).withArguments(workflowSpec.getName(),String.format("String_Node_Str",RunnableOptions.RUNTIME_ARGS),runtimeArgs);
  WeaveController controller=preparer.start();
  ProgramResourceReporter resourceReporter=new DistributedResourceReporter(program,metricsCollectionService,controller);
  return new WorkflowWeaveProgramController(program.getName(),controller,resourceReporter).startListen();
}
Program: 7722
Project: 7722
Buggy source:
/** 
 * Open the table in the data fabric, to ensure it exists and is accessible.
 * @throws com.continuuity.api.data.OperationException if something goes wrong
 */
public void open() throws OperationException {
  try {
    if (!ocTableManager.exists(this.getName())) {
      ocTableManager.create(this.getName());
    }
  }
 catch (  OperationException oe) {
    throw oe;
  }
catch (  Exception e) {
    throw new OperationException(StatusCode.INTERNAL_ERROR,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Open the table in the data fabric, to ensure it exists and is accessible.
 * @throws OperationException if something goes wrong
 */
public void open() throws OperationException {
  try {
    if (!ocTableManager.exists(this.getName())) {
      ocTableManager.create(this.getName());
    }
  }
 catch (  OperationException oe) {
    throw oe;
  }
catch (  Exception e) {
    throw new OperationException(StatusCode.INTERNAL_ERROR,"String_Node_Str",e);
  }
}
Program: 7723
Project: 7723
Buggy source:
/** 
 * Increments (atomically) the specified row and columns by the specified amounts
 * @param amounts amounts to increment columns by
 * @return values of counters after the increments are performed, never null
 */
Map<byte[],Long> increment(byte[] row,byte[][] columns,long[] amounts) throws Exception ;

Fixed version (ground truth):
/** 
 * Increments (atomically) the specified row and columns by the specified amounts.
 * @param amounts amounts to increment columns by
 * @return values of counters after the increments are performed, never null
 */
Map<byte[],Long> increment(byte[] row,byte[][] columns,long[] amounts) throws Exception ;
Program: 7724
Project: 7724
Buggy source:
/** 
 * @return changes made by current transaction to be used for conflicts detection before commit
 */
Collection<byte[]> getTxChanges();

Fixed version (ground truth):
/** 
 * @return changes made by current transaction to be used for conflicts detection before commit.
 */
Collection<byte[]> getTxChanges();
Program: 7725
Project: 7725
Buggy source:
/** 
 * Called when new transaction has started
 * @param tx transaction info
 */
void startTx(Transaction tx);

Fixed version (ground truth):
/** 
 * Called when new transaction has started.
 * @param tx transaction info
 */
void startTx(Transaction tx);
Program: 7726
Project: 7726
Buggy source:
private Injector createGuiceInjector(){
  return Guice.createInjector(new MetricsClientRuntimeModule(kafkaClientService).getDistributedModules(),new GatewayModules(cConf).getDistributedModules(),new DataFabricModules(cConf,hConf).getDistributedModules(),new ConfigModule(cConf),new IOModule(),new LocationRuntimeModule().getDistributedModules(),new DiscoveryRuntimeModule(zkClientService).getDistributedModules(),new LoggingModules().getDistributedModules(),new AbstractModule(){
    @Override protected void configure(){
      bind(MetadataService.Iface.class).to(com.continuuity.metadata.MetadataService.class);
      bind(StoreFactory.class).to(MDSStoreFactory.class);
    }
  }
);
}

Fixed version (ground truth):
static Injector createGuiceInjector(KafkaClientService kafkaClientService,ZKClientService zkClientService,CConfiguration cConf,Configuration hConf){
  return Guice.createInjector(new MetricsClientRuntimeModule(kafkaClientService).getDistributedModules(),new GatewayModules(cConf).getDistributedModules(),new DataFabricModules(cConf,hConf).getDistributedModules(),new ConfigModule(cConf),new IOModule(),new LocationRuntimeModule().getDistributedModules(),new DiscoveryRuntimeModule(zkClientService).getDistributedModules(),new LoggingModules().getDistributedModules(),new AbstractModule(){
    @Override protected void configure(){
      bind(MetadataService.Iface.class).to(com.continuuity.metadata.MetadataService.class);
      bind(StoreFactory.class).to(MDSStoreFactory.class);
    }
  }
);
}
Program: 7728
Project: 7728
Buggy source:
@Override protected void bindTableHandle(){
  bind(TransactionOracle.class).to(NoopTransactionOracle.class).in(Scopes.SINGLETON);
  bind(OVCTableHandle.class).annotatedWith(MetricsAnnotation.class).to(HBaseFilterableOVCTableHandle.class).in(Scopes.SINGLETON);
}

Fixed version (ground truth):
@Override protected void bindTableHandle(){
  bind(OVCTableHandle.class).annotatedWith(MetricsAnnotation.class).to(HBaseFilterableOVCTableHandle.class).in(Scopes.SINGLETON);
}
Program: 7729
Project: 7729
Buggy source:
@Override public void create(String name) throws Exception {
  if (admin.tableExists(HBaseTableUtil.getHBaseTableName(name))) {
    return;
  }
  HTableDescriptor tableDescriptor=new HTableDescriptor(getHBaseTableName(name));
  HColumnDescriptor columnDescriptor=new HColumnDescriptor(DATA_COLUMN_FAMILY);
  columnDescriptor.setMaxVersions(100);
  columnDescriptor.setBloomFilterType(StoreFile.BloomType.ROW);
  tableDescriptor.addFamily(columnDescriptor);
  admin.createTable(tableDescriptor);
}

Fixed version (ground truth):
@Override public void create(String name) throws Exception {
  HBaseTableUtil.createTableIfNotExists(admin,HBaseTableUtil.getHBaseTableName(name),DATA_COLUMN_FAMILY);
}
Program: 7730
Project: 7730
Buggy source:
@Override public void run(){
  DefaultTransactionExecutor txExecutor=txExecutorFactory.createExecutor(Lists.newArrayList((TransactionAware)table));
  for (int k=0; k < 100; k++) {
    for (int i=0; i < ROWS_TO_APPEND_TO.length / 2; i++) {
      final byte[] row1=ROWS_TO_APPEND_TO[i * 2];
      final byte[] row2=ROWS_TO_APPEND_TO[i * 2 + 1];
      boolean appended=false;
      while (!appended) {
        try {
          txExecutor.execute(new TransactionExecutor.Subroutine(){
            @Override public void apply() throws Exception {
              appendColumn(row1);
              appendColumn(row2);
            }
            private void appendColumn(            byte[] row) throws Exception {
              OperationResult<Map<byte[],byte[]>> columns=table.get(row,null);
              int columnsCount=columns.isEmpty() ? 0 : columns.getValue().size();
              byte[] columnToAppend=Bytes.toBytes("String_Node_Str" + columnsCount);
              table.put(row,new byte[][]{columnToAppend},new byte[][]{Bytes.toBytes("String_Node_Str" + columnsCount)});
            }
          }
);
        }
 catch (        Throwable t) {
          LOG.warn("String_Node_Str",t);
          appended=false;
          continue;
        }
        appended=true;
      }
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    success.set(false);
    getTableManager().create("String_Node_Str");
    success.set(true);
  }
 catch (  Throwable throwable) {
    success.set(false);
    throwable.printStackTrace(System.err);
  }
}
Program: 7731
Project: 7731
Buggy source:
/** 
 * Constructor for a transaction executor.
 */
@Inject public DefaultTransactionExecutor(TransactionSystemClient txClient,@Assisted TransactionAware... txAwares){
  this.txAwares=ImmutableList.copyOf(txAwares);
  this.txClient=txClient;
}

Fixed version (ground truth):
/** 
 * Constructor for a transaction executor.
 */
@Inject public DefaultTransactionExecutor(TransactionSystemClient txClient,@Assisted Iterable<TransactionAware> txAwares){
  this.txAwares=ImmutableList.copyOf(txAwares);
  this.txClient=txClient;
}
Program: 7734
Project: 7734
Buggy source:
private void getHistory(HttpRequest request,HttpResponder responder,String appId,String id){
  try {
    String accountId=getAuthenticatedAccountId(request);
    TProtocol protocol=getThriftProtocol(Services.APP_FABRIC,endpointStrategy);
    AppFabricService.Client client=new AppFabricService.Client(protocol);
    try {
      List<ProgramRunRecord> records=client.getHistory(new ProgramId(accountId,appId,id));
      JsonArray history=new JsonArray();
      for (      ProgramRunRecord record : records) {
        JsonObject object=new JsonObject();
        object.addProperty("String_Node_Str",record.getRunId());
        object.addProperty("String_Node_Str",record.getStartTime());
        object.addProperty("String_Node_Str",record.getEndTime());
        object.addProperty("String_Node_Str",record.getEndStatus());
        history.add(object);
      }
      responder.sendJson(HttpResponseStatus.OK,history);
    }
  finally {
      if (client.getInputProtocol().getTransport().isOpen()) {
        client.getInputProtocol().getTransport().close();
      }
      if (client.getOutputProtocol().getTransport().isOpen()) {
        client.getOutputProtocol().getTransport().close();
      }
    }
  }
 catch (  SecurityException e) {
    responder.sendStatus(HttpResponseStatus.FORBIDDEN);
  }
catch (  Exception e) {
    responder.sendStatus(HttpResponseStatus.NOT_FOUND);
  }
}

Fixed version (ground truth):
private void getHistory(HttpRequest request,HttpResponder responder,String appId,String id){
  try {
    String accountId=getAuthenticatedAccountId(request);
    TProtocol protocol=getThriftProtocol(Constants.Service.APP_FABRIC,endpointStrategy);
    AppFabricService.Client client=new AppFabricService.Client(protocol);
    try {
      List<ProgramRunRecord> records=client.getHistory(new ProgramId(accountId,appId,id));
      JsonArray history=new JsonArray();
      for (      ProgramRunRecord record : records) {
        JsonObject object=new JsonObject();
        object.addProperty("String_Node_Str",record.getRunId());
        object.addProperty("String_Node_Str",record.getStartTime());
        object.addProperty("String_Node_Str",record.getEndTime());
        object.addProperty("String_Node_Str",record.getEndStatus());
        history.add(object);
      }
      responder.sendJson(HttpResponseStatus.OK,history);
    }
  finally {
      if (client.getInputProtocol().getTransport().isOpen()) {
        client.getInputProtocol().getTransport().close();
      }
      if (client.getOutputProtocol().getTransport().isOpen()) {
        client.getOutputProtocol().getTransport().close();
      }
    }
  }
 catch (  SecurityException e) {
    responder.sendStatus(HttpResponseStatus.FORBIDDEN);
  }
catch (  Exception e) {
    responder.sendStatus(HttpResponseStatus.NOT_FOUND);
  }
}
Program: 7735
Project: 7735
Buggy source:
private void runnableStartStop(HttpRequest request,HttpResponder responder,ProgramId id,String action){
  try {
    String accountId=getAuthenticatedAccountId(request);
    id.setAccountId(accountId);
    AuthToken token=new AuthToken(request.getHeader(GatewayAuthenticator.CONTINUUITY_API_KEY));
    TProtocol protocol=getThriftProtocol(Services.APP_FABRIC,endpointStrategy);
    AppFabricService.Client client=new AppFabricService.Client(protocol);
    try {
      if ("String_Node_Str".equals(action)) {
        client.start(token,new ProgramDescriptor(id,null));
      }
 else       if ("String_Node_Str".equals(action)) {
        client.stop(token,id);
      }
    }
  finally {
      if (client.getInputProtocol().getTransport().isOpen()) {
        client.getInputProtocol().getTransport().close();
      }
      if (client.getOutputProtocol().getTransport().isOpen()) {
        client.getOutputProtocol().getTransport().close();
      }
    }
    responder.sendStatus(HttpResponseStatus.OK);
  }
 catch (  SecurityException e) {
    responder.sendStatus(HttpResponseStatus.FORBIDDEN);
  }
catch (  Exception e) {
    responder.sendStatus(HttpResponseStatus.NOT_FOUND);
  }
}

Fixed version (ground truth):
private void runnableStartStop(HttpRequest request,HttpResponder responder,ProgramId id,String action){
  try {
    String accountId=getAuthenticatedAccountId(request);
    id.setAccountId(accountId);
    AuthToken token=new AuthToken(request.getHeader(GatewayAuthenticator.CONTINUUITY_API_KEY));
    TProtocol protocol=getThriftProtocol(Constants.Service.APP_FABRIC,endpointStrategy);
    AppFabricService.Client client=new AppFabricService.Client(protocol);
    try {
      if ("String_Node_Str".equals(action)) {
        client.start(token,new ProgramDescriptor(id,null));
      }
 else       if ("String_Node_Str".equals(action)) {
        client.stop(token,id);
      }
    }
  finally {
      if (client.getInputProtocol().getTransport().isOpen()) {
        client.getInputProtocol().getTransport().close();
      }
      if (client.getOutputProtocol().getTransport().isOpen()) {
        client.getOutputProtocol().getTransport().close();
      }
    }
    responder.sendStatus(HttpResponseStatus.OK);
  }
 catch (  SecurityException e) {
    responder.sendStatus(HttpResponseStatus.FORBIDDEN);
  }
catch (  Exception e) {
    responder.sendStatus(HttpResponseStatus.NOT_FOUND);
  }
}
Program: 7736
Project: 7736
Buggy source:
private void runnableStatus(HttpRequest request,HttpResponder responder,ProgramId id){
  try {
    String accountId=getAuthenticatedAccountId(request);
    id.setAccountId(accountId);
    AuthToken token=new AuthToken(request.getHeader(GatewayAuthenticator.CONTINUUITY_API_KEY));
    TProtocol protocol=getThriftProtocol(Services.APP_FABRIC,endpointStrategy);
    AppFabricService.Client client=new AppFabricService.Client(protocol);
    try {
      ProgramStatus status=client.status(token,id);
      JsonObject o=new JsonObject();
      o.addProperty("String_Node_Str",status.getStatus());
      responder.sendJson(HttpResponseStatus.OK,o);
    }
  finally {
      if (client.getInputProtocol().getTransport().isOpen()) {
        client.getInputProtocol().getTransport().close();
      }
      if (client.getOutputProtocol().getTransport().isOpen()) {
        client.getOutputProtocol().getTransport().close();
      }
    }
  }
 catch (  SecurityException e) {
    responder.sendStatus(HttpResponseStatus.FORBIDDEN);
  }
catch (  Exception e) {
    responder.sendStatus(HttpResponseStatus.NOT_FOUND);
  }
}

Fixed version (ground truth):
private void runnableStatus(HttpRequest request,HttpResponder responder,ProgramId id){
  try {
    String accountId=getAuthenticatedAccountId(request);
    id.setAccountId(accountId);
    AuthToken token=new AuthToken(request.getHeader(GatewayAuthenticator.CONTINUUITY_API_KEY));
    TProtocol protocol=getThriftProtocol(Constants.Service.APP_FABRIC,endpointStrategy);
    AppFabricService.Client client=new AppFabricService.Client(protocol);
    try {
      ProgramStatus status=client.status(token,id);
      JsonObject o=new JsonObject();
      o.addProperty("String_Node_Str",status.getStatus());
      responder.sendJson(HttpResponseStatus.OK,o);
    }
  finally {
      if (client.getInputProtocol().getTransport().isOpen()) {
        client.getInputProtocol().getTransport().close();
      }
      if (client.getOutputProtocol().getTransport().isOpen()) {
        client.getOutputProtocol().getTransport().close();
      }
    }
  }
 catch (  SecurityException e) {
    responder.sendStatus(HttpResponseStatus.FORBIDDEN);
  }
catch (  Exception e) {
    responder.sendStatus(HttpResponseStatus.NOT_FOUND);
  }
}
Program: 7737
Project: 7737
Buggy source:
/** 
 * Deletes an application specified by appId
 */
@DELETE @Path("String_Node_Str") public void deleteApp(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") final String appId){
  try {
    String accountId=getAuthenticatedAccountId(request);
    AuthToken token=new AuthToken(request.getHeader(GatewayAuthenticator.CONTINUUITY_API_KEY));
    TProtocol protocol=getThriftProtocol(Services.APP_FABRIC,endpointStrategy);
    AppFabricService.Client client=new AppFabricService.Client(protocol);
    try {
      client.removeApplication(token,new ProgramId(accountId,appId,"String_Node_Str"));
    }
  finally {
      if (client.getInputProtocol().getTransport().isOpen()) {
        client.getInputProtocol().getTransport().close();
      }
      if (client.getOutputProtocol().getTransport().isOpen()) {
        client.getOutputProtocol().getTransport().close();
      }
    }
    responder.sendStatus(HttpResponseStatus.OK);
  }
 catch (  SecurityException e) {
    responder.sendStatus(HttpResponseStatus.FORBIDDEN);
  }
catch (  Exception e) {
    responder.sendStatus(HttpResponseStatus.NOT_FOUND);
  }
}

Fixed version (ground truth):
/** 
 * Deletes an application specified by appId
 */
@DELETE @Path("String_Node_Str") public void deleteApp(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") final String appId){
  try {
    String accountId=getAuthenticatedAccountId(request);
    AuthToken token=new AuthToken(request.getHeader(GatewayAuthenticator.CONTINUUITY_API_KEY));
    TProtocol protocol=getThriftProtocol(Constants.Service.APP_FABRIC,endpointStrategy);
    AppFabricService.Client client=new AppFabricService.Client(protocol);
    try {
      client.removeApplication(token,new ProgramId(accountId,appId,"String_Node_Str"));
    }
  finally {
      if (client.getInputProtocol().getTransport().isOpen()) {
        client.getInputProtocol().getTransport().close();
      }
      if (client.getOutputProtocol().getTransport().isOpen()) {
        client.getOutputProtocol().getTransport().close();
      }
    }
    responder.sendStatus(HttpResponseStatus.OK);
  }
 catch (  SecurityException e) {
    responder.sendStatus(HttpResponseStatus.FORBIDDEN);
  }
catch (  Exception e) {
    responder.sendStatus(HttpResponseStatus.NOT_FOUND);
  }
}
Program: 7738
Project: 7738
Buggy source:
/** 
 * *DO NOT DOCUMENT THIS API
 */
@DELETE @Path("String_Node_Str") public void resetReactor(HttpRequest request,HttpResponder responder){
  try {
    if (!conf.getBoolean(Constants.Dangerous.UNRECOVERABLE_RESET,Constants.Dangerous.DEFAULT_UNRECOVERABLE_RESET)) {
      responder.sendStatus(HttpResponseStatus.FORBIDDEN);
      return;
    }
    String accountId=getAuthenticatedAccountId(request);
    AuthToken token=new AuthToken(request.getHeader(GatewayAuthenticator.CONTINUUITY_API_KEY));
    TProtocol protocol=getThriftProtocol(Services.APP_FABRIC,endpointStrategy);
    AppFabricService.Client client=new AppFabricService.Client(protocol);
    try {
      client.reset(token,accountId);
    }
  finally {
      if (client.getInputProtocol().getTransport().isOpen()) {
        client.getInputProtocol().getTransport().close();
      }
      if (client.getOutputProtocol().getTransport().isOpen()) {
        client.getOutputProtocol().getTransport().close();
      }
    }
    responder.sendStatus(HttpResponseStatus.OK);
  }
 catch (  SecurityException e) {
    responder.sendStatus(HttpResponseStatus.FORBIDDEN);
  }
catch (  Exception e) {
    responder.sendStatus(HttpResponseStatus.NOT_FOUND);
  }
}

Fixed version (ground truth):
/** 
 * *DO NOT DOCUMENT THIS API
 */
@DELETE @Path("String_Node_Str") public void resetReactor(HttpRequest request,HttpResponder responder){
  try {
    if (!conf.getBoolean(Constants.Dangerous.UNRECOVERABLE_RESET,Constants.Dangerous.DEFAULT_UNRECOVERABLE_RESET)) {
      responder.sendStatus(HttpResponseStatus.FORBIDDEN);
      return;
    }
    String accountId=getAuthenticatedAccountId(request);
    AuthToken token=new AuthToken(request.getHeader(GatewayAuthenticator.CONTINUUITY_API_KEY));
    TProtocol protocol=getThriftProtocol(Constants.Service.APP_FABRIC,endpointStrategy);
    AppFabricService.Client client=new AppFabricService.Client(protocol);
    try {
      client.reset(token,accountId);
    }
  finally {
      if (client.getInputProtocol().getTransport().isOpen()) {
        client.getInputProtocol().getTransport().close();
      }
      if (client.getOutputProtocol().getTransport().isOpen()) {
        client.getOutputProtocol().getTransport().close();
      }
    }
    responder.sendStatus(HttpResponseStatus.OK);
  }
 catch (  SecurityException e) {
    responder.sendStatus(HttpResponseStatus.FORBIDDEN);
  }
catch (  Exception e) {
    responder.sendStatus(HttpResponseStatus.NOT_FOUND);
  }
}
Program: 7739
Project: 7739
Buggy source:
@Inject public AppFabricServiceHandler(GatewayAuthenticator authenticator,CConfiguration conf,DiscoveryServiceClient discoveryClient){
  super(authenticator);
  this.discoveryClient=discoveryClient;
  this.conf=conf;
  this.endpointStrategy=new RandomEndpointStrategy(discoveryClient.discover(Services.APP_FABRIC));
}

Fixed version (ground truth):
@Inject public AppFabricServiceHandler(GatewayAuthenticator authenticator,CConfiguration conf,DiscoveryServiceClient discoveryClient){
  super(authenticator);
  this.discoveryClient=discoveryClient;
  this.conf=conf;
  this.endpointStrategy=new RandomEndpointStrategy(discoveryClient.discover(Constants.Service.APP_FABRIC));
}
Program: 7741
Project: 7741
Buggy source:
/** 
 * Deletes all applications in the reactor.
 */
@DELETE @Path("String_Node_Str") public void deleteAllApps(HttpRequest request,HttpResponder responder){
  try {
    String accountId=getAuthenticatedAccountId(request);
    AuthToken token=new AuthToken(request.getHeader(GatewayAuthenticator.CONTINUUITY_API_KEY));
    TProtocol protocol=getThriftProtocol(Services.APP_FABRIC,endpointStrategy);
    AppFabricService.Client client=new AppFabricService.Client(protocol);
    try {
      client.removeAll(token,accountId);
    }
  finally {
      if (client.getInputProtocol().getTransport().isOpen()) {
        client.getInputProtocol().getTransport().close();
      }
      if (client.getOutputProtocol().getTransport().isOpen()) {
        client.getOutputProtocol().getTransport().close();
      }
    }
    responder.sendStatus(HttpResponseStatus.OK);
  }
 catch (  SecurityException e) {
    responder.sendStatus(HttpResponseStatus.FORBIDDEN);
  }
catch (  Exception e) {
    responder.sendStatus(HttpResponseStatus.NOT_FOUND);
  }
}

Fixed version (ground truth):
/** 
 * Deletes all applications in the reactor.
 */
@DELETE @Path("String_Node_Str") public void deleteAllApps(HttpRequest request,HttpResponder responder){
  try {
    String accountId=getAuthenticatedAccountId(request);
    AuthToken token=new AuthToken(request.getHeader(GatewayAuthenticator.CONTINUUITY_API_KEY));
    TProtocol protocol=getThriftProtocol(Constants.Service.APP_FABRIC,endpointStrategy);
    AppFabricService.Client client=new AppFabricService.Client(protocol);
    try {
      client.removeAll(token,accountId);
    }
  finally {
      if (client.getInputProtocol().getTransport().isOpen()) {
        client.getInputProtocol().getTransport().close();
      }
      if (client.getOutputProtocol().getTransport().isOpen()) {
        client.getOutputProtocol().getTransport().close();
      }
    }
    responder.sendStatus(HttpResponseStatus.OK);
  }
 catch (  SecurityException e) {
    responder.sendStatus(HttpResponseStatus.FORBIDDEN);
  }
catch (  Exception e) {
    responder.sendStatus(HttpResponseStatus.NOT_FOUND);
  }
}
Program: 7742
Project: 7742
Buggy source:
private void runnableSpecification(HttpRequest request,HttpResponder responder,ProgramId id){
  try {
    String accountId=getAuthenticatedAccountId(request);
    id.setAccountId(accountId);
    TProtocol protocol=getThriftProtocol(Services.APP_FABRIC,endpointStrategy);
    AppFabricService.Client client=new AppFabricService.Client(protocol);
    try {
      String specification=client.getSpecification(id);
      responder.sendByteArray(HttpResponseStatus.OK,specification.getBytes(Charsets.UTF_8),ImmutableMultimap.of(HttpHeaders.Names.CONTENT_TYPE,"String_Node_Str"));
    }
  finally {
      if (client.getInputProtocol().getTransport().isOpen()) {
        client.getInputProtocol().getTransport().close();
      }
      if (client.getOutputProtocol().getTransport().isOpen()) {
        client.getOutputProtocol().getTransport().close();
      }
    }
  }
 catch (  SecurityException e) {
    responder.sendStatus(HttpResponseStatus.FORBIDDEN);
  }
catch (  Exception e) {
    responder.sendStatus(HttpResponseStatus.NOT_FOUND);
  }
}

Fixed version (ground truth):
private void runnableSpecification(HttpRequest request,HttpResponder responder,ProgramId id){
  try {
    String accountId=getAuthenticatedAccountId(request);
    id.setAccountId(accountId);
    TProtocol protocol=getThriftProtocol(Constants.Service.APP_FABRIC,endpointStrategy);
    AppFabricService.Client client=new AppFabricService.Client(protocol);
    try {
      String specification=client.getSpecification(id);
      responder.sendByteArray(HttpResponseStatus.OK,specification.getBytes(Charsets.UTF_8),ImmutableMultimap.of(HttpHeaders.Names.CONTENT_TYPE,"String_Node_Str"));
    }
  finally {
      if (client.getInputProtocol().getTransport().isOpen()) {
        client.getInputProtocol().getTransport().close();
      }
      if (client.getOutputProtocol().getTransport().isOpen()) {
        client.getOutputProtocol().getTransport().close();
      }
    }
  }
 catch (  SecurityException e) {
    responder.sendStatus(HttpResponseStatus.FORBIDDEN);
  }
catch (  Exception e) {
    responder.sendStatus(HttpResponseStatus.NOT_FOUND);
  }
}
Program: 7743
Project: 7743
Buggy source:
/** 
 * Returns number of instances for a flowlet within a flow.
 */
@GET @Path("String_Node_Str") public void getFlowletInstances(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") final String appId,@PathParam("String_Node_Str") final String flowId,@PathParam("String_Node_Str") final String flowletId){
  try {
    String accountId=getAuthenticatedAccountId(request);
    AuthToken token=new AuthToken(request.getHeader(GatewayAuthenticator.CONTINUUITY_API_KEY));
    TProtocol protocol=getThriftProtocol(Services.APP_FABRIC,endpointStrategy);
    AppFabricService.Client client=new AppFabricService.Client(protocol);
    try {
      int count=client.getInstances(token,new ProgramId(accountId,appId,flowId),flowletId);
      JsonObject o=new JsonObject();
      o.addProperty("String_Node_Str",count);
      responder.sendJson(HttpResponseStatus.OK,o);
    }
  finally {
      if (client.getInputProtocol().getTransport().isOpen()) {
        client.getInputProtocol().getTransport().close();
      }
      if (client.getOutputProtocol().getTransport().isOpen()) {
        client.getOutputProtocol().getTransport().close();
      }
    }
    responder.sendStatus(HttpResponseStatus.OK);
  }
 catch (  SecurityException e) {
    responder.sendStatus(HttpResponseStatus.FORBIDDEN);
  }
catch (  Exception e) {
    responder.sendStatus(HttpResponseStatus.NOT_FOUND);
  }
}

Fixed version (ground truth):
/** 
 * Returns number of instances for a flowlet within a flow.
 */
@GET @Path("String_Node_Str") public void getFlowletInstances(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") final String appId,@PathParam("String_Node_Str") final String flowId,@PathParam("String_Node_Str") final String flowletId){
  try {
    String accountId=getAuthenticatedAccountId(request);
    AuthToken token=new AuthToken(request.getHeader(GatewayAuthenticator.CONTINUUITY_API_KEY));
    TProtocol protocol=getThriftProtocol(Constants.Service.APP_FABRIC,endpointStrategy);
    AppFabricService.Client client=new AppFabricService.Client(protocol);
    try {
      int count=client.getInstances(token,new ProgramId(accountId,appId,flowId),flowletId);
      JsonObject o=new JsonObject();
      o.addProperty("String_Node_Str",count);
      responder.sendJson(HttpResponseStatus.OK,o);
    }
  finally {
      if (client.getInputProtocol().getTransport().isOpen()) {
        client.getInputProtocol().getTransport().close();
      }
      if (client.getOutputProtocol().getTransport().isOpen()) {
        client.getOutputProtocol().getTransport().close();
      }
    }
    responder.sendStatus(HttpResponseStatus.OK);
  }
 catch (  SecurityException e) {
    responder.sendStatus(HttpResponseStatus.FORBIDDEN);
  }
catch (  Exception e) {
    responder.sendStatus(HttpResponseStatus.NOT_FOUND);
  }
}
Program: 7744
Project: 7744
Buggy source:
@Override protected void before() throws Throwable {
  conf.setInt(Constants.Gateway.PORT,0);
  conf.setInt(Constants.AppFabric.SERVER_PORT,0);
  conf.set(Constants.Gateway.ADDRESS,hostname);
  conf.set(Constants.AppFabric.OUTPUT_DIR,System.getProperty("String_Node_Str"));
  conf.set(Constants.AppFabric.TEMP_DIR,System.getProperty("String_Node_Str"));
  conf.setBoolean(Constants.Dangerous.UNRECOVERABLE_RESET,true);
  injector=Guice.createInjector(new GatewayModules(conf).getInMemoryModules(),new AppFabricTestModule(conf),new AbstractModule(){
    @Override protected void configure(){
      bind(LogReader.class).to(MockLogReader.class).in(Scopes.SINGLETON);
      bind(DataSetInstantiatorFromMetaData.class).in(Scopes.SINGLETON);
    }
  }
);
  discoveryService=injector.getInstance(DiscoveryService.class);
  gateway=injector.getInstance(Gateway.class);
  mds=injector.getInstance(MetadataService.Iface.class);
  injector.getInstance(InMemoryTransactionManager.class).init();
  appFabricServer=injector.getInstance(AppFabricServer.class);
  appFabricServer.startAndWait();
  gateway.startAndWait();
  port=gateway.getBindAddress().getPort();
}

Fixed version (ground truth):
@Override protected void before() throws Throwable {
  conf.setInt(Constants.Gateway.PORT,0);
  conf.set(Constants.Gateway.ADDRESS,hostname);
  conf.set(Constants.AppFabric.OUTPUT_DIR,System.getProperty("String_Node_Str"));
  conf.set(Constants.AppFabric.TEMP_DIR,System.getProperty("String_Node_Str"));
  conf.setBoolean(Constants.Dangerous.UNRECOVERABLE_RESET,true);
  injector=Guice.createInjector(new GatewayModules(conf).getInMemoryModules(),new AppFabricTestModule(conf),new AbstractModule(){
    @Override protected void configure(){
      bind(LogReader.class).to(MockLogReader.class).in(Scopes.SINGLETON);
      bind(DataSetInstantiatorFromMetaData.class).in(Scopes.SINGLETON);
    }
  }
);
  discoveryService=injector.getInstance(DiscoveryService.class);
  gateway=injector.getInstance(Gateway.class);
  mds=injector.getInstance(MetadataService.Iface.class);
  injector.getInstance(InMemoryTransactionManager.class).init();
  appFabricServer=injector.getInstance(AppFabricServer.class);
  appFabricServer.startAndWait();
  gateway.startAndWait();
  port=gateway.getBindAddress().getPort();
}
Program: 7746
Project: 7746
Buggy source:
/** 
 * The root of all goodness!
 * @param args Our cmdline arguments
 */
public static void main(String[] args){
  CConfiguration configuration=CConfiguration.create();
  boolean inMemory=false;
  String webAppPath=WebCloudAppService.WEB_APP;
  String webAppPath=WebCloudAppService.WEB_APP;
  if (args.length > 0) {
    if ("String_Node_Str".equals(args[0]) || "String_Node_Str".equals(args[0])) {
      usage(false);
      return;
    }
 else     if ("String_Node_Str".equals(args[0])) {
      inMemory=true;
    }
 else     if ("String_Node_Str".equals(args[0])) {
      configuration.setBoolean(Constants.CFG_DATA_LEVELDB_ENABLED,false);
    }
 else     if ("String_Node_Str".equals(args[0])) {
      webAppPath=args[1];
    }
 else {
      usage(true);
    }
  }
  Configuration hConf=new Configuration();
  hConf.addResource("String_Node_Str");
  hConf.reloadConfiguration();
  List<Module> modules=inMemory ? createInMemoryModules(configuration,hConf) : createPersistentModules(configuration,hConf);
  SingleNodeMain main=new SingleNodeMain(modules,configuration,webAppPath);
  try {
    main.startUp(args);
  }
 catch (  Exception e) {
    System.err.println("String_Node_Str" + e.getMessage());
    LOG.error("String_Node_Str",e);
    main.shutDown();
    System.exit(-2);
  }
}

Fixed version (ground truth):
/** 
 * The root of all goodness!
 * @param args Our cmdline arguments
 */
public static void main(String[] args){
  CConfiguration configuration=CConfiguration.create();
  boolean inMemory=false;
  String webAppPath=WebCloudAppService.WEB_APP;
  if (args.length > 0) {
    if ("String_Node_Str".equals(args[0]) || "String_Node_Str".equals(args[0])) {
      usage(false);
      return;
    }
 else     if ("String_Node_Str".equals(args[0])) {
      inMemory=true;
    }
 else     if ("String_Node_Str".equals(args[0])) {
      configuration.setBoolean(Constants.CFG_DATA_LEVELDB_ENABLED,false);
    }
 else     if ("String_Node_Str".equals(args[0])) {
      webAppPath=args[1];
    }
 else {
      usage(true);
    }
  }
  Configuration hConf=new Configuration();
  hConf.addResource("String_Node_Str");
  hConf.reloadConfiguration();
  List<Module> modules=inMemory ? createInMemoryModules(configuration,hConf) : createPersistentModules(configuration,hConf);
  SingleNodeMain main=new SingleNodeMain(modules,configuration,webAppPath);
  try {
    main.startUp(args);
  }
 catch (  Exception e) {
    System.err.println("String_Node_Str" + e.getMessage());
    LOG.error("String_Node_Str",e);
    main.shutDown();
    System.exit(-2);
  }
}
Program: 7747
Project: 7747
Buggy source:
@Override public ProcedureManager startProcedure(final String procedureName,Map<String,String> arguments){
  try {
    final FlowIdentifier procedureId=new FlowIdentifier(accountId,applicationId,procedureName,0);
    procedureId.setType(EntityType.PROCEDURE);
    Preconditions.checkState(runningProcessses.putIfAbsent(procedureName,procedureId) == null,"String_Node_Str",procedureName);
    try {
      appFabricServer.start(token,new FlowDescriptor(procedureId,arguments));
    }
 catch (    Exception e) {
      runningProcessses.remove(procedureName);
      throw Throwables.propagate(e);
    }
    return new ProcedureManager(){
      @Override public void stop(){
        try {
          if (runningProcessses.remove(procedureName,procedureId)) {
            appFabricServer.stop(token,procedureId);
          }
        }
 catch (        Exception e) {
          throw Throwables.propagate(e);
        }
      }
      @Override public ProcedureClient getClient(){
        return procedureClientFactory.create(accountId,applicationId,procedureName);
      }
    }
;
  }
 catch (  Exception e) {
    throw Throwables.propagate(e);
  }
}

Fixed version (ground truth):
@Override public ProcedureManager startProcedure(final String procedureName,Map<String,String> arguments){
  try {
    final ProgramId procedureId=new ProgramId(accountId,applicationId,procedureName);
    procedureId.setType(EntityType.PROCEDURE);
    Preconditions.checkState(runningProcessses.putIfAbsent(procedureName,procedureId) == null,"String_Node_Str",procedureName);
    try {
      appFabricServer.start(token,new ProgramDescriptor(procedureId,arguments));
    }
 catch (    Exception e) {
      runningProcessses.remove(procedureName);
      throw Throwables.propagate(e);
    }
    return new ProcedureManager(){
      @Override public void stop(){
        try {
          if (runningProcessses.remove(procedureName,procedureId)) {
            appFabricServer.stop(token,procedureId);
          }
        }
 catch (        Exception e) {
          throw Throwables.propagate(e);
        }
      }
      @Override public ProcedureClient getClient(){
        return procedureClientFactory.create(accountId,applicationId,procedureName);
      }
    }
;
  }
 catch (  Exception e) {
    throw Throwables.propagate(e);
  }
}
Program: 7748
Project: 7748
Buggy source:
@Override public void stopAll(){
  try {
    for (    Map.Entry<String,FlowIdentifier> entry : Iterables.consumingIterable(runningProcessses.entrySet())) {
      if (isRunning(entry.getValue())) {
        appFabricServer.stop(token,entry.getValue());
      }
    }
  }
 catch (  Exception e) {
    throw Throwables.propagate(e);
  }
 finally {
    RuntimeStats.clearStats(applicationId);
  }
}

Fixed version (ground truth):
@Override public void stopAll(){
  try {
    for (    Map.Entry<String,ProgramId> entry : Iterables.consumingIterable(runningProcessses.entrySet())) {
      if (isRunning(entry.getValue())) {
        appFabricServer.stop(token,entry.getValue());
      }
    }
  }
 catch (  Exception e) {
    throw Throwables.propagate(e);
  }
 finally {
    RuntimeStats.clearStats(applicationId);
  }
}
Program: 7749
Project: 7749
Buggy source:
private boolean isRunning(FlowIdentifier flowId){
  try {
    FlowStatus status=appFabricServer.status(token,flowId);
    return "String_Node_Str".equals(status.getStatus());
  }
 catch (  Exception e) {
    throw Throwables.propagate(e);
  }
}

Fixed version (ground truth):
private boolean isRunning(ProgramId flowId){
  try {
    ProgramStatus status=appFabricServer.status(token,flowId);
    return "String_Node_Str".equals(status.getStatus());
  }
 catch (  Exception e) {
    throw Throwables.propagate(e);
  }
}