nus-yam/ex-repair huggingface dataset:
Program: 5686
Project: 5686
Buggy source:
private void validateMetric(long expected,Id.Application appId,String metric) throws TimeoutException, InterruptedException {
  Map<String,String> tags=ImmutableMap.of(Constants.Metrics.Tag.NAMESPACE,appId.getNamespaceId(),Constants.Metrics.Tag.APP,appId.getId(),Constants.Metrics.Tag.WORKER,ETLWorker.NAME);
  getMetricsManager().waitForTotalMetricCount(tags,"String_Node_Str" + metric,expected,20,TimeUnit.SECONDS);
  Assert.assertEquals(expected,getMetricsManager().getTotalMetric(tags,"String_Node_Str" + metric));
}

Fixed version (ground truth):
private void validateMetric(long expected,ApplicationId appId,String metric) throws TimeoutException, InterruptedException {
  Map<String,String> tags=ImmutableMap.of(Constants.Metrics.Tag.NAMESPACE,appId.getNamespace(),Constants.Metrics.Tag.APP,appId.getApplication(),Constants.Metrics.Tag.WORKER,ETLWorker.NAME);
  getMetricsManager().waitForTotalMetricCount(tags,"String_Node_Str" + metric,expected,20,TimeUnit.SECONDS);
  Assert.assertEquals(expected,getMetricsManager().getTotalMetric(tags,"String_Node_Str" + metric));
}
Program: 5687
Project: 5687
Buggy source:
@Test @Category(SlowTests.class) public void testOneSourceOneSink() throws Exception {
  Schema schema=Schema.recordOf("String_Node_Str",Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING)),Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING)));
  List<StructuredRecord> input=new ArrayList<>();
  input.add(StructuredRecord.builder(schema).set("String_Node_Str","String_Node_Str").set("String_Node_Str","String_Node_Str").build());
  input.add(StructuredRecord.builder(schema).set("String_Node_Str","String_Node_Str").set("String_Node_Str","String_Node_Str").build());
  File tmpDir=TMP_FOLDER.newFolder();
  ETLRealtimeConfig etlConfig=ETLRealtimeConfig.builder().addStage(new ETLStage("String_Node_Str",MockSource.getPlugin(input))).addStage(new ETLStage("String_Node_Str",MockSink.getPlugin(tmpDir))).addConnection("String_Node_Str","String_Node_Str").build();
  Id.Application appId=Id.Application.from(Id.Namespace.DEFAULT,"String_Node_Str");
  AppRequest<ETLRealtimeConfig> appRequest=new AppRequest<>(APP_ARTIFACT,etlConfig);
  ApplicationManager appManager=deployApplication(appId,appRequest);
  WorkerManager workerManager=appManager.getWorkerManager(ETLWorker.NAME);
  workerManager.start();
  workerManager.waitForStatus(true,10,1);
  try {
    List<StructuredRecord> written=MockSink.getRecords(tmpDir,0,10,TimeUnit.SECONDS);
    Assert.assertEquals(input,written);
  }
  finally {
    stopWorker(workerManager);
  }
  validateMetric(2,appId,"String_Node_Str");
  validateMetric(2,appId,"String_Node_Str");
}

Fixed version (ground truth):
@Test @Category(SlowTests.class) public void testOneSourceOneSink() throws Exception {
  Schema schema=Schema.recordOf("String_Node_Str",Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING)),Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING)));
  List<StructuredRecord> input=new ArrayList<>();
  input.add(StructuredRecord.builder(schema).set("String_Node_Str","String_Node_Str").set("String_Node_Str","String_Node_Str").build());
  input.add(StructuredRecord.builder(schema).set("String_Node_Str","String_Node_Str").set("String_Node_Str","String_Node_Str").build());
  File tmpDir=TMP_FOLDER.newFolder();
  ETLRealtimeConfig etlConfig=ETLRealtimeConfig.builder().addStage(new ETLStage("String_Node_Str",MockSource.getPlugin(input))).addStage(new ETLStage("String_Node_Str",MockSink.getPlugin(tmpDir))).addConnection("String_Node_Str","String_Node_Str").build();
  ApplicationId appId=NamespaceId.DEFAULT.app("String_Node_Str");
  AppRequest<ETLRealtimeConfig> appRequest=new AppRequest<>(APP_ARTIFACT,etlConfig);
  ApplicationManager appManager=deployApplication(appId,appRequest);
  WorkerManager workerManager=appManager.getWorkerManager(ETLWorker.NAME);
  workerManager.start();
  workerManager.waitForStatus(true,10,1);
  try {
    List<StructuredRecord> written=MockSink.getRecords(tmpDir,0,10,TimeUnit.SECONDS);
    Assert.assertEquals(input,written);
  }
  finally {
    stopWorker(workerManager);
  }
  validateMetric(2,appId,"String_Node_Str");
  validateMetric(2,appId,"String_Node_Str");
}
Program: 5688
Project: 5688
Buggy source:
@Test public void testEmptyProperties() throws Exception {
  ETLRealtimeConfig etlConfig=ETLRealtimeConfig.builder().addStage(new ETLStage("String_Node_Str",MockSource.getPlugin(null))).addStage(new ETLStage("String_Node_Str",MockSink.getPlugin(null))).addConnection("String_Node_Str","String_Node_Str").setInstances(2).build();
  Id.Application appId=Id.Application.from(Id.Namespace.DEFAULT,"String_Node_Str");
  AppRequest<ETLRealtimeConfig> appRequest=new AppRequest<>(APP_ARTIFACT,etlConfig);
  ApplicationManager appManager=deployApplication(appId,appRequest);
  Assert.assertNotNull(appManager);
  WorkerManager workerManager=appManager.getWorkerManager(ETLWorker.NAME);
  workerManager.start();
  workerManager.waitForStatus(true,10,1);
  try {
    Assert.assertEquals(2,workerManager.getInstances());
  }
  finally {
    stopWorker(workerManager);
  }
}

