nus-yam/ex-repair huggingface dataset:
Program: 5478
Project: 5478
Buggy source:
@DELETE @Path("String_Node_Str") public synchronized void deleteQueues(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId){
  NamespaceId namespace=new NamespaceId(namespaceId);
  try {
    List<ProgramRecord> flows=lifecycleService.list(new NamespaceId(namespaceId),ProgramType.FLOW);
    for (    ProgramRecord flow : flows) {
      String appId=flow.getApp();
      String flowId=flow.getName();
      ProgramId programId=new ProgramId(namespaceId,appId,ProgramType.FLOW,flowId);
      ProgramStatus status=lifecycleService.getProgramStatus(programId);
      if (ProgramStatus.STOPPED != status) {
        responder.sendString(HttpResponseStatus.FORBIDDEN,String.format("String_Node_Str" + "String_Node_Str",flowId,appId,namespaceId));
        return;
      }
    }
    queueAdmin.dropAllInNamespace(namespace);
    FlowUtils.deleteFlowPendingMetrics(metricStore,namespaceId,null,null);
    responder.sendStatus(HttpResponseStatus.OK);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str" + namespace,e);
    responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,e.getMessage());
  }
}

Fixed version (ground truth):
@DELETE @Path("String_Node_Str") public synchronized void deleteQueues(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId) throws NamespaceNotFoundException {
  NamespaceId namespace=validateAndGetNamespace(namespaceId);
  try {
    List<ProgramRecord> flows=lifecycleService.list(validateAndGetNamespace(namespaceId),ProgramType.FLOW);
    for (    ProgramRecord flow : flows) {
      String appId=flow.getApp();
      String flowId=flow.getName();
      ProgramId programId=new ProgramId(namespaceId,appId,ProgramType.FLOW,flowId);
      ProgramStatus status=lifecycleService.getProgramStatus(programId);
      if (ProgramStatus.STOPPED != status) {
        responder.sendString(HttpResponseStatus.FORBIDDEN,String.format("String_Node_Str" + "String_Node_Str",flowId,appId,namespaceId));
        return;
      }
    }
    queueAdmin.dropAllInNamespace(namespace);
    FlowUtils.deleteFlowPendingMetrics(metricStore,namespaceId,null,null);
    responder.sendStatus(HttpResponseStatus.OK);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str" + namespace,e);
    responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,e.getMessage());
  }
}
Program: 5479
Project: 5479
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) throws Exception {
  responder.sendJson(HttpResponseStatus.OK,lifecycleService.list(new NamespaceId(namespaceId),ProgramType.WORKFLOW));
}

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 {
  responder.sendJson(HttpResponseStatus.OK,lifecycleService.list(validateAndGetNamespace(namespaceId),ProgramType.WORKFLOW));
}
Program: 5480
Project: 5480
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(new NamespaceId(namespaceId).app(appId).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;
  }
}

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) throws Exception {
  try {
    int count=store.getWorkerInstances(validateAndGetNamespace(namespaceId).app(appId).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: 5481
Project: 5481
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) throws Exception {
  responder.sendJson(HttpResponseStatus.OK,lifecycleService.list(new NamespaceId(namespaceId),ProgramType.SPARK));
}

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 {
  responder.sendJson(HttpResponseStatus.OK,lifecycleService.list(validateAndGetNamespace(namespaceId),ProgramType.SPARK));
}
Program: 5482
Project: 5482
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) throws Exception {
  responder.sendJson(HttpResponseStatus.OK,lifecycleService.list(new NamespaceId(namespaceId),ProgramType.MAPREDUCE));
}

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 {
  responder.sendJson(HttpResponseStatus.OK,lifecycleService.list(validateAndGetNamespace(namespaceId),ProgramType.MAPREDUCE));
}
Program: 5483
Project: 5483
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) throws Exception {
  responder.sendJson(HttpResponseStatus.OK,lifecycleService.list(new NamespaceId(namespaceId),ProgramType.FLOW));
}

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 {
  responder.sendJson(HttpResponseStatus.OK,lifecycleService.list(validateAndGetNamespace(namespaceId),ProgramType.FLOW));
}
Program: 5484
Project: 5484
Buggy source:
@Inject WorkflowHttpHandler(Store store,WorkflowClient workflowClient,ProgramRuntimeService runtimeService,QueueAdmin queueAdmin,Scheduler scheduler,PreferencesStore preferencesStore,MRJobInfoFetcher mrJobInfoFetcher,ProgramLifecycleService lifecycleService,MetricStore metricStore,DatasetFramework datasetFramework,DiscoveryServiceClient discoveryServiceClient){
  super(store,runtimeService,discoveryServiceClient,lifecycleService,queueAdmin,preferencesStore,mrJobInfoFetcher,metricStore);
  this.workflowClient=workflowClient;
  this.datasetFramework=datasetFramework;
  this.scheduler=scheduler;
}

