nus-yam/ex-repair huggingface dataset:
Program: 6562
Project: 6562
Buggy source:
@GET @Path("String_Node_Str") public void searchMetadata(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@QueryParam("String_Node_Str") String searchQuery,@QueryParam("String_Node_Str") String target) throws Exception {
  MetadataSearchTargetType metadataSearchTargetType;
  if (target != null) {
    metadataSearchTargetType=MetadataSearchTargetType.valueOf(target.toUpperCase());
  }
 else {
    metadataSearchTargetType=null;
  }
  Set<MetadataSearchResultRecord> results=metadataAdmin.searchMetadata(searchQuery,metadataSearchTargetType);
  responder.sendJson(HttpResponseStatus.OK,results,SET_METADATA_SEARCH_RESULT_TYPE,GSON);
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") public void searchMetadata(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@QueryParam("String_Node_Str") String searchQuery,@QueryParam("String_Node_Str") String target) throws Exception {
  MetadataSearchTargetType metadataSearchTargetType;
  if (target != null) {
    metadataSearchTargetType=MetadataSearchTargetType.valueOf(target.toUpperCase());
  }
 else {
    metadataSearchTargetType=null;
  }
  Set<MetadataSearchResultRecord> results=metadataAdmin.searchMetadata(namespaceId,searchQuery,metadataSearchTargetType);
  responder.sendJson(HttpResponseStatus.OK,results,SET_METADATA_SEARCH_RESULT_TYPE,GSON);
}
Program: 6565
Project: 6565
Buggy source:
/** 
 * Find the instance of   {@link BusinessMetadataRecord} for key:value pair
 * @param keyValue The metadata value to be found.
 * @param type The target type of objects to search from.
 * @return The {@link Iterable} of {@link BusinessMetadataRecord} that fit the key value pair.
 */
public List<BusinessMetadataRecord> findBusinessMetadataOnKeyValue(String keyValue,MetadataSearchTargetType type){
  return executeSearchOnColumns(BusinessMetadataDataset.KEYVALUE_COLUMN,keyValue,type);
}

Fixed version (ground truth):
/** 
 * Find the instance of   {@link BusinessMetadataRecord} for key:value pair
 * @param namespaceId The namespace id to filter
 * @param keyValue The metadata value to be found.
 * @param type The target type of objects to search from.
 * @return The {@link Iterable} of {@link BusinessMetadataRecord} that fit the key value pair.
 */
public List<BusinessMetadataRecord> findBusinessMetadataOnKeyValue(String namespaceId,String keyValue,MetadataSearchTargetType type){
  return executeSearchOnColumns(namespaceId,BusinessMetadataDataset.KEYVALUE_COLUMN,keyValue,type);
}
Program: 6566
Project: 6566
Buggy source:
/** 
 * Find the instance of   {@link BusinessMetadataRecord} based on key.
 * @param value The metadata value to be found
 * @param type The target type of objects to search from
 * @return The {@link Iterable} of {@link BusinessMetadataRecord} that fit the value
 */
public List<BusinessMetadataRecord> findBusinessMetadataOnValue(String value,MetadataSearchTargetType type){
  return executeSearchOnColumns(BusinessMetadataDataset.CASE_INSENSITIVE_VALUE_COLUMN,value,type);
}

Fixed version (ground truth):
/** 
 * Find the instance of   {@link BusinessMetadataRecord} based on key.
 * @param namespaceId The namespace id to filter
 * @param value The metadata value to be found
 * @param type The target type of objects to search from
 * @return The {@link Iterable} of {@link BusinessMetadataRecord} that fit the value
 */
public List<BusinessMetadataRecord> findBusinessMetadataOnValue(String namespaceId,String value,MetadataSearchTargetType type){
  return executeSearchOnColumns(namespaceId,BusinessMetadataDataset.CASE_INSENSITIVE_VALUE_COLUMN,value,type);
}
Program: 6567
Project: 6567
Buggy source:
private void write(Id.NamespacedId targetId,MetadataType metadataType,BusinessMetadataRecord record){
  String key=record.getKey();
  MDSKey mdsKey=MdsValueKey.getMDSKey(targetId,metadataType,key);
  Put put=new Put(mdsKey.getKey());
  put.add(Bytes.toBytes(KEYVALUE_COLUMN),Bytes.toBytes(record.getKey().toLowerCase() + KEYVALUE_SEPARATOR + record.getValue().toLowerCase()));
  put.add(Bytes.toBytes(CASE_INSENSITIVE_VALUE_COLUMN),Bytes.toBytes(record.getValue().toLowerCase()));
  put.add(Bytes.toBytes(VALUE_COLUMN),Bytes.toBytes(record.getValue()));
  indexedTable.put(put);
  writeHistory(targetId);
}

Fixed version (ground truth):
private void write(Id.NamespacedId targetId,MetadataType metadataType,BusinessMetadataRecord record){
  String key=record.getKey();
  MDSKey mdsKey=MdsValueKey.getMDSKey(targetId,metadataType,key);
  Put put=new Put(mdsKey.getKey());
  String lowerCaseKey=record.getKey().toLowerCase();
  String lowerCaseValue=record.getValue().toLowerCase();
  String nameSpacedKVIndexValue=MdsValueKey.getNamespaceId(mdsKey) + KEYVALUE_SEPARATOR + lowerCaseKey+ KEYVALUE_SEPARATOR+ lowerCaseValue;
  put.add(Bytes.toBytes(KEYVALUE_COLUMN),Bytes.toBytes(nameSpacedKVIndexValue));
  String nameSpacedVIndexValue=MdsValueKey.getNamespaceId(mdsKey) + KEYVALUE_SEPARATOR + lowerCaseValue;
  put.add(Bytes.toBytes(CASE_INSENSITIVE_VALUE_COLUMN),Bytes.toBytes(nameSpacedVIndexValue));
  put.add(Bytes.toBytes(VALUE_COLUMN),Bytes.toBytes(record.getValue()));
  indexedTable.put(put);
  writeHistory(targetId);
}
Program: 6568
Project: 6568
Buggy source:
/** 
 * Search to the underlying Business Metadata Dataset.
 */
