nus-yam/ex-repair huggingface dataset:
Program: 4775
Project: 4775
Buggy source:
@BeforeClass public static void setup() throws Exception {
  SConfiguration sConf=SConfiguration.create();
  sConf.set(Constants.Security.Store.FILE_PASSWORD,"String_Node_Str");
  final Injector injector=AppFabricTestHelper.getInjector(createCConf(),sConf,new AbstractModule(){
    @Override protected void configure(){
    }
  }
);
  discoveryServiceClient=injector.getInstance(DiscoveryServiceClient.class);
  appFabricServer=injector.getInstance(AppFabricServer.class);
  appFabricServer.startAndWait();
  waitForService(Constants.Service.DATASET_MANAGER);
  secureStore=injector.getInstance(SecureStore.class);
  secureStoreManager=injector.getInstance(SecureStoreManager.class);
  authorizer=injector.getInstance(AuthorizerInstantiator.class).get();
  authorizer.grant(NamespaceId.DEFAULT,ALICE,Collections.singleton(Action.READ));
  Tasks.waitFor(true,new Callable<Boolean>(){
    @Override public Boolean call() throws Exception {
      return injector.getInstance(NamespaceAdmin.class).exists(NamespaceId.DEFAULT);
    }
  }
,5,TimeUnit.SECONDS);
  authorizer.revoke(NamespaceId.DEFAULT,ALICE,Collections.singleton(Action.READ));
}

Fixed version (ground truth):
@BeforeClass public static void setup() throws Exception {
  SConfiguration sConf=SConfiguration.create();
  sConf.set(Constants.Security.Store.FILE_PASSWORD,"String_Node_Str");
  CConfiguration cConf=createCConf();
  final Injector injector=AppFabricTestHelper.getInjector(cConf,sConf,new AbstractModule(){
    @Override protected void configure(){
    }
  }
);
  discoveryServiceClient=injector.getInstance(DiscoveryServiceClient.class);
  appFabricServer=injector.getInstance(AppFabricServer.class);
  appFabricServer.startAndWait();
  waitForService(Constants.Service.DATASET_MANAGER);
  secureStore=injector.getInstance(SecureStore.class);
  secureStoreManager=injector.getInstance(SecureStoreManager.class);
  authorizer=injector.getInstance(AuthorizerInstantiator.class).get();
  String user=SecurityUtil.getMasterPrincipal(cConf);
  authorizer.grant(NamespaceId.DEFAULT,new Principal(user,Principal.PrincipalType.USER),Collections.singleton(Action.ADMIN));
  injector.getInstance(NamespaceAdmin.class).create(NamespaceMeta.DEFAULT);
  authorizer.revoke(NamespaceId.DEFAULT,new Principal(user,Principal.PrincipalType.USER),Collections.singleton(Action.ADMIN));
}
Program: 4776
Project: 4776
Buggy source:
@BeforeClass public static void setup() throws Exception {
  cConf=createCConf();
  Injector injector=AppFabricTestHelper.getInjector(cConf);
  authorizer=injector.getInstance(AuthorizerInstantiator.class).get();
  appFabricServer=injector.getInstance(AppFabricServer.class);
  appFabricServer.startAndWait();
  programLifecycleService=injector.getInstance(ProgramLifecycleService.class);
}

Fixed version (ground truth):
@BeforeClass public static void setup() throws Exception {
  cConf=createCConf();
  Injector injector=AppFabricTestHelper.getInjector(cConf);
  authorizer=injector.getInstance(AuthorizerInstantiator.class).get();
  appFabricServer=injector.getInstance(AppFabricServer.class);
  appFabricServer.startAndWait();
  programLifecycleService=injector.getInstance(ProgramLifecycleService.class);
  String user=SecurityUtil.getMasterPrincipal(cConf);
  authorizer.grant(NamespaceId.DEFAULT,new Principal(user,Principal.PrincipalType.USER),Collections.singleton(Action.ADMIN));
  injector.getInstance(NamespaceAdmin.class).create(NamespaceMeta.DEFAULT);
  authorizer.revoke(NamespaceId.DEFAULT,new Principal(user,Principal.PrincipalType.USER),Collections.singleton(Action.ADMIN));
}
Program: 4777
Project: 4777
Buggy source:
@BeforeClass public static void setup() throws Exception {
  SConfiguration sConf=SConfiguration.create();
  sConf.set(Constants.Security.Store.FILE_PASSWORD,"String_Node_Str");
  CConfiguration cConf=createCConf();
  final Injector injector=AppFabricTestHelper.getInjector(cConf,sConf,new AbstractModule(){
    @Override protected void configure(){
    }
  }
);
  discoveryServiceClient=injector.getInstance(DiscoveryServiceClient.class);
  appFabricServer=injector.getInstance(AppFabricServer.class);
  appFabricServer.startAndWait();
  waitForService(Constants.Service.DATASET_MANAGER);
  secureStore=injector.getInstance(SecureStore.class);
  secureStoreManager=injector.getInstance(SecureStoreManager.class);
  authorizer=injector.getInstance(AuthorizerInstantiator.class).get();
  String user=SecurityUtil.getMasterPrincipal(cConf);
  authorizer.grant(NamespaceId.DEFAULT,new Principal(user,Principal.PrincipalType.USER),Collections.singleton(Action.ADMIN));
  NamespaceAdmin namespaceAdmin=injector.getInstance(NamespaceAdmin.class);
  if (!namespaceAdmin.exists(NamespaceId.DEFAULT)) {
    namespaceAdmin.create(NamespaceMeta.DEFAULT);
  }
  authorizer.revoke(NamespaceId.DEFAULT,new Principal(user,Principal.PrincipalType.USER),Collections.singleton(Action.ADMIN));
}

