nus-yam/ex-repair huggingface dataset:
Program: 6757
Project: 6757
Buggy source:
@Override public ProgramController run(Program program,ProgramOptions options){
  ApplicationSpecification appSpec=program.getApplicationSpecification();
  Preconditions.checkNotNull(appSpec,"String_Node_Str");
  ProgramType processorType=program.getType();
  Preconditions.checkNotNull(processorType,"String_Node_Str");
  Preconditions.checkArgument(processorType == ProgramType.WORKFLOW,"String_Node_Str");
  WorkflowSpecification workflowSpec=appSpec.getWorkflows().get(program.getName());
  Preconditions.checkNotNull(workflowSpec,"String_Node_Str",program.getName());
  WorkflowDriver driver=new WorkflowDriver(program,options,hostname,workflowSpec,programRunnerFactory,metricsCollectionService,datasetFramework,discoveryServiceClient,txClient,store);
  RunId runId=RunIds.fromString(options.getArguments().getOption(ProgramOptionConstants.RUN_ID));
  ProgramController controller=new WorkflowProgramController(program,driver,serviceAnnouncer,runId);
  driver.start();
  return controller;
}

Fixed version (ground truth):
@Override public ProgramController run(Program program,ProgramOptions options){
  ApplicationSpecification appSpec=program.getApplicationSpecification();
  Preconditions.checkNotNull(appSpec,"String_Node_Str");
  ProgramType processorType=program.getType();
  Preconditions.checkNotNull(processorType,"String_Node_Str");
  Preconditions.checkArgument(processorType == ProgramType.WORKFLOW,"String_Node_Str");
  WorkflowSpecification workflowSpec=appSpec.getWorkflows().get(program.getName());
  Preconditions.checkNotNull(workflowSpec,"String_Node_Str",program.getName());
  WorkflowDriver driver=new WorkflowDriver(program,options,hostname,workflowSpec,programRunnerFactory,metricsCollectionService,datasetFramework,discoveryServiceClient,txClient,store,cConf);
  RunId runId=RunIds.fromString(options.getArguments().getOption(ProgramOptionConstants.RUN_ID));
  ProgramController controller=new WorkflowProgramController(program,driver,serviceAnnouncer,runId);
  driver.start();
  return controller;
}
Program: 6758
Project: 6758
Buggy source:
public WorkflowToken getWorkflowToken(Id.Workflow workflowId,String workflowRunId) throws NotFoundException {
  RunRecordMeta runRecordMeta=getRun(workflowId,workflowRunId);
  if (runRecordMeta == null) {
    throw new NotFoundException(new Id.Run(workflowId,workflowRunId));
  }
  String workflowToken=runRecordMeta.getProperties().get(WORKFLOW_TOKEN_PROPERTY_KEY);
  if (workflowToken == null) {
    LOG.debug("String_Node_Str",workflowId,workflowRunId);
    return new BasicWorkflowToken();
  }
  return GSON.fromJson(workflowToken,BasicWorkflowToken.class);
}

Fixed version (ground truth):
public WorkflowToken getWorkflowToken(Id.Workflow workflowId,String workflowRunId) throws NotFoundException {
  RunRecordMeta runRecordMeta=getRun(workflowId,workflowRunId);
  if (runRecordMeta == null) {
    throw new NotFoundException(new Id.Run(workflowId,workflowRunId));
  }
  String workflowToken=runRecordMeta.getProperties().get(WORKFLOW_TOKEN_PROPERTY_KEY);
  if (workflowToken == null) {
    LOG.debug("String_Node_Str",workflowId,workflowRunId);
    return new BasicWorkflowToken(0);
  }
  return GSON.fromJson(workflowToken,BasicWorkflowToken.class);
}
Program: 6759
Project: 6759
Buggy source:
/** 
 * Shuts down a cleanup thread com.mysql.jdbc.AbandonedConnectionCleanupThread that mysql driver fails to destroy If this is not done, the thread keeps a reference to the classloader, thereby causing OOMs or too many open files
 * @param classLoader the unfiltered classloader of the jdbc driver class
 */