Iterable<BusinessMetadataRecord> searchMetadata(String searchQuery);

Fixed version (ground truth):
/** 
 * Search to the underlying Business Metadata Dataset.
 */
Iterable<BusinessMetadataRecord> searchMetadata(String namespaceId,String searchQuery);
Program: 6569
Project: 6569
Buggy source:
/** 
 * Search to the underlying Business Metadata Dataset for a target type.
 */
Iterable<BusinessMetadataRecord> searchMetadataOnType(String searchQuery,MetadataSearchTargetType type);

Fixed version (ground truth):
/** 
 * Search to the underlying Business Metadata Dataset for a target type.
 */
Iterable<BusinessMetadataRecord> searchMetadataOnType(String namespaceId,String searchQuery,MetadataSearchTargetType type);
Program: 6570
Project: 6570
Buggy source:
/** 
 * Search to the underlying Business Metadata Dataset.
 */
@Override public Iterable<BusinessMetadataRecord> searchMetadata(final String searchQuery){
  return searchMetadataOnType(searchQuery,MetadataSearchTargetType.ALL);
}

Fixed version (ground truth):
/** 
 * Search to the underlying Business Metadata Dataset.
 */
@Override public Iterable<BusinessMetadataRecord> searchMetadata(final String namespaceId,final String searchQuery){
  return searchMetadataOnType(namespaceId,searchQuery,MetadataSearchTargetType.ALL);
}
Program: 6571
Project: 6571
Buggy source:
@Override public Iterable<BusinessMetadataRecord> apply(BusinessMetadataDataset input) throws Exception {
  if (searchQuery.contains(BusinessMetadataDataset.KEYVALUE_SEPARATOR)) {
    return input.findBusinessMetadataOnKeyValue(searchQuery,type);
  }
  return input.findBusinessMetadataOnValue(searchQuery,type);
}

Fixed version (ground truth):
@Override public Iterable<BusinessMetadataRecord> apply(BusinessMetadataDataset input) throws Exception {
  if (searchQuery.contains(BusinessMetadataDataset.KEYVALUE_SEPARATOR)) {
    return input.findBusinessMetadataOnKeyValue(namespaceId,searchQuery,type);
  }
  return input.findBusinessMetadataOnValue(namespaceId,searchQuery,type);
}
Program: 6572
Project: 6572
Buggy source:
/** 
 * Search to the underlying Business Metadata Dataset for a target type.
 */