Fixed version (ground truth):
@Inject WorkflowHttpHandler(Store store,WorkflowClient workflowClient,ProgramRuntimeService runtimeService,QueueAdmin queueAdmin,Scheduler scheduler,PreferencesStore preferencesStore,MRJobInfoFetcher mrJobInfoFetcher,ProgramLifecycleService lifecycleService,MetricStore metricStore,NamespaceQueryAdmin namespaceQueryAdmin,DatasetFramework datasetFramework,DiscoveryServiceClient discoveryServiceClient){
  super(store,runtimeService,discoveryServiceClient,lifecycleService,queueAdmin,preferencesStore,mrJobInfoFetcher,metricStore,namespaceQueryAdmin);
  this.workflowClient=workflowClient;
  this.datasetFramework=datasetFramework;
  this.scheduler=scheduler;
}
Program: 5485
Project: 5485
Buggy source:
public Instances getWorkerInstances(String namespaceId,String appId,String workerId){
  MockResponder responder=new MockResponder();
  String uri=String.format("String_Node_Str",getNamespacePath(namespaceId),appId,workerId);
  HttpRequest request=new DefaultHttpRequest(HttpVersion.HTTP_1_1,HttpMethod.GET,uri);
  programLifecycleHttpHandler.getWorkerInstances(request,responder,namespaceId,appId,workerId);
  verifyResponse(HttpResponseStatus.OK,responder.getStatus(),"String_Node_Str");
  return responder.decodeResponseContent(Instances.class);
}

Fixed version (ground truth):
public Instances getWorkerInstances(String namespaceId,String appId,String workerId) throws Exception {
  MockResponder responder=new MockResponder();
  String uri=String.format("String_Node_Str",getNamespacePath(namespaceId),appId,workerId);
  HttpRequest request=new DefaultHttpRequest(HttpVersion.HTTP_1_1,HttpMethod.GET,uri);
  programLifecycleHttpHandler.getWorkerInstances(request,responder,namespaceId,appId,workerId);
  verifyResponse(HttpResponseStatus.OK,responder.getStatus(),"String_Node_Str");
  return responder.decodeResponseContent(Instances.class);
}
Program: 5486
Project: 5486
Buggy source:
@Override public int getInstances(){
  return appFabricClient.getWorkerInstances(programId.getNamespace(),programId.getApplication(),programId.getProgram()).getInstances();
}

