nus-yam/ex-repair huggingface dataset:
Program: 5525
Project: 5525
Buggy source:
/** 
 * Returns the relative path for a given location
 * @param location
 * @return
 */
public static String getRelativePath(Location location){
  URI baseURI=location.getLocationFactory().create("String_Node_Str").toURI();
  URI locationURI=location.toURI();
  URI relativeURI=baseURI.relativize(locationURI);
  return relativeURI.getPath();
}

Fixed version (ground truth):
/** 
 * Returns the relative path for a given locationURI. If locationURI was created with a different locationFactory the same locationURI may be returned.
 * @param locationFactory locationFactory to be used to create base URI
 * @param locationURI URI to be used for base URI
 * @return Path relative to the Base path of the given locationFactory
 */
public static String getRelativePath(LocationFactory locationFactory,URI locationURI){
  URI baseURI=URI.create(locationFactory.create("String_Node_Str").toURI().getPath());
  URI relativeURI=baseURI.relativize(URI.create(locationURI.getPath()));
  return relativeURI.getPath();
}
Program: 5527
Project: 5527
Buggy source:
@Override public Location call() throws Exception {
  return rootLocationFactory.create(new URI(Bytes.toString(entry.getValue())));
}

Fixed version (ground truth):
@Override public Location call() throws Exception {
  return getCompatibleLocationFromValue(entry.getValue());
}
Program: 5529
Project: 5529
Buggy source:
/** 
 * Persists meta data associated with a log file.
 * @param logPartition partition name that is used to group log messages
 * @param startTimeMs start log time associated with the file.
 * @param location log file.
 */
private void writeMetaData(final String logPartition,final long startTimeMs,final Location location) throws Exception {
  LOG.debug("String_Node_Str",logPartition,startTimeMs,location);
  execute(new TransactionExecutor.Procedure<Table>(){
    @Override public void apply(    Table table) throws Exception {
      table.put(getRowKey(logPartition),Bytes.toBytes(startTimeMs),Bytes.toBytes(location.toURI().toString()));
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Persists meta data associated with a log file.
 * @param logPartition partition name that is used to group log messages
 * @param startTimeMs start log time associated with the file.
 * @param location log file.
 */
private void writeMetaData(final String logPartition,final long startTimeMs,final Location location) throws Exception {
  LOG.debug("String_Node_Str",logPartition,startTimeMs,location);
  execute(new TransactionExecutor.Procedure<Table>(){
    @Override public void apply(    Table table) throws Exception {
      String locationPath=Locations.getRelativePath(rootLocationFactory,location.toURI());
      table.put(getRowKey(logPartition),Bytes.toBytes(startTimeMs),Bytes.toBytes(locationPath));
    }
  }
);
}
Program: 5530
Project: 5530
Buggy source:
ArtifactData(Location location,ArtifactMeta meta){
  this.locationURI=location.toURI();
  this.meta=meta;
}

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

Fixed version (ground truth):
AppData(ApplicationClass appClass,Location artifactLocation){
  this.appClass=appClass;
  this.artifactLocationURI=null;
  this.artifactLocationPath=Locations.getRelativePath(artifactLocation);
}
Program: 5534
Project: 5534
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(),locationFactory.create(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.getCompatibleLocation(locationFactory,data.locationPath,data.locationURI)),data.meta));
  }
}
Program: 5535
Project: 5535
Buggy source:
PluginData(PluginClass pluginClass,ArtifactRange usableBy,Location artifactLocation){
  this.pluginClass=pluginClass;
  this.usableBy=usableBy;
  this.artifactLocationURI=artifactLocation.toURI();
}

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);
}
Program: 5537
Project: 5537
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(),locationFactory.create(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.getCompatibleLocation(locationFactory,pluginData.artifactLocationPath,pluginData.artifactLocationURI));
    return ImmutablePair.of(artifactDescriptor,pluginData.pluginClass);
  }
  return null;
}
Program: 5538
Project: 5538
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().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.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);
  }
}
Program: 5539
Project: 5539
Buggy source:
@Override public Void call() throws Exception {
  locationFactory.create(oldMeta.locationURI).delete();
  return null;
}

Fixed version (ground truth):
@Override public Void call() throws Exception {
  Locations.getCompatibleLocation(locationFactory,oldMeta.locationPath,oldMeta.locationURI).delete();
  return null;
}
Program: 5540
Project: 5540
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=locationFactory.create(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.getCompatibleLocation(locationFactory,parentData.locationPath,parentData.locationURI);
    ArtifactDescriptor descriptor=new ArtifactDescriptor(artifactId.toArtifactId(),parentLocation);
    result.put(descriptor,filteredPlugins);
  }
  return result;
}
Program: 5541
Project: 5541
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 {
        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 {
        Locations.getCompatibleLocation(locationFactory,oldMeta.locationPath,oldMeta.locationURI).delete();
        return null;
      }
    }
);
  }
 catch (  IOException ioe) {
    throw ioe;
  }