@Override public Iterable<BusinessMetadataRecord> searchMetadataOnType(final String searchQuery,final MetadataSearchTargetType type){
  return execute(new TransactionExecutor.Function<BusinessMetadataDataset,Iterable<BusinessMetadataRecord>>(){
    @Override public Iterable<BusinessMetadataRecord> apply(    BusinessMetadataDataset input) throws Exception {
      if (searchQuery.contains(BusinessMetadataDataset.KEYVALUE_SEPARATOR)) {
        return input.findBusinessMetadataOnKeyValue(searchQuery,type);
      }
      return input.findBusinessMetadataOnValue(searchQuery,type);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Search to the underlying Business Metadata Dataset for a target type.
 */
@Override public Iterable<BusinessMetadataRecord> searchMetadataOnType(final String namespaceId,final String searchQuery,final MetadataSearchTargetType type){
  return execute(new TransactionExecutor.Function<BusinessMetadataDataset,Iterable<BusinessMetadataRecord>>(){
    @Override public Iterable<BusinessMetadataRecord> apply(    BusinessMetadataDataset input) throws Exception {
      if (searchQuery.contains(BusinessMetadataDataset.KEYVALUE_SEPARATOR)) {
        return input.findBusinessMetadataOnKeyValue(namespaceId,searchQuery,type);
      }
      return input.findBusinessMetadataOnValue(namespaceId,searchQuery,type);
    }
  }
);
}
Program: 6573
Project: 6573
Buggy source:
@Override public Iterable<BusinessMetadataRecord> searchMetadata(String searchQuery){
  return null;
}

Fixed version (ground truth):
@Override public Iterable<BusinessMetadataRecord> searchMetadata(String namespaceId,String searchQuery){
  return null;
}
Program: 6574
Project: 6574
Buggy source:
@Override public Iterable<BusinessMetadataRecord> searchMetadataOnType(String searchQuery,MetadataSearchTargetType type){
  return null;
}

Fixed version (ground truth):
@Override public Iterable<BusinessMetadataRecord> searchMetadataOnType(String namespaceId,String searchQuery,MetadataSearchTargetType type){
  return null;
}
Program: 6575
Project: 6575
Buggy source:
@Test public void testSearchOnKeyValue() throws Exception {
  BusinessMetadataRecord record=new BusinessMetadataRecord(flow1,"String_Node_Str","String_Node_Str");
  dataset.setProperty(flow1,"String_Node_Str","String_Node_Str");
  dataset.setProperty(flow1,"String_Node_Str","String_Node_Str");
  List<BusinessMetadataRecord> results=dataset.findBusinessMetadataOnKeyValue("String_Node_Str" + BusinessMetadataDataset.KEYVALUE_SEPARATOR + "String_Node_Str",MetadataSearchTargetType.PROGRAM);
  Assert.assertEquals(1,results.size());
  BusinessMetadataRecord result=results.get(0);
  Assert.assertEquals(record,result);
}

Fixed version (ground truth):
@Test public void testSearchOnKeyValue() throws Exception {
  BusinessMetadataRecord record=new BusinessMetadataRecord(flow1,"String_Node_Str","String_Node_Str");
  dataset.setProperty(flow1,"String_Node_Str","String_Node_Str");
  dataset.setProperty(flow1,"String_Node_Str","String_Node_Str");
  List<BusinessMetadataRecord> results=dataset.findBusinessMetadataOnKeyValue("String_Node_Str","String_Node_Str" + BusinessMetadataDataset.KEYVALUE_SEPARATOR + "String_Node_Str",MetadataSearchTargetType.PROGRAM);
  Assert.assertEquals(1,results.size());
  BusinessMetadataRecord result=results.get(0);
  Assert.assertEquals(record,result);
  List<BusinessMetadataRecord> results2=dataset.findBusinessMetadataOnKeyValue("String_Node_Str","String_Node_Str" + BusinessMetadataDataset.KEYVALUE_SEPARATOR + "String_Node_Str",MetadataSearchTargetType.PROGRAM);
  Assert.assertEquals(0,results2.size());
}
Program: 6576
Project: 6576
Buggy source:
@Test public void testSearchOnValue() throws Exception {
  BusinessMetadataRecord record=new BusinessMetadataRecord(flow1,"String_Node_Str","String_Node_Str");
  dataset.setProperty(flow1,"String_Node_Str","String_Node_Str");
  dataset.setProperty(flow1,"String_Node_Str","String_Node_Str");
  List<BusinessMetadataRecord> results=dataset.findBusinessMetadataOnValue("String_Node_Str",MetadataSearchTargetType.PROGRAM);
  Assert.assertEquals(1,results.size());
  results=dataset.findBusinessMetadataOnValue("String_Node_Str",MetadataSearchTargetType.PROGRAM);
  BusinessMetadataRecord result=results.get(0);
  Assert.assertEquals(record,result);
  dataset.setProperty(flow1,"String_Node_Str","String_Node_Str");
  List<BusinessMetadataRecord> results2=dataset.findBusinessMetadataOnValue("String_Node_Str",MetadataSearchTargetType.PROGRAM);
  Assert.assertEquals(2,results2.size());
  for (  BusinessMetadataRecord result2 : results2) {
    Assert.assertEquals("String_Node_Str",result2.getValue());
  }
  dataset.setProperty(stream1,"String_Node_Str","String_Node_Str");
  List<BusinessMetadataRecord> results3=dataset.findBusinessMetadataOnValue("String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(2,results3.size());
  for (  BusinessMetadataRecord result3 : results3) {
    Assert.assertTrue(result3.getValue().startsWith("String_Node_Str"));
  }
}

Fixed version (ground truth):
@Test public void testSearchOnValue() throws Exception {
  BusinessMetadataRecord record=new BusinessMetadataRecord(flow1,"String_Node_Str","String_Node_Str");
  dataset.setProperty(flow1,"String_Node_Str","String_Node_Str");
  dataset.setProperty(flow1,"String_Node_Str","String_Node_Str");
  List<BusinessMetadataRecord> results=dataset.findBusinessMetadataOnValue("String_Node_Str","String_Node_Str",MetadataSearchTargetType.PROGRAM);
  Assert.assertEquals(1,results.size());
  BusinessMetadataRecord result=results.get(0);
  Assert.assertEquals(record,result);
  results=dataset.findBusinessMetadataOnValue("String_Node_Str","String_Node_Str",MetadataSearchTargetType.PROGRAM);
  Assert.assertEquals(1,results.size());
  result=results.get(0);
  Assert.assertEquals(record,result);
  dataset.setProperty(flow1,"String_Node_Str","String_Node_Str");
  List<BusinessMetadataRecord> results2=dataset.findBusinessMetadataOnValue("String_Node_Str","String_Node_Str",MetadataSearchTargetType.PROGRAM);
  Assert.assertEquals(2,results2.size());
  for (  BusinessMetadataRecord result2 : results2) {
    Assert.assertEquals("String_Node_Str",result2.getValue());
  }
  dataset.setProperty(stream1,"String_Node_Str","String_Node_Str");
  List<BusinessMetadataRecord> results3=dataset.findBusinessMetadataOnValue("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(2,results3.size());
  for (  BusinessMetadataRecord result3 : results3) {
    Assert.assertTrue(result3.getValue().startsWith("String_Node_Str"));
  }
  List<BusinessMetadataRecord> results4=dataset.findBusinessMetadataOnValue("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(0,results4.size());
}
Program: 6577
Project: 6577
Buggy source:
@PUT @Path("String_Node_Str") public void createFeed(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String category,@PathParam("String_Node_Str") String name){
  try {
    Id.NotificationFeed combinedFeed;
    try {
      Id.NotificationFeed feed=parseBody(request,Id.NotificationFeed.class);
      combinedFeed=new Id.NotificationFeed.Builder().setNamespaceId(namespaceId).setCategory(category).setName(name).setDescription(feed == null ? null : feed.getDescription()).build();
    }
 catch (    IllegalArgumentException e) {
      responder.sendString(HttpResponseStatus.BAD_REQUEST,String.format("String_Node_Str",e.getMessage()));
      return;
    }
    if (feedManager.createFeed(combinedFeed)) {
      responder.sendString(HttpResponseStatus.OK,"String_Node_Str");
    }
 else {
      LOG.trace("String_Node_Str");
      responder.sendString(HttpResponseStatus.OK,"String_Node_Str");
    }
  }
 catch (  NotificationFeedException e) {
    LOG.error("String_Node_Str",e);
    responder.sendStatus(HttpResponseStatus.INTERNAL_SERVER_ERROR);
  }
catch (  JsonSyntaxException e) {
    responder.sendString(HttpResponseStatus.BAD_REQUEST,"String_Node_Str");
  }
catch (  IOException e) {
    LOG.error("String_Node_Str",e);
    responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,e.getMessage());
  }
catch (  Throwable t) {
    LOG.debug("String_Node_Str",t);
    responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,t.getMessage());
  }
}

Fixed version (ground truth):
@PUT @Path("String_Node_Str") public void createFeed(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String category,@PathParam("String_Node_Str") String name){
  try {
    Id.NotificationFeed combinedFeed;
    try {
      Id.NotificationFeed feed=parseBody(request,Id.NotificationFeed.class);
      combinedFeed=new Id.NotificationFeed.Builder().setNamespaceId(namespaceId).setCategory(category).setName(name).setDescription(feed == null ? null : feed.getDescription()).build();
    }
 catch (    IllegalArgumentException e) {
      responder.sendString(HttpResponseStatus.BAD_REQUEST,String.format("String_Node_Str",e.getMessage()));
      return;
    }
    if (feedManager.createFeed(combinedFeed)) {
      responder.sendString(HttpResponseStatus.OK,"String_Node_Str");
    }
 else {
      LOG.trace("String_Node_Str");
      responder.sendString(HttpResponseStatus.OK,"String_Node_Str");
    }
  }
 catch (  NotificationFeedException e) {
    LOG.error("String_Node_Str",e);
    responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,e.getMessage());
  }
catch (  JsonSyntaxException e) {
    responder.sendString(HttpResponseStatus.BAD_REQUEST,"String_Node_Str");
  }
catch (  IOException e) {
    LOG.error("String_Node_Str",e);
    responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,e.getMessage());
  }
catch (  Throwable t) {
    LOG.debug("String_Node_Str",t);
    responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,t.getMessage());
  }
}
Program: 6578
Project: 6578
Buggy source:
/** 
 * Returns a list of services associated with a namespace.
 */
@GET @Path("String_Node_Str") public void getAllServices(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId){
  programList(responder,namespaceId,ProgramType.SERVICE,store);
}

Fixed version (ground truth):
/** 
 * Returns a list of services associated with a namespace.
 */
@GET @Path("String_Node_Str") public void getAllServices(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId) throws Exception {
  programList(responder,namespaceId,ProgramType.SERVICE,store);
}
Program: 6579
Project: 6579
Buggy source:
@GET @Path("String_Node_Str") public void programSpecification(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){
  ProgramType type=getProgramType(programType);
  if (type == null) {
    responder.sendString(HttpResponseStatus.METHOD_NOT_ALLOWED,String.format("String_Node_Str",programType));
    return;
  }
  try {
    Id.Program id=Id.Program.from(namespaceId,appId,type,programId);
    ProgramSpecification specification=getProgramSpecification(id);
    if (specification == null) {
      responder.sendStatus(HttpResponseStatus.NOT_FOUND);
    }
 else {
      responder.sendJson(HttpResponseStatus.OK,specification);
    }
  }
 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):
@GET @Path("String_Node_Str") public void programSpecification(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){
  ProgramType type=getProgramType(programType);
  if (type == null) {
    responder.sendString(HttpResponseStatus.METHOD_NOT_ALLOWED,String.format("String_Node_Str",programType));
    return;
  }
  try {
    Id.Program id=Id.Program.from(namespaceId,appId,type,programId);
    ProgramSpecification specification=getProgramSpecification(id);
    if (specification == null) {
      responder.sendStatus(HttpResponseStatus.NOT_FOUND);
    }
 else {
      responder.sendJson(HttpResponseStatus.OK,specification);
    }
  }
 catch (  SecurityException e) {
    responder.sendStatus(HttpResponseStatus.UNAUTHORIZED);
  }
}
Program: 6580
Project: 6580
Buggy source:
/** 
 * Save program runtime args.
 */
@PUT @Path("String_Node_Str") public void saveProgramRuntimeArgs(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){
  ProgramType type=ProgramType.valueOfCategoryName(programType);
  if (type == null || type == ProgramType.WEBAPP) {
    responder.sendStatus(HttpResponseStatus.NOT_FOUND);
    return;
  }
  Id.Program id=Id.Program.from(namespaceId,appId,type,programId);
  try {
    if (!store.programExists(id)) {
      responder.sendString(HttpResponseStatus.NOT_FOUND,"String_Node_Str");
      return;
    }
    Map<String,String> args=decodeArguments(request);
    preferencesStore.setProperties(namespaceId,appId,programType,programId,args);
    responder.sendStatus(HttpResponseStatus.OK);
  }
 catch (  Throwable e) {
    LOG.error("String_Node_Str",e.getMessage(),e);
    responder.sendStatus(HttpResponseStatus.INTERNAL_SERVER_ERROR);
  }
}

Fixed version (ground truth):
/** 
 * Save program runtime args.
 */
@PUT @Path("String_Node_Str") public void saveProgramRuntimeArgs(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){
  ProgramType type=ProgramType.valueOfCategoryName(programType);
  if (type == null || type == ProgramType.WEBAPP) {
    responder.sendStatus(HttpResponseStatus.NOT_FOUND);
    return;
  }
  Id.Program id=Id.Program.from(namespaceId,appId,type,programId);
  if (!store.programExists(id)) {
    responder.sendString(HttpResponseStatus.NOT_FOUND,"String_Node_Str");
    return;
  }
  Map<String,String> args=decodeArguments(request);
  preferencesStore.setProperties(namespaceId,appId,programType,programId,args);
  responder.sendStatus(HttpResponseStatus.OK);
}
Program: 6581
Project: 6581
Buggy source:
/** 
 * Deletes queues.
 */
@DELETE @Path("String_Node_Str") public void deleteFlowQueues(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String flowId){
  Id.Program programId=Id.Program.from(namespaceId,appId,ProgramType.FLOW,flowId);
  try {
    ProgramStatus status=getProgramStatus(programId);
    if (status.getStatus().equals(HttpResponseStatus.NOT_FOUND.toString())) {
      responder.sendStatus(HttpResponseStatus.NOT_FOUND);
    }
 else     if (status.getStatus().equals("String_Node_Str")) {
      responder.sendString(HttpResponseStatus.FORBIDDEN,"String_Node_Str");
    }
 else {
      queueAdmin.dropAllForFlow(Id.Flow.from(programId.getApplication(),programId.getId()));
      FlowUtils.deleteFlowPendingMetrics(metricStore,namespaceId,appId,flowId);
      responder.sendStatus(HttpResponseStatus.OK);
    }
  }
 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):
/** 
 * Deletes queues.
 */
@DELETE @Path("String_Node_Str") public void deleteFlowQueues(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String flowId) throws Exception {
  Id.Program programId=Id.Program.from(namespaceId,appId,ProgramType.FLOW,flowId);
  try {
    ProgramStatus status=getProgramStatus(programId);
    if (status.getStatus().equals(HttpResponseStatus.NOT_FOUND.toString())) {
      responder.sendStatus(HttpResponseStatus.NOT_FOUND);
    }
 else     if (status.getStatus().equals("String_Node_Str")) {
      responder.sendString(HttpResponseStatus.FORBIDDEN,"String_Node_Str");
    }
 else {
      queueAdmin.dropAllForFlow(Id.Flow.from(programId.getApplication(),programId.getId()));
      FlowUtils.deleteFlowPendingMetrics(metricStore,namespaceId,appId,flowId);
      responder.sendStatus(HttpResponseStatus.OK);
    }
  }
 catch (  SecurityException e) {
    responder.sendStatus(HttpResponseStatus.UNAUTHORIZED);
  }
}
Program: 6582
Project: 6582
Buggy source:
/** 
 * Returns number of instances of a worker.
 */
@GET @Path("String_Node_Str") public void getWorkerInstances(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String workerId){
  try {
    int count=store.getWorkerInstances(Id.Program.from(namespaceId,appId,ProgramType.WORKER,workerId));
    responder.sendJson(HttpResponseStatus.OK,new Instances(count));
  }
 catch (  SecurityException e) {
    responder.sendStatus(HttpResponseStatus.UNAUTHORIZED);
  }
catch (  Throwable e) {
    if (respondIfElementNotFound(e,responder)) {
      return;
    }
    LOG.error("String_Node_Str",e);
    responder.sendStatus(HttpResponseStatus.INTERNAL_SERVER_ERROR);
  }
}

Fixed version (ground truth):
/** 
 * Returns number of instances of a worker.
 */
@GET @Path("String_Node_Str") public void getWorkerInstances(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String workerId){
  try {
    int count=store.getWorkerInstances(Id.Program.from(namespaceId,appId,ProgramType.WORKER,workerId));
    responder.sendJson(HttpResponseStatus.OK,new Instances(count));
  }
 catch (  SecurityException e) {
    responder.sendStatus(HttpResponseStatus.UNAUTHORIZED);
  }
catch (  Throwable e) {
    if (respondIfElementNotFound(e,responder)) {
      return;
    }
    throw e;
  }
}
Program: 6583
Project: 6583
Buggy source:
/** 
 * Returns a list of map/reduces associated with a namespace.
 */
@GET @Path("String_Node_Str") public void getAllMapReduce(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId){
  programList(responder,namespaceId,ProgramType.MAPREDUCE,store);
}

Fixed version (ground truth):
/** 
 * Returns a list of map/reduces associated with a namespace.
 */
@GET @Path("String_Node_Str") public void getAllMapReduce(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId) throws Exception {
  programList(responder,namespaceId,ProgramType.MAPREDUCE,store);
}
Program: 6584
Project: 6584
Buggy source:
/** 
 * Return the number of instances of a service.
 */
@GET @Path("String_Node_Str") public void getServiceInstances(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String serviceId){
  try {
    Id.Program programId=Id.Program.from(namespaceId,appId,ProgramType.SERVICE,serviceId);
    if (!store.programExists(programId)) {
      responder.sendString(HttpResponseStatus.NOT_FOUND,"String_Node_Str");
      return;
    }
    ServiceSpecification specification=(ServiceSpecification)getProgramSpecification(programId);
    if (specification == null) {
      responder.sendStatus(HttpResponseStatus.NOT_FOUND);
      return;
    }
    int instances=specification.getInstances();
    responder.sendJson(HttpResponseStatus.OK,new ServiceInstances(instances,getInstanceCount(programId,serviceId)));
  }
 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):
/** 
 * Return the number of instances of a service.
 */
@GET @Path("String_Node_Str") public void getServiceInstances(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String serviceId){
  try {
    Id.Program programId=Id.Program.from(namespaceId,appId,ProgramType.SERVICE,serviceId);
    if (!store.programExists(programId)) {
      responder.sendString(HttpResponseStatus.NOT_FOUND,"String_Node_Str");
      return;
    }
    ServiceSpecification specification=(ServiceSpecification)getProgramSpecification(programId);
    if (specification == null) {
      responder.sendStatus(HttpResponseStatus.NOT_FOUND);
      return;
    }
    int instances=specification.getInstances();
    responder.sendJson(HttpResponseStatus.OK,new ServiceInstances(instances,getInstanceCount(programId,serviceId)));
  }
 catch (  SecurityException e) {
    responder.sendStatus(HttpResponseStatus.UNAUTHORIZED);
  }
}
Program: 6585
Project: 6585
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());
      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);
  }
}

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);
  }
}
Program: 6588
Project: 6588
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 {
    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);
  }
}

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);
  }
}
Program: 6590
Project: 6590
Buggy source:
@GET @Path("String_Node_Str") public void getAllWorkers(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId){
  programList(responder,namespaceId,ProgramType.WORKER,store);
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") public void getAllWorkers(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId) throws Exception {
  programList(responder,namespaceId,ProgramType.WORKER,store);
}
Program: 6591
Project: 6591
Buggy source:
@Inject public ProgramLifecycleHttpHandler(Store store,CConfiguration cConf,ProgramRuntimeService runtimeService,ProgramLifecycleService lifecycleService,QueueAdmin queueAdmin,Scheduler scheduler,PreferencesStore preferencesStore,NamespacedLocationFactory namespacedLocationFactory,MRJobInfoFetcher mrJobInfoFetcher,PropertiesResolver propertiesResolver,AdapterService adapterService,MetricStore metricStore){
  this.namespacedLocationFactory=namespacedLocationFactory;
  this.store=store;
  this.runtimeService=runtimeService;
  this.lifecycleService=lifecycleService;
  this.metricStore=metricStore;
  this.appFabricDir=cConf.get(Constants.AppFabric.OUTPUT_DIR);
  this.queueAdmin=queueAdmin;
  this.scheduler=scheduler;
  this.preferencesStore=preferencesStore;
  this.mrJobInfoFetcher=mrJobInfoFetcher;
  this.propertiesResolver=propertiesResolver;
  this.adapterService=adapterService;
}