Fixed version (ground truth):
@Override public int getInstances(){
  try {
    return appFabricClient.getWorkerInstances(programId.getNamespace(),programId.getApplication(),programId.getProgram()).getInstances();
  }
 catch (  Exception e) {
    throw Throwables.propagate(e);
  }
}
Program: 5488
Project: 5488
Buggy source:
@Test public void testHBaseVersionToCompatMapping() throws ParseException {
  assertCompatModuleMapping(HBaseVersion.Version.HBASE_96,"String_Node_Str");
  assertCompatModuleMapping(HBaseVersion.Version.HBASE_98,"String_Node_Str");
  assertCompatModuleMapping(HBaseVersion.Version.HBASE_98,"String_Node_Str");
  assertCompatModuleMapping(HBaseVersion.Version.HBASE_10,"String_Node_Str");
  assertCompatModuleMapping(HBaseVersion.Version.HBASE_10_CDH,"String_Node_Str");
  assertCompatModuleMapping(HBaseVersion.Version.HBASE_10_CDH55,"String_Node_Str");
  assertCompatModuleMapping(HBaseVersion.Version.HBASE_10_CDH56,"String_Node_Str");
  assertCompatModuleMapping(HBaseVersion.Version.HBASE_11,"String_Node_Str");
  assertCompatModuleMapping(HBaseVersion.Version.HBASE_11,"String_Node_Str");
  assertCompatModuleMapping(HBaseVersion.Version.HBASE_12_CDH57,"String_Node_Str");
  assertCompatModuleMapping(HBaseVersion.Version.HBASE_12_CDH57,"String_Node_Str");
  assertCompatModuleMapping(HBaseVersion.Version.HBASE_12_CDH57,"String_Node_Str");
  assertCompatModuleMapping(HBaseVersion.Version.HBASE_12_CDH57,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testHBaseVersionToCompatMapping() throws ParseException {
  assertCompatModuleMapping(HBaseVersion.Version.HBASE_96,"String_Node_Str");
  assertCompatModuleMapping(HBaseVersion.Version.HBASE_98,"String_Node_Str");
  assertCompatModuleMapping(HBaseVersion.Version.HBASE_98,"String_Node_Str");
  assertCompatModuleMapping(HBaseVersion.Version.HBASE_10,"String_Node_Str");
  assertCompatModuleMapping(HBaseVersion.Version.HBASE_10_CDH,"String_Node_Str");
  assertCompatModuleMapping(HBaseVersion.Version.HBASE_10_CDH55,"String_Node_Str");
  assertCompatModuleMapping(HBaseVersion.Version.HBASE_10_CDH56,"String_Node_Str");
  assertCompatModuleMapping(HBaseVersion.Version.HBASE_11,"String_Node_Str");
  assertCompatModuleMapping(HBaseVersion.Version.HBASE_11,"String_Node_Str");
  assertCompatModuleMapping(HBaseVersion.Version.HBASE_12_CDH57,"String_Node_Str");
  assertCompatModuleMapping(HBaseVersion.Version.HBASE_12_CDH57,"String_Node_Str");
  assertCompatModuleMapping(HBaseVersion.Version.HBASE_12_CDH57,"String_Node_Str");
  assertCompatModuleMapping(HBaseVersion.Version.HBASE_12_CDH57,"String_Node_Str");
  assertCompatModuleMapping(HBaseVersion.Version.HBASE_12_CDH57,"String_Node_Str");
}
Program: 5489
Project: 5489
Buggy source:
@VisibleForTesting static Version determineVersionFromVersionString(String versionString) throws ParseException {
  if (versionString.startsWith(HBASE_94_VERSION)) {
    return Version.HBASE_94;
  }
 else   if (versionString.startsWith(HBASE_96_VERSION)) {
    return Version.HBASE_96;
  }
 else   if (versionString.startsWith(HBASE_98_VERSION)) {
    return Version.HBASE_98;
  }
 else   if (versionString.startsWith(HBASE_10_VERSION)) {
    VersionNumber ver=VersionNumber.create(versionString);
    if (ver.getClassifier() != null && ver.getClassifier().startsWith(CDH55_CLASSIFIER)) {
      return Version.HBASE_10_CDH55;
    }
 else     if (ver.getClassifier() != null && ver.getClassifier().startsWith(CDH56_CLASSIFIER)) {
      return Version.HBASE_10_CDH56;
    }
 else     if (ver.getClassifier() != null && ver.getClassifier().startsWith(CDH_CLASSIFIER)) {
      return Version.HBASE_10_CDH;
    }
 else {
      return Version.HBASE_10;
    }
  }
 else   if (versionString.startsWith(HBASE_11_VERSION)) {
    return Version.HBASE_11;
  }
 else   if (versionString.startsWith(HBASE_12_VERSION)) {
    VersionNumber ver=VersionNumber.create(versionString);
    if (ver.getClassifier() != null && (ver.getClassifier().startsWith(CDH57_CLASSIFIER) || ver.getClassifier().startsWith(CDH58_CLASSIFIER) || ver.getClassifier().startsWith(CDH59_CLASSIFIER))) {
      return Version.HBASE_12_CDH57;
    }
 else {
      return Version.HBASE_11;
    }
  }
 else {
    return Version.UNKNOWN;
  }
}

Fixed version (ground truth):
@VisibleForTesting static Version determineVersionFromVersionString(String versionString) throws ParseException {
  if (versionString.startsWith(HBASE_94_VERSION)) {
    return Version.HBASE_94;
  }
 else   if (versionString.startsWith(HBASE_96_VERSION)) {
    return Version.HBASE_96;
  }
 else   if (versionString.startsWith(HBASE_98_VERSION)) {
    return Version.HBASE_98;
  }
 else   if (versionString.startsWith(HBASE_10_VERSION)) {
    VersionNumber ver=VersionNumber.create(versionString);
    if (ver.getClassifier() != null && ver.getClassifier().startsWith(CDH55_CLASSIFIER)) {
      return Version.HBASE_10_CDH55;
    }
 else     if (ver.getClassifier() != null && ver.getClassifier().startsWith(CDH56_CLASSIFIER)) {
      return Version.HBASE_10_CDH56;
    }
 else     if (ver.getClassifier() != null && ver.getClassifier().startsWith(CDH_CLASSIFIER)) {
      return Version.HBASE_10_CDH;
    }
 else {
      return Version.HBASE_10;
    }
  }
 else   if (versionString.startsWith(HBASE_11_VERSION)) {
    return Version.HBASE_11;
  }
 else   if (versionString.startsWith(HBASE_12_VERSION)) {
    VersionNumber ver=VersionNumber.create(versionString);
    if (ver.getClassifier() != null && (ver.getClassifier().startsWith(CDH57_CLASSIFIER) || ver.getClassifier().startsWith(CDH58_CLASSIFIER) || ver.getClassifier().startsWith(CDH59_CLASSIFIER)|| ver.getClassifier().startsWith(CDH510_CLASSIFIER))) {
      return Version.HBASE_12_CDH57;
    }
 else {
      return Version.HBASE_11;
    }
  }
 else {
    return Version.UNKNOWN;
  }
}
Program: 5491
Project: 5491
Buggy source:
/** 
 * Given a locationPath which is derived from URI.getPath() and a locationFactory this method generates a Location with URI generated from the given Absolute path
 * @param locationFactory locationFactory to create Location from given Path
 * @param absolutePath Path to be used for Location
 * @return Location resulting from absolute locationPath
 */
public static Location getLocationFromAbsolutePath(LocationFactory locationFactory,String absolutePath){
  URI basePathURI=URI.create(locationFactory.create("String_Node_Str").toURI().getPath());
  URI locationURI=URI.create(absolutePath);
  URI relativePathURI=basePathURI.relativize(locationURI);
  return locationFactory.create(relativePathURI);
}

Fixed version (ground truth):
/** 
 * Get a Location using a specified location factory and absolute path
 * @param locationFactory locationFactory to create Location from given Path
 * @param absolutePath Path to be used for Location
 * @return Location resulting from absolute locationPath
 */
public static Location getLocationFromAbsolutePath(LocationFactory locationFactory,String absolutePath){
  URI homeURI=locationFactory.getHomeLocation().toURI();
  try {
    return locationFactory.create(new URI(homeURI.getScheme(),homeURI.getAuthority(),absolutePath,null,null));
  }
 catch (  URISyntaxException e) {
    throw Throwables.propagate(e);
  }
}
Program: 5492
Project: 5492
Buggy source:
/** 
 * Given a locationPath which is derived from URI.getPath() and a locationFactory this method generates a Location with URI generated from the given Absolute path
 * @param locationFactory locationFactory to create Location from given Path
 * @param absolutePath Path to be used for Location
 * @return Location resulting from absolute locationPath
 */
public static Location getLocationFromAbsolutePath(LocationFactory locationFactory,String absolutePath){
  URI basePathURI=URI.create(locationFactory.create("String_Node_Str").toURI().getPath());
  URI locationURI=URI.create(absolutePath);
  URI relativePathURI=basePathURI.relativize(locationURI);
  return locationFactory.create(relativePathURI);
}

Fixed version (ground truth):
/** 
 * Get a Location using a specified location factory and absolute path
 * @param locationFactory locationFactory to create Location from given Path
 * @param absolutePath Path to be used for Location
 * @return Location resulting from absolute locationPath
 */
public static Location getLocationFromAbsolutePath(LocationFactory locationFactory,String absolutePath){
  URI homeURI=locationFactory.getHomeLocation().toURI();
  try {
    return locationFactory.create(new URI(homeURI.getScheme(),homeURI.getAuthority(),absolutePath,null,null));
  }
 catch (  URISyntaxException e) {
    throw Throwables.propagate(e);
  }
}
Program: 5495
Project: 5495
Buggy source:
ArtifactData(Location location,ArtifactMeta meta){
  this.locationURI=null;
  this.locationPath=Locations.getRelativePath(location.getLocationFactory(),location.toURI());
  this.meta=meta;
}

Fixed version (ground truth):
ArtifactData(Location location,ArtifactMeta meta){
  this.locationURI=null;
  this.locationPath=location.toURI().getPath();
  this.meta=meta;
}
Program: 5497
Project: 5497
Buggy source:
AppData(ApplicationClass appClass,Location artifactLocation){
  this.appClass=appClass;
  this.artifactLocationURI=null;
  this.artifactLocationPath=Locations.getRelativePath(artifactLocation.getLocationFactory(),artifactLocation.toURI());
}

Fixed version (ground truth):
AppData(ApplicationClass appClass,Location artifactLocation){
  this.appClass=appClass;
  this.artifactLocationURI=null;
  this.artifactLocationPath=artifactLocation.toURI().getPath();
}
Program: 5499
Project: 5499
Buggy source:
private void addArtifactsToList(List<ArtifactDetail> artifactDetails,Row row) throws IOException {
  ArtifactKey artifactKey=ArtifactKey.parse(row.getRow());
  for (  Map.Entry<byte[],byte[]> columnVal : row.getColumns().entrySet()) {
    String version=Bytes.toString(columnVal.getKey());
    ArtifactData data=GSON.fromJson(Bytes.toString(columnVal.getValue()),ArtifactData.class);
    Id.Artifact artifactId=Id.Artifact.from(artifactKey.namespace.toId(),artifactKey.name,version);
    artifactDetails.add(new ArtifactDetail(new ArtifactDescriptor(artifactId.toArtifactId(),Locations.getCompatibleLocation(locationFactory,data.locationPath,data.locationURI)),data.meta));
  }
}

Fixed version (ground truth):
private void addArtifactsToList(List<ArtifactDetail> artifactDetails,Row row) throws IOException {
  ArtifactKey artifactKey=ArtifactKey.parse(row.getRow());
  for (  Map.Entry<byte[],byte[]> columnVal : row.getColumns().entrySet()) {
    String version=Bytes.toString(columnVal.getKey());
    ArtifactData data=GSON.fromJson(Bytes.toString(columnVal.getValue()),ArtifactData.class);
    Id.Artifact artifactId=Id.Artifact.from(artifactKey.namespace.toId(),artifactKey.name,version);
    artifactDetails.add(new ArtifactDetail(new ArtifactDescriptor(artifactId.toArtifactId(),Locations.getLocationFromAbsolutePath(locationFactory,data.getLocationPath())),data.meta));
  }
}
Program: 5500
Project: 5500
Buggy source:
PluginData(PluginClass pluginClass,ArtifactRange usableBy,Location artifactLocation){
  this.pluginClass=pluginClass;
  this.usableBy=usableBy;
  this.artifactLocationURI=null;
  this.artifactLocationPath=Locations.getRelativePath(artifactLocation.getLocationFactory(),artifactLocation.toURI());
}

Fixed version (ground truth):
PluginData(PluginClass pluginClass,ArtifactRange usableBy,Location artifactLocation){
  this.pluginClass=pluginClass;
  this.usableBy=usableBy;
  this.artifactLocationURI=null;
  this.artifactLocationPath=artifactLocation.toURI().getPath();
}
Program: 5502
Project: 5502
Buggy source:
/** 
 * Decode the PluginClass from the table column if it is from an artifact in the given namespace and extends the given parent artifact. If the plugin's artifact is not in the given namespace, or it does not extend the given parent artifact, return null.
 */
private ImmutablePair<ArtifactDescriptor,PluginClass> getPluginEntry(NamespaceId namespace,Id.Artifact parentArtifactId,Map.Entry<byte[],byte[]> column){
  ArtifactColumn artifactColumn=ArtifactColumn.parse(column.getKey());
  Id.Namespace artifactNamespace=artifactColumn.artifactId.getNamespace();
  if (!Id.Namespace.SYSTEM.equals(artifactNamespace) && !artifactNamespace.equals(namespace.toId())) {
    return null;
  }
  PluginData pluginData=GSON.fromJson(Bytes.toString(column.getValue()),PluginData.class);
  if (pluginData.usableBy.versionIsInRange(parentArtifactId.getVersion())) {
    ArtifactDescriptor artifactDescriptor=new ArtifactDescriptor(artifactColumn.artifactId.toArtifactId(),Locations.getCompatibleLocation(locationFactory,pluginData.artifactLocationPath,pluginData.artifactLocationURI));
    return ImmutablePair.of(artifactDescriptor,pluginData.pluginClass);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Decode the PluginClass from the table column if it is from an artifact in the given namespace and extends the given parent artifact. If the plugin's artifact is not in the given namespace, or it does not extend the given parent artifact, return null.
 */
private ImmutablePair<ArtifactDescriptor,PluginClass> getPluginEntry(NamespaceId namespace,Id.Artifact parentArtifactId,Map.Entry<byte[],byte[]> column){
  ArtifactColumn artifactColumn=ArtifactColumn.parse(column.getKey());
  Id.Namespace artifactNamespace=artifactColumn.artifactId.getNamespace();
  if (!Id.Namespace.SYSTEM.equals(artifactNamespace) && !artifactNamespace.equals(namespace.toId())) {
    return null;
  }
  PluginData pluginData=GSON.fromJson(Bytes.toString(column.getValue()),PluginData.class);
  if (pluginData.usableBy.versionIsInRange(parentArtifactId.getVersion())) {
    ArtifactDescriptor artifactDescriptor=new ArtifactDescriptor(artifactColumn.artifactId.toArtifactId(),Locations.getLocationFromAbsolutePath(locationFactory,pluginData.getArtifactLocationPath()));
    return ImmutablePair.of(artifactDescriptor,pluginData.pluginClass);
  }
  return null;
}
Program: 5503
Project: 5503
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=Locations.getCompatibleLocation(locationFactory,data.locationPath,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);
  }
}

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=Locations.getLocationFromAbsolutePath(locationFactory,data.getLocationPath());
  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: 5504
Project: 5504
Buggy source:
@Override public Void call() throws Exception {
  Locations.getCompatibleLocation(locationFactory,oldMeta.locationPath,oldMeta.locationURI).delete();
  return null;
}

Fixed version (ground truth):
@Override public Void call() throws Exception {
  Locations.getLocationFromAbsolutePath(locationFactory,oldMeta.getLocationPath()).delete();
  return null;
}
Program: 5505
Project: 5505
Buggy source:
private SortedMap<ArtifactDescriptor,Set<PluginClass>> getPluginsInArtifact(Table table,Id.Artifact artifactId,Predicate<PluginClass> filter){
  SortedMap<ArtifactDescriptor,Set<PluginClass>> result=new TreeMap<>();
  ArtifactCell parentCell=new ArtifactCell(artifactId);
  byte[] parentDataBytes=table.get(parentCell.rowkey,parentCell.column);
  if (parentDataBytes == null) {
    return null;
  }
  ArtifactData parentData=GSON.fromJson(Bytes.toString(parentDataBytes),ArtifactData.class);
  Set<PluginClass> parentPlugins=parentData.meta.getClasses().getPlugins();
  Set<PluginClass> filteredPlugins=Sets.newLinkedHashSet(Iterables.filter(parentPlugins,filter));
  if (!filteredPlugins.isEmpty()) {
    Location parentLocation=Locations.getCompatibleLocation(locationFactory,parentData.locationPath,parentData.locationURI);
    ArtifactDescriptor descriptor=new ArtifactDescriptor(artifactId.toArtifactId(),parentLocation);
    result.put(descriptor,filteredPlugins);
  }
  return result;
}

Fixed version (ground truth):
private SortedMap<ArtifactDescriptor,Set<PluginClass>> getPluginsInArtifact(Table table,Id.Artifact artifactId,Predicate<PluginClass> filter){
  SortedMap<ArtifactDescriptor,Set<PluginClass>> result=new TreeMap<>();
  ArtifactCell parentCell=new ArtifactCell(artifactId);
  byte[] parentDataBytes=table.get(parentCell.rowkey,parentCell.column);
  if (parentDataBytes == null) {
    return null;
  }
  ArtifactData parentData=GSON.fromJson(Bytes.toString(parentDataBytes),ArtifactData.class);
  Set<PluginClass> parentPlugins=parentData.meta.getClasses().getPlugins();
  Set<PluginClass> filteredPlugins=Sets.newLinkedHashSet(Iterables.filter(parentPlugins,filter));
  if (!filteredPlugins.isEmpty()) {
    Location parentLocation=Locations.getLocationFromAbsolutePath(locationFactory,parentData.getLocationPath());
    ArtifactDescriptor descriptor=new ArtifactDescriptor(artifactId.toArtifactId(),parentLocation);
    result.put(descriptor,filteredPlugins);
  }
  return result;
}
Program: 5506
Project: 5506
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().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 {
        Locations.getCompatibleLocation(locationFactory,oldMeta.locationPath,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 {
        Locations.getLocationFromAbsolutePath(locationFactory,oldMeta.getLocationPath()).delete();
        return null;
      }
    }
);
  }
 catch (  IOException ioe) {
    throw ioe;
  }
catch (  Exception e) {
    throw Throwables.propagate(e);
  }
}
Program: 5508
Project: 5508
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);
  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.getJarLocationPath(),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: 5509