catch (  Exception e) {
    throw Throwables.propagate(e);
  }
}
Program: 5543
Project: 5543
Buggy source:
/** 
 * Retrieve the   {@link UserGroupInformation} for the given {@link NamespaceId}
 * @param namespaceId namespace to lookup the user
 * @return {@link UserGroupInformation}
 * @throws IOException if there was any error fetching the {@link UserGroupInformation}
 */
UserGroupInformation getUGI(NamespaceId namespaceId) throws IOException ;

Fixed version (ground truth):
/** 
 * Retrieve the   {@link UserGroupInformation} for the given {@link NamespaceId}
 * @param namespaceId namespace to lookup the user
 * @return {@link UserGroupInformation}
 * @throws IOException if there was any error fetching the {@link UserGroupInformation}
 * @throws NamespaceNotFoundException if namespaceId does not exist
 */
UserGroupInformation getUGI(NamespaceId namespaceId) throws IOException, NamespaceNotFoundException ;
Program: 5544
Project: 5544
Buggy source:
@Override public StreamConfig getConfig(final StreamId streamId) throws IOException {
  UserGroupInformation ugi=impersonator.getUGI(streamId.getParent());
  try {
    return ImpersonationUtils.doAs(ugi,new Callable<StreamConfig>(){
      @Override public StreamConfig call() throws IOException {
        Location configLocation=getConfigLocation(streamId);
        if (!configLocation.exists()) {
          throw new FileNotFoundException(String.format("String_Node_Str",configLocation.toURI().getPath(),streamId));
        }
        StreamConfig config=GSON.fromJson(CharStreams.toString(CharStreams.newReaderSupplier(Locations.newInputSupplier(configLocation),Charsets.UTF_8)),StreamConfig.class);
        int threshold=config.getNotificationThresholdMB();
        if (threshold <= 0) {
          threshold=cConf.getInt(Constants.Stream.NOTIFICATION_THRESHOLD);
        }
        return new StreamConfig(streamId,config.getPartitionDuration(),config.getIndexInterval(),config.getTTL(),getStreamLocation(streamId),config.getFormat(),threshold);
      }
    }
);
  }
 catch (  Exception ex) {
    Throwables.propagateIfPossible(ex,IOException.class);
    throw new IOException(ex);
  }
}

Fixed version (ground truth):
@Override public StreamConfig getConfig(final StreamId streamId) throws IOException {
  try {
    UserGroupInformation ugi=impersonator.getUGI(streamId.getParent());
    return ImpersonationUtils.doAs(ugi,new Callable<StreamConfig>(){
      @Override public StreamConfig call() throws IOException {
        Location configLocation=getConfigLocation(streamId);
        if (!configLocation.exists()) {
          throw new FileNotFoundException(String.format("String_Node_Str",configLocation.toURI().getPath(),streamId));
        }
        StreamConfig config=GSON.fromJson(CharStreams.toString(CharStreams.newReaderSupplier(Locations.newInputSupplier(configLocation),Charsets.UTF_8)),StreamConfig.class);
        int threshold=config.getNotificationThresholdMB();
        if (threshold <= 0) {
          threshold=cConf.getInt(Constants.Stream.NOTIFICATION_THRESHOLD);
        }
        return new StreamConfig(streamId,config.getPartitionDuration(),config.getIndexInterval(),config.getTTL(),getStreamLocation(streamId),config.getFormat(),threshold);
      }
    }
);
  }
 catch (  Exception ex) {
    Throwables.propagateIfPossible(ex,IOException.class);
    throw new IOException(ex);
  }
}
Program: 5545
Project: 5545
Buggy source:
private void writeSystemMetadataForDatasets(NamespaceId namespace,DatasetFramework dsFramework) throws DatasetManagementException, IOException {
  SystemDatasetInstantiatorFactory systemDatasetInstantiatorFactory=new SystemDatasetInstantiatorFactory(locationFactory,dsFramework,cConf);
  try (SystemDatasetInstantiator systemDatasetInstantiator=systemDatasetInstantiatorFactory.create()){
    UserGroupInformation ugi=impersonator.getUGI(namespace);
    for (    DatasetSpecificationSummary summary : dsFramework.getInstances(namespace)) {
      final DatasetId dsInstance=namespace.dataset(summary.getName());
      DatasetProperties dsProperties=DatasetProperties.of(summary.getProperties());
      String dsType=summary.getType();
      Dataset dataset=null;
      try {
        try {
          dataset=ImpersonationUtils.doAs(ugi,new Callable<Dataset>(){
            @Override public Dataset call() throws Exception {
              return systemDatasetInstantiator.getDataset(dsInstance);
            }
          }
);
        }
 catch (        Exception e) {
          LOG.warn("String_Node_Str",dsInstance,e);
        }
        SystemMetadataWriter writer=new DatasetSystemMetadataWriter(metadataStore,dsInstance,dsProperties,dataset,dsType,summary.getDescription());
        writer.write();
      }
  finally {
        if (dataset != null) {
          dataset.close();
        }
      }
    }
  }
 }