Fixed version (ground truth):
@Test public void testEmptyProperties() throws Exception {
  ETLRealtimeConfig etlConfig=ETLRealtimeConfig.builder().addStage(new ETLStage("String_Node_Str",MockSource.getPlugin(null))).addStage(new ETLStage("String_Node_Str",MockSink.getPlugin(null))).addConnection("String_Node_Str","String_Node_Str").setInstances(2).build();
  ApplicationId appId=NamespaceId.DEFAULT.app("String_Node_Str");
  AppRequest<ETLRealtimeConfig> appRequest=new AppRequest<>(APP_ARTIFACT,etlConfig);
  ApplicationManager appManager=deployApplication(appId,appRequest);
  Assert.assertNotNull(appManager);
  WorkerManager workerManager=appManager.getWorkerManager(ETLWorker.NAME);
  workerManager.start();
  workerManager.waitForStatus(true,10,1);
  try {
    Assert.assertEquals(2,workerManager.getInstances());
  }
  finally {
    stopWorker(workerManager);
  }
}
Program: 5691
Project: 5691
Buggy source:
private <T extends ETLConfig>void upgrade(ApplicationId appId,ArtifactSummary appArtifact,T config) throws IOException {
  AppRequest<T> updateRequest=new AppRequest<>(appArtifact,config);
  try {
    appClient.update(appId.toId(),updateRequest);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",appId,e);
    if (errorDir != null) {
      File errorFile=new File(errorDir,String.format("String_Node_Str",appId.getParent(),appId.getEntityName()));
      LOG.error("String_Node_Str",appId,errorFile.getAbsolutePath());
      try (OutputStreamWriter outputStreamWriter=new OutputStreamWriter(new FileOutputStream(errorFile))){
        outputStreamWriter.write(GSON.toJson(updateRequest));
      }
     }
  }
}

Fixed version (ground truth):
private <T extends ETLConfig>void upgrade(ApplicationId appId,ArtifactSummary appArtifact,T config) throws IOException {
  AppRequest<T> updateRequest=new AppRequest<>(appArtifact,config);
  try {
    appClient.update(appId,updateRequest);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",appId,e);
    if (errorDir != null) {
      File errorFile=new File(errorDir,String.format("String_Node_Str",appId.getParent(),appId.getEntityName()));
      LOG.error("String_Node_Str",appId,errorFile.getAbsolutePath());
      try (OutputStreamWriter outputStreamWriter=new OutputStreamWriter(new FileOutputStream(errorFile))){
        outputStreamWriter.write(GSON.toJson(updateRequest));
      }
     }
  }
}
Program: 5692
Project: 5692
Buggy source:
@Nullable @Override public ArtifactSelectorConfig getPluginArtifact(String pluginType,String pluginName){
  try {
    List<PluginInfo> plugins=artifactClient.getPluginInfo(artifactId.toId(),pluginType,pluginName,ArtifactScope.SYSTEM);
    if (plugins.isEmpty()) {
      return null;
    }
    ArtifactSummary chosenArtifact=plugins.get(plugins.size() - 1).getArtifact();
    return new ArtifactSelectorConfig(chosenArtifact.getScope().name(),chosenArtifact.getName(),chosenArtifact.getVersion());
  }
 catch (  Exception e) {
    return null;
  }
}

Fixed version (ground truth):
@Nullable @Override public ArtifactSelectorConfig getPluginArtifact(String pluginType,String pluginName){
  try {
    List<PluginInfo> plugins=artifactClient.getPluginInfo(artifactId,pluginType,pluginName,ArtifactScope.SYSTEM);
    if (plugins.isEmpty()) {
      return null;
    }
    ArtifactSummary chosenArtifact=plugins.get(plugins.size() - 1).getArtifact();
    return new ArtifactSelectorConfig(chosenArtifact.getScope().name(),chosenArtifact.getName(),chosenArtifact.getVersion());
  }
 catch (  Exception e) {
    return null;
  }
}
Program: 5697
Project: 5697
Buggy source:
private Map<String,String> parsePreferences(String[] programIdParts) throws IOException, UnauthenticatedException, NotFoundException, UnauthorizedException {
switch (type) {
case INSTANCE:
    checkInputLength(programIdParts,0);
  return client.getInstancePreferences();
case NAMESPACE:
checkInputLength(programIdParts,0);
return client.getNamespacePreferences(cliConfig.getCurrentNamespace().toId(),resolved);
case APP:
return client.getApplicationPreferences(parseAppId(programIdParts).toId(),resolved);
case FLOW:
case MAPREDUCE:
case WORKFLOW:
case SERVICE:
case SPARK:
return client.getProgramPreferences(parseProgramId(programIdParts,type.getProgramType()).toId(),resolved);
default :
throw new IllegalArgumentException("String_Node_Str" + type.getShortName());
}
}

Fixed version (ground truth):
private Map<String,String> parsePreferences(String[] programIdParts) throws IOException, UnauthenticatedException, NotFoundException, UnauthorizedException {
switch (type) {
case INSTANCE:
    checkInputLength(programIdParts,0);
  return client.getInstancePreferences();
case NAMESPACE:
checkInputLength(programIdParts,0);
return client.getNamespacePreferences(cliConfig.getCurrentNamespace(),resolved);
case APP:
return client.getApplicationPreferences(parseAppId(programIdParts),resolved);
case FLOW:
case MAPREDUCE:
case WORKFLOW:
case SERVICE:
case SPARK:
return client.getProgramPreferences(parseProgramId(programIdParts,type.getProgramType()),resolved);
default :
throw new IllegalArgumentException("String_Node_Str" + type.getShortName());
}
}
Program: 5698
Project: 5698
Buggy source:
protected void setPreferences(String[] programIdParts,PrintStream printStream,Map<String,String> args) throws Exception {
switch (type) {
case INSTANCE:
    checkInputLength(programIdParts,0);
  client.setInstancePreferences(args);
printSuccessMessage(printStream,type);
break;
case NAMESPACE:
checkInputLength(programIdParts,0);
client.setNamespacePreferences(cliConfig.getCurrentNamespace().toId(),args);
printSuccessMessage(printStream,type);
break;
case APP:
client.setApplicationPreferences(parseAppId(programIdParts).toId(),args);
printSuccessMessage(printStream,type);
break;
case FLOW:
case MAPREDUCE:
case WORKFLOW:
case SERVICE:
case SPARK:
client.setProgramPreferences(parseProgramId(programIdParts,type.getProgramType()).toId(),args);
printSuccessMessage(printStream,type);
break;
default :
throw new IllegalArgumentException("String_Node_Str" + type.getShortName());
}
}