Project: 5509
Buggy source:
@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()));
}

Fixed version (ground truth):
@Override public List<?> makeRow(DatasetModuleMeta object){
  return Lists.newArrayList(object.getName(),object.getClassName(),object.getJarLocationPath(),Joiner.on("String_Node_Str").join(object.getTypes()),Joiner.on("String_Node_Str").join(object.getUsesModules()),Joiner.on("String_Node_Str").join(object.getUsedByModules()));
}
Program: 5510
Project: 5510
Buggy source:
@Override public void apply() throws Exception {
  Collection<DatasetModuleMeta> allDatasets=datasetTypeMDS.getModules(NamespaceId.SYSTEM);
  for (  DatasetModuleMeta ds : allDatasets) {
    if (ds.getJarLocation() == null) {
      LOG.debug("String_Node_Str",ds.toString());
      DatasetModuleId moduleId=NamespaceId.SYSTEM.datasetModule(ds.getName());
      datasetTypeMDS.deleteModule(moduleId);
      revokeAllPrivilegesOnModule(moduleId,ds);
    }
  }
}

Fixed version (ground truth):
@Override public void apply() throws Exception {
  Collection<DatasetModuleMeta> allDatasets=datasetTypeMDS.getModules(NamespaceId.SYSTEM);
  for (  DatasetModuleMeta ds : allDatasets) {
    if (ds.getJarLocationPath() == null) {
      LOG.debug("String_Node_Str",ds.toString());
      DatasetModuleId moduleId=NamespaceId.SYSTEM.datasetModule(ds.getName());
      datasetTypeMDS.deleteModule(moduleId);
      revokeAllPrivilegesOnModule(moduleId,ds);
    }
  }
}
Program: 5511
Project: 5511
Buggy source:
private void deleteSystemModules() throws InterruptedException, TransactionFailureException {
  final DatasetTypeMDS datasetTypeMDS=datasetCache.getDataset(DatasetMetaTableUtil.META_TABLE_NAME);
  txExecutorFactory.createExecutor(datasetCache).execute(new TransactionExecutor.Subroutine(){
    @Override public void apply() throws Exception {
      Collection<DatasetModuleMeta> allDatasets=datasetTypeMDS.getModules(NamespaceId.SYSTEM);
      for (      DatasetModuleMeta ds : allDatasets) {
        if (ds.getJarLocation() == null) {
          LOG.debug("String_Node_Str",ds.toString());
          DatasetModuleId moduleId=NamespaceId.SYSTEM.datasetModule(ds.getName());
          datasetTypeMDS.deleteModule(moduleId);
          revokeAllPrivilegesOnModule(moduleId,ds);
        }
      }
    }
  }
);
}