Fixed version (ground truth):
private void writeSystemMetadataForDatasets(NamespaceId namespace,DatasetFramework dsFramework) throws DatasetManagementException, IOException, NamespaceNotFoundException {
  SystemDatasetInstantiatorFactory systemDatasetInstantiatorFactory=new SystemDatasetInstantiatorFactory(locationFactory,dsFramework,cConf);
  try (SystemDatasetInstantiator systemDatasetInstantiator=systemDatasetInstantiatorFactory.create()){
    UserGroupInformation ugi=impersonator.getUGI(namespace);
    for (    DatasetSpecificationSummary summary : dsFramework.getInstances(namespace)) {
      final DatasetId dsInstance=namespace.dataset(summary.getName());
      DatasetProperties dsProperties=DatasetProperties.of(summary.getProperties());
      String dsType=summary.getType();
      Dataset dataset=null;
      try {
        try {
          dataset=ImpersonationUtils.doAs(ugi,new Callable<Dataset>(){
            @Override public Dataset call() throws Exception {
              return systemDatasetInstantiator.getDataset(dsInstance);
            }
          }
);
        }
 catch (        Exception e) {
          LOG.warn("String_Node_Str",dsInstance,e);
        }
        SystemMetadataWriter writer=new DatasetSystemMetadataWriter(metadataStore,dsInstance,dsProperties,dataset,dsType,summary.getDescription());
        writer.write();
      }
  finally {
        if (dataset != null) {
          dataset.close();
        }
      }
    }
  }
 }
Program: 5550
Project: 5550
Buggy source:
public Boolean getStopGracefully(){
  return stopGracefully == null ? false : stopGracefully;
}

Fixed version (ground truth):
public Boolean getStopGracefully(){
  return stopGracefully == null ? true : stopGracefully;
}
Program: 5551
Project: 5551
Buggy source:
public Builder(){
  this.isUnitTest=true;
  this.batchInterval="String_Node_Str";
  this.stopGraceFully=false;
}

Fixed version (ground truth):
public Builder(){
  this.isUnitTest=true;
  this.batchInterval="String_Node_Str";
  this.stopGraceFully=true;
}
Program: 5552
Project: 5552
Buggy source:
@GET @Path("String_Node_Str") public void getProperty(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String artifactName,@PathParam("String_Node_Str") String artifactVersion,@PathParam("String_Node_Str") String key) throws Exception {
  NamespaceId namespace=NamespaceId.SYSTEM.getNamespace().equalsIgnoreCase(namespaceId) ? NamespaceId.SYSTEM : validateAndGetNamespace(namespaceId);
  Id.Artifact artifactId=validateAndGetArtifactId(namespace,artifactName,artifactVersion);
  try {
    ArtifactDetail detail=artifactRepository.getArtifact(artifactId);
    responder.sendString(HttpResponseStatus.OK,detail.getMeta().getProperties().get(key));
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",artifactId,e);
    responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,"String_Node_Str");
  }
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") public void getProperty(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String artifactName,@PathParam("String_Node_Str") String artifactVersion,@PathParam("String_Node_Str") String key,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") String scope) throws Exception {
  NamespaceId namespace=validateAndGetScopedNamespace(Ids.namespace(namespaceId),scope);
  Id.Artifact artifactId=validateAndGetArtifactId(namespace,artifactName,artifactVersion);
  try {
    ArtifactDetail detail=artifactRepository.getArtifact(artifactId);
    responder.sendString(HttpResponseStatus.OK,detail.getMeta().getProperties().get(key));
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",artifactId,e);
    responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,"String_Node_Str");
  }
}
Program: 5553
Project: 5553
Buggy source:
/** 
 * Delete the specified artifact. Programs that use the artifact will not be able to start.
 * @param artifactId the artifact to delete
 * @throws IOException if there was some IO error deleting the artifact
 * @throws UnauthorizedException if the current user is not authorized to delete the artifact. To delete an artifact,a user needs  {@link Action#ADMIN} permission on the artifact.
 */
public void deleteArtifact(Id.Artifact artifactId) throws Exception {
  Principal principal=authenticationContext.getPrincipal();
  authorizationEnforcer.enforce(artifactId.toEntityId(),principal,Action.ADMIN);
  artifactStore.delete(artifactId);
  metadataStore.removeMetadata(artifactId.toEntityId());
  privilegesManager.revoke(artifactId.toEntityId());
}

Fixed version (ground truth):
/** 
 * Delete the specified artifact. Programs that use the artifact will not be able to start.
 * @param artifactId the artifact to delete
 * @throws IOException if there was some IO error deleting the artifact
 * @throws ArtifactNotFoundException if the given artifact does not exist
 * @throws UnauthorizedException if the current user is not authorized to delete the artifact. To delete an artifact,a user needs  {@link Action#ADMIN} permission on the artifact.
 */
public void deleteArtifact(Id.Artifact artifactId) throws Exception {
  Principal principal=authenticationContext.getPrincipal();
  authorizationEnforcer.enforce(artifactId.toEntityId(),principal,Action.ADMIN);
  artifactStore.delete(artifactId);
  metadataStore.removeMetadata(artifactId.toEntityId());
  privilegesManager.revoke(artifactId.toEntityId());
}
Program: 5554
Project: 5554
Buggy source:
/** 
 * Delete the specified artifact. Programs that use the artifact will no longer be able to start.
 * @param artifactId the id of the artifact to delete
 * @throws IOException if there was an IO error deleting the metadata or the actual artifact
 */