Fixed version (ground truth):
@BeforeClass public static void setup() throws Exception {
  SConfiguration sConf=SConfiguration.create();
  sConf.set(Constants.Security.Store.FILE_PASSWORD,"String_Node_Str");
  CConfiguration cConf=createCConf();
  final Injector injector=AppFabricTestHelper.getInjector(cConf,sConf,new AbstractModule(){
    @Override protected void configure(){
    }
  }
);
  discoveryServiceClient=injector.getInstance(DiscoveryServiceClient.class);
  appFabricServer=injector.getInstance(AppFabricServer.class);
  appFabricServer.startAndWait();
  waitForService(Constants.Service.DATASET_MANAGER);
  secureStore=injector.getInstance(SecureStore.class);
  secureStoreManager=injector.getInstance(SecureStoreManager.class);
  authorizer=injector.getInstance(AuthorizerInstantiator.class).get();
  String user=SecurityUtil.getMasterPrincipal(cConf);
  authorizer.grant(NamespaceId.DEFAULT,new Principal(user,Principal.PrincipalType.USER),Collections.singleton(Action.ADMIN));
  Tasks.waitFor(true,new Callable<Boolean>(){
    @Override public Boolean call() throws Exception {
      return injector.getInstance(NamespaceAdmin.class).exists(NamespaceId.DEFAULT);
    }
  }
,5,TimeUnit.SECONDS);
  authorizer.revoke(NamespaceId.DEFAULT,new Principal(user,Principal.PrincipalType.USER),Collections.singleton(Action.ADMIN));
}
Program: 4778
Project: 4778
Buggy source:
@BeforeClass public static void setup() throws Exception {
  cConf=createCConf();
  final Injector injector=AppFabricTestHelper.getInjector(cConf);
  metadataAdmin=injector.getInstance(MetadataAdmin.class);
  authorizer=injector.getInstance(AuthorizerInstantiator.class).get();
  appFabricServer=injector.getInstance(AppFabricServer.class);
  appFabricServer.startAndWait();
  String user=SecurityUtil.getMasterPrincipal(cConf);
  authorizer.grant(NamespaceId.DEFAULT,new Principal(user,Principal.PrincipalType.USER),Collections.singleton(Action.ADMIN));
  NamespaceAdmin namespaceAdmin=injector.getInstance(NamespaceAdmin.class);
  if (!namespaceAdmin.exists(NamespaceId.DEFAULT)) {
    namespaceAdmin.create(NamespaceMeta.DEFAULT);
  }
  authorizer.revoke(NamespaceId.DEFAULT,new Principal(user,Principal.PrincipalType.USER),Collections.singleton(Action.ADMIN));
}

Fixed version (ground truth):
@BeforeClass public static void setup() throws Exception {
  cConf=createCConf();
  final Injector injector=AppFabricTestHelper.getInjector(cConf);
  metadataAdmin=injector.getInstance(MetadataAdmin.class);
  authorizer=injector.getInstance(AuthorizerInstantiator.class).get();
  appFabricServer=injector.getInstance(AppFabricServer.class);
  appFabricServer.startAndWait();
  String user=SecurityUtil.getMasterPrincipal(cConf);
  authorizer.grant(NamespaceId.DEFAULT,new Principal(user,Principal.PrincipalType.USER),Collections.singleton(Action.ADMIN));
  Tasks.waitFor(true,new Callable<Boolean>(){
    @Override public Boolean call() throws Exception {
      return injector.getInstance(NamespaceAdmin.class).exists(NamespaceId.DEFAULT);
    }
  }
,5,TimeUnit.SECONDS);
  authorizer.revoke(NamespaceId.DEFAULT,new Principal(user,Principal.PrincipalType.USER),Collections.singleton(Action.ADMIN));
}
Program: 4779
Project: 4779
Buggy source:
/** 
 * Call a Callable.
 * @param callable the callable to call
 * @param < T > the return type
 * @return the result of the callable
 * @throws Exception if there was any exception encountered while calling the callable
 */
public <T>T call(Callable<T> callable) throws Exception {
  return call(callable,CallArgs.NONE);
}

Fixed version (ground truth):
/** 
 * Call a Callable.
 * @param callable the callable to call
 * @param < T > the return type
 * @return the result of the callable
 * @throws Exception if there was any exception encountered while calling the callable
 */
public abstract <T>T call(Callable<T> callable) throws Exception ;
Program: 4780
Project: 4780
Buggy source:
/** 
 * Call a Callable that does not throw checked exceptions with the specified arguments. It is up to you to ensure that it does not throw checked exceptions. Otherwise, any checked exceptions will be wrapped in a RuntimeException and propagated.
 * @param callable the callable to call
 * @param args arguments that may override default behavior
 * @param < T > the return type
 * @return the result of the callable
 */
public <T>T callUnchecked(Callable<T> callable,CallArgs args){
  try {
    return call(callable,args);
  }
 catch (  Exception e) {
    throw Throwables.propagate(e);
  }
}

Fixed version (ground truth):
/** 
 * Call a Callable that does not throw checked exceptions. It is up to you to ensure that it does not throw checked exceptions. Otherwise, any checked exceptions will be wrapped in a RuntimeException and propagated.
 * @param callable the callable to call
 * @param < T > the return type
 * @return the result of the callable
 */
public <T>T callUnchecked(Callable<T> callable){
  try {
    return call(callable);
  }
 catch (  Exception e) {
    throw Throwables.propagate(e);
  }
}
Program: 4781
Project: 4781
Buggy source:
@Override public <T>T call(Callable<T> callable,CallArgs args) throws Exception {
  String stage=MDC.get(Constants.MDC_STAGE_KEY);
  if (stage == null) {
    return delegate.call(callable,args);
  }
  MDC.remove(Constants.MDC_STAGE_KEY);
  try {
    return delegate.call(callable,args);
  }
  finally {
    MDC.put(Constants.MDC_STAGE_KEY,stage);
  }
}

Fixed version (ground truth):
@Override public <T>T call(Callable<T> callable) throws Exception {
  String stage=MDC.get(Constants.MDC_STAGE_KEY);
  if (stage == null) {
    return delegate.call(callable);
  }
  MDC.remove(Constants.MDC_STAGE_KEY);
  try {
    return delegate.call(callable);
  }
  finally {
    MDC.put(Constants.MDC_STAGE_KEY,stage);
  }
}
Program: 4782
Project: 4782
Buggy source:
public Caller getCaller(String pluginId){
  Caller caller=Caller.DEFAULT;
  if (processTimingEnabled) {
    caller=TimingCaller.wrap(caller,new DefaultStageMetrics(metrics,pluginId));
  }
  if (stageLoggingEnabled) {
    caller=StageLoggingCaller.wrap(caller,pluginId);
  }
  return caller;
}