Fixed version (ground truth):
protected void setPreferences(String[] programIdParts,PrintStream printStream,Map<String,String> args) throws Exception {
switch (type) {
case INSTANCE:
    checkInputLength(programIdParts,0);
  client.setInstancePreferences(args);
printSuccessMessage(printStream,type);
break;
case NAMESPACE:
checkInputLength(programIdParts,0);
client.setNamespacePreferences(cliConfig.getCurrentNamespace(),args);
printSuccessMessage(printStream,type);
break;
case APP:
client.setApplicationPreferences(parseAppId(programIdParts),args);
printSuccessMessage(printStream,type);
break;
case FLOW:
case MAPREDUCE:
case WORKFLOW:
case SERVICE:
case SPARK:
client.setProgramPreferences(parseProgramId(programIdParts,type.getProgramType()),args);
printSuccessMessage(printStream,type);
break;
default :
throw new IllegalArgumentException("String_Node_Str" + type.getShortName());
}
}
Program: 5699
Project: 5699
Buggy source:
@Override public void perform(Arguments arguments,PrintStream output) throws Exception {
  String datasetType=arguments.get(ArgumentName.DATASET_TYPE.toString());
  String datasetName=arguments.get(ArgumentName.NEW_DATASET.toString());
  String datasetPropertiesString=arguments.getOptional(ArgumentName.DATASET_PROPERTIES.toString(),"String_Node_Str");
  String datasetDescription=arguments.getOptional(ArgumentName.DATASET_DESCRIPTON.toString(),null);
  Map<String,String> datasetProperties=ArgumentParser.parseMap(datasetPropertiesString);
  DatasetInstanceConfiguration datasetConfig=new DatasetInstanceConfiguration(datasetType,datasetProperties,datasetDescription);
  datasetClient.create(cliConfig.getCurrentNamespace().dataset(datasetName).toId(),datasetConfig);
  output.printf("String_Node_Str",datasetName,datasetType,GSON.toJson(datasetProperties));
  output.println();
}

Fixed version (ground truth):
@Override public void perform(Arguments arguments,PrintStream output) throws Exception {
  String datasetType=arguments.get(ArgumentName.DATASET_TYPE.toString());
  String datasetName=arguments.get(ArgumentName.NEW_DATASET.toString());
  String datasetPropertiesString=arguments.getOptional(ArgumentName.DATASET_PROPERTIES.toString(),"String_Node_Str");
  String datasetDescription=arguments.getOptional(ArgumentName.DATASET_DESCRIPTON.toString(),null);
  Map<String,String> datasetProperties=ArgumentParser.parseMap(datasetPropertiesString);
  DatasetInstanceConfiguration datasetConfig=new DatasetInstanceConfiguration(datasetType,datasetProperties,datasetDescription);
  datasetClient.create(cliConfig.getCurrentNamespace().dataset(datasetName),datasetConfig);
  output.printf("String_Node_Str",datasetName,datasetType,GSON.toJson(datasetProperties));
  output.println();
}
Program: 5700
Project: 5700
Buggy source:
@Override public void perform(Arguments arguments,PrintStream output) throws Exception {
  String streamId=arguments.get(ArgumentName.NEW_STREAM.toString());
  StreamProperties streamProperties=null;
  if (arguments.hasArgument(ArgumentName.LOCAL_FILE_PATH.toString())) {
    File file=new File(arguments.get(ArgumentName.LOCAL_FILE_PATH.toString()));
    try (Reader reader=Files.newReader(file,Charsets.UTF_8)){
      streamProperties=GSON.fromJson(reader,StreamProperties.class);
    }
 catch (    FileNotFoundException e) {
      throw new IllegalArgumentException("String_Node_Str" + file);
    }
catch (    Exception e) {
      throw new IllegalArgumentException("String_Node_Str",e);
    }
  }
  streamClient.create(cliConfig.getCurrentNamespace().stream(streamId).toId(),streamProperties);
  output.printf("String_Node_Str",streamId);
}

Fixed version (ground truth):
@Override public void perform(Arguments arguments,PrintStream output) throws Exception {
  String streamId=arguments.get(ArgumentName.NEW_STREAM.toString());
  StreamProperties streamProperties=null;
  if (arguments.hasArgument(ArgumentName.LOCAL_FILE_PATH.toString())) {
    File file=new File(arguments.get(ArgumentName.LOCAL_FILE_PATH.toString()));
    try (Reader reader=Files.newReader(file,Charsets.UTF_8)){
      streamProperties=GSON.fromJson(reader,StreamProperties.class);
    }
 catch (    FileNotFoundException e) {
      throw new IllegalArgumentException("String_Node_Str" + file);
    }
catch (    Exception e) {
      throw new IllegalArgumentException("String_Node_Str",e);
    }
  }
  streamClient.create(cliConfig.getCurrentNamespace().stream(streamId),streamProperties);
  output.printf("String_Node_Str",streamId);
}
Program: 5701
Project: 5701
Buggy source:
@Override public void perform(Arguments arguments,PrintStream output) throws Exception {
  DatasetId dataset=cliConfig.getCurrentNamespace().dataset(arguments.get(ArgumentName.DATASET.toString()));
  datasetClient.delete(dataset.toId());
  output.printf("String_Node_Str",dataset.getEntityName());
}

Fixed version (ground truth):
@Override public void perform(Arguments arguments,PrintStream output) throws Exception {
  DatasetId dataset=cliConfig.getCurrentNamespace().dataset(arguments.get(ArgumentName.DATASET.toString()));
  datasetClient.delete(dataset);
  output.printf("String_Node_Str",dataset.getEntityName());
}
Program: 5702
Project: 5702
Buggy source:
@Override public void perform(Arguments arguments,PrintStream output) throws Exception {
  DatasetModuleId module=cliConfig.getCurrentNamespace().datasetModule(arguments.get(ArgumentName.DATASET_MODULE.toString()));
  datasetClient.delete(module.toId());
  output.printf("String_Node_Str",module.getEntityName());
}

Fixed version (ground truth):
@Override public void perform(Arguments arguments,PrintStream output) throws Exception {
  DatasetModuleId module=cliConfig.getCurrentNamespace().datasetModule(arguments.get(ArgumentName.DATASET_MODULE.toString()));
  datasetClient.delete(module);
  output.printf("String_Node_Str",module.getEntityName());
}
Program: 5703
Project: 5703
Buggy source:
@Override public void perform(Arguments arguments,PrintStream printStream) throws Exception {
  String[] programIdParts=new String[0];
  if (arguments.hasArgument(type.getArgumentName().toString())) {
    programIdParts=arguments.get(type.getArgumentName().toString()).split("String_Node_Str");
  }
switch (type) {
case INSTANCE:
    checkInputLength(programIdParts,0);
  client.deleteInstancePreferences();
printStream.printf(SUCCESS + "String_Node_Str",type.getName());
break;
case NAMESPACE:
checkInputLength(programIdParts,0);
client.deleteNamespacePreferences(cliConfig.getCurrentNamespace().toId());
printStream.printf(SUCCESS + "String_Node_Str",type.getName());
break;
case APP:
client.deleteApplicationPreferences(parseAppId(programIdParts).toId());
printStream.printf(SUCCESS + "String_Node_Str",type.getName());
break;
case FLOW:
case MAPREDUCE:
case WORKFLOW:
case SERVICE:
case SPARK:
checkInputLength(programIdParts,2);
client.deleteProgramPreferences(parseProgramId(programIdParts,type.getProgramType()).toId());
printStream.printf(SUCCESS + "String_Node_Str",type.getName());
break;
default :
throw new IllegalArgumentException("String_Node_Str" + type.getName());
}
}