public void delete(final Id.Artifact artifactId) throws IOException {
  try {
    transactional.execute(new TxRunnable(){
      @Override public void run(      DatasetContext context) throws Exception {
        ArtifactCell artifactCell=new ArtifactCell(artifactId);
        Table metaTable=getMetaTable(context);
        byte[] detailBytes=metaTable.get(artifactCell.rowkey,artifactCell.column);
        if (detailBytes == null) {
          return;
        }
        deleteMeta(metaTable,artifactId,detailBytes);
      }
    }
);
  }
 catch (  TransactionFailureException e) {
    throw Transactions.propagate(e,IOException.class);
  }
}

Fixed version (ground truth):
/** 
 * Delete the specified artifact. Programs that use the artifact will no longer be able to start.
 * @param artifactId the id of the artifact to delete
 * @throws IOException if there was an IO error deleting the metadata or the actual artifact
 */
public void delete(final Id.Artifact artifactId) throws ArtifactNotFoundException, IOException {
  try {
    transactional.execute(new TxRunnable(){
      @Override public void run(      DatasetContext context) throws Exception {
        ArtifactCell artifactCell=new ArtifactCell(artifactId);
        Table metaTable=getMetaTable(context);
        byte[] detailBytes=metaTable.get(artifactCell.rowkey,artifactCell.column);
        if (detailBytes == null) {
          throw new ArtifactNotFoundException(artifactId.toEntityId());
        }
        deleteMeta(metaTable,artifactId,detailBytes);
      }
    }
);
  }
 catch (  TransactionFailureException e) {
    throw Transactions.propagate(e,IOException.class,ArtifactNotFoundException.class);
  }
}
Program: 5559
Project: 5559
Buggy source:
@Override public String getWebURL(){
  try {
    if (HAUtil.isHAEnabled(conf,getNameService())) {
      URL haWebURL=getHAWebURL();
      if (haWebURL != null) {
        return haWebURL.toString();
      }
    }
 else {
      try (FileSystem fs=FileSystem.get(conf)){
        URL webUrl=rpcToHttpAddress(fs.getUri());
        if (webUrl != null) {
          return webUrl.toString();
        }
      }
     }
  }
 catch (  IOException e) {
    LOG.warn("String_Node_Str",e);
  }
  return null;
}