Fixed version (ground truth):
public Caller getCaller(String pluginId){
  Caller caller=Caller.DEFAULT;
  if (stageLoggingEnabled) {
    caller=StageLoggingCaller.wrap(caller,pluginId);
  }
  return caller;
}
Program: 4783
Project: 4783
Buggy source:
private Object wrapPlugin(String pluginId,Object plugin){
  Caller caller=getCaller(pluginId);
  if (plugin instanceof Action) {
    return new WrappedAction((Action)plugin,caller);
  }
 else   if (plugin instanceof BatchSource) {
    return new WrappedBatchSource<>((BatchSource)plugin,caller);
  }
 else   if (plugin instanceof BatchSink) {
    return new WrappedBatchSink<>((BatchSink)plugin,caller);
  }
 else   if (plugin instanceof ErrorTransform) {
    return new WrappedErrorTransform<>((ErrorTransform)plugin,caller);
  }
 else   if (plugin instanceof Transform) {
    return new WrappedTransform<>((Transform)plugin,caller);
  }
 else   if (plugin instanceof BatchAggregator) {
    return new WrappedBatchAggregator<>((BatchAggregator)plugin,caller);
  }
 else   if (plugin instanceof BatchJoiner) {
    return new WrappedBatchJoiner<>((BatchJoiner)plugin,caller);
  }
 else   if (plugin instanceof PostAction) {
    return new WrappedPostAction((PostAction)plugin,caller);
  }
  return wrapUnknownPlugin(pluginId,plugin,caller);
}

Fixed version (ground truth):
private Object wrapPlugin(String pluginId,Object plugin){
  Caller caller=getCaller(pluginId);
  StageMetrics stageMetrics=new DefaultStageMetrics(metrics,pluginId);
  OperationTimer operationTimer=processTimingEnabled ? new MetricsOperationTimer(stageMetrics) : NoOpOperationTimer.INSTANCE;
  if (plugin instanceof Action) {
    return new WrappedAction((Action)plugin,caller);
  }
 else   if (plugin instanceof BatchSource) {
    return new WrappedBatchSource<>((BatchSource)plugin,caller,operationTimer);
  }
 else   if (plugin instanceof BatchSink) {
    return new WrappedBatchSink<>((BatchSink)plugin,caller,operationTimer);
  }
 else   if (plugin instanceof ErrorTransform) {
    return new WrappedErrorTransform<>((ErrorTransform)plugin,caller,operationTimer);
  }
 else   if (plugin instanceof Transform) {
    return new WrappedTransform<>((Transform)plugin,caller,operationTimer);
  }
 else   if (plugin instanceof BatchAggregator) {
    return new WrappedBatchAggregator<>((BatchAggregator)plugin,caller,operationTimer);
  }
 else   if (plugin instanceof BatchJoiner) {
    return new WrappedBatchJoiner<>((BatchJoiner)plugin,caller,operationTimer);
  }
 else   if (plugin instanceof PostAction) {
    return new WrappedPostAction((PostAction)plugin,caller);
  }
 else   if (plugin instanceof SplitterTransform) {
    return new WrappedSplitterTransform<>((SplitterTransform)plugin,caller,operationTimer);
  }
  return wrapUnknownPlugin(pluginId,plugin,caller);
}
Program: 4784
Project: 4784
Buggy source:
@Override public <T>T call(Callable<T> callable,CallArgs args) throws Exception {
  MDC.put(Constants.MDC_STAGE_KEY,stageName);
  try {
    return delegate.call(callable,args);
  }
  finally {
    MDC.remove(Constants.MDC_STAGE_KEY);
  }
}

Fixed version (ground truth):
@Override public <T>T call(Callable<T> callable) throws Exception {
  MDC.put(Constants.MDC_STAGE_KEY,stageName);
  try {
    return delegate.call(callable);
  }
  finally {
    MDC.remove(Constants.MDC_STAGE_KEY);
  }
}
Program: 4785
Project: 4785
Buggy source:
private ScanBuilder configureRangeScan(ScanBuilder scan,@Nullable byte[] startRow,@Nullable byte[] stopRow,@Nullable FuzzyRowFilter filter){
  scan.setCaching(1000);
  if (startRow != null) {
    scan.setStartRow(startRow);
  }
  if (stopRow != null) {
    scan.setStopRow(stopRow);
  }
  scan.addFamily(columnFamily);
  if (filter != null) {
    List<Pair<byte[],byte[]>> fuzzyPairs=Lists.newArrayListWithExpectedSize(filter.getFuzzyKeysData().size());
    for (    ImmutablePair<byte[],byte[]> pair : filter.getFuzzyKeysData()) {
      if (rowKeyDistributor != null) {
        fuzzyPairs.addAll(rowKeyDistributor.getDistributedFilterPairs(pair));
      }
 else {
        fuzzyPairs.add(Pair.newPair(pair.getFirst(),pair.getSecond()));
      }
    }
    scan.setFilter(new org.apache.hadoop.hbase.filter.FuzzyRowFilter(fuzzyPairs));
  }
  return scan;
}