Fixed version (ground truth):
@Override public void perform(Arguments arguments,PrintStream printStream) throws Exception {
  String[] programIdParts=new String[0];
  if (arguments.hasArgument(type.getArgumentName().toString())) {
    programIdParts=arguments.get(type.getArgumentName().toString()).split("String_Node_Str");
  }
switch (type) {
case INSTANCE:
    checkInputLength(programIdParts,0);
  client.deleteInstancePreferences();
printStream.printf(SUCCESS + "String_Node_Str",type.getName());
break;
case NAMESPACE:
checkInputLength(programIdParts,0);
client.deleteNamespacePreferences(cliConfig.getCurrentNamespace());
printStream.printf(SUCCESS + "String_Node_Str",type.getName());
break;
case APP:
client.deleteApplicationPreferences(parseAppId(programIdParts));
printStream.printf(SUCCESS + "String_Node_Str",type.getName());
break;
case FLOW:
case MAPREDUCE:
case WORKFLOW:
case SERVICE:
case SPARK:
checkInputLength(programIdParts,2);
client.deleteProgramPreferences(parseProgramId(programIdParts,type.getProgramType()));
printStream.printf(SUCCESS + "String_Node_Str",type.getName());
break;
default :
throw new IllegalArgumentException("String_Node_Str" + type.getName());
}
}
Program: 5704
Project: 5704
Buggy source:
@Override public void perform(Arguments arguments,PrintStream output) throws Exception {
  StreamId streamId=cliConfig.getCurrentNamespace().stream(arguments.get(ArgumentName.STREAM.toString()));
  streamClient.delete(streamId.toId());
  output.printf("String_Node_Str",streamId.getEntityName());
}

Fixed version (ground truth):
@Override public void perform(Arguments arguments,PrintStream output) throws Exception {
  StreamId streamId=cliConfig.getCurrentNamespace().stream(arguments.get(ArgumentName.STREAM.toString()));
  streamClient.delete(streamId);
  output.printf("String_Node_Str",streamId.getEntityName());
}
Program: 5705
Project: 5705
Buggy source:
@Override public void perform(Arguments arguments,PrintStream output) throws Exception {
  File moduleJarFile=resolver.resolvePathToFile(arguments.get(ArgumentName.DATASET_MODULE_JAR_FILE.toString()));
  Preconditions.checkArgument(moduleJarFile.exists(),"String_Node_Str" + moduleJarFile.getAbsolutePath() + "String_Node_Str");
  Preconditions.checkArgument(moduleJarFile.canRead());
  String moduleName=arguments.get(ArgumentName.NEW_DATASET_MODULE.toString());
  String moduleJarClassname=arguments.get(ArgumentName.DATASET_MODULE_JAR_CLASSNAME.toString());
  datasetModuleClient.add(cliConfig.getCurrentNamespace().datasetModule(moduleName).toId(),moduleJarClassname,moduleJarFile);
  output.printf("String_Node_Str",moduleName);
}

Fixed version (ground truth):
@Override public void perform(Arguments arguments,PrintStream output) throws Exception {
  File moduleJarFile=resolver.resolvePathToFile(arguments.get(ArgumentName.DATASET_MODULE_JAR_FILE.toString()));
  Preconditions.checkArgument(moduleJarFile.exists(),"String_Node_Str" + moduleJarFile.getAbsolutePath() + "String_Node_Str");
  Preconditions.checkArgument(moduleJarFile.canRead());
  String moduleName=arguments.get(ArgumentName.NEW_DATASET_MODULE.toString());
  String moduleJarClassname=arguments.get(ArgumentName.DATASET_MODULE_JAR_CLASSNAME.toString());
  datasetModuleClient.add(cliConfig.getCurrentNamespace().datasetModule(moduleName),moduleJarClassname,moduleJarFile);
  output.printf("String_Node_Str",moduleName);
}
Program: 5706
Project: 5706
Buggy source:
@Override public void perform(Arguments arguments,PrintStream output) throws Exception {
  DatasetId instance=cliConfig.getCurrentNamespace().dataset(arguments.get(ArgumentName.DATASET.toString()));
  DatasetMeta meta=datasetClient.get(instance.toId());
  Table table=Table.builder().setHeader("String_Node_Str","String_Node_Str","String_Node_Str").setRows(ImmutableList.of(meta),new RowMaker<DatasetMeta>(){
    @Override public List<?> makeRow(    DatasetMeta object){
      return Lists.newArrayList(object.getHiveTableName(),GSON.toJson(object.getSpec()),GSON.toJson(object.getType()));
    }
  }
).build();
  cliConfig.getTableRenderer().render(cliConfig,output,table);
}

Fixed version (ground truth):
@Override public void perform(Arguments arguments,PrintStream output) throws Exception {
  DatasetId instance=cliConfig.getCurrentNamespace().dataset(arguments.get(ArgumentName.DATASET.toString()));
  DatasetMeta meta=datasetClient.get(instance);
  Table table=Table.builder().setHeader("String_Node_Str","String_Node_Str","String_Node_Str").setRows(ImmutableList.of(meta),new RowMaker<DatasetMeta>(){
    @Override public List<?> makeRow(    DatasetMeta object){
      return Lists.newArrayList(object.getHiveTableName(),GSON.toJson(object.getSpec()),GSON.toJson(object.getType()));
    }
  }
).build();
  cliConfig.getTableRenderer().render(cliConfig,output,table);
}
Program: 5707
Project: 5707
Buggy source:
@Override public void perform(Arguments arguments,PrintStream output) throws Exception {
  DatasetModuleId moduleId=cliConfig.getCurrentNamespace().datasetModule(arguments.get(ArgumentName.DATASET_MODULE.toString()));
  DatasetModuleMeta datasetModuleMeta=datasetModuleClient.get(moduleId.toId());
  Table table=Table.builder().setHeader("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str").setRows(ImmutableList.of(datasetModuleMeta),new RowMaker<DatasetModuleMeta>(){
    @Override public List<?> makeRow(    DatasetModuleMeta object){
      return Lists.newArrayList(object.getName(),object.getClassName(),object.getJarLocation(),Joiner.on("String_Node_Str").join(object.getTypes()),Joiner.on("String_Node_Str").join(object.getUsesModules()),Joiner.on("String_Node_Str").join(object.getUsedByModules()));
    }
  }
).build();
  cliConfig.getTableRenderer().render(cliConfig,output,table);
}