Fixed version (ground truth):
private void deleteSystemModules() throws InterruptedException, TransactionFailureException {
  final DatasetTypeMDS datasetTypeMDS=datasetCache.getDataset(DatasetMetaTableUtil.META_TABLE_NAME);
  txExecutorFactory.createExecutor(datasetCache).execute(new TransactionExecutor.Subroutine(){
    @Override public void apply() throws Exception {
      Collection<DatasetModuleMeta> allDatasets=datasetTypeMDS.getModules(NamespaceId.SYSTEM);
      for (      DatasetModuleMeta ds : allDatasets) {
        if (ds.getJarLocationPath() == null) {
          LOG.debug("String_Node_Str",ds.toString());
          DatasetModuleId moduleId=NamespaceId.SYSTEM.datasetModule(ds.getName());
          datasetTypeMDS.deleteModule(moduleId);
          revokeAllPrivilegesOnModule(moduleId,ds);
        }
      }
    }
  }
);
}
Program: 5512
Project: 5512
Buggy source:
@Override public void apply() throws DatasetModuleConflictException, IOException {
  final Set<String> typesToDelete=new HashSet<String>();
  final List<Location> moduleLocations=new ArrayList<>();
  final Collection<DatasetModuleMeta> modules=datasetTypeMDS.getModules(namespaceId);
  try {
    impersonator.doAs(namespaceId,new Callable<Void>(){
      @Override public Void call() throws Exception {
        for (        DatasetModuleMeta module : modules) {
          typesToDelete.addAll(module.getTypes());
          moduleLocations.add(locationFactory.create(module.getJarLocation()));
        }
        return null;
      }
    }
);
  }
 catch (  Exception e) {
    Throwables.propagate(e);
  }
  Collection<DatasetSpecification> instances=datasetInstanceMDS.getByTypes(namespaceId,typesToDelete);
  if (!instances.isEmpty()) {
    throw new DatasetModuleConflictException("String_Node_Str");
  }
  datasetTypeMDS.deleteModules(namespaceId);
  for (  Location moduleLocation : moduleLocations) {
    if (!moduleLocation.delete()) {
      LOG.debug("String_Node_Str",moduleLocation);
    }
  }
}