Fixed version (ground truth):
private ScanBuilder configureRangeScan(ScanBuilder scan,@Nullable byte[] startRow,@Nullable byte[] stopRow,@Nullable FuzzyRowFilter filter){
  scan.setCaching(1000);
  if (startRow != null) {
    scan.setStartRow(startRow);
  }
  if (stopRow != null) {
    scan.setStopRow(stopRow);
  }
  scan.addFamily(columnFamily);
  if (filter != null) {
    List<Pair<byte[],byte[]>> fuzzyPairs=Lists.newArrayListWithExpectedSize(filter.getFuzzyKeysData().size());
    for (    ImmutablePair<byte[],byte[]> pair : filter.getFuzzyKeysData()) {
      if (rowKeyDistributor != null) {
        fuzzyPairs.addAll(rowKeyDistributor.getDistributedFilterPairs(pair));
      }
 else {
        fuzzyPairs.add(Pair.newPair(Arrays.copyOf(pair.getFirst(),pair.getFirst().length),Arrays.copyOf(pair.getSecond(),pair.getSecond().length)));
      }
    }
    scan.setFilter(new org.apache.hadoop.hbase.filter.FuzzyRowFilter(fuzzyPairs));
  }
  return scan;
}
Program: 4786
Project: 4786
Buggy source:
protected MetricsTable getOrCreateResolutionMetricsTable(String v3TableName,TableProperties.Builder props,int resolution){
  try {
    MetricsTable v2Table=null;
    if (cConf.getBoolean(Constants.Metrics.METRICS_V2_TABLE_SCAN_ENABLED)) {
      String v2TableName=cConf.get(Constants.Metrics.METRICS_TABLE_PREFIX,Constants.Metrics.DEFAULT_METRIC_TABLE_PREFIX + "String_Node_Str" + resolution);
      DatasetId v2TableId=NamespaceId.SYSTEM.dataset(v2TableName);
      v2Table=dsFramework.getDataset(v2TableId,null,null);
    }
    props.add(HBaseTableAdmin.PROPERTY_SPLITS,GSON.toJson(getV3MetricsTableSplits(Constants.Metrics.METRICS_HBASE_SPLITS)));
    props.add(Constants.Metrics.METRICS_HBASE_MAX_SCAN_THREADS,cConf.get(Constants.Metrics.METRICS_HBASE_MAX_SCAN_THREADS));
    DatasetId v3TableId=NamespaceId.SYSTEM.dataset(v3TableName);
    MetricsTable v3Table=DatasetsUtil.getOrCreateDataset(dsFramework,v3TableId,MetricsTable.class.getName(),props.build(),null);
    if (v2Table != null) {
      return new CombinedHBaseMetricsTable(v2Table,v3Table);
    }
    return v3Table;
  }
 catch (  Exception e) {
    throw Throwables.propagate(e);
  }
}

Fixed version (ground truth):
protected MetricsTable getOrCreateResolutionMetricsTable(String v3TableName,TableProperties.Builder props,int resolution){
  try {
    MetricsTable v2Table=null;
    if (cConf.getBoolean(Constants.Metrics.METRICS_V2_TABLE_SCAN_ENABLED)) {
      String v2TableName=cConf.get(Constants.Metrics.METRICS_TABLE_PREFIX,Constants.Metrics.DEFAULT_METRIC_TABLE_PREFIX + "String_Node_Str" + resolution);
      DatasetId v2TableId=NamespaceId.SYSTEM.dataset(v2TableName);
      v2Table=dsFramework.getDataset(v2TableId,ImmutableMap.<String,String>of(),null);
    }
    props.add(HBaseTableAdmin.PROPERTY_SPLITS,GSON.toJson(getV3MetricsTableSplits(Constants.Metrics.METRICS_HBASE_SPLITS)));
    props.add(Constants.Metrics.METRICS_HBASE_MAX_SCAN_THREADS,cConf.get(Constants.Metrics.METRICS_HBASE_MAX_SCAN_THREADS));
    DatasetId v3TableId=NamespaceId.SYSTEM.dataset(v3TableName);
    MetricsTable v3Table=DatasetsUtil.getOrCreateDataset(dsFramework,v3TableId,MetricsTable.class.getName(),props.build(),null);
    if (v2Table != null) {
      return new CombinedHBaseMetricsTable(v2Table,v3Table);
    }
    return v3Table;
  }
 catch (  Exception e) {
    throw Throwables.propagate(e);
  }
}
Program: 4791
Project: 4791
Buggy source:
@Category(XSlowTests.class) @Test public void testKillSuspendedWorkflow() throws Exception {
  HttpResponse response=deploy(SleepingWorkflowApp.class,Constants.Gateway.API_VERSION_3_TOKEN,TEST_NAMESPACE2);
  Assert.assertEquals(200,response.getStatusLine().getStatusCode());
  WorkflowId workflow=new WorkflowId(TEST_NAMESPACE2,"String_Node_Str","String_Node_Str");
  startProgram(workflow,200);
  waitState(workflow,ProgramStatus.RUNNING.name());
  String runId=getRunIdOfRunningProgram(workflow.toId());
  suspendWorkflow(workflow.toId(),runId,200);
  waitState(workflow,ProgramStatus.STOPPED.name());
  stopProgram(workflow.toId(),runId,200);
  waitState(workflow,ProgramStatus.STOPPED.name());
  verifyProgramRuns(workflow.toId(),ProgramRunStatus.KILLED.name(),0);
}

Fixed version (ground truth):
@Category(XSlowTests.class) @Test public void testKillSuspendedWorkflow() throws Exception {
  HttpResponse response=deploy(SleepingWorkflowApp.class,Constants.Gateway.API_VERSION_3_TOKEN,TEST_NAMESPACE2);
  Assert.assertEquals(200,response.getStatusLine().getStatusCode());
  WorkflowId workflow=new WorkflowId(TEST_NAMESPACE2,"String_Node_Str","String_Node_Str");
  startProgram(workflow,200);
  waitState(workflow,ProgramStatus.RUNNING.name());
  String runId=getRunIdOfRunningProgram(workflow.toId());
  suspendWorkflow(workflow.toId(),runId,200);
  waitState(workflow,ProgramStatus.STOPPED.name());
  stopProgram(workflow.toId(),runId,200);
  waitState(workflow,ProgramStatus.STOPPED.name());
  verifyProgramRuns(workflow.toId(),ProgramRunStatus.KILLED,0);
}
Program: 4796
Project: 4796
Buggy source:
private String getRunIdOfRunningProgram(final Id.Program programId) throws Exception {
  Tasks.waitFor(1,new Callable<Integer>(){
    @Override public Integer call() throws Exception {
      return getProgramRuns(programId,"String_Node_Str").size();
    }
  }
,5,TimeUnit.SECONDS);
  List<RunRecord> historyRuns=getProgramRuns(programId,"String_Node_Str");
  Assert.assertEquals(1,historyRuns.size());
  RunRecord record=historyRuns.get(0);
  return record.getPid();
}