Fixed version (ground truth):
@Override public void perform(Arguments arguments,PrintStream output) throws Exception {
  DatasetModuleId moduleId=cliConfig.getCurrentNamespace().datasetModule(arguments.get(ArgumentName.DATASET_MODULE.toString()));
  DatasetModuleMeta datasetModuleMeta=datasetModuleClient.get(moduleId);
  Table table=Table.builder().setHeader("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str").setRows(ImmutableList.of(datasetModuleMeta),new RowMaker<DatasetModuleMeta>(){
    @Override public List<?> makeRow(    DatasetModuleMeta object){
      return Lists.newArrayList(object.getName(),object.getClassName(),object.getJarLocation(),Joiner.on("String_Node_Str").join(object.getTypes()),Joiner.on("String_Node_Str").join(object.getUsesModules()),Joiner.on("String_Node_Str").join(object.getUsedByModules()));
    }
  }
).build();
  cliConfig.getTableRenderer().render(cliConfig,output,table);
}
Program: 5708
Project: 5708
Buggy source:
@Override public void perform(Arguments arguments,PrintStream output) throws Exception {
  DatasetTypeId type=cliConfig.getCurrentNamespace().datasetType(arguments.get(ArgumentName.DATASET_TYPE.toString()));
  DatasetTypeMeta datasetTypeMeta=datasetTypeClient.get(type.toId());
  Table table=Table.builder().setHeader("String_Node_Str","String_Node_Str").setRows(ImmutableList.of(datasetTypeMeta),new RowMaker<DatasetTypeMeta>(){
    @Override public List<?> makeRow(    DatasetTypeMeta object){
      return Lists.newArrayList(object.getName(),Joiner.on("String_Node_Str").join(object.getModules()));
    }
  }
).build();
  cliConfig.getTableRenderer().render(cliConfig,output,table);
}

Fixed version (ground truth):
@Override public void perform(Arguments arguments,PrintStream output) throws Exception {
  DatasetTypeId type=cliConfig.getCurrentNamespace().datasetType(arguments.get(ArgumentName.DATASET_TYPE.toString()));
  DatasetTypeMeta datasetTypeMeta=datasetTypeClient.get(type);
  Table table=Table.builder().setHeader("String_Node_Str","String_Node_Str").setRows(ImmutableList.of(datasetTypeMeta),new RowMaker<DatasetTypeMeta>(){
    @Override public List<?> makeRow(    DatasetTypeMeta object){
      return Lists.newArrayList(object.getName(),Joiner.on("String_Node_Str").join(object.getModules()));
    }
  }
).build();
  cliConfig.getTableRenderer().render(cliConfig,output,table);
}
Program: 5709
Project: 5709
Buggy source:
@Override public void perform(Arguments arguments,PrintStream output) throws Exception {
  StreamId streamId=cliConfig.getCurrentNamespace().stream(arguments.get(ArgumentName.STREAM.toString()));
  StreamProperties config=streamClient.getConfig(streamId.toId());
  Table table=Table.builder().setHeader("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str").setRows(ImmutableList.of(config),new RowMaker<StreamProperties>(){
    @Override public List<?> makeRow(    StreamProperties object){
      FormatSpecification format=object.getFormat();
      return Lists.newArrayList(object.getTTL(),format.getName(),format.getSchema().toString(),object.getNotificationThresholdMB(),object.getDescription());
    }
  }
).build();
  cliConfig.getTableRenderer().render(cliConfig,output,table);
}

Fixed version (ground truth):
@Override public void perform(Arguments arguments,PrintStream output) throws Exception {
  StreamId streamId=cliConfig.getCurrentNamespace().stream(arguments.get(ArgumentName.STREAM.toString()));
  StreamProperties config=streamClient.getConfig(streamId);
  Table table=Table.builder().setHeader("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str").setRows(ImmutableList.of(config),new RowMaker<StreamProperties>(){
    @Override public List<?> makeRow(    StreamProperties object){
      FormatSpecification format=object.getFormat();
      return Lists.newArrayList(object.getTTL(),format.getName(),format.getSchema().toString(),object.getNotificationThresholdMB(),object.getDescription());
    }
  }
).build();
  cliConfig.getTableRenderer().render(cliConfig,output,table);
}
Program: 5710
Project: 5710
Buggy source:
@Override public void perform(Arguments arguments,PrintStream output) throws Exception {
  DatasetId instance=cliConfig.getCurrentNamespace().dataset(arguments.get(ArgumentName.DATASET.toString()));
  Map<String,String> properties=datasetClient.getProperties(instance.toId());
  output.printf(GSON.toJson(properties));
}