Fixed version (ground truth):
@Override public void apply() throws DatasetModuleConflictException, IOException {
  final Set<String> typesToDelete=new HashSet<String>();
  final List<Location> moduleLocations=new ArrayList<>();
  final Collection<DatasetModuleMeta> modules=datasetTypeMDS.getModules(namespaceId);
  try {
    impersonator.doAs(namespaceId,new Callable<Void>(){
      @Override public Void call() throws Exception {
        for (        DatasetModuleMeta module : modules) {
          typesToDelete.addAll(module.getTypes());
          moduleLocations.add(Locations.getLocationFromAbsolutePath(locationFactory,module.getJarLocationPath()));
        }
        return null;
      }
    }
);
  }
 catch (  Exception e) {
    Throwables.propagate(e);
  }
  Collection<DatasetSpecification> instances=datasetInstanceMDS.getByTypes(namespaceId,typesToDelete);
  if (!instances.isEmpty()) {
    throw new DatasetModuleConflictException("String_Node_Str");
  }
  datasetTypeMDS.deleteModules(namespaceId);
  for (  Location moduleLocation : moduleLocations) {
    if (!moduleLocation.delete()) {
      LOG.debug("String_Node_Str",moduleLocation);
    }
  }
}
Program: 5514
Project: 5514
Buggy source:
@Override public Void call() throws Exception {
  for (  DatasetModuleMeta module : modules) {
    typesToDelete.addAll(module.getTypes());
    moduleLocations.add(locationFactory.create(module.getJarLocation()));
  }
  return null;
}