Fixed version (ground truth):
private String getRunIdOfRunningProgram(final Id.Program programId) throws Exception {
  Tasks.waitFor(1,new Callable<Integer>(){
    @Override public Integer call() throws Exception {
      return getProgramRuns(programId,ProgramRunStatus.RUNNING).size();
    }
  }
,5,TimeUnit.SECONDS);
  List<RunRecord> historyRuns=getProgramRuns(programId,ProgramRunStatus.RUNNING);
  Assert.assertEquals(1,historyRuns.size());
  RunRecord record=historyRuns.get(0);
  return record.getPid();
}
Program: 4799
Project: 4799
Buggy source:
@Override public Integer call() throws Exception {
  return getProgramRuns(workflowId,ProgramRunStatus.COMPLETED.name()).size();
}

Fixed version (ground truth):
@Override public Integer call() throws Exception {
  return getProgramRuns(workflowId,ProgramRunStatus.COMPLETED).size();
}
Program: 4800
Project: 4800
Buggy source:
private void verifyMultipleConcurrentRuns(Id.Program workflowId) throws Exception {
  verifyProgramRuns(workflowId,ProgramRunStatus.RUNNING.name(),1);
  List<RunRecord> historyRuns=getProgramRuns(workflowId,"String_Node_Str");
  Assert.assertEquals(2,historyRuns.size());
  HttpResponse response=getWorkflowCurrentStatus(workflowId,historyRuns.get(0).getPid());
  Assert.assertEquals(200,response.getStatusLine().getStatusCode());
  String json=EntityUtils.toString(response.getEntity());
  List<WorkflowActionNode> nodes=GSON.fromJson(json,LIST_WORKFLOWACTIONNODE_TYPE);
  Assert.assertEquals(1,nodes.size());
  Assert.assertEquals(ConcurrentWorkflowApp.SimpleAction.class.getSimpleName(),nodes.get(0).getProgram().getProgramName());
  response=getWorkflowCurrentStatus(workflowId,historyRuns.get(1).getPid());
  Assert.assertEquals(200,response.getStatusLine().getStatusCode());
  json=EntityUtils.toString(response.getEntity());
  nodes=GSON.fromJson(json,LIST_WORKFLOWACTIONNODE_TYPE);
  Assert.assertEquals(1,nodes.size());
  Assert.assertEquals(ConcurrentWorkflowApp.SimpleAction.class.getSimpleName(),nodes.get(0).getProgram().getProgramName());
}

Fixed version (ground truth):
private void verifyMultipleConcurrentRuns(Id.Program workflowId) throws Exception {
  verifyProgramRuns(workflowId,ProgramRunStatus.RUNNING,1);
  List<RunRecord> historyRuns=getProgramRuns(workflowId,ProgramRunStatus.RUNNING);
  Assert.assertEquals(2,historyRuns.size());
  HttpResponse response=getWorkflowCurrentStatus(workflowId,historyRuns.get(0).getPid());
  Assert.assertEquals(200,response.getStatusLine().getStatusCode());
  String json=EntityUtils.toString(response.getEntity());
  List<WorkflowActionNode> nodes=GSON.fromJson(json,LIST_WORKFLOWACTIONNODE_TYPE);
  Assert.assertEquals(1,nodes.size());
  Assert.assertEquals(ConcurrentWorkflowApp.SimpleAction.class.getSimpleName(),nodes.get(0).getProgram().getProgramName());
  response=getWorkflowCurrentStatus(workflowId,historyRuns.get(1).getPid());
  Assert.assertEquals(200,response.getStatusLine().getStatusCode());
  json=EntityUtils.toString(response.getEntity());
  nodes=GSON.fromJson(json,LIST_WORKFLOWACTIONNODE_TYPE);
  Assert.assertEquals(1,nodes.size());
  Assert.assertEquals(ConcurrentWorkflowApp.SimpleAction.class.getSimpleName(),nodes.get(0).getProgram().getProgramName());
}
Program: 4803
Project: 4803
Buggy source:
@Override protected void configure(){
  bind(ProgramStateWriter.class).to(DirectStoreProgramStateWriter.class);
  MapBinder<ProgramType,ProgramRunner> defaultProgramRunnerBinder=MapBinder.newMapBinder(binder(),ProgramType.class,ProgramRunner.class);
  defaultProgramRunnerBinder.addBinding(ProgramType.FLOW).to(DistributedFlowProgramRunner.class);
  defaultProgramRunnerBinder.addBinding(ProgramType.MAPREDUCE).to(DistributedMapReduceProgramRunner.class);
  defaultProgramRunnerBinder.addBinding(ProgramType.WORKFLOW).to(DistributedWorkflowProgramRunner.class);
  defaultProgramRunnerBinder.addBinding(ProgramType.WEBAPP).to(DistributedWebappProgramRunner.class);
  defaultProgramRunnerBinder.addBinding(ProgramType.SERVICE).to(DistributedServiceProgramRunner.class);
  defaultProgramRunnerBinder.addBinding(ProgramType.WORKER).to(DistributedWorkerProgramRunner.class);
  bind(ProgramRuntimeProvider.Mode.class).toInstance(ProgramRuntimeProvider.Mode.DISTRIBUTED);
  bind(ProgramRunnerFactory.class).to(DefaultProgramRunnerFactory.class).in(Scopes.SINGLETON);
  expose(ProgramRunnerFactory.class);
  bind(ProgramRuntimeService.class).to(DistributedProgramRuntimeService.class).in(Scopes.SINGLETON);
  expose(ProgramRuntimeService.class);
}