Fixed version (ground truth):
@Override public String getWebURL(){
  try {
    if (HAUtil.isHAEnabled(conf,getNameService())) {
      URL haWebURL=getHAWebURL();
      if (haWebURL != null) {
        return haWebURL.toString();
      }
    }
 else {
      try (FileSystem fs=FileSystem.get(conf)){
        URL webUrl=rpcToHttpAddress(fs.getUri());
        if (webUrl != null) {
          return webUrl.toString();
        }
      }
     }
    lastCollectFailed=false;
  }
 catch (  Exception e) {
    if (!lastCollectFailed) {
      LOG.warn("String_Node_Str",e);
    }
    lastCollectFailed=true;
  }
  return null;
}
Program: 5560
Project: 5560
Buggy source:
@Nullable private URL getHAWebURL() throws IOException {
  String activeNamenode=null;
  String nameService=getNameService();
  for (  String nnId : DFSUtil.getNameNodeIds(conf,nameService)) {
    HAServiceTarget haServiceTarget=new NNHAServiceTarget(conf,nameService,nnId);
    HAServiceProtocol proxy=haServiceTarget.getProxy(conf,10000);
    HAServiceStatus serviceStatus=proxy.getServiceStatus();
    if (HAServiceProtocol.HAServiceState.ACTIVE != serviceStatus.getState()) {
      continue;
    }
    activeNamenode=DFSUtil.getNamenodeServiceAddr(conf,nameService,nnId);
  }
  if (activeNamenode == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  return rpcToHttpAddress(URI.create(activeNamenode));
}

Fixed version (ground truth):
@Nullable private URL getHAWebURL() throws IOException {
  String activeNamenode=null;
  String nameService=getNameService();
  HdfsConfiguration hdfsConf=new HdfsConfiguration(conf);
  String nameNodePrincipal=conf.get(DFSConfigKeys.DFS_NAMENODE_USER_NAME_KEY,"String_Node_Str");
  hdfsConf.set(CommonConfigurationKeys.HADOOP_SECURITY_SERVICE_USER_NAME_KEY,nameNodePrincipal);
  for (  String nnId : DFSUtil.getNameNodeIds(conf,nameService)) {
    HAServiceTarget haServiceTarget=new NNHAServiceTarget(hdfsConf,nameService,nnId);
    HAServiceProtocol proxy=haServiceTarget.getProxy(hdfsConf,10000);
    HAServiceStatus serviceStatus=proxy.getServiceStatus();
    if (HAServiceProtocol.HAServiceState.ACTIVE != serviceStatus.getState()) {
      continue;
    }
    activeNamenode=DFSUtil.getNamenodeServiceAddr(hdfsConf,nameService,nnId);
  }
  if (activeNamenode == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  return rpcToHttpAddress(URI.create(activeNamenode));
}
Program: 5561
Project: 5561
Buggy source:
/** 
 * Should only be called when HA is enabled.
 */
private URL getHAWebURL() throws IOException {
  InetSocketAddress activeRM=null;
  Collection<String> rmIds=HAUtil.getRMHAIds(conf);
  if (rmIds.isEmpty()) {
    throw new IllegalStateException("String_Node_Str");
  }
  for (  String rmId : rmIds) {
    YarnConfiguration yarnConf=new YarnConfiguration(conf);
    yarnConf.set(YarnConfiguration.RM_HA_ID,rmId);
    RMHAServiceTarget rmhaServiceTarget=new RMHAServiceTarget(yarnConf);
    HAServiceProtocol proxy=rmhaServiceTarget.getProxy(yarnConf,10000);
    HAServiceStatus serviceStatus=proxy.getServiceStatus();
    if (HAServiceProtocol.HAServiceState.ACTIVE != serviceStatus.getState()) {
      continue;
    }
    activeRM=rmhaServiceTarget.getAddress();
  }
  if (activeRM == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  return adminToWebappAddress(activeRM);
}

Fixed version (ground truth):
/** 
 * Should only be called when HA is enabled.
 */
private URL getHAWebURL() throws IOException {
  InetSocketAddress activeRM=null;
  Collection<String> rmIds=HAUtil.getRMHAIds(conf);
  if (rmIds.isEmpty()) {
    throw new IllegalStateException("String_Node_Str");
  }
  for (  String rmId : rmIds) {
    YarnConfiguration yarnConf=new YarnConfiguration(conf);
    yarnConf.set(YarnConfiguration.RM_HA_ID,rmId);
    yarnConf.set(CommonConfigurationKeys.HADOOP_SECURITY_SERVICE_USER_NAME_KEY,conf.get(YarnConfiguration.RM_PRINCIPAL,"String_Node_Str"));
    RMHAServiceTarget rmhaServiceTarget=new RMHAServiceTarget(yarnConf);
    HAServiceProtocol proxy=rmhaServiceTarget.getProxy(yarnConf,10000);
    HAServiceStatus serviceStatus=proxy.getServiceStatus();
    if (HAServiceProtocol.HAServiceState.ACTIVE != serviceStatus.getState()) {
      continue;
    }
    activeRM=rmhaServiceTarget.getAddress();
  }
  if (activeRM == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  return adminToWebappAddress(activeRM);
}
Program: 5562
Project: 5562
Buggy source:
@Override public synchronized void collect() throws IOException {
  webUrl=getResourceManager().toString();
  logsUrl=webUrl + "String_Node_Str";
}

Fixed version (ground truth):
@Override public synchronized void collect() throws IOException {
  try {
    webUrl=getResourceManager().toString();
    logsUrl=webUrl + "String_Node_Str";
    lastCollectFailed=false;
  }
 catch (  Exception e) {
    if (!lastCollectFailed) {
      LOG.warn("String_Node_Str",e);
    }
    lastCollectFailed=true;
  }
}
Program: 5563
Project: 5563
Buggy source:
/** 
 * Parses a   {@link SortInfo} object from the specified string. The supported format is<pre>[sortBy][whitespace][sortOrder]</pre>.
 * @param sort the string to parse into a {@link SortInfo}. If   {@code null},   {@link #DEFAULT} is returned
 * @return the parsed {@link SortInfo}
 * @throws BadRequestException if the string does not conform to the expected format
 */
public static SortInfo of(@Nullable String sort) throws BadRequestException {
  if (Strings.isNullOrEmpty(sort)) {
    return SortInfo.DEFAULT;
  }
  Iterable<String> sortSplit=Splitter.on(SPACE_SPLIT_PATTERN).trimResults().omitEmptyStrings().split(sort);
  if (Iterables.size(sortSplit) != 2) {
    throw new BadRequestException("String_Node_Str" + "String_Node_Str" + sort);
  }
  Iterator<String> iterator=sortSplit.iterator();
  String sortBy=iterator.next();
  String sortOrder=iterator.next();
  if (!AbstractSystemMetadataWriter.ENTITY_NAME_KEY.equalsIgnoreCase(sortBy) && !AbstractSystemMetadataWriter.CREATION_TIME_KEY.equalsIgnoreCase(sortBy)) {
    throw new BadRequestException("String_Node_Str" + sortBy);
  }
  if (!"String_Node_Str".equalsIgnoreCase(sortOrder) && !"String_Node_Str".equalsIgnoreCase(sortOrder)) {
    throw new BadRequestException("String_Node_Str" + sortOrder);
  }
  return new SortInfo(sortBy,SortInfo.SortOrder.valueOf(sortOrder.toUpperCase()));
}

Fixed version (ground truth):
/** 
 * Parses a   {@link SortInfo} object from the specified string. The supported format is<pre>[sortBy][whitespace][sortOrder]</pre>.
 * @param sort the string to parse into a {@link SortInfo}. If   {@code null},   {@link #DEFAULT} is returned
 * @return the parsed {@link SortInfo}
 * @throws BadRequestException if the string does not conform to the expected format
 */
public static SortInfo of(@Nullable String sort) throws BadRequestException {
  if (Strings.isNullOrEmpty(sort)) {
    return SortInfo.DEFAULT;
  }
  Iterable<String> sortSplit=Splitter.on(SPACE_SPLIT_PATTERN).trimResults().omitEmptyStrings().split(sort);
  if (Iterables.size(sortSplit) != 2) {
    throw new BadRequestException(String.format("String_Node_Str" + "String_Node_Str",AbstractSystemMetadataWriter.ENTITY_NAME_KEY,AbstractSystemMetadataWriter.CREATION_TIME_KEY,SortOrder.ASC,SortOrder.DESC,sort));
  }
  Iterator<String> iterator=sortSplit.iterator();
  String sortBy=iterator.next();
  String sortOrder=iterator.next();
  if (!AbstractSystemMetadataWriter.ENTITY_NAME_KEY.equalsIgnoreCase(sortBy) && !AbstractSystemMetadataWriter.CREATION_TIME_KEY.equalsIgnoreCase(sortBy)) {
    throw new BadRequestException(String.format("String_Node_Str",AbstractSystemMetadataWriter.ENTITY_NAME_KEY,AbstractSystemMetadataWriter.CREATION_TIME_KEY,sortBy));
  }
  if (!"String_Node_Str".equalsIgnoreCase(sortOrder) && !"String_Node_Str".equalsIgnoreCase(sortOrder)) {
    throw new BadRequestException(String.format("String_Node_Str",SortOrder.ASC,SortOrder.DESC,sortOrder));
  }
  return new SortInfo(sortBy,SortInfo.SortOrder.valueOf(sortOrder.toUpperCase()));
}
Program: 5564
Project: 5564
Buggy source:
public DatasetFramework getDSFramework(){
  return datasetFramework;
}

Fixed version (ground truth):
DatasetFramework getDSFramework(){
  return datasetFramework;
}
Program: 5565
Project: 5565
Buggy source:
@Inject UpgradeDatasetServiceManager(CConfiguration cConf,Configuration hConf,AuthorizationEnforcementService authorizationEnforcementService){
  Injector injector=createInjector(cConf,hConf,authorizationEnforcementService);
  this.datasetService=injector.getInstance(DatasetService.class);
  this.zkClientService=injector.getInstance(ZKClientService.class);
  this.datasetFramework=injector.getInstance(DatasetFramework.class);
  this.datasetOpExecutorService=injector.getInstance(DatasetOpExecutorService.class);
  this.remoteSystemOperationsService=injector.getInstance(RemoteSystemOperationsService.class);
}

Fixed version (ground truth):
@Inject UpgradeDatasetServiceManager(CConfiguration cConf,Configuration hConf,AuthorizationEnforcementService authorizationEnforcementService){
  Injector injector=createInjector(cConf,hConf,authorizationEnforcementService);
  this.datasetService=injector.getInstance(DatasetService.class);
  this.zkClientService=injector.getInstance(ZKClientService.class);
  this.datasetFramework=injector.getInstance(DatasetFramework.class);
  this.datasetOpExecutorService=injector.getInstance(DatasetOpExecutorService.class);
  this.remoteSystemOperationsService=injector.getInstance(RemoteSystemOperationsService.class);
  this.metadataStore=injector.getInstance(MetadataStore.class);
}
Program: 5568
Project: 5568
Buggy source:
private void performUpgrade() throws Exception {
  performCoprocessorUpgrade();
  LOG.info("String_Node_Str");
  store.upgradeAppVersion();
  LOG.info("String_Node_Str");
  dsSpecUpgrader.upgrade();
  LOG.info("String_Node_Str");
  streamStateStoreUpgrader.upgrade();
  LOG.info("String_Node_Str");
  upgradeMetadataDatasetSpecs();
  upgradeDatasetServiceManager.startUp();
  LOG.info("String_Node_Str");
  datasetBasedStreamSizeScheduleStore.upgrade();
  LOG.info("String_Node_Str");
  datasetBasedTimeScheduleStore.upgrade();
  LOG.info("String_Node_Str");
  try {
    existingEntitySystemMetadataWriter.write(upgradeDatasetServiceManager.getDSFramework());
    LOG.info("String_Node_Str");
    DeletedDatasetMetadataRemover datasetMetadataRemover=new DeletedDatasetMetadataRemover(nsStore,metadataStore,upgradeDatasetServiceManager.getDSFramework());
    datasetMetadataRemover.remove();
    LOG.info("String_Node_Str");
    metadataStore.deleteAllIndexes();
    LOG.info("String_Node_Str");
    metadataStore.rebuildIndexes();
  }
  finally {
    upgradeDatasetServiceManager.shutDown();
  }
}

Fixed version (ground truth):
private void performUpgrade() throws Exception {
  performCoprocessorUpgrade();
  LOG.info("String_Node_Str");
  store.upgradeAppVersion();
  LOG.info("String_Node_Str");
  dsSpecUpgrader.upgrade();
  LOG.info("String_Node_Str");
  streamStateStoreUpgrader.upgrade();
  LOG.info("String_Node_Str");
  upgradeMetadataDatasetSpecs();
  upgradeDatasetServiceManager.startUp();
  LOG.info("String_Node_Str");
  datasetBasedStreamSizeScheduleStore.upgrade();
  LOG.info("String_Node_Str");
  datasetBasedTimeScheduleStore.upgrade();
  LOG.info("String_Node_Str");
  MetadataStore metadataStore=upgradeDatasetServiceManager.getMetadataStore();
  try {
    existingEntitySystemMetadataWriter.write(upgradeDatasetServiceManager.getDSFramework());
    LOG.info("String_Node_Str");
    DeletedDatasetMetadataRemover datasetMetadataRemover=new DeletedDatasetMetadataRemover(nsStore,metadataStore,upgradeDatasetServiceManager.getDSFramework());
    datasetMetadataRemover.remove();
    LOG.info("String_Node_Str");
    metadataStore.deleteAllIndexes();
    LOG.info("String_Node_Str");
    metadataStore.rebuildIndexes();
  }
  finally {
    upgradeDatasetServiceManager.shutDown();
  }
}
Program: 5569
Project: 5569
Buggy source:
private void upgradeMetadataDatasetSpecs(){
  upgradeMetadataDatasetSpec(DefaultMetadataStore.BUSINESS_METADATA_INSTANCE_ID);
  upgradeMetadataDatasetSpec(DefaultMetadataStore.SYSTEM_METADATA_INSTANCE_ID);
}

Fixed version (ground truth):
private void upgradeMetadataDatasetSpecs(){
  upgradeMetadataDatasetSpec(MetadataScope.USER,DefaultMetadataStore.BUSINESS_METADATA_INSTANCE_ID);
  upgradeMetadataDatasetSpec(MetadataScope.SYSTEM,DefaultMetadataStore.SYSTEM_METADATA_INSTANCE_ID);
}
Program: 5570
Project: 5570
Buggy source:
/** 
 * Parses a   {@link SortInfo} object from the specified string. The supported format is<pre>[sortBy][whitespace][sortOrder]</pre>.
 * @param sort the string to parse into a {@link SortInfo}. If   {@code null},   {@link #DEFAULT} is returned
 * @return the parsed {@link SortInfo}
 * @throws BadRequestException if the string does not conform to the expected format
 */
public static SortInfo of(@Nullable String sort) throws BadRequestException {
  if (Strings.isNullOrEmpty(sort)) {
    return SortInfo.DEFAULT;
  }
  Iterable<String> sortSplit=Splitter.on(SPACE_SPLIT_PATTERN).trimResults().omitEmptyStrings().split(sort);
  if (Iterables.size(sortSplit) != 2) {
    throw new BadRequestException("String_Node_Str" + "String_Node_Str" + sort);
  }
  Iterator<String> iterator=sortSplit.iterator();
  String sortBy=iterator.next();
  String sortOrder=iterator.next();
  if (!AbstractSystemMetadataWriter.ENTITY_NAME_KEY.equalsIgnoreCase(sortBy) && !AbstractSystemMetadataWriter.CREATION_TIME_KEY.equalsIgnoreCase(sortBy)) {
    throw new BadRequestException("String_Node_Str" + sortBy);
  }
  if (!"String_Node_Str".equalsIgnoreCase(sortOrder) && !"String_Node_Str".equalsIgnoreCase(sortOrder)) {
    throw new BadRequestException("String_Node_Str" + sortOrder);
  }
  return new SortInfo(sortBy,SortInfo.SortOrder.valueOf(sortOrder.toUpperCase()));
}

Fixed version (ground truth):
/** 
 * Parses a   {@link SortInfo} object from the specified string. The supported format is<pre>[sortBy][whitespace][sortOrder]</pre>.
 * @param sort the string to parse into a {@link SortInfo}. If   {@code null},   {@link #DEFAULT} is returned
 * @return the parsed {@link SortInfo}
 * @throws BadRequestException if the string does not conform to the expected format
 */
public static SortInfo of(@Nullable String sort) throws BadRequestException {
  if (Strings.isNullOrEmpty(sort)) {
    return SortInfo.DEFAULT;
  }
  Iterable<String> sortSplit=Splitter.on(SPACE_SPLIT_PATTERN).trimResults().omitEmptyStrings().split(sort);
  if (Iterables.size(sortSplit) != 2) {
    throw new BadRequestException(String.format("String_Node_Str" + "String_Node_Str",AbstractSystemMetadataWriter.ENTITY_NAME_KEY,AbstractSystemMetadataWriter.CREATION_TIME_KEY,SortOrder.ASC,SortOrder.DESC,sort));
  }
  Iterator<String> iterator=sortSplit.iterator();
  String sortBy=iterator.next();
  String sortOrder=iterator.next();
  if (!AbstractSystemMetadataWriter.ENTITY_NAME_KEY.equalsIgnoreCase(sortBy) && !AbstractSystemMetadataWriter.CREATION_TIME_KEY.equalsIgnoreCase(sortBy)) {
    throw new BadRequestException(String.format("String_Node_Str",AbstractSystemMetadataWriter.ENTITY_NAME_KEY,AbstractSystemMetadataWriter.CREATION_TIME_KEY,sortBy));
  }
  if (!"String_Node_Str".equalsIgnoreCase(sortOrder) && !"String_Node_Str".equalsIgnoreCase(sortOrder)) {
    throw new BadRequestException(String.format("String_Node_Str",SortOrder.ASC,SortOrder.DESC,sortOrder));
  }
  return new SortInfo(sortBy,SortInfo.SortOrder.valueOf(sortOrder.toUpperCase()));
}
Program: 5571
Project: 5571
Buggy source:
public ProgramControllerServiceAdapter(Service service,ProgramId programId,RunId runId,@Nullable String componentName){
  super(programId,runId,componentName);
  this.service=service;
  listenToRuntimeState(service);
}

Fixed version (ground truth):
public ProgramControllerServiceAdapter(Service service,ProgramId programId,RunId runId,@Nullable String componentName){
  super(programId,runId,componentName);
  this.service=service;
  this.serviceStoppedLatch=new CountDownLatch(1);
  listenToRuntimeState(service);
}
Program: 5572
Project: 5572
Buggy source:
@Override protected void doStop() throws Exception {
  if (service.state() != Service.State.TERMINATED && service.state() != Service.State.FAILED) {
    service.stopAndWait();
  }
}

Fixed version (ground truth):
@Override protected void doStop() throws Exception {
  if (service.state() != Service.State.TERMINATED && service.state() != Service.State.FAILED) {
    LOG.debug("String_Node_Str",getProgramRunId());
    service.stopAndWait();
    LOG.debug("String_Node_Str",getProgramRunId());
    serviceStoppedLatch.await(30,TimeUnit.SECONDS);
    LOG.debug("String_Node_Str",getProgramRunId());
  }
}
Program: 5573
Project: 5573
Buggy source:
@Override public void failed(Service.State from,Throwable failure){
  LOG.error("String_Node_Str",failure);
  error(failure);
}

Fixed version (ground truth):
@Override public void failed(Service.State from,Throwable failure){
  LOG.error("String_Node_Str",failure);
  serviceStoppedLatch.countDown();
  error(failure);
}
Program: 5574
Project: 5574
Buggy source:
private void listenToRuntimeState(Service service){
  service.addListener(new ServiceListenerAdapter(){
    @Override public void running(){
      started();
    }
    @Override public void failed(    Service.State from,    Throwable failure){
      LOG.error("String_Node_Str",failure);
      error(failure);
    }
    @Override public void terminated(    Service.State from){
      if (from != Service.State.STOPPING) {
        complete();
      }
 else {
        stop();
      }
    }
  }
,Threads.SAME_THREAD_EXECUTOR);
}

Fixed version (ground truth):
private void listenToRuntimeState(Service service){
  service.addListener(new ServiceListenerAdapter(){
    @Override public void running(){
      started();
    }
    @Override public void failed(    Service.State from,    Throwable failure){
      LOG.error("String_Node_Str",failure);
      serviceStoppedLatch.countDown();
      error(failure);
    }
    @Override public void terminated(    Service.State from){
      serviceStoppedLatch.countDown();
      if (from != Service.State.STOPPING) {
        complete();
      }
 else {
        stop();
      }
    }
  }
,Threads.SAME_THREAD_EXECUTOR);
}
Program: 5575
Project: 5575
Buggy source:
@Override public void terminated(Service.State from){
  if (from != Service.State.STOPPING) {
    complete();
  }
 else {
    stop();
  }
}

Fixed version (ground truth):
@Override public void terminated(Service.State from){
  serviceStoppedLatch.countDown();
  if (from != Service.State.STOPPING) {
    complete();
  }
 else {
    stop();
  }
}
Program: 5576
Project: 5576
Buggy source:
public DataStreamsPipelineSpec build(){
  return new DataStreamsPipelineSpec(stages,connections,resources,driverResources,clientResources,stageLoggingEnabled,batchIntervalMillis,extraJavaOpts,numOfRecordsPreview);
}

Fixed version (ground truth):
public DataStreamsPipelineSpec build(){
  return new DataStreamsPipelineSpec(stages,connections,resources,driverResources,clientResources,stageLoggingEnabled,batchIntervalMillis,extraJavaOpts,numOfRecordsPreview,stopGracefully);
}
Program: 5577
Project: 5577
Buggy source:
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  if (!super.equals(o)) {
    return false;
  }
  DataStreamsPipelineSpec that=(DataStreamsPipelineSpec)o;
  return batchIntervalMillis == that.batchIntervalMillis && Objects.equals(extraJavaOpts,that.extraJavaOpts);
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  if (!super.equals(o)) {
    return false;
  }
  DataStreamsPipelineSpec that=(DataStreamsPipelineSpec)o;
  return batchIntervalMillis == that.batchIntervalMillis && Objects.equals(extraJavaOpts,that.extraJavaOpts) && stopGracefully == that.stopGracefully;
}
Program: 5578
Project: 5578
Buggy source:
public Builder(long batchIntervalMillis){
  this.batchIntervalMillis=batchIntervalMillis;
}

Fixed version (ground truth):
public Builder(long batchIntervalMillis){
  this.batchIntervalMillis=batchIntervalMillis;
  this.stopGracefully=false;
}