private static void shutDownMySQLAbandonedConnectionCleanupThread(ClassLoader classLoader){
  if (classLoader == null) {
    return;
  }
  try {
    Class<?> mysqlCleanupThreadClass=classLoader.loadClass("String_Node_Str");
    Method shutdownMethod=mysqlCleanupThreadClass.getMethod("String_Node_Str");
    shutdownMethod.invoke(null);
    LOG.info("String_Node_Str");
  }
 catch (  Throwable e) {
    LOG.warn("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Shuts down a cleanup thread com.mysql.jdbc.AbandonedConnectionCleanupThread that mysql driver fails to destroy If this is not done, the thread keeps a reference to the classloader, thereby causing OOMs or too many open files
 * @param classLoader the unfiltered classloader of the jdbc driver class
 */
private static void shutDownMySQLAbandonedConnectionCleanupThread(ClassLoader classLoader){
  if (classLoader == null) {
    return;
  }
  try {
    Class<?> mysqlCleanupThreadClass;
    try {
      mysqlCleanupThreadClass=classLoader.loadClass("String_Node_Str");
    }
 catch (    ClassNotFoundException e) {
      LOG.trace("String_Node_Str" + "String_Node_Str",e);
      return;
    }
    Method shutdownMethod=mysqlCleanupThreadClass.getMethod("String_Node_Str");
    shutdownMethod.invoke(null);
    LOG.debug("String_Node_Str");
  }
 catch (  Throwable e) {
    LOG.warn("String_Node_Str",e);
  }
}
Program: 6760
Project: 6760
Buggy source:
public static File hijackConfFile(File confFile){
  if (HIVE_SITE_FILE_PATTERN.matcher(confFile.getAbsolutePath()).matches()) {
    return hijackHiveConfFile(confFile);
  }
 else   if (YARN_SITE_FILE_PATTERN.matcher(confFile.getAbsolutePath()).matches()) {
    return hijackYarnConfFile(confFile);
  }
 else {
    return confFile;
  }
}

Fixed version (ground truth):
public static File hijackConfFile(File confFile){
  if (HIVE_SITE_FILE_PATTERN.matcher(confFile.getAbsolutePath()).matches()) {
    return hijackHiveConfFile(confFile);
  }
 else   if (YARN_SITE_FILE_PATTERN.matcher(confFile.getAbsolutePath()).matches()) {
    return hijackYarnConfFile(confFile);
  }
 else   if (MAPRED_SITE_FILE_PATTERN.matcher(confFile.getAbsolutePath()).matches()) {
    return hijackMapredConfFile(confFile);
  }
 else {
    return confFile;
  }
}
Program: 6761
Project: 6761
Buggy source:
/** 
 * Check that the file is a hive-site.xml file, and return a temp copy of it to which are added necessary options. If it is not a hive-site.xml file, return it as is.
 */
private static File hijackHiveConfFile(File confFile){
  Configuration conf=new Configuration(false);
  try {
    conf.addResource(confFile.toURI().toURL());
  }
 catch (  MalformedURLException e) {
    LOG.error("String_Node_Str",confFile,e);
    throw Throwables.propagate(e);
  }
  conf.setBoolean(Job.MAPREDUCE_JOB_USER_CLASSPATH_FIRST,false);
  conf.setBoolean(MRJobConfig.MAPREDUCE_JOB_CLASSLOADER,false);
  File newHiveConfFile=new File(Files.createTempDir(),"String_Node_Str");
  try (FileOutputStream os=new FileOutputStream(newHiveConfFile)){
    conf.writeXml(os);
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",newHiveConfFile,e);
    throw Throwables.propagate(e);
  }
  return newHiveConfFile;
}

Fixed version (ground truth):
/** 
 * Change hive-site.xml file, and return a temp copy of it to which are added necessary options.
 */
private static File hijackHiveConfFile(File confFile){
  Configuration conf=new Configuration(false);
  try {
    conf.addResource(confFile.toURI().toURL());
  }
 catch (  MalformedURLException e) {
    LOG.error("String_Node_Str",confFile,e);
    throw Throwables.propagate(e);
  }
  conf.setBoolean(Job.MAPREDUCE_JOB_USER_CLASSPATH_FIRST,false);
  conf.setBoolean(MRJobConfig.MAPREDUCE_JOB_CLASSLOADER,false);
  File newHiveConfFile=new File(Files.createTempDir(),"String_Node_Str");
  try (FileOutputStream os=new FileOutputStream(newHiveConfFile)){
    conf.writeXml(os);
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",newHiveConfFile,e);
    throw Throwables.propagate(e);
  }
  return newHiveConfFile;
}
Program: 6762
Project: 6762
Buggy source:
/** 
 * Check that the file is a yarn-site.xml file, and return a temp copy of it to which are added necessary options. If it is not a yarn-site.xml file, return it as is.
 */
private static File hijackYarnConfFile(File confFile){
  Configuration conf=new Configuration(false);
  try {
    conf.addResource(confFile.toURI().toURL());
  }
 catch (  MalformedURLException e) {
    LOG.error("String_Node_Str",confFile,e);
    throw Throwables.propagate(e);
  }
  String yarnAppClassPath=conf.get(YarnConfiguration.YARN_APPLICATION_CLASSPATH,Joiner.on("String_Node_Str").join(YarnConfiguration.DEFAULT_YARN_APPLICATION_CLASSPATH));
  yarnAppClassPath="String_Node_Str" + yarnAppClassPath;
  conf.set(YarnConfiguration.YARN_APPLICATION_CLASSPATH,yarnAppClassPath);
  File newYarnConfFile=new File(Files.createTempDir(),"String_Node_Str");
  try (FileOutputStream os=new FileOutputStream(newYarnConfFile)){
    conf.writeXml(os);
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",newYarnConfFile,e);
    throw Throwables.propagate(e);
  }
  return newYarnConfFile;
}

Fixed version (ground truth):
/** 
 * Change yarn-site.xml file, and return a temp copy of it to which are added necessary options.
 */
private static File hijackYarnConfFile(File confFile){
  Configuration conf=new Configuration(false);
  try {
    conf.addResource(confFile.toURI().toURL());
  }
 catch (  MalformedURLException e) {
    LOG.error("String_Node_Str",confFile,e);
    throw Throwables.propagate(e);
  }
  String yarnAppClassPath=conf.get(YarnConfiguration.YARN_APPLICATION_CLASSPATH,Joiner.on("String_Node_Str").join(YarnConfiguration.DEFAULT_YARN_APPLICATION_CLASSPATH));
  yarnAppClassPath="String_Node_Str" + yarnAppClassPath;
  conf.set(YarnConfiguration.YARN_APPLICATION_CLASSPATH,yarnAppClassPath);
  File newYarnConfFile=new File(Files.createTempDir(),"String_Node_Str");
  try (FileOutputStream os=new FileOutputStream(newYarnConfFile)){
    conf.writeXml(os);
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",newYarnConfFile,e);
    throw Throwables.propagate(e);
  }
  return newYarnConfFile;
}
Program: 6764
Project: 6764
Buggy source:
@Override public void onChange(ServiceDiscovered serviceDiscovered){
  ResourceRequirement requirement=requirements.get(serviceDiscovered.getName());
  if (requirement != null) {
    performAssignment(requirement,ImmutableSortedSet.copyOf(DiscoverableComparator.COMPARATOR,serviceDiscovered));
  }
}

Fixed version (ground truth):
@Override public void onChange(ServiceDiscovered serviceDiscovered){
  ResourceRequirement requirement=requirements.get(serviceDiscovered.getName());
  if (requirement != null) {
    performAssignment(requirement,serviceDiscovered);
  }
}
Program: 6766
Project: 6766
Buggy source:
/** 
 * Save a   {@link ResourceAssignment} to local cache as well as ZK ZK.
 * @param assignment The assignment to be persisted.
 */
private void saveAssignment(ResourceAssignment assignment){
  assignments.put(assignment.getName(),assignment);
  try {
    final byte[] data=CoordinationConstants.RESOURCE_ASSIGNMENT_CODEC.encode(assignment);
    String zkPath=CoordinationConstants.ASSIGNMENTS_PATH + "String_Node_Str" + assignment.getName();
    Futures.addCallback(ZKExtOperations.setOrCreate(zkClient,zkPath,data,assignment,CoordinationConstants.MAX_ZK_FAILURE_RETRY),new FutureCallback<ResourceAssignment>(){
      @Override public void onSuccess(      ResourceAssignment result){
        LOG.debug("String_Node_Str",result.getName(),Bytes.toString(data));
      }
      @Override public void onFailure(      Throwable t){
        LOG.error("String_Node_Str",Bytes.toStringBinary(data),t);
        doNotifyFailed(t);
      }
    }
,executor);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",assignment.getName(),e);
  }
}

Fixed version (ground truth):
/** 
 * Save a   {@link ResourceAssignment} to local cache as well as ZK ZK.
 * @param assignment The assignment to be persisted.
 */
private void saveAssignment(ResourceAssignment assignment){
  assignments.put(assignment.getName(),assignment);
  try {
    final byte[] data=CoordinationConstants.RESOURCE_ASSIGNMENT_CODEC.encode(assignment);
    String zkPath=CoordinationConstants.ASSIGNMENTS_PATH + "String_Node_Str" + assignment.getName();
    Futures.addCallback(ZKExtOperations.setOrCreate(zkClient,zkPath,data,assignment,CoordinationConstants.MAX_ZK_FAILURE_RETRY),new FutureCallback<ResourceAssignment>(){
      @Override public void onSuccess(      ResourceAssignment result){
        LOG.info("String_Node_Str",result.getName(),Bytes.toString(data));
      }
      @Override public void onFailure(      Throwable t){
        LOG.error("String_Node_Str",Bytes.toStringBinary(data),t);
        doNotifyFailed(t);
      }
    }
,executor);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",assignment.getName(),e);
  }
}
Program: 6769
Project: 6769
Buggy source:
/** 
 * Send request to restart all instances for a CDAP system service.
 */
@Path("String_Node_Str") @PUT public void restartAllServiceInstances(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String serviceName){
  super.restartAllServiceInstances(request,responder,serviceName);
}

Fixed version (ground truth):
/** 
 * Send request to restart all instances for a CDAP system service.
 */
@Path("String_Node_Str") @POST public void restartAllServiceInstances(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String serviceName){
  super.restartAllServiceInstances(request,responder,serviceName);
}
Program: 6770
Project: 6770
Buggy source:
/** 
 * Send request to restart single instance identified by <instance-id>
 */
@Path("String_Node_Str") @PUT public void restartServiceInstance(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String serviceName,@PathParam("String_Node_Str") int instanceId){
  super.restartServiceInstance(request,responder,serviceName,instanceId);
}

Fixed version (ground truth):
/** 
 * Send request to restart single instance identified by <instance-id>
 */
@Path("String_Node_Str") @POST public void restartServiceInstance(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String serviceName,@PathParam("String_Node_Str") int instanceId){
  super.restartServiceInstance(request,responder,serviceName,instanceId);
}
Program: 6771
Project: 6771
Buggy source:
@Test public void testInvalidIdRestartInstances() throws Exception {
  String path=String.format("String_Node_Str",Constants.Gateway.API_VERSION_3,Constants.Service.APP_FABRIC_HTTP);
  HttpResponse response=doPut(path);
  Assert.assertEquals(HttpResponseStatus.BAD_REQUEST.getCode(),response.getStatusLine().getStatusCode());
  path=String.format("String_Node_Str",Constants.Gateway.API_VERSION_3,Constants.Service.APP_FABRIC_HTTP);
  response=doGet(path);
  Assert.assertEquals(HttpResponseStatus.OK.getCode(),response.getStatusLine().getStatusCode());
  RestartServiceInstancesStatus result=GSON.fromJson(new String(ByteStreams.toByteArray(response.getEntity().getContent()),Charsets.UTF_8),RestartServiceInstancesStatus.class);
  Assert.assertNotNull(result);
  Assert.assertEquals(Constants.Service.APP_FABRIC_HTTP,result.getServiceName());
  Assert.assertEquals(RestartServiceInstancesStatus.RestartStatus.FAILURE,result.getStatus());
}

Fixed version (ground truth):
@Test public void testInvalidIdRestartInstances() throws Exception {
  String path=String.format("String_Node_Str",Constants.Gateway.API_VERSION_3,Constants.Service.APP_FABRIC_HTTP);
  HttpResponse response=doPost(path);
  Assert.assertEquals(HttpResponseStatus.BAD_REQUEST.getCode(),response.getStatusLine().getStatusCode());
  path=String.format("String_Node_Str",Constants.Gateway.API_VERSION_3,Constants.Service.APP_FABRIC_HTTP);
  response=doGet(path);
  Assert.assertEquals(HttpResponseStatus.OK.getCode(),response.getStatusLine().getStatusCode());
  RestartServiceInstancesStatus result=GSON.fromJson(new String(ByteStreams.toByteArray(response.getEntity().getContent()),Charsets.UTF_8),RestartServiceInstancesStatus.class);
  Assert.assertNotNull(result);
  Assert.assertEquals(Constants.Service.APP_FABRIC_HTTP,result.getServiceName());
  Assert.assertEquals(RestartServiceInstancesStatus.RestartStatus.FAILURE,result.getStatus());
}
Program: 6772
Project: 6772
Buggy source:
@Test public void testRestartInstances() throws Exception {
  String path=String.format("String_Node_Str",Constants.Service.APP_FABRIC_HTTP);
  HttpURLConnection urlConn=openURL(path,HttpMethod.PUT);
  Assert.assertEquals(HttpResponseStatus.OK.getCode(),urlConn.getResponseCode());
  urlConn.disconnect();
  urlConn=openURL(path,HttpMethod.GET);
  Assert.assertEquals(HttpResponseStatus.OK.getCode(),urlConn.getResponseCode());
  RestartServiceInstancesStatus result=GSON.fromJson(new String(ByteStreams.toByteArray(urlConn.getInputStream()),Charsets.UTF_8),RestartServiceInstancesStatus.class);
  urlConn.disconnect();
  Assert.assertNotNull(result);
  Assert.assertEquals(Constants.Service.APP_FABRIC_HTTP,result.getServiceName());
  Assert.assertEquals(RestartServiceInstancesStatus.RestartStatus.SUCCESS,result.getStatus());
}

Fixed version (ground truth):
@Test public void testRestartInstances() throws Exception {
  String path=String.format("String_Node_Str",Constants.Gateway.API_VERSION_3,Constants.Service.APP_FABRIC_HTTP);
  HttpResponse response=doPost(path);
  Assert.assertEquals(HttpResponseStatus.OK.getCode(),response.getStatusLine().getStatusCode());
  path=String.format("String_Node_Str",Constants.Gateway.API_VERSION_3,Constants.Service.APP_FABRIC_HTTP);
  response=doGet(path);
  Assert.assertEquals(HttpResponseStatus.OK.getCode(),response.getStatusLine().getStatusCode());
  RestartServiceInstancesStatus result=GSON.fromJson(new String(ByteStreams.toByteArray(response.getEntity().getContent()),Charsets.UTF_8),RestartServiceInstancesStatus.class);
  Assert.assertNotNull(result);
  Assert.assertEquals(Constants.Service.APP_FABRIC_HTTP,result.getServiceName());
  Assert.assertEquals(RestartServiceInstancesStatus.RestartStatus.SUCCESS,result.getStatus());
}
Program: 6773
Project: 6773
Buggy source:
private Collection<DatasetSpecificationSummary> spec2Summary(Collection<DatasetSpecification> specs){
  List<DatasetSpecificationSummary> datasetSummaries=Lists.newArrayList();
  for (  DatasetSpecification spec : specs) {
    datasetSummaries.add(new DatasetSpecificationSummary(spec.getName(),spec.getType(),spec.getProperties()));
  }
  return datasetSummaries;
}

Fixed version (ground truth):
private Collection<DatasetSpecificationSummary> spec2Summary(Collection<DatasetSpecification> specs){
  List<DatasetSpecificationSummary> datasetSummaries=Lists.newArrayList();
  for (  DatasetSpecification spec : specs) {
    if (QueueConstants.STATE_STORE_NAME.equals(spec.getName())) {
      continue;
    }
    datasetSummaries.add(new DatasetSpecificationSummary(spec.getName(),spec.getType(),spec.getProperties()));
  }
  return datasetSummaries;
}
Program: 6774
Project: 6774
Buggy source:
public static TableId getConfigTableId(String namespace){
  return TableId.from(namespace,HBaseQueueDatasetModule.STATE_STORE_NAME + "String_Node_Str" + HBaseQueueDatasetModule.STATE_STORE_EMBEDDED_TABLE_NAME);
}

Fixed version (ground truth):
public static TableId getConfigTableId(String namespace){
  return TableId.from(namespace,QueueConstants.STATE_STORE_NAME + "String_Node_Str" + HBaseQueueDatasetModule.STATE_STORE_EMBEDDED_TABLE_NAME);
}
Program: 6775
Project: 6775
Buggy source:
private Id.DatasetInstance getStateStoreId(String namespaceId){
  return Id.DatasetInstance.from(namespaceId,HBaseQueueDatasetModule.STATE_STORE_NAME);
}

Fixed version (ground truth):
private Id.DatasetInstance getStateStoreId(String namespaceId){
  return Id.DatasetInstance.from(namespaceId,QueueConstants.STATE_STORE_NAME);
}
Program: 6776
Project: 6776
Buggy source:
@Override public void configurePipeline(PipelineConfigurer pipelineConfigurer){
  Preconditions.checkArgument(!(dbSinkConfig.user == null && dbSinkConfig.password != null),"String_Node_Str" + "String_Node_Str");
  Preconditions.checkArgument(!(dbSinkConfig.user != null && dbSinkConfig.password == null),"String_Node_Str" + "String_Node_Str");
  Class<? extends Driver> jdbcDriverClass=pipelineConfigurer.usePluginClass(dbSinkConfig.jdbcPluginType,dbSinkConfig.jdbcPluginName,getJDBCPluginId(),PluginProperties.builder().build());
  Preconditions.checkArgument(jdbcDriverClass != null,"String_Node_Str");
}

Fixed version (ground truth):
@Override public void configurePipeline(PipelineConfigurer pipelineConfigurer){
  Preconditions.checkArgument(!(dbSinkConfig.user == null && dbSinkConfig.password != null),"String_Node_Str" + "String_Node_Str");
  Preconditions.checkArgument(!(dbSinkConfig.user != null && dbSinkConfig.password == null),"String_Node_Str" + "String_Node_Str");
  Class<? extends Driver> jdbcDriverClass=pipelineConfigurer.usePluginClass(dbSinkConfig.jdbcPluginType,dbSinkConfig.jdbcPluginName,getJDBCPluginId(),PluginProperties.builder().build());
  Preconditions.checkArgument(jdbcDriverClass != null,"String_Node_Str" + "String_Node_Str",dbSinkConfig.jdbcPluginName,dbSinkConfig.jdbcPluginName,dbSinkConfig.jdbcPluginType);
}
Program: 6777
Project: 6777
Buggy source:
@Override public void configurePipeline(PipelineConfigurer pipelineConfigurer){
  Preconditions.checkArgument(!(dbSourceConfig.user == null && dbSourceConfig.password != null),"String_Node_Str" + "String_Node_Str");
  Preconditions.checkArgument(!(dbSourceConfig.user != null && dbSourceConfig.password == null),"String_Node_Str" + "String_Node_Str");
  String jdbcPluginId=String.format("String_Node_Str","String_Node_Str",dbSourceConfig.jdbcPluginType,dbSourceConfig.jdbcPluginName);
  Class<? extends Driver> jdbcDriverClass=pipelineConfigurer.usePluginClass(dbSourceConfig.jdbcPluginType,dbSourceConfig.jdbcPluginName,jdbcPluginId,PluginProperties.builder().build());
  Preconditions.checkArgument(jdbcDriverClass != null,"String_Node_Str");
}

Fixed version (ground truth):
@Override public void configurePipeline(PipelineConfigurer pipelineConfigurer){
  Preconditions.checkArgument(!(dbSourceConfig.user == null && dbSourceConfig.password != null),"String_Node_Str" + "String_Node_Str");
  Preconditions.checkArgument(!(dbSourceConfig.user != null && dbSourceConfig.password == null),"String_Node_Str" + "String_Node_Str");
  String jdbcPluginId=String.format("String_Node_Str","String_Node_Str",dbSourceConfig.jdbcPluginType,dbSourceConfig.jdbcPluginName);
  Class<? extends Driver> jdbcDriverClass=pipelineConfigurer.usePluginClass(dbSourceConfig.jdbcPluginType,dbSourceConfig.jdbcPluginName,jdbcPluginId,PluginProperties.builder().build());
  Preconditions.checkArgument(jdbcDriverClass != null,"String_Node_Str" + "String_Node_Str",dbSourceConfig.jdbcPluginName,dbSourceConfig.jdbcPluginName,dbSourceConfig.jdbcPluginType);
}
Program: 6778
Project: 6778
Buggy source:
@Override public void configurePipeline(PipelineConfigurer pipelineConfigurer){
  Preconditions.checkArgument(!(dbSinkConfig.user == null && dbSinkConfig.password != null),"String_Node_Str" + "String_Node_Str");
  Preconditions.checkArgument(!(dbSinkConfig.user != null && dbSinkConfig.password == null),"String_Node_Str" + "String_Node_Str");
  Class<? extends Driver> jdbcDriverClass=pipelineConfigurer.usePluginClass(dbSinkConfig.jdbcPluginType,dbSinkConfig.jdbcPluginName,getJDBCPluginId(),PluginProperties.builder().build());
  Preconditions.checkArgument(jdbcDriverClass != null,"String_Node_Str");
}

Fixed version (ground truth):
@Override public void configurePipeline(PipelineConfigurer pipelineConfigurer){
  Preconditions.checkArgument(!(dbSinkConfig.user == null && dbSinkConfig.password != null),"String_Node_Str" + "String_Node_Str");
  Preconditions.checkArgument(!(dbSinkConfig.user != null && dbSinkConfig.password == null),"String_Node_Str" + "String_Node_Str");
  Class<? extends Driver> jdbcDriverClass=pipelineConfigurer.usePluginClass(dbSinkConfig.jdbcPluginType,dbSinkConfig.jdbcPluginName,getJDBCPluginId(),PluginProperties.builder().build());
  Preconditions.checkArgument(jdbcDriverClass != null,"String_Node_Str" + "String_Node_Str",dbSinkConfig.jdbcPluginName,dbSinkConfig.jdbcPluginName,dbSinkConfig.jdbcPluginType);
}
Program: 6779
Project: 6779
Buggy source:
@Override public void configurePipeline(PipelineConfigurer pipelineConfigurer){
  Preconditions.checkArgument(!(dbSourceConfig.user == null && dbSourceConfig.password != null),"String_Node_Str" + "String_Node_Str");
  Preconditions.checkArgument(!(dbSourceConfig.user != null && dbSourceConfig.password == null),"String_Node_Str" + "String_Node_Str");
  String jdbcPluginId=String.format("String_Node_Str","String_Node_Str",dbSourceConfig.jdbcPluginType,dbSourceConfig.jdbcPluginName);
  Class<? extends Driver> jdbcDriverClass=pipelineConfigurer.usePluginClass(dbSourceConfig.jdbcPluginType,dbSourceConfig.jdbcPluginName,jdbcPluginId,PluginProperties.builder().build());
  Preconditions.checkArgument(jdbcDriverClass != null,"String_Node_Str");
}

Fixed version (ground truth):
@Override public void configurePipeline(PipelineConfigurer pipelineConfigurer){
  Preconditions.checkArgument(!(dbSourceConfig.user == null && dbSourceConfig.password != null),"String_Node_Str" + "String_Node_Str");
  Preconditions.checkArgument(!(dbSourceConfig.user != null && dbSourceConfig.password == null),"String_Node_Str" + "String_Node_Str");
  String jdbcPluginId=String.format("String_Node_Str","String_Node_Str",dbSourceConfig.jdbcPluginType,dbSourceConfig.jdbcPluginName);
  Class<? extends Driver> jdbcDriverClass=pipelineConfigurer.usePluginClass(dbSourceConfig.jdbcPluginType,dbSourceConfig.jdbcPluginName,jdbcPluginId,PluginProperties.builder().build());
  Preconditions.checkArgument(jdbcDriverClass != null,"String_Node_Str" + "String_Node_Str",dbSourceConfig.jdbcPluginName,dbSourceConfig.jdbcPluginName,dbSourceConfig.jdbcPluginType);
}
Program: 6780
Project: 6780
Buggy source:
@BeforeClass public static void setupBeforeClass() throws Exception {
  testUtil=new HBaseTestingUtility();
  testUtil.startMiniCluster();
  conf=testUtil.getConfiguration();
  cConf=CConfiguration.create();
}

Fixed version (ground truth):
@BeforeClass public static void setupBeforeClass() throws Exception {
  testUtil=new HBase96Test();
  testUtil.startHBase();
  conf=testUtil.getConfiguration();
  cConf=CConfiguration.create();
}
Program: 6781
Project: 6781
Buggy source:
@AfterClass public static void shutdownAfterClass() throws Exception {
  testUtil.shutdownMiniCluster();
}

Fixed version (ground truth):
@AfterClass public static void shutdownAfterClass() throws Exception {
  testUtil.stopHBase();
}
Program: 6782
Project: 6782
Buggy source:
@BeforeClass public static void setupBeforeClass() throws Exception {
  testUtil=new HBaseTestingUtility();
  testUtil.startMiniCluster();
  conf=testUtil.getConfiguration();
  cConf=CConfiguration.create();
}

Fixed version (ground truth):
@BeforeClass public static void setupBeforeClass() throws Exception {
  testUtil=new HBase98Test();
  testUtil.startHBase();
  conf=testUtil.getConfiguration();
  cConf=CConfiguration.create();
}
Program: 6783
Project: 6783
Buggy source:
@AfterClass public static void shutdownAfterClass() throws Exception {
  testUtil.shutdownMiniCluster();
}

Fixed version (ground truth):
@AfterClass public static void shutdownAfterClass() throws Exception {
  testUtil.stopHBase();
}
Program: 6784
Project: 6784
Buggy source:
@BeforeClass public static void setupBeforeClass() throws Exception {
  testUtil=new HBaseTestingUtility();
  testUtil.startMiniCluster();
  conf=testUtil.getConfiguration();
  cConf=CConfiguration.create();
}

Fixed version (ground truth):
@BeforeClass public static void setupBeforeClass() throws Exception {
  testUtil=new HBase10CDHTest();
  testUtil.startHBase();
  conf=testUtil.getConfiguration();
  cConf=CConfiguration.create();
}
Program: 6785
Project: 6785
Buggy source:
@AfterClass public static void shutdownAfterClass() throws Exception {
  testUtil.shutdownMiniCluster();
}

Fixed version (ground truth):
@AfterClass public static void shutdownAfterClass() throws Exception {
  testUtil.stopHBase();
}
Program: 6786
Project: 6786
Buggy source:
@BeforeClass public static void setupBeforeClass() throws Exception {
  testUtil=new HBaseTestingUtility();
  testUtil.startMiniCluster();
  conf=testUtil.getConfiguration();
  cConf=CConfiguration.create();
}

Fixed version (ground truth):
@BeforeClass public static void setupBeforeClass() throws Exception {
  testUtil=new HBase10Test();
  testUtil.startHBase();
  conf=testUtil.getConfiguration();
  cConf=CConfiguration.create();
}
Program: 6787
Project: 6787
Buggy source:
@AfterClass public static void shutdownAfterClass() throws Exception {
  testUtil.shutdownMiniCluster();
}

Fixed version (ground truth):
@AfterClass public static void shutdownAfterClass() throws Exception {
  testUtil.stopHBase();
}
Program: 6788
Project: 6788
Buggy source:
private QueryHandle createFromSchemaProperty(DatasetSpecification spec,Id.DatasetInstance datasetID,Map<String,String> serdeProperties) throws ExploreException, SQLException, UnsupportedTypeException {
  String schemaStr=spec.getProperty(DatasetProperties.SCHEMA);
  if (schemaStr == null) {
    throw new IllegalArgumentException(String.format("String_Node_Str",datasetID.getId(),DatasetProperties.SCHEMA));
  }
  try {
    Schema schema=Schema.parseJson(schemaStr);
    String createStatement=new CreateStatementBuilder(datasetID.getId(),getDatasetTableName(datasetID)).setSchema(schema).setTableComment("String_Node_Str").buildWithStorageHandler(Constants.Explore.DATASET_STORAGE_HANDLER_CLASS,serdeProperties);
    return exploreService.execute(datasetID.getNamespace(),createStatement);
  }
 catch (  IOException e) {
    throw new IllegalArgumentException("String_Node_Str" + datasetID);
  }
}

Fixed version (ground truth):
private QueryHandle createFromSchemaProperty(DatasetSpecification spec,Id.DatasetInstance datasetID,Map<String,String> serdeProperties,boolean shouldErrorOnMissingSchema) throws ExploreException, SQLException, UnsupportedTypeException {
  String schemaStr=spec.getProperty(DatasetProperties.SCHEMA);
  if (schemaStr == null) {
    if (shouldErrorOnMissingSchema) {
      throw new IllegalArgumentException(String.format("String_Node_Str",datasetID.getId(),DatasetProperties.SCHEMA));
    }
 else {
      return QueryHandle.NO_OP;
    }
  }
  try {
    Schema schema=Schema.parseJson(schemaStr);
    String createStatement=new CreateStatementBuilder(datasetID.getId(),getDatasetTableName(datasetID)).setSchema(schema).setTableComment("String_Node_Str").buildWithStorageHandler(Constants.Explore.DATASET_STORAGE_HANDLER_CLASS,serdeProperties);
    return exploreService.execute(datasetID.getNamespace(),createStatement);
  }
 catch (  IOException e) {
    throw new IllegalArgumentException("String_Node_Str" + datasetID);
  }
}
Program: 6791
Project: 6791
Buggy source:
/** 
 * Recursively search the datasets of a Dataset for   {@link PartitionedFileSet}s. Return the migrated dataset spec, and add the DatasetInstances of the partitions table that require data migration to the given list.
 * @return recursively migrated dsSpec
 */
DatasetSpecification recursivelyMigrateSpec(Id.Namespace namespaceId,String dsName,DatasetSpecification dsSpec,Multimap<Id.Namespace,DatasetSpecification> addTo) throws Exception {
  if (isPartitionedFileSet(dsSpec)) {
    if (alreadyUpgraded(dsSpec)) {
      LOG.info("String_Node_Str",dsSpec.getName());
      return dsSpec;
    }
    DatasetSpecification convertedSpec=convertSpec(dsName,dsSpec);
    addTo.put(namespaceId,convertedSpec);
    return convertedSpec;
  }
  List<DatasetSpecification> newSpecs=Lists.newArrayList();
  for (  Map.Entry<String,DatasetSpecification> entry : dsSpec.getSpecifications().entrySet()) {
    newSpecs.add(recursivelyMigrateSpec(namespaceId,entry.getKey(),entry.getValue(),addTo));
  }
  DatasetSpecification.Builder builder=DatasetSpecification.builder(dsName,dsSpec.getType());
  builder.properties(dsSpec.getProperties());
  builder.datasets(newSpecs);
  return builder.build();
}

Fixed version (ground truth):
/** 
 * Recursively search the datasets of a Dataset for   {@link PartitionedFileSet}s. Return the migrated dataset spec, and add the DatasetInstances of the partitions table that require data migration to the given list.
 * @return recursively migrated dsSpec
 */
DatasetSpecification recursivelyMigrateSpec(Id.Namespace namespaceId,String dsName,DatasetSpecification dsSpec,Multimap<Id.Namespace,DatasetSpecification> addTo) throws Exception {
  if (isPartitionedFileSet(dsSpec)) {
    if (alreadyUpgraded(dsSpec)) {
      LOG.info("String_Node_Str",dsSpec.getName());
      return dsSpec;
    }
    DatasetSpecification convertedSpec=convertSpec(dsName,dsSpec);
    addTo.put(namespaceId,changeName(convertedSpec,dsSpec.getName()));
    return convertedSpec;
  }
  List<DatasetSpecification> newSpecs=Lists.newArrayList();
  for (  Map.Entry<String,DatasetSpecification> entry : dsSpec.getSpecifications().entrySet()) {
    newSpecs.add(recursivelyMigrateSpec(namespaceId,entry.getKey(),entry.getValue(),addTo));
  }
  DatasetSpecification.Builder builder=DatasetSpecification.builder(dsName,dsSpec.getType());
  builder.properties(dsSpec.getProperties());
  builder.datasets(newSpecs);
  return builder.build();
}
Program: 6792
Project: 6792
Buggy source:
public void upgrade() throws Exception {
  LOG.info("String_Node_Str");
  upgradePartitionedFileSets();
  LOG.info("String_Node_Str");
}

Fixed version (ground truth):
public void upgrade() throws Exception {
  LOG.info("String_Node_Str");
  upgradePartitionedFileSets();
  upgradeModulesDependingOnPfs();
  LOG.info("String_Node_Str");
}
Program: 6793
Project: 6793
Buggy source:
@Override public void apply() throws Exception {
  MDSKey key=new MDSKey.Builder().add(DatasetInstanceMDS.INSTANCE_PREFIX).build();
  Map<MDSKey,DatasetSpecification> dsSpecs=dsInstancesMDS.listKV(key,DatasetSpecification.class);
  Multimap<Id.Namespace,DatasetSpecification> partitionDatasetsToMigrate=HashMultimap.create();
  for (  Map.Entry<MDSKey,DatasetSpecification> entry : dsSpecs.entrySet()) {
    DatasetSpecification dsSpec=entry.getValue();
    if (!needsConverting(dsSpec)) {
      continue;
    }
    DatasetSpecification migratedSpec=recursivelyMigrateSpec(extractNamespace(entry.getKey()),dsSpec.getName(),dsSpec,partitionDatasetsToMigrate);
    dsInstancesMDS.write(entry.getKey(),migratedSpec);
  }
  LOG.info("String_Node_Str",partitionDatasetsToMigrate);
  for (  Map.Entry<Id.Namespace,DatasetSpecification> entry : partitionDatasetsToMigrate.entries()) {
    pfsTableMigrator.upgrade(entry.getKey(),entry.getValue());
  }
}

Fixed version (ground truth):
@Override public void apply() throws Exception {
  MDSKey key=new MDSKey.Builder().add(DatasetTypeMDS.MODULES_PREFIX).build();
  Map<MDSKey,DatasetModuleMeta> dsSpecs=dsTypeMDS.listKV(key,DatasetModuleMeta.class);
  for (  Map.Entry<MDSKey,DatasetModuleMeta> entry : dsSpecs.entrySet()) {
    DatasetModuleMeta moduleMeta=entry.getValue();
    if (!needsConverting(moduleMeta)) {
      continue;
    }
    LOG.info("String_Node_Str",moduleMeta);
    DatasetModuleMeta migratedModuleMeta=migrateDatasetModuleMeta(moduleMeta);
    dsTypeMDS.write(entry.getKey(),migratedModuleMeta);
  }
}
Program: 6794
Project: 6794
Buggy source:
/** 
 * Recursively search the datasets of a Dataset for   {@link PartitionedFileSet}s. Return the migrated dataset spec, and add the DatasetInstances of the partitions table that require data migration to the given list.
 * @return recursively migrated dsSpec
 */
DatasetSpecification recursivelyMigrateSpec(Id.Namespace namespaceId,String dsName,DatasetSpecification dsSpec,Multimap<Id.Namespace,DatasetSpecification> addTo) throws Exception {
  if (isPartitionedFileSet(dsSpec)) {
    if (alreadyUpgraded(dsSpec)) {
      LOG.info("String_Node_Str",dsSpec.getName());
      return dsSpec;
    }
    DatasetSpecification convertedSpec=convertSpec(dsName,dsSpec);
    addTo.put(namespaceId,convertedSpec);
    return convertedSpec;
  }
  List<DatasetSpecification> newSpecs=Lists.newArrayList();
  for (  Map.Entry<String,DatasetSpecification> entry : dsSpec.getSpecifications().entrySet()) {
    newSpecs.add(recursivelyMigrateSpec(namespaceId,entry.getKey(),entry.getValue(),addTo));
  }
  DatasetSpecification.Builder builder=DatasetSpecification.builder(dsName,dsSpec.getType());
  builder.properties(dsSpec.getProperties());
  builder.datasets(newSpecs);
  return builder.build();
}

Fixed version (ground truth):
/** 
 * Recursively search the datasets of a Dataset for   {@link PartitionedFileSet}s. Return the migrated dataset spec, and add the DatasetInstances of the partitions table that require data migration to the given list.
 * @return recursively migrated dsSpec
 */
DatasetSpecification recursivelyMigrateSpec(Id.Namespace namespaceId,String dsName,DatasetSpecification dsSpec,Multimap<Id.Namespace,DatasetSpecification> addTo) throws Exception {
  if (isPartitionedFileSet(dsSpec)) {
    if (alreadyUpgraded(dsSpec)) {
      LOG.info("String_Node_Str",dsSpec.getName());
      return dsSpec;
    }
    DatasetSpecification convertedSpec=convertSpec(dsName,dsSpec);
    addTo.put(namespaceId,changeName(convertedSpec,dsSpec.getName()));
    return convertedSpec;
  }
  List<DatasetSpecification> newSpecs=Lists.newArrayList();
  for (  Map.Entry<String,DatasetSpecification> entry : dsSpec.getSpecifications().entrySet()) {
    newSpecs.add(recursivelyMigrateSpec(namespaceId,entry.getKey(),entry.getValue(),addTo));
  }
  DatasetSpecification.Builder builder=DatasetSpecification.builder(dsName,dsSpec.getType());
  builder.properties(dsSpec.getProperties());
  builder.datasets(newSpecs);
  return builder.build();
}
Program: 6795
Project: 6795
Buggy source:
/** 
 * Fetches the run record for particular run of a program.
 * @param id        program id
 * @param runid     run id of the program
 * @return          run record for the specified program and runid, null if not found
 */
@Nullable RunRecord getRun(Id.Program id,String runid);

Fixed version (ground truth):
/** 
 * Fetches the run record for particular run of a program.
 * @param id        program id
 * @param runid     run id of the program
 * @return          run record for the specified program and runid, null if not found
 */
@Nullable RunRecordMeta getRun(Id.Program id,String runid);
Program: 6796
Project: 6796
Buggy source:
/** 
 * Fetches the run records for the particular status.
 * @param status  status of the program running/completed/failed or all
 * @param filter  predicate to be passed to filter the records
 * @return        list of logged runs
 */
List<RunRecord> getRuns(ProgramRunStatus status,Predicate<RunRecord> filter);

Fixed version (ground truth):
/** 
 * Fetches the run records for the particular status.
 * @param status  status of the program running/completed/failed or all
 * @param filter  predicate to be passed to filter the records
 * @return        list of logged runs
 */
List<RunRecordMeta> getRuns(ProgramRunStatus status,Predicate<RunRecordMeta> filter);
Program: 6798
Project: 6798
Buggy source:
private void getRuns(HttpResponder responder,Id.Program programId,String status,long start,long end,int limit){
  try {
    try {
      ProgramRunStatus runStatus=(status == null) ? ProgramRunStatus.ALL : ProgramRunStatus.valueOf(status.toUpperCase());
      responder.sendJson(HttpResponseStatus.OK,store.getRuns(programId,runStatus,start,end,limit));
    }
 catch (    IllegalArgumentException e) {
      responder.sendString(HttpResponseStatus.BAD_REQUEST,"String_Node_Str");
    }
  }
 catch (  SecurityException e) {
    responder.sendStatus(HttpResponseStatus.UNAUTHORIZED);
  }
catch (  Throwable e) {
    LOG.error("String_Node_Str",e);
    responder.sendStatus(HttpResponseStatus.INTERNAL_SERVER_ERROR);
  }
}

Fixed version (ground truth):
private void getRuns(HttpResponder responder,Id.Program programId,String status,long start,long end,int limit){
  try {
    try {
      ProgramRunStatus runStatus=(status == null) ? ProgramRunStatus.ALL : ProgramRunStatus.valueOf(status.toUpperCase());
      List<RunRecord> records=Lists.transform(store.getRuns(programId,runStatus,start,end,limit),CONVERT_TO_RUN_RECORD);
      responder.sendJson(HttpResponseStatus.OK,records);
    }
 catch (    IllegalArgumentException e) {
      responder.sendString(HttpResponseStatus.BAD_REQUEST,"String_Node_Str");
    }
  }
 catch (  SecurityException e) {
    responder.sendStatus(HttpResponseStatus.UNAUTHORIZED);
  }
catch (  Throwable e) {
    LOG.error("String_Node_Str",e);
    responder.sendStatus(HttpResponseStatus.INTERNAL_SERVER_ERROR);
  }
}
Program: 6799
Project: 6799
Buggy source:
/** 
 * Returns run record for a particular run of a program.
 */
@GET @Path("String_Node_Str") public void programRunRecord(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String programType,@PathParam("String_Node_Str") String programId,@PathParam("String_Node_Str") String runid){
  ProgramType type=ProgramType.valueOfCategoryName(programType);
  if (type == null || type == ProgramType.WEBAPP) {
    responder.sendStatus(HttpResponseStatus.NOT_FOUND);
    return;
  }
  try {
    RunRecord runRecord=store.getRun(Id.Program.from(namespaceId,appId,type,programId),runid);
    if (runRecord != null) {
      responder.sendJson(HttpResponseStatus.OK,runRecord);
      return;
    }
    responder.sendStatus(HttpResponseStatus.NOT_FOUND);
  }
 catch (  SecurityException e) {
    responder.sendStatus(HttpResponseStatus.UNAUTHORIZED);
  }
catch (  Throwable e) {
    LOG.error("String_Node_Str",e);
    responder.sendStatus(HttpResponseStatus.INTERNAL_SERVER_ERROR);
  }
}

Fixed version (ground truth):
/** 
 * Returns run record for a particular run of a program.
 */
@GET @Path("String_Node_Str") public void programRunRecord(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String programType,@PathParam("String_Node_Str") String programId,@PathParam("String_Node_Str") String runid){
  ProgramType type=ProgramType.valueOfCategoryName(programType);
  if (type == null || type == ProgramType.WEBAPP) {
    responder.sendStatus(HttpResponseStatus.NOT_FOUND);
    return;
  }
  try {
    RunRecordMeta runRecordMeta=store.getRun(Id.Program.from(namespaceId,appId,type,programId),runid);
    if (runRecordMeta != null) {
      RunRecord runRecord=CONVERT_TO_RUN_RECORD.apply(runRecordMeta);
      responder.sendJson(HttpResponseStatus.OK,runRecord);
      return;
    }
    responder.sendStatus(HttpResponseStatus.NOT_FOUND);
  }
 catch (  SecurityException e) {
    responder.sendStatus(HttpResponseStatus.UNAUTHORIZED);
  }
catch (  Throwable e) {
    LOG.error("String_Node_Str",e);
    responder.sendStatus(HttpResponseStatus.INTERNAL_SERVER_ERROR);
  }
}
Program: 6800
Project: 6800
Buggy source:
private void stopWorkerAdapter(Id.Namespace namespace,AdapterDefinition adapterSpec) throws NotFoundException, ExecutionException, InterruptedException {
  final Id.Program workerId=getProgramId(namespace,adapterSpec);
  List<RunRecord> runRecords=store.getRuns(workerId,ProgramRunStatus.RUNNING,0,Long.MAX_VALUE,Integer.MAX_VALUE,adapterSpec.getName());
  RunRecord adapterRun=Iterables.getFirst(runRecords,null);
  if (adapterRun != null) {
    RunId runId=RunIds.fromString(adapterRun.getPid());
    lifecycleService.stopProgram(workerId,runId);
  }
 else {
    LOG.warn("String_Node_Str",adapterSpec.getName());
  }
}

Fixed version (ground truth):
private void stopWorkerAdapter(Id.Namespace namespace,AdapterDefinition adapterSpec) throws NotFoundException, ExecutionException, InterruptedException {
  final Id.Program workerId=getProgramId(namespace,adapterSpec);
  List<RunRecordMeta> runRecords=store.getRuns(workerId,ProgramRunStatus.RUNNING,0,Long.MAX_VALUE,Integer.MAX_VALUE,adapterSpec.getName());
  RunRecordMeta adapterRun=Iterables.getFirst(runRecords,null);
  if (adapterRun != null) {
    RunId runId=RunIds.fromString(adapterRun.getPid());
    lifecycleService.stopProgram(workerId,runId);
  }
 else {
    LOG.warn("String_Node_Str",adapterSpec.getName());
  }
}
Program: 6801
Project: 6801
Buggy source:
/** 
 * Fetch RunRecord for a given adapter.
 * @param namespace namespace in which adapter is deployed
 * @param adapterName name of the adapter
 * @param runId run id
 * @return {@link RunRecord}
 * @throws NotFoundException if adapter is not found
 */
public RunRecord getRun(Id.Namespace namespace,String adapterName,String runId) throws NotFoundException {
  Id.Program program=getProgramId(namespace,adapterName);
  RunRecord runRecord=store.getRun(program,runId);
  if (runRecord != null && adapterName.equals(runRecord.getAdapterName())) {
    return runRecord;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Fetch RunRecord for a given adapter.
 * @param namespace namespace in which adapter is deployed
 * @param adapterName name of the adapter
 * @param runId run id
 * @return {@link RunRecord}
 * @throws NotFoundException if adapter is not found
 */
public RunRecord getRun(Id.Namespace namespace,String adapterName,String runId) throws NotFoundException {
  Id.Program program=getProgramId(namespace,adapterName);
  RunRecordMeta runRecordMeta=store.getRun(program,runId);
  if (runRecordMeta != null && adapterName.equals(runRecordMeta.getAdapterName())) {
    return CONVERT_TO_RUN_RECORD.apply(runRecordMeta);
  }
  return null;
}
Program: 6802
Project: 6802
Buggy source:
/** 
 * Fetch RunRecords for a given adapter.
 * @param namespace namespace in which adapter is deployed
 * @param adapterName name of the adapter
 * @param status {@link ProgramRunStatus} status of the program running/completed/failed or all
 * @param start fetch run history that has started after the startTime in seconds
 * @param end fetch run history that has started before the endTime in seconds
 * @param limit max number of entries to fetch for this history call
 * @return list of {@link RunRecord}
 * @throws NotFoundException if adapter is not found
 */
public List<RunRecord> getRuns(Id.Namespace namespace,String adapterName,ProgramRunStatus status,long start,long end,int limit) throws NotFoundException {
  Id.Program program=getProgramId(namespace,adapterName);
  return store.getRuns(program,status,start,end,limit,adapterName);
}

Fixed version (ground truth):
/** 
 * Fetch RunRecords for a given adapter.
 * @param namespace namespace in which adapter is deployed
 * @param adapterName name of the adapter
 * @param status {@link ProgramRunStatus} status of the program running/completed/failed or all
 * @param start fetch run history that has started after the startTime in seconds
 * @param end fetch run history that has started before the endTime in seconds
 * @param limit max number of entries to fetch for this history call
 * @return list of {@link RunRecord}
 * @throws NotFoundException if adapter is not found
 */
public List<RunRecord> getRuns(Id.Namespace namespace,String adapterName,ProgramRunStatus status,long start,long end,int limit) throws NotFoundException {
  Id.Program program=getProgramId(namespace,adapterName);
  return Lists.transform(store.getRuns(program,status,start,end,limit,adapterName),CONVERT_TO_RUN_RECORD);
}