Fixed version (ground truth):
@Override protected void configure(){
  bind(ProgramStateWriter.class).to(MessagingProgramStateWriter.class);
  MapBinder<ProgramType,ProgramRunner> defaultProgramRunnerBinder=MapBinder.newMapBinder(binder(),ProgramType.class,ProgramRunner.class);
  defaultProgramRunnerBinder.addBinding(ProgramType.FLOW).to(DistributedFlowProgramRunner.class);
  defaultProgramRunnerBinder.addBinding(ProgramType.MAPREDUCE).to(DistributedMapReduceProgramRunner.class);
  defaultProgramRunnerBinder.addBinding(ProgramType.WORKFLOW).to(DistributedWorkflowProgramRunner.class);
  defaultProgramRunnerBinder.addBinding(ProgramType.WEBAPP).to(DistributedWebappProgramRunner.class);
  defaultProgramRunnerBinder.addBinding(ProgramType.SERVICE).to(DistributedServiceProgramRunner.class);
  defaultProgramRunnerBinder.addBinding(ProgramType.WORKER).to(DistributedWorkerProgramRunner.class);
  bind(ProgramRuntimeProvider.Mode.class).toInstance(ProgramRuntimeProvider.Mode.DISTRIBUTED);
  bind(ProgramRunnerFactory.class).to(DefaultProgramRunnerFactory.class).in(Scopes.SINGLETON);
  expose(ProgramRunnerFactory.class);
  bind(ProgramRuntimeService.class).to(DistributedProgramRuntimeService.class).in(Scopes.SINGLETON);
  expose(ProgramRuntimeService.class);
}
Program: 4805
Project: 4805
Buggy source:
void State(ProgramRunStatus runStatus){
  this.runStatus=runStatus;
  this.programStatus=ProgramRunStatus.STARTING == runStatus || ProgramRunStatus.RUNNING == runStatus ? ProgramStatus.RUNNING : ProgramStatus.STOPPED;
}

Fixed version (ground truth):
void State(ProgramRunStatus runStatus){
  this.runStatus=runStatus;
}
Program: 4806
Project: 4806
Buggy source:
@Override public void initialize(EventHandlerContext context){
  super.initialize(context);
  this.twillRunId=context.getRunId();
  this.programRunId=GSON.fromJson(context.getSpecification().getConfigs().get("String_Node_Str"),ProgramRunId.class);
  File cConfFile=new File("String_Node_Str" + CDAP_CONF_FILE_NAME);
  File hConfFile=new File("String_Node_Str" + HADOOP_CONF_FILE_NAME);
  if (cConfFile.exists() && hConfFile.exists()) {
    CConfiguration cConf=CConfiguration.create();
    cConf.clear();
    Configuration hConf=new Configuration();
    hConf.clear();
    try {
      cConf.addResource(cConfFile.toURI().toURL());
      hConf.addResource(hConfFile.toURI().toURL());
      Injector injector=Guice.createInjector(new ConfigModule(cConf,hConf),new ZKClientModule(),new KafkaClientModule(),new DiscoveryRuntimeModule().getDistributedModules(),new AbstractModule(){
        @Override protected void configure(){
          bind(RuntimeStore.class).to(RemoteRuntimeStore.class);
          bind(ProgramStateWriter.class).to(DirectStoreProgramStateWriter.class);
        }
      }
);
      zkClientService=injector.getInstance(ZKClientService.class);
      startServices();
      this.programStateWriter=injector.getInstance(ProgramStateWriter.class);
    }
 catch (    Exception e) {
      throw Throwables.propagate(e);
    }
  }
 else {
    LOG.warn("String_Node_Str",CDAP_CONF_FILE_NAME,HADOOP_CONF_FILE_NAME);
    this.programStateWriter=new NoOpProgramStateWriter();
  }
}

Fixed version (ground truth):
@Override public void initialize(EventHandlerContext context){
  super.initialize(context);
  this.twillRunId=context.getRunId();
  this.programRunId=GSON.fromJson(context.getSpecification().getConfigs().get("String_Node_Str"),ProgramRunId.class);
  File cConfFile=new File("String_Node_Str" + CDAP_CONF_FILE_NAME);
  File hConfFile=new File("String_Node_Str" + HADOOP_CONF_FILE_NAME);
  if (cConfFile.exists() && hConfFile.exists()) {
    CConfiguration cConf=CConfiguration.create();
    cConf.clear();
    Configuration hConf=new Configuration();
    hConf.clear();
    try {
      cConf.addResource(cConfFile.toURI().toURL());
      hConf.addResource(hConfFile.toURI().toURL());
      Injector injector=Guice.createInjector(new ConfigModule(cConf,hConf),new ZKClientModule(),new KafkaClientModule(),new DiscoveryRuntimeModule().getDistributedModules(),new MessagingClientModule(),new AbstractModule(){
        @Override protected void configure(){
          bind(ProgramStateWriter.class).to(MessagingProgramStateWriter.class);
        }
      }
);
      zkClientService=injector.getInstance(ZKClientService.class);
      startServices();
      this.programStateWriter=injector.getInstance(ProgramStateWriter.class);
    }
 catch (    Exception e) {
      throw Throwables.propagate(e);
    }
  }
 else {
    LOG.warn("String_Node_Str",CDAP_CONF_FILE_NAME,HADOOP_CONF_FILE_NAME);
    this.programStateWriter=new NoOpProgramStateWriter();
  }
}
Program: 4807
Project: 4807
Buggy source:
@Override protected void configure(){
  bind(RuntimeStore.class).to(RemoteRuntimeStore.class);
  bind(ProgramStateWriter.class).to(DirectStoreProgramStateWriter.class);
}

Fixed version (ground truth):
@Override protected void configure(){
  bind(ProgramStateWriter.class).to(MessagingProgramStateWriter.class);
}
Program: 4809
Project: 4809
Buggy source:
@Override public void store(StageSpec stageSpec,SparkSink<T> sink) throws Exception {
  Compat.foreachRDD(stream,new StreamingSparkSinkFunction<T>(sec,stageSpec));
}

Fixed version (ground truth):
@Override public void store(StageSpec stageSpec,SparkSink<T> sink) throws Exception {
  Compat.foreachRDD(stream.cache(),new StreamingSparkSinkFunction<T>(sec,stageSpec));
}
Program: 4812
Project: 4812
Buggy source:
private void flattenFrom(String node){
  Set<String> outputs=outgoingConnections.get(node);
  if (outputs.isEmpty()) {
    return;
  }
  if (outputs.size() == 1) {
    flattenFrom(outputs.iterator().next());
    return;
  }
  Multimap<String,String> branchEndpointOutputs=HashMultimap.create();
  Set<String> branchEndpoints=new HashSet<>();
  for (  String output : outputs) {
    String branchEndpoint=findBranchEnd(output);
    branchEndpoints.add(branchEndpoint);
    branchEndpointOutputs.putAll(branchEndpoint,outgoingConnections.get(branchEndpoint));
  }
  Set<String> endpointOutputs=new HashSet<>(branchEndpointOutputs.values());
  if (endpointOutputs.size() == 1) {
    flattenFrom(endpointOutputs.iterator().next());
    return;
  }
  String newJoinNode=generateJoinNodeName(branchEndpoints);
  addNode(newJoinNode,branchEndpoints,endpointOutputs);
  for (  Map.Entry<String,String> endpointEntry : branchEndpointOutputs.entries()) {
    removeConnection(endpointEntry.getKey(),endpointEntry.getValue());
  }
  trim();
  flattenFrom(newJoinNode);
}