Fixed version (ground truth):
@Inject public ProgramLifecycleHttpHandler(Store store,CConfiguration cConf,ProgramRuntimeService runtimeService,ProgramLifecycleService lifecycleService,QueueAdmin queueAdmin,Scheduler scheduler,PreferencesStore preferencesStore,NamespacedLocationFactory namespacedLocationFactory,MRJobInfoFetcher mrJobInfoFetcher,PropertiesResolver propertiesResolver,MetricStore metricStore){
  this.namespacedLocationFactory=namespacedLocationFactory;
  this.store=store;
  this.runtimeService=runtimeService;
  this.lifecycleService=lifecycleService;
  this.metricStore=metricStore;
  this.appFabricDir=cConf.get(Constants.AppFabric.OUTPUT_DIR);
  this.queueAdmin=queueAdmin;
  this.scheduler=scheduler;
  this.preferencesStore=preferencesStore;
  this.mrJobInfoFetcher=mrJobInfoFetcher;
  this.propertiesResolver=propertiesResolver;
}
Program: 6592
Project: 6592
Buggy source:
/** 
 * Get program runtime args.
 */
@GET @Path("String_Node_Str") public void getProgramRuntimeArgs(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){
  ProgramType type=ProgramType.valueOfCategoryName(programType);
  if (type == null || type == ProgramType.WEBAPP) {
    responder.sendStatus(HttpResponseStatus.NOT_FOUND);
    return;
  }
  Id.Program id=Id.Program.from(namespaceId,appId,type,programId);
  try {
    if (!store.programExists(id)) {
      responder.sendString(HttpResponseStatus.NOT_FOUND,"String_Node_Str");
      return;
    }
    Map<String,String> runtimeArgs=preferencesStore.getProperties(id.getNamespaceId(),appId,programType,programId);
    responder.sendJson(HttpResponseStatus.OK,runtimeArgs);
  }
 catch (  Throwable e) {
    LOG.error("String_Node_Str",e.getMessage(),e);
    responder.sendStatus(HttpResponseStatus.INTERNAL_SERVER_ERROR);
  }
}