Fixed version (ground truth):
@Override public Void call() throws Exception {
  for (  DatasetModuleMeta module : modules) {
    typesToDelete.addAll(module.getTypes());
    moduleLocations.add(Locations.getLocationFromAbsolutePath(locationFactory,module.getJarLocationPath()));
  }
  return null;
}
Program: 5516
Project: 5516
Buggy source:
@Override public ClassLoader load(CacheKey key) throws Exception {
  if (key.uri == null) {
    return key.parentClassLoader;
  }
  Location jarLocation=locationFactory.create(key.uri);
  File unpackedDir=DirUtils.createTempDir(tmpDir);
  BundleJarUtil.unJar(jarLocation,unpackedDir);
  LOG.trace("String_Node_Str",key.uri.toString(),unpackedDir.getAbsolutePath());
  return new DirectoryClassLoader(unpackedDir,key.parentClassLoader,"String_Node_Str");
}

Fixed version (ground truth):
@Override public ClassLoader load(CacheKey key) throws Exception {
  if (key.uri == null) {
    return key.parentClassLoader;
  }
  Location jarLocation=Locations.getLocationFromAbsolutePath(locationFactory,key.uri.getPath());
  File unpackedDir=DirUtils.createTempDir(tmpDir);
  BundleJarUtil.unJar(jarLocation,unpackedDir);
  LOG.trace("String_Node_Str",key.uri.toString(),unpackedDir.getAbsolutePath());
  return new DirectoryClassLoader(unpackedDir,key.parentClassLoader,"String_Node_Str");
}
Program: 5517
Project: 5517
Buggy source:
@Override public ClassLoader get(DatasetModuleMeta moduleMeta,ClassLoader parentClassLoader) throws IOException {
  URI jarLocation=moduleMeta.getJarLocation();
  return jarLocation == null ? parentClassLoader : classLoaders.getUnchecked(new CacheKey(jarLocation,parentClassLoader));
}

Fixed version (ground truth):
@Override public ClassLoader get(DatasetModuleMeta moduleMeta,ClassLoader parentClassLoader) throws IOException {
  URI jarLocation=moduleMeta.getJarLocationPath() == null ? null : URI.create(moduleMeta.getJarLocationPath());
  return jarLocation == null ? parentClassLoader : classLoaders.getUnchecked(new CacheKey(jarLocation,parentClassLoader));
}
Program: 5518
Project: 5518
Buggy source:
static void verify(DatasetModuleMeta moduleMeta,String moduleName,Class moduleClass,List<String> types,List<String> usesModules,Collection<String> usedByModules){
  Assert.assertEquals(moduleName,moduleMeta.getName());
  Assert.assertEquals(moduleClass.getName(),moduleMeta.getClassName());
  Assert.assertArrayEquals(types.toArray(),moduleMeta.getTypes().toArray());
  Assert.assertArrayEquals(usesModules.toArray(),moduleMeta.getUsesModules().toArray());
  Assert.assertArrayEquals(Sets.newTreeSet(usedByModules).toArray(),Sets.newTreeSet(moduleMeta.getUsedByModules()).toArray());
  Assert.assertNotNull(moduleMeta.getJarLocation());
  Assert.assertTrue(new File(moduleMeta.getJarLocation()).exists());
}

Fixed version (ground truth):
static void verify(DatasetModuleMeta moduleMeta,String moduleName,Class moduleClass,List<String> types,List<String> usesModules,Collection<String> usedByModules){
  Assert.assertEquals(moduleName,moduleMeta.getName());
  Assert.assertEquals(moduleClass.getName(),moduleMeta.getClassName());
  Assert.assertArrayEquals(types.toArray(),moduleMeta.getTypes().toArray());
  Assert.assertArrayEquals(usesModules.toArray(),moduleMeta.getUsesModules().toArray());
  Assert.assertArrayEquals(Sets.newTreeSet(usedByModules).toArray(),Sets.newTreeSet(moduleMeta.getUsedByModules()).toArray());
  Assert.assertNotNull(moduleMeta.getJarLocationPath());
  Assert.assertTrue(new File(moduleMeta.getJarLocationPath()).exists());
}
Program: 5519
Project: 5519
Buggy source:
/** 
 * Creates instance of   {@link DatasetModuleMeta}
 * @param name name of the dataset module
 * @param className class name of the dataset module
 * @param jarLocation location of the dataset module jar. {@code null} means this is "system module" which classesalways present in classpath. This helps to minimize redundant copying of jars.
 * @param types list of types announced by this module in the order they are announced
 * @param usesModules list of modules that this module depends on, ordered in a way they must beloaded and initialized
 * @param usedByModules list of modules that depend on this module
 */