Fixed version (ground truth):
private void flattenFrom(String node){
  Set<String> outputs=outgoingConnections.get(node);
  if (outputs.isEmpty()) {
    return;
  }
  if (outputs.size() == 1) {
    flattenFrom(outputs.iterator().next());
    return;
  }
  Map<String,Set<String>> branchEndpointOutputs=new HashMap<>();
  Set<String> branchEndpoints=new HashSet<>();
  for (  String output : outputs) {
    String branchEndpoint=findBranchEnd(output);
    branchEndpoints.add(branchEndpoint);
    branchEndpointOutputs.put(branchEndpoint,new HashSet<>(outgoingConnections.get(branchEndpoint)));
  }
  Set<String> endpointOutputs=new HashSet<>();
  boolean endpointsContainSink=false;
  for (  Set<String> branchEndpointOutput : branchEndpointOutputs.values()) {
    endpointOutputs.addAll(branchEndpointOutput);
    if (branchEndpointOutput.isEmpty()) {
      endpointsContainSink=true;
    }
  }
  if (endpointOutputs.size() == 1 && !endpointsContainSink) {
    flattenFrom(endpointOutputs.iterator().next());
    return;
  }
  String newJoinNode=generateJoinNodeName(branchEndpoints);
  addNode(newJoinNode,branchEndpoints,endpointOutputs);
  for (  Map.Entry<String,Set<String>> endpointEntry : branchEndpointOutputs.entrySet()) {
    String branchEndpoint=endpointEntry.getKey();
    for (    String branchEndpointOutput : endpointEntry.getValue()) {
      removeConnection(branchEndpoint,branchEndpointOutput);
    }
  }
  trim();
  flattenFrom(newJoinNode);
}
Program: 4813
Project: 4813
Buggy source:
@Test public void testNoOpTrim(){
  ControlDag cdag=new ControlDag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str")));
  Assert.assertEquals(0,cdag.trim());
  cdag=new ControlDag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str")));
  Assert.assertEquals(0,cdag.trim());
  cdag=new ControlDag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str")));
  Assert.assertEquals(0,cdag.trim());
}

Fixed version (ground truth):
@Test public void testNoOpTrim(){
  ControlDag cdag=new ControlDag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str")));
  Assert.assertEquals(0,cdag.trim());
  cdag=new ControlDag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str")));
  Assert.assertEquals(0,cdag.trim());
  cdag=new ControlDag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str")));
  Assert.assertEquals(0,cdag.trim());
  cdag=new ControlDag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str")));
  Assert.assertEquals(0,cdag.trim());
}
Program: 4817
Project: 4817
Buggy source:
@Override public List<?> makeRow(RunRecord object){
  return Lists.newArrayList(object.getPid(),object.getStatus(),object.getRunTs(),object.getStatus().name().equals("String_Node_Str") ? "String_Node_Str" : object.getStopTs());
}

Fixed version (ground truth):
@Override public List<?> makeRow(RunRecord object){
  return Lists.newArrayList(object.getPid(),object.getStatus(),object.getStartTs(),object.getRunTs() == null ? "String_Node_Str" : object.getRunTs(),object.getStopTs() == null ? "String_Node_Str" : object.getStopTs());
}
Program: 4818
Project: 4818
Buggy source:
private void flattenFrom(String node){
  Set<String> outputs=outgoingConnections.get(node);
  if (outputs.isEmpty()) {
    return;
  }
  if (outputs.size() == 1) {
    flattenFrom(outputs.iterator().next());
    return;
  }
  Multimap<String,String> branchEndpointOutputs=HashMultimap.create();
  Set<String> branchEndpoints=new HashSet<>();
  for (  String output : outputs) {
    String branchEndpoint=findBranchEnd(output);
    branchEndpoints.add(branchEndpoint);
    branchEndpointOutputs.putAll(branchEndpoint,outgoingConnections.get(branchEndpoint));
  }
  Set<String> endpointOutputs=new HashSet<>(branchEndpointOutputs.values());
  if (endpointOutputs.size() == 1) {
    flattenFrom(endpointOutputs.iterator().next());
    return;
  }
  String newJoinNode=generateJoinNodeName(branchEndpoints);
  addNode(newJoinNode,branchEndpoints,endpointOutputs);
  for (  Map.Entry<String,String> endpointEntry : branchEndpointOutputs.entries()) {
    removeConnection(endpointEntry.getKey(),endpointEntry.getValue());
  }
  trim();
  flattenFrom(newJoinNode);
}

Fixed version (ground truth):
private void flattenFrom(String node){
  Set<String> outputs=outgoingConnections.get(node);
  if (outputs.isEmpty()) {
    return;
  }
  if (outputs.size() == 1) {
    flattenFrom(outputs.iterator().next());
    return;
  }
  Map<String,Set<String>> branchEndpointOutputs=new HashMap<>();
  Set<String> branchEndpoints=new HashSet<>();
  for (  String output : outputs) {
    String branchEndpoint=findBranchEnd(output);
    branchEndpoints.add(branchEndpoint);
    branchEndpointOutputs.put(branchEndpoint,new HashSet<>(outgoingConnections.get(branchEndpoint)));
  }
  Set<String> endpointOutputs=new HashSet<>();
  boolean endpointsContainSink=false;
  for (  Set<String> branchEndpointOutput : branchEndpointOutputs.values()) {
    endpointOutputs.addAll(branchEndpointOutput);
    if (branchEndpointOutput.isEmpty()) {
      endpointsContainSink=true;
    }
  }
  if (endpointOutputs.size() == 1 && !endpointsContainSink) {
    flattenFrom(endpointOutputs.iterator().next());
    return;
  }
  String newJoinNode=generateJoinNodeName(branchEndpoints);
  addNode(newJoinNode,branchEndpoints,endpointOutputs);
  for (  Map.Entry<String,Set<String>> endpointEntry : branchEndpointOutputs.entrySet()) {
    String branchEndpoint=endpointEntry.getKey();
    for (    String branchEndpointOutput : endpointEntry.getValue()) {
      removeConnection(branchEndpoint,branchEndpointOutput);
    }
  }
  trim();
  flattenFrom(newJoinNode);
}
Program: 4819
Project: 4819
Buggy source:
@Test public void testNoOpTrim(){
  ControlDag cdag=new ControlDag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str")));
  Assert.assertEquals(0,cdag.trim());
  cdag=new ControlDag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str")));
  Assert.assertEquals(0,cdag.trim());
  cdag=new ControlDag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str")));
  Assert.assertEquals(0,cdag.trim());
}