Fixed version (ground truth):
/** 
 * Get program runtime args.
 */
@GET @Path("String_Node_Str") public void getProgramRuntimeArgs(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){
  ProgramType type=ProgramType.valueOfCategoryName(programType);
  if (type == null || type == ProgramType.WEBAPP) {
    responder.sendStatus(HttpResponseStatus.NOT_FOUND);
    return;
  }
  Id.Program id=Id.Program.from(namespaceId,appId,type,programId);
  if (!store.programExists(id)) {
    responder.sendString(HttpResponseStatus.NOT_FOUND,"String_Node_Str");
    return;
  }
  Map<String,String> runtimeArgs=preferencesStore.getProperties(id.getNamespaceId(),appId,programType,programId);
  responder.sendJson(HttpResponseStatus.OK,runtimeArgs);
}
Program: 6594
Project: 6594
Buggy source:
/** 
 * Returns a list of workflows associated with a namespace.
 */
@GET @Path("String_Node_Str") public void getAllWorkflows(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId){
  programList(responder,namespaceId,ProgramType.WORKFLOW,store);
}

Fixed version (ground truth):
/** 
 * Returns a list of workflows associated with a namespace.
 */
@GET @Path("String_Node_Str") public void getAllWorkflows(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId) throws Exception {
  programList(responder,namespaceId,ProgramType.WORKFLOW,store);
}
Program: 6595
Project: 6595
Buggy source:
@POST @Path("String_Node_Str") public void performAction(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String type,@PathParam("String_Node_Str") String id,@PathParam("String_Node_Str") String action) throws NotFoundException, BadRequestException, IOException, NotImplementedException {
  if (type.equals("String_Node_Str")) {
    suspendResumeSchedule(responder,namespaceId,appId,id,action);
    return;
  }
  if (!isValidAction(action)) {
    throw new NotFoundException(String.format("String_Node_Str",action));
  }
  ProgramType programType;
  try {
    programType=ProgramType.valueOfCategoryName(type);
  }
 catch (  IllegalArgumentException e) {
    throw new BadRequestException(String.format("String_Node_Str",type),e);
  }
  if ("String_Node_Str".equals(action) && !isDebugAllowed(programType)) {
    throw new NotImplementedException(String.format("String_Node_Str",programType));
  }
  Id.Program programId=Id.Program.from(namespaceId,appId,programType,id);
  startStopProgram(request,responder,programId,action);
}