public DatasetModuleMeta(String name,String className,@Nullable URI jarLocation,Collection<String> types,Collection<String> usesModules,Collection<String> usedByModules){
  this.name=name;
  this.className=className;
  this.jarLocation=jarLocation;
  this.types=Collections.unmodifiableList(new ArrayList<>(types));
  this.usesModules=Collections.unmodifiableList(new ArrayList<>(usesModules));
  this.usedByModules=new ArrayList<>(usedByModules);
}

Fixed version (ground truth):
/** 
 * Creates instance of   {@link DatasetModuleMeta}
 * @param name name of the dataset module
 * @param className class name of the dataset module
 * @param jarLocation location of the dataset module jar. {@code null} means this is "system module" which classesalways present in classpath. This helps to minimize redundant copying of jars.
 * @param types list of types announced by this module in the order they are announced
 * @param usesModules list of modules that this module depends on, ordered in a way they must beloaded and initialized
 * @param usedByModules list of modules that depend on this module
 */
public DatasetModuleMeta(String name,String className,@Nullable URI jarLocation,Collection<String> types,Collection<String> usesModules,Collection<String> usedByModules){
  this.name=name;
  this.className=className;
  this.jarLocation=null;
  this.jarLocationPath=jarLocation == null ? null : jarLocation.getPath();
  this.types=Collections.unmodifiableList(new ArrayList<>(types));
  this.usesModules=Collections.unmodifiableList(new ArrayList<>(usesModules));
  this.usedByModules=new ArrayList<>(usedByModules);
}
Program: 5520
Project: 5520
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + name + '\''+ "String_Node_Str"+ className+ '\''+ "String_Node_Str"+ jarLocation+ "String_Node_Str"+ types+ "String_Node_Str"+ usesModules+ "String_Node_Str"+ usedByModules+ '}';
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + name + '\''+ "String_Node_Str"+ className+ '\''+ "String_Node_Str"+ jarLocation+ "String_Node_Str"+ jarLocationPath+ "String_Node_Str"+ types+ "String_Node_Str"+ usesModules+ "String_Node_Str"+ usedByModules+ '}';
}
Program: 5521
Project: 5521
Buggy source:
ArtifactData(Location location,ArtifactMeta meta){
  this.locationURI=null;
  this.locationPath=Locations.getRelativePath(location);
  this.meta=meta;
}

Fixed version (ground truth):
ArtifactData(Location location,ArtifactMeta meta){
  this.locationURI=null;
  this.locationPath=Locations.getRelativePath(location.getLocationFactory(),location.toURI());
  this.meta=meta;
}
Program: 5522
Project: 5522
Buggy source:
AppData(ApplicationClass appClass,Location artifactLocation){
  this.appClass=appClass;
  this.artifactLocationURI=null;
  this.artifactLocationPath=Locations.getRelativePath(artifactLocation);
}

Fixed version (ground truth):
AppData(ApplicationClass appClass,Location artifactLocation){
  this.appClass=appClass;
  this.artifactLocationURI=null;
  this.artifactLocationPath=Locations.getRelativePath(artifactLocation.getLocationFactory(),artifactLocation.toURI());
}
Program: 5523
Project: 5523
Buggy source:
PluginData(PluginClass pluginClass,ArtifactRange usableBy,Location artifactLocation){
  this.pluginClass=pluginClass;
  this.usableBy=usableBy;
  this.artifactLocationURI=null;
  this.artifactLocationPath=Locations.getRelativePath(artifactLocation);
}

Fixed version (ground truth):
PluginData(PluginClass pluginClass,ArtifactRange usableBy,Location artifactLocation){
  this.pluginClass=pluginClass;
  this.usableBy=usableBy;
  this.artifactLocationURI=null;
  this.artifactLocationPath=Locations.getRelativePath(artifactLocation.getLocationFactory(),artifactLocation.toURI());
}
Program: 5524
Project: 5524
Buggy source:
/** 
 * For backward compatibility with URIs, this method creates a location based on uri or path one of them should be non-null
 * @param locationFactory corresponding to the uri and path
 * @param path if path is available
 * @param uri if uri is available
 * @return
 */
public static Location getCompatibleLocation(LocationFactory locationFactory,@Nullable String path,@Nullable URI uri){
  Location artifactLocation=uri != null ? locationFactory.create(Locations.getRelativePath(locationFactory.create(uri))) : locationFactory.create(path);
  return artifactLocation;
}

Fixed version (ground truth):
/** 
 * For backward compatibility with URIs, this method creates a location based on uri or path one of them should be non-null
 * @param locationFactory corresponding to the uri and path
 * @param path if path is available
 * @param uri if uri is available
 * @return Backward compatible Location
 */
public static Location getCompatibleLocation(LocationFactory locationFactory,@Nullable String path,@Nullable URI uri){
  Location artifactLocation=uri != null ? locationFactory.create(Locations.getRelativePath(locationFactory,uri)) : locationFactory.create(path);
  return artifactLocation;
}