Fixed version (ground truth):
@Test public void testNoOpTrim(){
  ControlDag cdag=new ControlDag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str")));
  Assert.assertEquals(0,cdag.trim());
  cdag=new ControlDag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str")));
  Assert.assertEquals(0,cdag.trim());
  cdag=new ControlDag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str")));
  Assert.assertEquals(0,cdag.trim());
  cdag=new ControlDag(ImmutableSet.of(new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str"),new Connection("String_Node_Str","String_Node_Str")));
  Assert.assertEquals(0,cdag.trim());
}
Program: 4821
Project: 4821
Buggy source:
public DataSetException(String message,Throwable cause){
  super(message,cause);
}

Fixed version (ground truth):
public DataSetException(Throwable cause){
  super(cause);
}
Program: 4822
Project: 4822
Buggy source:
/** 
 * Return a partition output for a specific partition key, in preparation for creating a new partition. Obtain the location to write from the PartitionOutput, then call the   {@link PartitionOutput#addPartition}to add the partition to this dataset.
 * @throws IllegalArgumentException if the partition key does not match the partitioning of the dataset
 */
PartitionOutput getPartitionOutput(PartitionKey key);

Fixed version (ground truth):
/** 
 * Return a partition output for a specific partition key, in preparation for creating a new partition. Obtain the location to write from the PartitionOutput, then call the   {@link PartitionOutput#addPartition}to add the partition to this dataset.
 * @throws PartitionAlreadyExistsException if the partition already exists
 * @throws IllegalArgumentException if the partition key does not match the partitioning of the dataset
 */
PartitionOutput getPartitionOutput(PartitionKey key);
Program: 4823
Project: 4823
Buggy source:
/** 
 * Add a partition for a given partition key, stored at a given path (relative to the file set's base path), with the given metadata.
 * @throws DataSetException if a partition for the same key already exists
 * @throws IllegalArgumentException if the partition key does not match the partitioning of the dataset
 */
void addPartition(PartitionKey key,String path,Map<String,String> metadata);

Fixed version (ground truth):
/** 
 * Add a partition for a given partition key, stored at a given path (relative to the file set's base path), with the given metadata.
 * @throws PartitionAlreadyExistsException if a partition for the same key already exists
 * @throws IllegalArgumentException if the partition key does not match the partitioning of the dataset
 */
void addPartition(PartitionKey key,String path,Map<String,String> metadata);
Program: 4824
Project: 4824
Buggy source:
/** 
 * Return a partition output for a specific time, rounded to the minute, in preparation for creating a new partition. Obtain the location to write from the PartitionOutput, then call the   {@link PartitionOutput#addPartition}to add the partition to this dataset.
 * @param time the partition time in milliseconds since the Epoch
 */
TimePartitionOutput getPartitionOutput(long time);

Fixed version (ground truth):
/** 
 * Return a partition output for a specific time, rounded to the minute, in preparation for creating a new partition. Obtain the location to write from the PartitionOutput, then call the   {@link PartitionOutput#addPartition}to add the partition to this dataset.
 * @param time the partition time in milliseconds since the Epoch
 * @throws PartitionAlreadyExistsException if the partition for the given time already exists
 */
TimePartitionOutput getPartitionOutput(long time);
Program: 4825
Project: 4825
Buggy source:
/** 
 * Add a partition for a given time, stored at a given path (relative to the file set's base path), with given metadata.
 * @param time the partition time in milliseconds since the Epoch
 */
void addPartition(long time,String path,Map<String,String> metadata);

Fixed version (ground truth):
/** 
 * Add a partition for a given time, stored at a given path (relative to the file set's base path), with given metadata.
 * @param time the partition time in milliseconds since the Epoch
 * @throws PartitionAlreadyExistsException if the partition for the given time already exists
 */
void addPartition(long time,String path,Map<String,String> metadata);
Program: 4826
Project: 4826
Buggy source:
/** 
 * Adds a set of new metadata entries for a particular partition Note that existing entries can not be updated.
 * @param time the partition time in milliseconds since the Epoch
 * @throws DataSetException in case an attempt is made to update existing entries.
 */
void addMetadata(long time,Map<String,String> metadata);

Fixed version (ground truth):
/** 
 * Adds a set of new metadata entries for a particular partition Note that existing entries can not be updated.
 * @param time the partition time in milliseconds since the Epoch
 * @throws DataSetException in case an attempt is made to update existing entries.
 * @throws PartitionNotFoundException when a partition for the given time is not found
 */
void addMetadata(long time,Map<String,String> metadata);
Program: 4827
Project: 4827
Buggy source:
@ReadOnly @Override public PartitionOutput getPartitionOutput(PartitionKey key){
  if (isExternal) {
    throw new UnsupportedOperationException("String_Node_Str" + spec.getName() + "String_Node_Str");
  }
  return new BasicPartitionOutput(this,getOutputPath(key),key);
}

Fixed version (ground truth):
@ReadOnly @Override public PartitionOutput getPartitionOutput(PartitionKey key){
  if (isExternal) {
    throw new UnsupportedOperationException("String_Node_Str" + spec.getName() + "String_Node_Str");
  }
  assertNotExists(key,true);
  return new BasicPartitionOutput(this,getOutputPath(key),key);
}