Fixed version (ground truth):
@POST @Path("String_Node_Str") public void performAction(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String type,@PathParam("String_Node_Str") String id,@PathParam("String_Node_Str") String action) throws NotFoundException, BadRequestException, IOException, NotImplementedException, SchedulerException {
  if (type.equals("String_Node_Str")) {
    suspendResumeSchedule(responder,namespaceId,appId,id,action);
    return;
  }
  if (!isValidAction(action)) {
    throw new NotFoundException(String.format("String_Node_Str",action));
  }
  ProgramType programType;
  try {
    programType=ProgramType.valueOfCategoryName(type);
  }
 catch (  IllegalArgumentException e) {
    throw new BadRequestException(String.format("String_Node_Str",type),e);
  }
  if ("String_Node_Str".equals(action) && !isDebugAllowed(programType)) {
    throw new NotImplementedException(String.format("String_Node_Str",programType));
  }
  Id.Program programId=Id.Program.from(namespaceId,appId,programType,id);
  startStopProgram(request,responder,programId,action);
}
Program: 6597
Project: 6597
Buggy source:
/** 
 * Returns a list of spark jobs associated with a namespace.
 */
@GET @Path("String_Node_Str") public void getAllSpark(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId){
  programList(responder,namespaceId,ProgramType.SPARK,store);
}