Fixed version (ground truth):
@Override public void perform(Arguments arguments,PrintStream output) throws Exception {
  DatasetId instance=cliConfig.getCurrentNamespace().dataset(arguments.get(ArgumentName.DATASET.toString()));
  Map<String,String> properties=datasetClient.getProperties(instance);
  output.printf(GSON.toJson(properties));
}
Program: 5711
Project: 5711
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public void perform(Arguments arguments,PrintStream output) throws Exception {
  String[] programIdParts=arguments.get(elementType.getArgumentName().toString()).split("String_Node_Str");
  ApplicationId appId=cliConfig.getCurrentNamespace().app(programIdParts[0]);
  int instances;
switch (elementType) {
case FLOWLET:
    if (programIdParts.length < 3) {
      throw new CommandInputError(this);
    }
  String flowId=programIdParts[1];
String flowletName=programIdParts[2];
FlowletId flowlet=appId.flow(flowId).flowlet(flowletName);
instances=programClient.getFlowletInstances(flowlet.toId());
break;
case WORKER:
if (programIdParts.length < 2) {
throw new CommandInputError(this);
}
String workerId=programIdParts[1];
ProgramId worker=appId.worker(workerId);
instances=programClient.getWorkerInstances(Id.Worker.from(worker.getParent().toId(),workerId));
break;
case SERVICE:
if (programIdParts.length < 2) {
throw new CommandInputError(this);
}
String serviceName=programIdParts[1];
instances=programClient.getServiceInstances(appId.service(serviceName).toId());
break;
default :
throw new IllegalArgumentException("String_Node_Str" + elementType);
}
output.println(instances);
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public void perform(Arguments arguments,PrintStream output) throws Exception {
  String[] programIdParts=arguments.get(elementType.getArgumentName().toString()).split("String_Node_Str");
  ApplicationId appId=cliConfig.getCurrentNamespace().app(programIdParts[0]);
  int instances;
switch (elementType) {
case FLOWLET:
    if (programIdParts.length < 3) {
      throw new CommandInputError(this);
    }
  String flowId=programIdParts[1];
String flowletName=programIdParts[2];
FlowletId flowlet=appId.flow(flowId).flowlet(flowletName);
instances=programClient.getFlowletInstances(flowlet);
break;
case WORKER:
if (programIdParts.length < 2) {
throw new CommandInputError(this);
}
String workerId=programIdParts[1];
ProgramId worker=appId.worker(workerId);
instances=programClient.getWorkerInstances(worker);
break;
case SERVICE:
if (programIdParts.length < 2) {
throw new CommandInputError(this);
}
String serviceName=programIdParts[1];
instances=programClient.getServiceInstances(appId.service(serviceName));
break;
default :
throw new IllegalArgumentException("String_Node_Str" + elementType);
}
output.println(instances);
}
Program: 5718
Project: 5718
Buggy source:
/** 
 * Returns a Set of resources name that are visible through the cdap-api module as well as Hadoop classes. This includes all classes+resources in cdap-api plus all classes+resources that cdap-api depends on (for example, sl4j, guava, gson, etc).
 */
private static Set<String> createBaseResources() throws IOException {
  ClassLoader classLoader=ProgramResources.class.getClassLoader();
  Set<String> result=ClassPathResources.getResourcesWithDependencies(classLoader,Application.class);
  Iterables.addAll(result,Iterables.transform(ClassPathResources.getClassPathResources(classLoader,Path.class),ClassPathResources.RESOURCE_INFO_TO_RESOURCE_NAME));
  getResources(ClassPath.from(classLoader,JAR_ONLY_URI),HADOOP_PACKAGES,HBASE_PACKAGES,ClassPathResources.RESOURCE_INFO_TO_RESOURCE_NAME,result);
  return Collections.unmodifiableSet(result);
}

Fixed version (ground truth):
/** 
 * Returns a Set of resources name that are visible through the cdap-api module as well as Hadoop classes. This includes all classes+resources in cdap-api plus all classes+resources that cdap-api depends on (for example, sl4j, gson, etc).
 */
private static Set<String> createBaseResources() throws IOException {
  ClassLoader classLoader=ProgramResources.class.getClassLoader();
  Set<String> result=ClassPathResources.getResourcesWithDependencies(classLoader,Application.class);
  Iterables.addAll(result,Iterables.transform(ClassPathResources.getClassPathResources(classLoader,Path.class),ClassPathResources.RESOURCE_INFO_TO_RESOURCE_NAME));
  getResources(ClassPath.from(classLoader,JAR_ONLY_URI),HADOOP_PACKAGES,EXCLUDE_PACKAGES,ClassPathResources.RESOURCE_INFO_TO_RESOURCE_NAME,result);
  return Collections.unmodifiableSet(result);
}
Program: 5719
Project: 5719
Buggy source:
private Set<ArtifactRange> parseExtendsHeader(NamespaceId namespace,String extendsHeader) throws BadRequestException {
  Set<ArtifactRange> parentArtifacts=Sets.newHashSet();
  if (extendsHeader != null) {
    for (    String parent : Splitter.on('/').split(extendsHeader)) {
      parent=parent.trim();
      ArtifactRange range;
      try {
        range=ArtifactRange.parse(parent);
        if (!range.getNamespace().equals(Id.Namespace.SYSTEM) && !range.getNamespace().equals(namespace.toId())) {
          throw new BadRequestException(String.format("String_Node_Str",parent));
        }
      }
 catch (      InvalidArtifactRangeException e) {
        try {
          range=ArtifactRange.parse(namespace.toId(),parent);
        }
 catch (        InvalidArtifactRangeException e1) {
          throw new BadRequestException(String.format("String_Node_Str",parent,e1.getMessage()));
        }
      }
      parentArtifacts.add(range);
    }
  }
  return parentArtifacts;
}

Fixed version (ground truth):
private Set<ArtifactRange> parseExtendsHeader(NamespaceId namespace,String extendsHeader) throws BadRequestException {
  Set<ArtifactRange> parentArtifacts=Sets.newHashSet();
  if (extendsHeader != null) {
    for (    String parent : Splitter.on('/').split(extendsHeader)) {
      parent=parent.trim();
      ArtifactRange range;
      try {
        range=ArtifactRange.parse(parent);
        if (!NamespaceId.SYSTEM.equals(range.getNamespace()) && !namespace.equals(range.getNamespace())) {
          throw new BadRequestException(String.format("String_Node_Str",parent));
        }
      }
 catch (      InvalidArtifactRangeException e) {
        try {
          range=ArtifactRange.parse(namespace,parent);
        }
 catch (        InvalidArtifactRangeException e1) {
          throw new BadRequestException(String.format("String_Node_Str",parent,e1.getMessage()));
        }
      }
      parentArtifacts.add(range);
    }
  }
  return parentArtifacts;
}
Program: 5720
Project: 5720
Buggy source:
/** 
 * Get all artifacts that match artifacts in the given ranges.
 * @param range the range to match artifacts in
 * @return an unmodifiable list of all artifacts that match the given ranges. If none exist, an empty list is returned
 */
public List<ArtifactDetail> getArtifacts(final ArtifactRange range) throws Exception {
  List<ArtifactDetail> artifacts=artifactStore.getArtifacts(range);
  Principal principal=authenticationContext.getPrincipal();
  final Predicate<EntityId> filter=authorizationEnforcer.createFilter(principal);
  return Lists.newArrayList(Iterables.filter(artifacts,new com.google.common.base.Predicate<ArtifactDetail>(){
    @Override public boolean apply(    ArtifactDetail artifactDetail){
      ArtifactId artifactId=artifactDetail.getDescriptor().getArtifactId();
      return filter.apply(range.getNamespace().toEntityId().artifact(artifactId.getName(),artifactId.getVersion().getVersion()));
    }
  }
));
}

Fixed version (ground truth):
/** 
 * Get all artifacts that match artifacts in the given ranges.
 * @param range the range to match artifacts in
 * @return an unmodifiable list of all artifacts that match the given ranges. If none exist, an empty list is returned
 */
public List<ArtifactDetail> getArtifacts(final ArtifactRange range) throws Exception {
  List<ArtifactDetail> artifacts=artifactStore.getArtifacts(range);
  Principal principal=authenticationContext.getPrincipal();
  final Predicate<EntityId> filter=authorizationEnforcer.createFilter(principal);
  return Lists.newArrayList(Iterables.filter(artifacts,new com.google.common.base.Predicate<ArtifactDetail>(){
    @Override public boolean apply(    ArtifactDetail artifactDetail){
      ArtifactId artifactId=artifactDetail.getDescriptor().getArtifactId();
      return filter.apply(range.getNamespace().artifact(artifactId.getName(),artifactId.getVersion().getVersion()));
    }
  }
));
}
Program: 5721
Project: 5721
Buggy source:
/** 
 * Validates the parents of an artifact. Checks that each artifact only appears with a single version range.
 * @param parents the set of parent ranges to validate
 * @throws InvalidArtifactException if there is more than one version range for an artifact
 */
@VisibleForTesting static void validateParentSet(Id.Artifact artifactId,Set<ArtifactRange> parents) throws InvalidArtifactException {
  boolean isInvalid=false;
  StringBuilder errMsg=new StringBuilder("String_Node_Str");
  Set<String> parentNames=new HashSet<>();
  Set<String> dupes=new HashSet<>();
  for (  ArtifactRange parent : parents) {
    String parentName=parent.getName();
    if (!parentNames.add(parentName) && !dupes.contains(parentName)) {
      errMsg.append("String_Node_Str");
      errMsg.append(parentName);
      errMsg.append("String_Node_Str");
      dupes.add(parentName);
      isInvalid=true;
    }
    if (artifactId.getName().equals(parentName) && artifactId.getNamespace().equals(parent.getNamespace())) {
      throw new InvalidArtifactException(String.format("String_Node_Str",parent,artifactId));
    }
  }
  if (isInvalid) {
    throw new InvalidArtifactException(errMsg.toString());
  }
}

Fixed version (ground truth):
/** 
 * Validates the parents of an artifact. Checks that each artifact only appears with a single version range.
 * @param parents the set of parent ranges to validate
 * @throws InvalidArtifactException if there is more than one version range for an artifact
 */
@VisibleForTesting static void validateParentSet(Id.Artifact artifactId,Set<ArtifactRange> parents) throws InvalidArtifactException {
  boolean isInvalid=false;
  StringBuilder errMsg=new StringBuilder("String_Node_Str");
  Set<String> parentNames=new HashSet<>();
  Set<String> dupes=new HashSet<>();
  for (  ArtifactRange parent : parents) {
    String parentName=parent.getName();
    if (!parentNames.add(parentName) && !dupes.contains(parentName)) {
      errMsg.append("String_Node_Str");
      errMsg.append(parentName);
      errMsg.append("String_Node_Str");
      dupes.add(parentName);
      isInvalid=true;
    }
    if (artifactId.getName().equals(parentName) && artifactId.getNamespace().toEntityId().equals(parent.getNamespace())) {
      throw new InvalidArtifactException(String.format("String_Node_Str",parent,artifactId));
    }
  }
  if (isInvalid) {
    throw new InvalidArtifactException(errMsg.toString());
  }
}
Program: 5722
Project: 5722
Buggy source:
private void writeMeta(Table table,Id.Artifact artifactId,ArtifactData data) throws IOException {
  ArtifactCell artifactCell=new ArtifactCell(artifactId);
  table.put(artifactCell.rowkey,artifactCell.column,Bytes.toBytes(GSON.toJson(data)));
  byte[] artifactColumn=new ArtifactColumn(artifactId).getColumn();
  ArtifactClasses classes=data.meta.getClasses();
  Location artifactLocation=locationFactory.create(data.locationURI);
  for (  PluginClass pluginClass : classes.getPlugins()) {
    for (    ArtifactRange artifactRange : data.meta.getUsableBy()) {
      PluginKey pluginKey=new PluginKey(artifactRange.getNamespace(),artifactRange.getName(),pluginClass.getType(),pluginClass.getName());
      byte[] pluginDataBytes=Bytes.toBytes(GSON.toJson(new PluginData(pluginClass,artifactRange,artifactLocation)));
      table.put(pluginKey.getRowKey(),artifactColumn,pluginDataBytes);
    }
  }
  for (  ApplicationClass appClass : classes.getApps()) {
    AppClassKey appClassKey=new AppClassKey(artifactId.getNamespace().toEntityId(),appClass.getClassName());
    byte[] appDataBytes=Bytes.toBytes(GSON.toJson(new AppData(appClass,artifactLocation)));
    table.put(appClassKey.getRowKey(),artifactColumn,appDataBytes);
  }
}

Fixed version (ground truth):
private void writeMeta(Table table,Id.Artifact artifactId,ArtifactData data) throws IOException {
  ArtifactCell artifactCell=new ArtifactCell(artifactId);
  table.put(artifactCell.rowkey,artifactCell.column,Bytes.toBytes(GSON.toJson(data)));
  byte[] artifactColumn=new ArtifactColumn(artifactId).getColumn();
  ArtifactClasses classes=data.meta.getClasses();
  Location artifactLocation=locationFactory.create(data.locationURI);
  for (  PluginClass pluginClass : classes.getPlugins()) {
    for (    ArtifactRange artifactRange : data.meta.getUsableBy()) {
      PluginKey pluginKey=new PluginKey(artifactRange.getNamespace().toId(),artifactRange.getName(),pluginClass.getType(),pluginClass.getName());
      byte[] pluginDataBytes=Bytes.toBytes(GSON.toJson(new PluginData(pluginClass,artifactRange,artifactLocation)));
      table.put(pluginKey.getRowKey(),artifactColumn,pluginDataBytes);
    }
  }
  for (  ApplicationClass appClass : classes.getApps()) {
    AppClassKey appClassKey=new AppClassKey(artifactId.getNamespace().toEntityId(),appClass.getClassName());
    byte[] appDataBytes=Bytes.toBytes(GSON.toJson(new AppData(appClass,artifactLocation)));
    table.put(appClassKey.getRowKey(),artifactColumn,appDataBytes);
  }
}
Program: 5723
Project: 5723
Buggy source:
private void deleteMeta(Table table,Id.Artifact artifactId,byte[] oldData) throws IOException {
  ArtifactCell artifactCell=new ArtifactCell(artifactId);
  table.delete(artifactCell.rowkey,artifactCell.column);
  final ArtifactData oldMeta=GSON.fromJson(Bytes.toString(oldData),ArtifactData.class);
  byte[] artifactColumn=new ArtifactColumn(artifactId).getColumn();
  for (  PluginClass pluginClass : oldMeta.meta.getClasses().getPlugins()) {
    for (    ArtifactRange artifactRange : oldMeta.meta.getUsableBy()) {
      PluginKey pluginKey=new PluginKey(artifactRange.getNamespace(),artifactRange.getName(),pluginClass.getType(),pluginClass.getName());
      table.delete(pluginKey.getRowKey(),artifactColumn);
    }
  }
  for (  ApplicationClass appClass : oldMeta.meta.getClasses().getApps()) {
    AppClassKey appClassKey=new AppClassKey(artifactId.getNamespace().toEntityId(),appClass.getClassName());
    table.delete(appClassKey.getRowKey(),artifactColumn);
  }
  try {
    new NamespacedImpersonator(artifactId.getNamespace().toEntityId(),impersonator).impersonate(new Callable<Void>(){
      @Override public Void call() throws Exception {
        locationFactory.create(oldMeta.locationURI).delete();
        return null;
      }
    }
);
  }
 catch (  IOException ioe) {
    throw ioe;
  }
catch (  Exception e) {
    throw Throwables.propagate(e);
  }
}

Fixed version (ground truth):
private void deleteMeta(Table table,Id.Artifact artifactId,byte[] oldData) throws IOException {
  ArtifactCell artifactCell=new ArtifactCell(artifactId);
  table.delete(artifactCell.rowkey,artifactCell.column);
  final ArtifactData oldMeta=GSON.fromJson(Bytes.toString(oldData),ArtifactData.class);
  byte[] artifactColumn=new ArtifactColumn(artifactId).getColumn();
  for (  PluginClass pluginClass : oldMeta.meta.getClasses().getPlugins()) {
    for (    ArtifactRange artifactRange : oldMeta.meta.getUsableBy()) {
      PluginKey pluginKey=new PluginKey(artifactRange.getNamespace().toId(),artifactRange.getName(),pluginClass.getType(),pluginClass.getName());
      table.delete(pluginKey.getRowKey(),artifactColumn);
    }
  }
  for (  ApplicationClass appClass : oldMeta.meta.getClasses().getApps()) {
    AppClassKey appClassKey=new AppClassKey(artifactId.getNamespace().toEntityId(),appClass.getClassName());
    table.delete(appClassKey.getRowKey(),artifactColumn);
  }
  try {
    new NamespacedImpersonator(artifactId.getNamespace().toEntityId(),impersonator).impersonate(new Callable<Void>(){
      @Override public Void call() throws Exception {
        locationFactory.create(oldMeta.locationURI).delete();
        return null;
      }
    }
);
  }
 catch (  IOException ioe) {
    throw ioe;
  }
catch (  Exception e) {
    throw Throwables.propagate(e);
  }
}
Program: 5724
Project: 5724
Buggy source:
@Test public void testVersionParse() throws InvalidArtifactRangeException {
  ArtifactRange expected=new ArtifactRange(Id.Namespace.DEFAULT,"String_Node_Str",new ArtifactVersion("String_Node_Str"),true,new ArtifactVersion("String_Node_Str"),false);
  ArtifactRange actual=ArtifactRange.parse(Id.Namespace.DEFAULT,"String_Node_Str");
  Assert.assertEquals(expected,actual);
  expected=new ArtifactRange(Id.Namespace.DEFAULT,"String_Node_Str",new ArtifactVersion("String_Node_Str"),false,new ArtifactVersion("String_Node_Str"),true);
  actual=ArtifactRange.parse(Id.Namespace.DEFAULT,"String_Node_Str");
  Assert.assertEquals(expected,actual);
  Assert.assertEquals(expected,ArtifactRange.parse(expected.toString()));
}

Fixed version (ground truth):
@Test public void testVersionParse() throws InvalidArtifactRangeException {
  ArtifactRange expected=new ArtifactRange(NamespaceId.DEFAULT,"String_Node_Str",new ArtifactVersion("String_Node_Str"),true,new ArtifactVersion("String_Node_Str"),false);
  ArtifactRange actual=ArtifactRange.parse(NamespaceId.DEFAULT,"String_Node_Str");
  Assert.assertEquals(expected,actual);
  expected=new ArtifactRange(NamespaceId.DEFAULT,"String_Node_Str",new ArtifactVersion("String_Node_Str"),false,new ArtifactVersion("String_Node_Str"),true);
  actual=ArtifactRange.parse(NamespaceId.DEFAULT,"String_Node_Str");
  Assert.assertEquals(expected,actual);
  Assert.assertEquals(expected,ArtifactRange.parse(expected.toString()));
}
Program: 5725
Project: 5725
Buggy source:
@Test public void testLowerVersionGreaterThanUpper(){
  List<String> invalidRanges=Lists.newArrayList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  for (  String invalidRange : invalidRanges) {
    try {
      ArtifactRange.parse(Id.Namespace.DEFAULT,invalidRange);
      Assert.fail();
    }
 catch (    InvalidArtifactRangeException e) {
    }
    try {
      ArtifactRange.parse("String_Node_Str" + invalidRange);
      Assert.fail();
    }
 catch (    InvalidArtifactRangeException e) {
    }
  }
}

Fixed version (ground truth):
@Test public void testLowerVersionGreaterThanUpper(){
  List<String> invalidRanges=Lists.newArrayList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  for (  String invalidRange : invalidRanges) {
    try {
      ArtifactRange.parse(NamespaceId.DEFAULT,invalidRange);
      Assert.fail();
    }
 catch (    InvalidArtifactRangeException e) {
    }
    try {
      ArtifactRange.parse("String_Node_Str" + invalidRange);
      Assert.fail();
    }
 catch (    InvalidArtifactRangeException e) {
    }
  }
}
Program: 5726
Project: 5726
Buggy source:
@Test public void testParseInvalid(){
  List<String> invalidRanges=Lists.newArrayList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  for (  String invalidRange : invalidRanges) {
    try {
      ArtifactRange.parse(Id.Namespace.DEFAULT,invalidRange);
      Assert.fail();
    }
 catch (    InvalidArtifactRangeException e) {
    }
    try {
      ArtifactRange.parse("String_Node_Str" + invalidRange);
      Assert.fail();
    }
 catch (    InvalidArtifactRangeException e) {
    }
  }
}

Fixed version (ground truth):
@Test public void testParseInvalid(){
  List<String> invalidRanges=Lists.newArrayList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  for (  String invalidRange : invalidRanges) {
    try {
      ArtifactRange.parse(NamespaceId.DEFAULT,invalidRange);
      Assert.fail();
    }
 catch (    InvalidArtifactRangeException e) {
    }
    try {
      ArtifactRange.parse("String_Node_Str" + invalidRange);
      Assert.fail();
    }
 catch (    InvalidArtifactRangeException e) {
    }
  }
}