Fixed version (ground truth):
/** 
 * Returns a list of spark jobs associated with a namespace.
 */
@GET @Path("String_Node_Str") public void getAllSpark(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId) throws Exception {
  programList(responder,namespaceId,ProgramType.SPARK,store);
}
Program: 6598
Project: 6598
Buggy source:
/** 
 * Returns number of instances for a flowlet within a flow.
 */
@GET @Path("String_Node_Str") public void getFlowletInstances(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String flowId,@PathParam("String_Node_Str") String flowletId){
  try {
    int count=store.getFlowletInstances(Id.Program.from(namespaceId,appId,ProgramType.FLOW,flowId),flowletId);
    responder.sendJson(HttpResponseStatus.OK,new Instances(count));
  }
 catch (  SecurityException e) {
    responder.sendStatus(HttpResponseStatus.UNAUTHORIZED);
  }
catch (  Throwable e) {
    if (respondIfElementNotFound(e,responder)) {
      return;
    }
    LOG.error("String_Node_Str",e);
    responder.sendStatus(HttpResponseStatus.INTERNAL_SERVER_ERROR);
  }
}

Fixed version (ground truth):
/** 
 * Returns number of instances for a flowlet within a flow.
 */
@GET @Path("String_Node_Str") public void getFlowletInstances(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String flowId,@PathParam("String_Node_Str") String flowletId){
  try {
    int count=store.getFlowletInstances(Id.Program.from(namespaceId,appId,ProgramType.FLOW,flowId),flowletId);
    responder.sendJson(HttpResponseStatus.OK,new Instances(count));
  }
 catch (  SecurityException e) {
    responder.sendStatus(HttpResponseStatus.UNAUTHORIZED);
  }
catch (  Throwable e) {
    if (respondIfElementNotFound(e,responder)) {
      return;
    }
    throw e;
  }
}
Program: 6599
Project: 6599
Buggy source:
/** 
 * Returns a list of flows associated with a namespace.
 */
@GET @Path("String_Node_Str") public void getAllFlows(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId){
  programList(responder,namespaceId,ProgramType.FLOW,store);
}

Fixed version (ground truth):
/** 
 * Returns a list of flows associated with a namespace.
 */
@GET @Path("String_Node_Str") public void getAllFlows(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId) throws Exception {
  programList(responder,namespaceId,ProgramType.FLOW,store);
}
Program: 6600
Project: 6600
Buggy source:
@Override public void perform(Arguments arguments,PrintStream output) throws Exception {
  File artifactFile=resolver.resolvePathToFile(arguments.get(ArgumentName.LOCAL_FILE_PATH.toString()));
  String name=arguments.getOptional(ArgumentName.ARTIFACT_NAME.toString());
  String version=arguments.getOptional(ArgumentName.ARTIFACT_VERSION.toString());
  Id.Artifact artifactId;
  if (name == null && version != null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
 else   if (name != null && version == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
 else   if (name == null) {
    artifactId=Id.Artifact.parse(cliConfig.getCurrentNamespace(),artifactFile.getName());
  }
 else {
    artifactId=Id.Artifact.from(cliConfig.getCurrentNamespace(),name,version);
  }
  String configPath=arguments.getOptional(ArgumentName.ARTIFACT_CONFIG_FILE.toString());
  if (configPath == null) {
    artifactClient.add(artifactId.getNamespace(),artifactId.getName(),Files.newInputStreamSupplier(artifactFile),artifactId.getVersion().getVersion());
  }
 else {
    File configFile=resolver.resolvePathToFile(configPath);
    ArtifactConfig artifactConfig=ArtifactConfig.read(artifactId,artifactFile,configFile);
    artifactClient.add(artifactId.getNamespace(),artifactId.getName(),Files.newInputStreamSupplier(artifactFile),artifactId.getVersion().getVersion(),artifactConfig.getParents(),artifactConfig.getPlugins());
  }
  output.printf("String_Node_Str",artifactId.getName());
}

Fixed version (ground truth):
@Override public void perform(Arguments arguments,PrintStream output) throws Exception {
  File artifactFile=resolver.resolvePathToFile(arguments.get(ArgumentName.LOCAL_FILE_PATH.toString()));
  String name=arguments.getOptional(ArgumentName.ARTIFACT_NAME.toString());
  String version=arguments.getOptional(ArgumentName.ARTIFACT_VERSION.toString());
  Id.Artifact artifactId;
  if (name == null && version != null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
 else   if (name != null && version == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
 else   if (name == null) {
    artifactId=Id.Artifact.parse(cliConfig.getCurrentNamespace(),artifactFile.getName());
  }
 else {
    artifactId=Id.Artifact.from(cliConfig.getCurrentNamespace(),name,version);
  }
  String configPath=arguments.getOptional(ArgumentName.ARTIFACT_CONFIG_FILE.toString());
  if (configPath == null) {
    artifactClient.add(artifactId.getNamespace(),artifactId.getName(),Files.newInputStreamSupplier(artifactFile),artifactId.getVersion().getVersion());
  }
 else {
    File configFile=resolver.resolvePathToFile(configPath);
    ArtifactConfig artifactConfig=ArtifactConfig.read(artifactId,configFile,artifactFile);
    artifactClient.add(artifactId.getNamespace(),artifactId.getName(),Files.newInputStreamSupplier(artifactFile),artifactId.getVersion().getVersion(),artifactConfig.getParents(),artifactConfig.getPlugins());
  }
  output.printf("String_Node_Str",artifactId.getName());
}
Program: 6601
Project: 6601
Buggy source:
/** 
 * Adds the names of   {@link Dataset}s used by the flowlet.
 * @param datasets dataset names
 */
void useDatasets(Iterable<String> datasets);

Fixed version (ground truth):
/** 
 * Adds the names of   {@link Dataset}s used by this workflow action.
 * @param datasets dataset names
 */
void useDatasets(Iterable<String> datasets);
Program: 6602
Project: 6602
Buggy source:
public DefaultWorkflowActionSpecification(String className,String name,String description,Map<String,String> properties,Set<String> datasets){
  this.className=className;
  this.name=name;
  this.description=description;
  this.properties=Collections.unmodifiableMap(new HashMap<>(properties));
  this.datasets=Collections.unmodifiableSet(new HashSet<>(datasets));
}

Fixed version (ground truth):
/** 
 * Constructor be used by WorkflowActionConfigurer during workflow action configuration.
 */
public DefaultWorkflowActionSpecification(String className,String name,String description,Map<String,String> properties,Set<String> datasets){
  this.className=className;
  this.name=name;
  this.description=description;
  this.properties=Collections.unmodifiableMap(new HashMap<>(properties));
  this.datasets=Collections.unmodifiableSet(new HashSet<>(datasets));
}
Program: 6603
Project: 6603
Buggy source:
@Override public WorkflowActionSpecification configure(){
  Map<String,String> options=new HashMap<>();
  options.put(PROGRAM_TYPE,programType.name());
  options.put(PROGRAM_NAME,programName);
  return WorkflowActionSpecification.Builder.with().setName(name).setDescription("String_Node_Str" + programName).withOptions(options).build();
}

Fixed version (ground truth):
@Override public void configure(WorkflowActionConfigurer configurer){
  super.configure(configurer);
  setName(programName);
  setDescription("String_Node_Str" + programType.name() + "String_Node_Str"+ programName);
  setProperties(ImmutableMap.of(PROGRAM_TYPE,programType.name(),PROGRAM_NAME,programName));
}
Program: 6604
Project: 6604
Buggy source:
public ProgramWorkflowAction(String name,String programName,SchedulableProgramType programType){
  this.name=name;
  this.programName=programName;
  this.programType=programType;
}

Fixed version (ground truth):
public ProgramWorkflowAction(String programName,SchedulableProgramType programType){
  this.programName=programName;
  this.programType=programType;
}