nus-yam/ex-repair huggingface dataset:
Program: 188274
Project: 188274
Buggy source:
private static void updateParent(IndexService index,ModelService model,String aipId,String newParentId,Optional<String> searchScope) throws GenericException, AuthorizationDeniedException, RequestNotValidException {
  Filter parentFilter=new Filter(new SimpleFilterParameter(RodaConstants.AIP_PARENT_ID,aipId));
  searchScope.ifPresent(id -> parentFilter.add(new SimpleFilterParameter(RodaConstants.AIP_ANCESTORS,id)));
  index.execute(IndexedAIP.class,parentFilter,Arrays.asList(RodaConstants.INDEX_UUID),child -> {
    try {
      AIP aip=model.retrieveAIP(child.getId());
      aip.setParentId(newParentId);
      model.updateAIP(aip,"String_Node_Str");
    }
 catch (    NotFoundException e) {
      LOGGER.debug("String_Node_Str",e);
    }
  }
,e -> LOGGER.debug("String_Node_Str",e));
  try {
    model.deleteAIP(aipId);
  }
 catch (  NotFoundException e) {
    LOGGER.debug("String_Node_Str",e);
  }
}

Fixed version (ground truth):
private static void updateParent(IndexService index,ModelService model,String aipId,String newParentId,Optional<String> searchScope,String updatedBy) throws GenericException, AuthorizationDeniedException, RequestNotValidException {
  Filter parentFilter=new Filter(new SimpleFilterParameter(RodaConstants.AIP_PARENT_ID,aipId));
  searchScope.ifPresent(id -> parentFilter.add(new SimpleFilterParameter(RodaConstants.AIP_ANCESTORS,id)));
  index.execute(IndexedAIP.class,parentFilter,Arrays.asList(RodaConstants.INDEX_UUID),child -> {
    try {
      AIP aip=model.retrieveAIP(child.getId());
      aip.setParentId(newParentId);
      model.updateAIP(aip,updatedBy);
    }
 catch (    NotFoundException e) {
      LOGGER.debug("String_Node_Str",e);
    }
  }
,e -> LOGGER.debug("String_Node_Str",e));
  try {
    model.deleteAIP(aipId);
  }
 catch (  NotFoundException e) {
    LOGGER.debug("String_Node_Str",e);
  }
}
Program: 188276
Project: 188276
Buggy source:
private void fixAncestors(IndexService index,ModelService model,Report report,SimpleJobPluginInfo jobPluginInfo,int counter){
  try {
    Optional<String> computedSearchScope=PluginHelper.getSearchScopeFromParameters(this,model);
    Job originalJob=PluginHelper.getJob(originalJobId,model);
    PluginHelper.fixParents(index,model,Optional.ofNullable(originalJob.getId()),computedSearchScope,originalJob.getUsername());
    jobPluginInfo.incrementObjectsProcessedWithSuccess(counter);
    report.setPluginState(PluginState.SUCCESS);
  }
 catch (  NotFoundException|GenericException|RequestNotValidException|AuthorizationDeniedException e) {
    LOGGER.error("String_Node_Str",e);
    jobPluginInfo.incrementObjectsProcessedWithFailure(counter);
    report.setPluginState(PluginState.FAILURE);
    Report reportItem=PluginHelper.initPluginReportItem(this,"String_Node_Str",AIP.class);
    reportItem.setPluginDetails("String_Node_Str" + e.getMessage());
    reportItem.setPluginState(PluginState.FAILURE);
    report.addReport(reportItem);
    try {
      PluginHelper.updatePartialJobReport(this,model,reportItem,true,PluginHelper.getJob(this,index));
    }
 catch (    NotFoundException|GenericException e1) {
    }
  }
}

Fixed version (ground truth):
private void fixAncestors(IndexService index,ModelService model,Report report,SimpleJobPluginInfo jobPluginInfo,int counter){
  try {
    Optional<String> computedSearchScope=PluginHelper.getSearchScopeFromParameters(this,model);
    Job originalJob=PluginHelper.getJob(originalJobId,model);
    PluginHelper.fixParents(index,model,Optional.ofNullable(originalJob.getId()),computedSearchScope,originalJob.getUsername());
    jobPluginInfo.incrementObjectsProcessedWithSuccess(counter);
    report.setPluginState(PluginState.SUCCESS);
  }
 catch (  NotFoundException|GenericException|RequestNotValidException|AuthorizationDeniedException e) {
    LOGGER.error("String_Node_Str",e);
    jobPluginInfo.incrementObjectsProcessedWithFailure(counter);
    report.setPluginState(PluginState.FAILURE);
    Report reportItem=PluginHelper.initPluginReportItem(this,"String_Node_Str",AIP.class);
    reportItem.setPluginDetails("String_Node_Str" + e.getMessage());
    reportItem.setPluginState(PluginState.FAILURE);
    report.addReport(reportItem);
    try {
      PluginHelper.updatePartialJobReport(this,model,reportItem,true,PluginHelper.getJob(this,index));
    }
 catch (    NotFoundException|GenericException e1) {
      LOGGER.error("String_Node_Str",e1);
    }
  }
}
Program: 188277
Project: 188277
Buggy source:
@GET @Path("String_Node_Str" + RodaConstants.API_PATH_PARAM_AIP_ID + "String_Node_Str") @Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML,ExtraMediaType.APPLICATION_ZIP}) @ApiOperation(value="String_Node_Str",notes="String_Node_Str",response=AIP.class) @ApiResponses(value={@ApiResponse(code=200,message="String_Node_Str",response=AIP.class),@ApiResponse(code=404,message="String_Node_Str",response=ApiResponseMessage.class)}) public Response retrieveAIP(@ApiParam(value="String_Node_Str",required=true) @PathParam(RodaConstants.API_PATH_PARAM_AIP_ID) String aipId,@ApiParam(value="String_Node_Str",allowableValues=RodaConstants.API_GET_LIST_MEDIA_TYPES,defaultValue=RodaConstants.API_QUERY_VALUE_ACCEPT_FORMAT_JSON) @QueryParam(RodaConstants.API_QUERY_KEY_ACCEPT_FORMAT) String acceptFormat) throws RODAException {
  String mediaType=ApiUtils.getMediaType(acceptFormat,request);
  User user=UserUtility.getApiUser(request);
  IndexedAIP indexedAIP=Browser.retrieve(user,IndexedAIP.class,aipId,new ArrayList<>());
  return ApiUtils.okResponse(indexedAIP,acceptFormat,mediaType);
}

Fixed version (ground truth):
@GET @Path("String_Node_Str" + RodaConstants.API_PATH_PARAM_AIP_ID + "String_Node_Str") @Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML,ExtraMediaType.APPLICATION_ZIP}) @ApiOperation(value="String_Node_Str",notes="String_Node_Str",response=IndexedAIP.class) @ApiResponses(value={@ApiResponse(code=200,message="String_Node_Str",response=IndexedAIP.class),@ApiResponse(code=404,message="String_Node_Str",response=ApiResponseMessage.class)}) public Response retrieveAIP(@ApiParam(value="String_Node_Str",required=true) @PathParam(RodaConstants.API_PATH_PARAM_AIP_ID) String aipId,@ApiParam(value="String_Node_Str",allowableValues=RodaConstants.API_GET_LIST_MEDIA_TYPES,defaultValue=RodaConstants.API_QUERY_VALUE_ACCEPT_FORMAT_JSON) @QueryParam(RodaConstants.API_QUERY_KEY_ACCEPT_FORMAT) String acceptFormat) throws RODAException {
  String mediaType=ApiUtils.getMediaType(acceptFormat,request);
  User user=UserUtility.getApiUser(request);
  IndexedAIP indexedAIP=Browser.retrieve(user,IndexedAIP.class,aipId,new ArrayList<>());
  return ApiUtils.okResponse(indexedAIP,acceptFormat,mediaType);
}
Program: 188278
Project: 188278
Buggy source:
public Report addReport(Report report){
  report.setDateUpdated(new Date());
  setDateUpdated(report.getDateUpdated());
  if (totalSteps == 0 && report.getTotalSteps() != 0) {
    setTotalSteps(report.getTotalSteps());
  }
  stepsCompleted=stepsCompleted + 1;
  if (totalSteps != 0) {
    completionPercentage=Math.round((100f / totalSteps) * stepsCompleted);
  }
  setPlugin(report.getPlugin());
  setPluginName(report.getPluginName());
  setPluginVersion(report.getPluginVersion());
  setPluginState(report.getPluginState());
  if (!"String_Node_Str".equals(report.getPluginDetails()) && !getPluginDetails().equals(report.getPluginDetails())) {
    setPluginDetails((!"String_Node_Str".equals(getPluginDetails()) ? getPluginDetails() + lineSeparator : "String_Node_Str") + report.getPluginDetails());
  }
  setOutcomeObjectState(report.getOutcomeObjectState());
  reports.add(report);
  return this;
}

Fixed version (ground truth):
public Report addReport(Report report,boolean updateReportItemDateUpdated){
  if (updateReportItemDateUpdated) {
    report.setDateUpdated(new Date());
  }
  setDateUpdated(report.getDateUpdated());
  if (totalSteps == 0 && report.getTotalSteps() != 0) {
    setTotalSteps(report.getTotalSteps());
  }
  stepsCompleted=stepsCompleted + 1;
  if (totalSteps != 0) {
    completionPercentage=Math.round((100f / totalSteps) * stepsCompleted);
  }
  setPlugin(report.getPlugin());
  setPluginName(report.getPluginName());
  setPluginVersion(report.getPluginVersion());
  setPluginState(report.getPluginState());
  if (!"String_Node_Str".equals(report.getPluginDetails()) && !getPluginDetails().equals(report.getPluginDetails())) {
    setPluginDetails((!"String_Node_Str".equals(getPluginDetails()) ? getPluginDetails() + lineSeparator : "String_Node_Str") + report.getPluginDetails());
  }
  setOutcomeObjectState(report.getOutcomeObjectState());
  reports.add(report);
  return this;
}
Program: 188279
Project: 188279
Buggy source:
public void addReport(String outcomeObjectId,Report report){
  reportsFromBeingProcessed.get(aipIdToTransferredResourceId.get(outcomeObjectId)).get(outcomeObjectId).addReport(report);
}

Fixed version (ground truth):
public void addReport(Report report){
  String outcomeObjectId=report.getOutcomeObjectId();
  reportsFromBeingProcessed.get(aipIdToTransferredResourceId.get(outcomeObjectId)).get(outcomeObjectId).addReport(report,false);
}
Program: 188280
Project: 188280
Buggy source:
private void mergeReports(IngestJobPluginInfo jobPluginInfo,Report plugin){
  Map<String,String> aipIdToTransferredResourceId=jobPluginInfo.getAipIdToTransferredResourceId();
  if (plugin != null) {
    for (    Report reportItem : plugin.getReports()) {
      if (TransferredResource.class.getName().equals(reportItem.getSourceObjectClass())) {
        Report report=new Report(reportItem);
        report.addReport(reportItem);
        jobPluginInfo.addReport(reportItem.getSourceObjectId(),reportItem.getOutcomeObjectId(),report);
      }
 else       if (StringUtils.isNotBlank(reportItem.getOutcomeObjectId()) && aipIdToTransferredResourceId.get(reportItem.getOutcomeObjectId()) != null) {
        jobPluginInfo.addReport(reportItem.getOutcomeObjectId(),reportItem);
      }
    }
  }
}

Fixed version (ground truth):
private void mergeReports(IngestJobPluginInfo jobPluginInfo,Report plugin){
  Map<String,String> aipIdToTransferredResourceId=jobPluginInfo.getAipIdToTransferredResourceId();
  if (plugin != null) {
    for (    Report reportItem : plugin.getReports()) {
      if (TransferredResource.class.getName().equals(reportItem.getSourceObjectClass())) {
        Report report=new Report(reportItem);
        report.addReport(reportItem);
        jobPluginInfo.addReport(reportItem.getSourceObjectId(),reportItem.getOutcomeObjectId(),report);
      }
 else       if (StringUtils.isNotBlank(reportItem.getOutcomeObjectId()) && aipIdToTransferredResourceId.get(reportItem.getOutcomeObjectId()) != null) {
        jobPluginInfo.addReport(reportItem);
      }
    }
  }
}
Program: 188281
Project: 188281
Buggy source:
@Override public Report execute(IndexService index,ModelService model,StorageService storage,List<LiteOptionalWithCause> liteList) throws PluginException {
  final CSVPrinter csvFilePrinter=createCSVPrinter();
  return PluginHelper.processObjects(this,new RODAObjectProcessingLogic<AIP>(){
    @Override public void process(    IndexService index,    ModelService model,    StorageService storage,    Report report,    Job cachedJob,    SimpleJobPluginInfo jobPluginInfo,    Plugin<AIP> plugin,    AIP object){
      processAIP(model,storage,jobPluginInfo,csvFilePrinter,object);
    }
  }
,new RODAProcessingLogic<AIP>(){
    @Override public void process(    IndexService index,    ModelService model,    StorageService storage,    Report report,    Job cachedJob,    SimpleJobPluginInfo jobPluginInfo,    Plugin<AIP> plugin){
      IOUtils.closeQuietly(csvFilePrinter);
    }
  }
,index,model,storage,liteList);
}

Fixed version (ground truth):
@Override public Report execute(IndexService index,ModelService model,StorageService storage,List<LiteOptionalWithCause> liteList) throws PluginException {
  Path jobCSVTempFolder=getJobCSVTempFolder();
  Path csvTempFile=jobCSVTempFolder.resolve(IdUtils.createUUID() + "String_Node_Str");
  CSVFormat csvFileFormat=CSVFormat.DEFAULT.withRecordSeparator("String_Node_Str");
  try {
    BufferedWriter fileWriter=Files.newBufferedWriter(csvTempFile);
    CSVPrinter csvFilePrinter=new CSVPrinter(fileWriter,csvFileFormat);
    return PluginHelper.processObjects(this,new RODAObjectProcessingLogic<AIP>(){
      @Override public void process(      IndexService index,      ModelService model,      StorageService storage,      Report report,      Job cachedJob,      SimpleJobPluginInfo jobPluginInfo,      Plugin<AIP> plugin,      AIP object){
        processAIP(model,storage,jobPluginInfo,csvFilePrinter,object);
      }
    }
,new RODAProcessingLogic<AIP>(){
      @Override public void process(      IndexService index,      ModelService model,      StorageService storage,      Report report,      Job cachedJob,      SimpleJobPluginInfo jobPluginInfo,      Plugin<AIP> plugin){
        IOUtils.closeQuietly(csvFilePrinter);
      }
    }
,index,model,storage,liteList);
  }
 catch (  IOException e) {
    throw new PluginException("String_Node_Str",e);
  }
}
Program: 188282
Project: 188282
Buggy source:
private void processAIP(ModelService model,StorageService storage,SimpleJobPluginInfo jobPluginInfo,CSVPrinter csvFilePrinter,AIP aip){
  if (csvFilePrinter == null) {
    LOGGER.warn("String_Node_Str");
    return;
  }
  try {
    if (outputDataInformation && aip.getRepresentations() != null) {
      List<List<String>> dataInformation=InventoryReportPluginUtils.getDataInformation(fields,aip,model,storage);
      csvFilePrinter.printRecords(dataInformation);
    }
    if (outputDescriptiveMetadataInformation && aip.getDescriptiveMetadata() != null) {
      List<List<String>> dataInformation=InventoryReportPluginUtils.getDescriptiveMetadataInformation(fields,aip,model,storage);
      csvFilePrinter.printRecords(dataInformation);
    }
    if (otherMetadataTypes != null && !otherMetadataTypes.isEmpty()) {
      for (      String otherMetadataType : otherMetadataTypes) {
        List<List<String>> otherMetadataInformation=InventoryReportPluginUtils.getOtherMetadataInformation(fields,otherMetadataType,aip,model,storage);
        csvFilePrinter.printRecords(otherMetadataInformation);
      }
    }
    jobPluginInfo.incrementObjectsProcessedWithSuccess();
  }
 catch (  IOException e) {
    jobPluginInfo.incrementObjectsProcessedWithFailure();
  }
}

Fixed version (ground truth):
private void processAIP(ModelService model,StorageService storage,SimpleJobPluginInfo jobPluginInfo,CSVPrinter csvFilePrinter,AIP aip){
  if (csvFilePrinter == null) {
    LOGGER.warn("String_Node_Str");
    return;
  }
  try {
    if (outputDataInformation && aip.getRepresentations() != null) {
      List<List<String>> dataInformation=InventoryReportPluginUtils.getDataInformation(fields,aip,model,storage);
      csvFilePrinter.printRecords(dataInformation);
    }
    if (outputDescriptiveMetadataInformation && aip.getDescriptiveMetadata() != null) {
      List<List<String>> dataInformation=InventoryReportPluginUtils.getDescriptiveMetadataInformation(fields,aip,model,storage);
      csvFilePrinter.printRecords(dataInformation);
    }
    if (otherMetadataTypes != null && !otherMetadataTypes.isEmpty()) {
      for (      String otherMetadataType : otherMetadataTypes) {
        List<List<String>> otherMetadataInformation=InventoryReportPluginUtils.getOtherMetadataInformation(fields,otherMetadataType,aip,model,storage);
        csvFilePrinter.printRecords(otherMetadataInformation);
      }
    }
    jobPluginInfo.incrementObjectsProcessedWithSuccess();
  }
 catch (  IOException e) {
    LOGGER.error("String_Node_Str",e);
    jobPluginInfo.incrementObjectsProcessedWithFailure();
  }
}
Program: 188283
Project: 188283
Buggy source:
@Override public void setTotalSteps(){
  this.totalSteps=11 - deactivatedPlugins.size();
}

Fixed version (ground truth):
@Override public void setTotalSteps(){
  this.totalSteps=DefaultIngestPlugin.INITIAL_TOTAL_STEPS - deactivatedPlugins.size();
}
Program: 188285
Project: 188285
Buggy source:
private int calculateEfectiveTotalSteps(){
  List<String> parameterIdsToIgnore=Arrays.asList(RodaConstants.PLUGIN_PARAMS_FORCE_PARENT_ID,RodaConstants.PLUGIN_PARAMS_DO_FEATURE_EXTRACTION,RodaConstants.PLUGIN_PARAMS_DO_FULL_TEXT_EXTRACTION,RodaConstants.PLUGIN_PARAMS_DO_AUTO_ACCEPT);
  int effectiveTotalSteps=getTotalSteps();
  boolean tikaParameters=false;
  boolean dontDoFeatureExtraction=false;
  boolean dontDoFulltext=false;
  for (  PluginParameter pluginParameter : getParameters()) {
    if (pluginParameter.getType() == PluginParameterType.BOOLEAN && !parameterIdsToIgnore.contains(pluginParameter.getId()) && !PluginHelper.verifyIfStepShouldBePerformed(this,pluginParameter)) {
      effectiveTotalSteps--;
    }
    if (pluginParameter.getId().equals(RodaConstants.PLUGIN_PARAMS_DO_FEATURE_EXTRACTION)) {
      tikaParameters=true;
      if (!PluginHelper.verifyIfStepShouldBePerformed(this,pluginParameter)) {
        dontDoFeatureExtraction=true;
      }
    }
    if (pluginParameter.getId().equals(RodaConstants.PLUGIN_PARAMS_DO_FULL_TEXT_EXTRACTION)) {
      tikaParameters=true;
      if (!PluginHelper.verifyIfStepShouldBePerformed(this,pluginParameter)) {
        dontDoFulltext=true;
      }
    }
  }
  if (tikaParameters && (dontDoFeatureExtraction && dontDoFulltext)) {
    effectiveTotalSteps--;
  }
  return effectiveTotalSteps;
}

Fixed version (ground truth):
private int calculateEfectiveTotalSteps(){
  List<String> parameterIdsToIgnore=Arrays.asList(RodaConstants.PLUGIN_PARAMS_FORCE_PARENT_ID,RodaConstants.PLUGIN_PARAMS_DO_FEATURE_EXTRACTION,RodaConstants.PLUGIN_PARAMS_DO_FULL_TEXT_EXTRACTION,RodaConstants.PLUGIN_PARAMS_DO_AUTO_ACCEPT,RodaConstants.PLUGIN_PARAMS_NOTIFICATION_WHEN_FAILED);
  int effectiveTotalSteps=getTotalSteps();
  boolean tikaParameters=false;
  boolean dontDoFeatureExtraction=false;
  boolean dontDoFulltext=false;
  for (  PluginParameter pluginParameter : getParameters()) {
    if (pluginParameter.getType() == PluginParameterType.BOOLEAN && !parameterIdsToIgnore.contains(pluginParameter.getId()) && !PluginHelper.verifyIfStepShouldBePerformed(this,pluginParameter)) {
      effectiveTotalSteps--;
    }
    if (pluginParameter.getId().equals(RodaConstants.PLUGIN_PARAMS_DO_FEATURE_EXTRACTION)) {
      tikaParameters=true;
      if (!PluginHelper.verifyIfStepShouldBePerformed(this,pluginParameter)) {
        dontDoFeatureExtraction=true;
      }
    }
    if (pluginParameter.getId().equals(RodaConstants.PLUGIN_PARAMS_DO_FULL_TEXT_EXTRACTION)) {
      tikaParameters=true;
      if (!PluginHelper.verifyIfStepShouldBePerformed(this,pluginParameter)) {
        dontDoFulltext=true;
      }
    }
  }
  if (tikaParameters && (dontDoFeatureExtraction && dontDoFulltext)) {
    effectiveTotalSteps--;
  }
  return effectiveTotalSteps;
}
Program: 188287
Project: 188287
Buggy source:
private static void moveChildrenAIPsAndDelete(IndexService index,ModelService model,String aipId,String newParentId,Optional<String> searchScope,String updatedBy) throws GenericException, AuthorizationDeniedException, RequestNotValidException {
  Filter parentFilter=new Filter(new SimpleFilterParameter(RodaConstants.AIP_PARENT_ID,aipId),new SimpleFilterParameter(RodaConstants.AIP_GHOST,Boolean.FALSE.toString()));
  searchScope.ifPresent(id -> parentFilter.add(new SimpleFilterParameter(RodaConstants.AIP_ANCESTORS,id)));
  IterableIndexResult<IndexedAIP> aips=index.findAll(IndexedAIP.class,parentFilter,Arrays.asList(RodaConstants.INDEX_UUID,RodaConstants.AIP_ID));
  for (  IndexedAIP child : aips) {
    try {
      model.moveAIP(child.getId(),newParentId,updatedBy);
    }
 catch (    NotFoundException e) {
      LOGGER.debug("String_Node_Str",e);
    }
  }
  try {
    model.deleteAIP(aipId);
  }
 catch (  NotFoundException e) {
    LOGGER.debug("String_Node_Str",e);
  }
}

Fixed version (ground truth):
private static void moveChildrenAIPsAndDelete(IndexService index,ModelService model,String aipId,String newParentId,Optional<String> searchScope,String updatedBy) throws GenericException, AuthorizationDeniedException, RequestNotValidException {
  Filter parentFilter=new Filter(new SimpleFilterParameter(RodaConstants.AIP_PARENT_ID,aipId),new SimpleFilterParameter(RodaConstants.AIP_GHOST,Boolean.FALSE.toString()));
  searchScope.ifPresent(id -> parentFilter.add(new SimpleFilterParameter(RodaConstants.AIP_ANCESTORS,id)));
  List<String> aipIds=new ArrayList<>();
  index.findAll(IndexedAIP.class,parentFilter,Arrays.asList(RodaConstants.INDEX_UUID,RodaConstants.AIP_ID)).forEach(e -> aipIds.add(e.getUUID()));
  for (  String id : aipIds) {
    try {
      model.moveAIP(id,newParentId,updatedBy);
    }
 catch (    NotFoundException e) {
      LOGGER.debug("String_Node_Str",e);
    }
  }
  try {
    model.deleteAIP(aipId);
  }
 catch (  NotFoundException e) {
    LOGGER.debug("String_Node_Str",e);
  }
}
Program: 188288
Project: 188288
Buggy source:
private void processTransferredResource(ModelService model,Report report,SimpleJobPluginInfo jobPluginInfo,Job job,List<TransferredResource> resources){
  if (destinationId == null) {
    destinationId="String_Node_Str";
  }
  try {
    Map<String,String> moveResult=RodaCoreFactory.getTransferredResourcesScanner().moveTransferredResource(resources,destinationId,false,true);
    for (    TransferredResource resource : resources) {
      if (!moveResult.containsKey(resource.getId())) {
        addFailedReport(model,report,jobPluginInfo,job,resource.getId());
      }
 else {
        jobPluginInfo.incrementObjectsProcessedWithSuccess();
      }
    }
  }
 catch (  GenericException|IsStillUpdatingException|NotFoundException|RuntimeException e) {
    LOGGER.error("String_Node_Str",e);
    for (    TransferredResource resource : resources) {
      addFailedReport(model,report,jobPluginInfo,job,resource.getId());
    }
  }
}

Fixed version (ground truth):
private void processTransferredResource(ModelService model,Report report,SimpleJobPluginInfo jobPluginInfo,Job job,List<TransferredResource> resources){
  if (destinationId == null) {
    destinationId="String_Node_Str";
  }
  try {
    Map<String,String> moveResult=RodaCoreFactory.getTransferredResourcesScanner().moveTransferredResource(resources,destinationId,false,true);
    for (    TransferredResource resource : resources) {
      if (!moveResult.containsKey(resource.getUUID())) {
        addFailedReport(model,report,jobPluginInfo,job,resource.getId());
      }
 else {
        jobPluginInfo.incrementObjectsProcessedWithSuccess();
      }
    }
  }
 catch (  GenericException|IsStillUpdatingException|NotFoundException|RuntimeException e) {
    LOGGER.error("String_Node_Str",e);
    for (    TransferredResource resource : resources) {
      addFailedReport(model,report,jobPluginInfo,job,resource.getId());
    }
  }
}
Program: 188290
Project: 188290
Buggy source:
/** 
 */
public void logout(){
  String currentURL=Window.Location.getHref().replaceAll("String_Node_Str","String_Node_Str");
  String locale=LocaleInfo.getCurrentLocale().getLocaleName();
  String moduleBaseURL=GWT.getModuleBaseURL();
  moduleBaseURL=moduleBaseURL.substring(0,moduleBaseURL.length() - 2).substring(0,moduleBaseURL.indexOf('/'));
  Window.open(moduleBaseURL + "String_Node_Str" + currentURL+ "String_Node_Str"+ locale,"String_Node_Str","String_Node_Str");
  getUserRequest.clearCache();
}

Fixed version (ground truth):
public void logout(){
  String currentURL=Window.Location.getHref().replaceAll("String_Node_Str","String_Node_Str");
  String locale=LocaleInfo.getCurrentLocale().getLocaleName();
  String moduleBaseURL=GWT.getModuleBaseURL();
  moduleBaseURL=moduleBaseURL.substring(0,moduleBaseURL.length() - 2).substring(0,moduleBaseURL.indexOf('/'));
  Window.open(moduleBaseURL + "String_Node_Str" + currentURL+ "String_Node_Str"+ locale,"String_Node_Str","String_Node_Str");
  getUserRequest.clearCache();
}
Program: 188291
Project: 188291
Buggy source:
private void handleTerminated(Object msg){
  LOGGER.trace("String_Node_Str","String_Node_Str",Terminated.class.getSimpleName());
  boolean allChildrenAreDead=true;
  if (stopping) {
    for (    ActorRef child : getContext().getChildren()) {
      allChildrenAreDead=false;
      break;
    }
    if (allChildrenAreDead) {
      getSelf().tell(new Messages.JobStateUpdated(plugin,JOB_STATE.STOPPED),getSelf());
    }
  }
  LOGGER.trace("String_Node_Str","String_Node_Str",Terminated.class.getSimpleName(),stopping,allChildrenAreDead);
}

Fixed version (ground truth):
private void handleTerminated(Object msg){
  LOGGER.trace("String_Node_Str","String_Node_Str",Terminated.class.getSimpleName());
  boolean allChildrenAreDead=true;
  if (stopping) {
    allChildrenAreDead=Iterables.isEmpty(getContext().getChildren());
    if (allChildrenAreDead) {
      getSelf().tell(new Messages.JobStateUpdated(plugin,JOB_STATE.STOPPED),getSelf());
    }
  }
  LOGGER.trace("String_Node_Str","String_Node_Str",Terminated.class.getSimpleName(),stopping,allChildrenAreDead);
}
Program: 188293
Project: 188293
Buggy source:
@Override public void onChange(ChangeEvent changeEvent){
  String typeString=null;
  String version="String_Node_Str";
  String value=type.getSelectedValue();
  if (value.contains(RodaConstants.METADATA_VERSION_SEPARATOR) && bundle.getVersion() != null) {
    typeString=value.substring(0,value.lastIndexOf(RodaConstants.METADATA_VERSION_SEPARATOR));
    version=value.substring(value.lastIndexOf(RodaConstants.METADATA_VERSION_SEPARATOR) + 1,value.length());
  }
  if (typeString == null) {
    typeString=value;
  }
  BrowserService.Util.getInstance().retrieveDescriptiveMetadataEditBundle(aipId,representationId,bundle.getId(),typeString,version,LocaleInfo.getCurrentLocale().getLocaleName(),new AsyncCallback<DescriptiveMetadataEditBundle>(){
    @Override public void onFailure(    Throwable caught){
      AsyncCallbackUtils.defaultFailureTreatment(caught);
    }
    @Override public void onSuccess(    DescriptiveMetadataEditBundle editBundle){
      bundle=editBundle;
      Set<MetadataValue> newValues=null;
      if (bundle.getValues() != null) {
        newValues=new TreeSet<>();
        for (        MetadataValue mv : bundle.getValues())         newValues.add(mv.copy());
      }
      supportedBundle=new SupportedMetadataTypeBundle(bundle.getId(),bundle.getType(),bundle.getVersion(),bundle.getId(),bundle.getRawTemplate(),newValues);
      updateFormOrXML();
    }
  }
);
}

Fixed version (ground truth):
@Override public void onChange(ChangeEvent changeEvent){
  String typeString=null;
  String version=null;
  String value=type.getSelectedValue();
  if (value.contains(RodaConstants.METADATA_VERSION_SEPARATOR) && bundle.getVersion() != null) {
    typeString=value.substring(0,value.lastIndexOf(RodaConstants.METADATA_VERSION_SEPARATOR));
    version=value.substring(value.lastIndexOf(RodaConstants.METADATA_VERSION_SEPARATOR) + 1,value.length());
  }
  if (typeString == null) {
    typeString=value;
  }
  BrowserService.Util.getInstance().retrieveDescriptiveMetadataEditBundle(aipId,representationId,bundle.getId(),typeString,version,LocaleInfo.getCurrentLocale().getLocaleName(),new AsyncCallback<DescriptiveMetadataEditBundle>(){
    @Override public void onFailure(    Throwable caught){
      AsyncCallbackUtils.defaultFailureTreatment(caught);
    }
    @Override public void onSuccess(    DescriptiveMetadataEditBundle editBundle){
      bundle=editBundle;
      Set<MetadataValue> newValues=null;
      if (bundle.getValues() != null) {
        newValues=new TreeSet<>();
        for (        MetadataValue mv : bundle.getValues())         newValues.add(mv.copy());
      }
      supportedBundle=new SupportedMetadataTypeBundle(bundle.getId(),bundle.getType(),bundle.getVersion(),bundle.getId(),bundle.getRawTemplate(),newValues);
      updateFormOrXML();
    }
  }
);
}
Program: 188295
Project: 188295
Buggy source:
public static void create(FlowPanel panel,Set<MetadataValue> bundle,boolean addStyle){
  for (  MetadataValue mv : bundle) {
    boolean mandatory=(mv.get("String_Node_Str") != null && "String_Node_Str".equalsIgnoreCase(mv.get("String_Node_Str"))) ? true : false;
    if (mv.get("String_Node_Str") != null && "String_Node_Str".equals(mv.get("String_Node_Str")))     continue;
    FlowPanel layout=new FlowPanel();
    if (addStyle) {
      layout.addStyleName("String_Node_Str");
    }
    String controlType=mv.get("String_Node_Str");
    if (controlType == null) {
      addTextField(panel,layout,mv,mandatory);
    }
 else {
switch (controlType) {
case "String_Node_Str":
        addTextField(panel,layout,mv,mandatory);
      break;
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
    addTextArea(panel,layout,mv,mandatory);
  break;
case "String_Node_Str":
addList(panel,layout,mv,mandatory);
break;
case "String_Node_Str":
addDatePicker(panel,layout,mv,mandatory);
break;
case "String_Node_Str":
layout.addStyleName("String_Node_Str");
addSeparator(panel,layout,mv);
break;
default :
addTextField(panel,layout,mv,mandatory);
break;
}
}
}
}

Fixed version (ground truth):
public static void create(FlowPanel panel,Set<MetadataValue> bundle,boolean addStyle){
  for (  MetadataValue mv : bundle) {
    boolean mandatory=(mv.get("String_Node_Str") != null && "String_Node_Str".equalsIgnoreCase(mv.get("String_Node_Str"))) ? true : false;
    if (mv.get("String_Node_Str") != null && "String_Node_Str".equals(mv.get("String_Node_Str"))) {
      continue;
    }
    FlowPanel layout=new FlowPanel();
    if (addStyle) {
      layout.addStyleName("String_Node_Str");
    }
    String controlType=mv.get("String_Node_Str");
    if (controlType == null) {
      addTextField(panel,layout,mv,mandatory);
    }
 else {
switch (controlType) {
case "String_Node_Str":
        addTextField(panel,layout,mv,mandatory);
      break;
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
    addTextArea(panel,layout,mv,mandatory);
  break;
case "String_Node_Str":
addList(panel,layout,mv,mandatory);
break;
case "String_Node_Str":
addDatePicker(panel,layout,mv,mandatory);
break;
case "String_Node_Str":
layout.addStyleName("String_Node_Str");
addSeparator(panel,layout,mv);
break;
default :
addTextField(panel,layout,mv,mandatory);
break;
}
}
}
}
Program: 188296
Project: 188296
Buggy source:
public LongRangeFilterParameter(String name,Long fromValue,Long toValue){
  super(name,fromValue,toValue);
}

Fixed version (ground truth):
public LongRangeFilterParameter(String name,String fromValue,String toValue){
  super(name,parseInput(fromValue),parseInput(toValue));
}
Program: 188298
Project: 188298
Buggy source:
private boolean intervalValid(TextBox inputFrom,TextBox inputTo){
  try {
    if (!inputFrom.getValue().isEmpty() && !inputTo.getValue().isEmpty()) {
      return true;
    }
    if (!inputFrom.getValue().isEmpty() || !inputTo.getValue().isEmpty()) {
      return true;
    }
  }
 catch (  Exception e) {
  }
  return false;
}

Fixed version (ground truth):
private boolean intervalValid(TextBox inputFrom,TextBox inputTo){
  try {
    if (!inputFrom.getValue().isEmpty() || !inputTo.getValue().isEmpty()) {
      return true;
    }
  }
 catch (  Exception e) {
  }
  return false;
}
Program: 188299
Project: 188299
Buggy source:
public static void updateMyUser(User user,User modifiedUser,String password,UserExtraBundle extra) throws AuthorizationDeniedException, NotFoundException, AlreadyExistsException, GenericException, IllegalOperationException {
  ControllerAssistant controllerAssistant=new ControllerAssistant(){
  }
;
  if (!user.getId().equals(modifiedUser.getId())) {
    throw new IllegalOperationException("String_Node_Str");
  }
  controllerAssistant.checkRoles(user);
  LOG_ENTRY_STATE state=LOG_ENTRY_STATE.SUCCESS;
  try {
    UserManagementHelper.updateMyUser(modifiedUser,password,extra);
  }
 catch (  RODAException e) {
    state=LOG_ENTRY_STATE.FAILURE;
    throw e;
  }
 finally {
    controllerAssistant.registerAction(user,state,RodaConstants.CONTROLLER_USER_PARAM,modifiedUser);
  }
}

Fixed version (ground truth):
public static User updateMyUser(User user,User modifiedUser,String password,UserExtraBundle extra) throws AuthorizationDeniedException, NotFoundException, AlreadyExistsException, GenericException, IllegalOperationException {
  ControllerAssistant controllerAssistant=new ControllerAssistant(){
  }
;
  if (!user.getId().equals(modifiedUser.getId())) {
    throw new IllegalOperationException("String_Node_Str");
  }
  controllerAssistant.checkRoles(user);
  LOG_ENTRY_STATE state=LOG_ENTRY_STATE.SUCCESS;
  try {
    return UserManagementHelper.updateMyUser(modifiedUser,password,extra);
  }
 catch (  RODAException e) {
    state=LOG_ENTRY_STATE.FAILURE;
    throw e;
  }
 finally {
    controllerAssistant.registerAction(user,state,RodaConstants.CONTROLLER_USER_PARAM,modifiedUser);
  }
}
Program: 188300
Project: 188300
Buggy source:
public static User updateMyUser(User user,String password,UserExtraBundle extra) throws GenericException, AlreadyExistsException, NotFoundException, AuthorizationDeniedException {
  user.setExtra(getUserExtra(extra));
  User currentUser=RodaCoreFactory.getModelService().retrieveUserByName(user.getName());
  User resetUser=resetUser(user,currentUser);
  User modifiedUser=RodaCoreFactory.getModelService().updateMyUser(resetUser,password,true);
  RodaCoreFactory.getIndexService().commit(RODAMember.class);
  return modifiedUser;
}

Fixed version (ground truth):
public static User updateMyUser(User modifiedUser,String password,UserExtraBundle extra) throws GenericException, AlreadyExistsException, NotFoundException, AuthorizationDeniedException {
  modifiedUser.setExtra(getUserExtra(extra));
  User currentUser=RodaCoreFactory.getModelService().retrieveUserByName(modifiedUser.getName());
  User resetUser=resetUser(modifiedUser,currentUser);
  User finalModifiedUser=RodaCoreFactory.getModelService().updateMyUser(resetUser,password,true);
  RodaCoreFactory.getIndexService().commit(RODAMember.class);
  return finalModifiedUser;
}
Program: 188301
Project: 188301
Buggy source:
@UiHandler("String_Node_Str") void buttonApplyHandler(ClickEvent e){
  if (userDataPanel.isChanged()) {
    if (userDataPanel.isValid()) {
      final User user=userDataPanel.getUser();
      final String password=userDataPanel.getPassword();
      UserManagementService.Util.getInstance().updateMyUser(user,password,userDataPanel.getExtra(),new AsyncCallback<Void>(){
        @Override public void onFailure(        Throwable caught){
          errorMessage(caught);
        }
        @Override public void onSuccess(        Void result){
          UserLogin.getInstance().updateLoggedUser(user);
          HistoryUtils.newHistory(Welcome.RESOLVER);
        }
      }
);
    }
  }
 else {
    HistoryUtils.newHistory(Welcome.RESOLVER);
  }
}

Fixed version (ground truth):
@UiHandler("String_Node_Str") void buttonApplyHandler(ClickEvent e){
  if (userDataPanel.isChanged()) {
    if (userDataPanel.isValid()) {
      final User user=userDataPanel.getUser();
      final String password=userDataPanel.getPassword();
      UserManagementService.Util.getInstance().updateMyUser(user,password,userDataPanel.getExtra(),new AsyncCallback<User>(){
        @Override public void onFailure(        Throwable caught){
          errorMessage(caught);
        }
        @Override public void onSuccess(        User updatedUser){
          UserLogin.getInstance().updateLoggedUser(updatedUser);
          HistoryUtils.newHistory(Welcome.RESOLVER);
        }
      }
);
    }
  }
 else {
    HistoryUtils.newHistory(Welcome.RESOLVER);
  }
}
Program: 188302
Project: 188302
Buggy source:
@Override public void onSuccess(Void result){
  UserLogin.getInstance().updateLoggedUser(user);
  HistoryUtils.newHistory(Welcome.RESOLVER);
}

Fixed version (ground truth):
@Override public void onSuccess(User updatedUser){
  UserLogin.getInstance().updateLoggedUser(updatedUser);
  HistoryUtils.newHistory(Welcome.RESOLVER);
}
Program: 188303
Project: 188303
Buggy source:
/** 
 * Modify the authenticated user
 * @param user the modified user
 * @param password the user password if modified, or null if it remains the same
 * @throws AuthorizationDeniedException
 * @throws NotFoundException
 * @throws AlreadyExistsException
 * @throws GenericException
 * @throws IllegalOperationException
 */
public void updateMyUser(User user,String password,UserExtraBundle extra) throws AuthorizationDeniedException, NotFoundException, AlreadyExistsException, GenericException, IllegalOperationException ;

Fixed version (ground truth):
/** 
 * Modify the authenticated user
 * @param user the modified user
 * @param password the user password if modified, or null if it remains the same
 * @throws AuthorizationDeniedException
 * @throws NotFoundException
 * @throws AlreadyExistsException
 * @throws GenericException
 * @throws IllegalOperationException
 */
public User updateMyUser(User user,String password,UserExtraBundle extra) throws AuthorizationDeniedException, NotFoundException, AlreadyExistsException, GenericException, IllegalOperationException ;
Program: 188304
Project: 188304
Buggy source:
/** 
 * Modify the authenticated user
 * @param user the modified user
 * @param password the user password if modified, or null if it remains the same
 * @throws AuthorizationDeniedException
 * @throws NotFoundException
 * @throws AlreadyExistsException
 * @throws GenericException
 * @throws IllegalOperationException
 */
public void updateMyUser(User user,String password,UserExtraBundle extra,AsyncCallback<Void> callback);

Fixed version (ground truth):
/** 
 * Modify the authenticated user
 * @param user the modified user
 * @param password the user password if modified, or null if it remains the same
 * @throws AuthorizationDeniedException
 * @throws NotFoundException
 * @throws AlreadyExistsException
 * @throws GenericException
 * @throws IllegalOperationException
 */
public void updateMyUser(User user,String password,UserExtraBundle extra,AsyncCallback<User> callback);
Program: 188305
Project: 188305
Buggy source:
@Override public void updateMyUser(User modifiedUser,String password,UserExtraBundle extra) throws AuthorizationDeniedException, NotFoundException, AlreadyExistsException, GenericException, IllegalOperationException {
  User user=UserUtility.getUser(getThreadLocalRequest());
  UserManagement.updateMyUser(user,modifiedUser,password,extra);
}

Fixed version (ground truth):
@Override public User updateMyUser(User modifiedUser,String password,UserExtraBundle extra) throws AuthorizationDeniedException, NotFoundException, AlreadyExistsException, GenericException, IllegalOperationException {
  HttpServletRequest request=getThreadLocalRequest();
  User user=UserUtility.getUser(request);
  User finalModifiedUser=UserManagement.updateMyUser(user,modifiedUser,password,extra);
  UserUtility.setUser(finalModifiedUser,request);
  return finalModifiedUser;
}
Program: 188306
Project: 188306
Buggy source:
public boolean isSmall(){
  boolean small=editPassword.getValue().length() < 6;
  updateAfterValidation(!small);
  return small;
}

Fixed version (ground truth):
public boolean isSmall(){
  boolean small;
  if (buttonMode && StringUtils.isBlank(editPassword.getValue())) {
    small=false;
  }
 else {
    small=editPassword.getValue().length() < 6;
  }
  updateAfterValidation(!small);
  return small;
}
Program: 188307
Project: 188307
Buggy source:
/** 
 * Is the requested path in the list of exclusions?
 * @param request the request.
 * @return <code>true</code> if it is excluded and <code>false</code>otherwise.
 */
private boolean isRequestUrlExcluded(final HttpServletRequest request){
  for (  String exclusion : this.exclusions) {
    if (request.getPathInfo().matches(exclusion)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Is the requested path in the list of exclusions?
 * @param request the request.
 * @return <code>true</code> if it is excluded and <code>false</code>otherwise.
 */
private boolean isRequestUrlExcluded(final HttpServletRequest request){
  for (  String exclusion : this.exclusions) {
    String pathInfo=request.getPathInfo();
    if (pathInfo != null && exclusion != null && pathInfo.matches(exclusion)) {
      return true;
    }
  }
  return false;
}
Program: 188310
Project: 188310
Buggy source:
private boolean doPluginExecute(String fileFormat,String filePronom,String fileMimetype,List<String> applicableTo,List<String> convertableTo,Map<String,List<String>> pronomToExtension,Map<String,List<String>> mimetypeToExtension){
  String lowerCaseFileFormat=fileFormat == null ? null : fileFormat.toLowerCase();
  if (LOGGER.isDebugEnabled()) {
    LOGGER.debug("String_Node_Str",lowerCaseFileFormat,filePronom,fileMimetype,applicableTo,convertableTo,pronomToExtension,mimetypeToExtension);
  }
  boolean format=getInputFormat().isEmpty() || lowerCaseFileFormat.equalsIgnoreCase(getInputFormat());
  boolean applicable=applicableTo.isEmpty() || (filePronom != null && pronomToExtension.containsKey(filePronom)) || (fileMimetype != null && mimetypeToExtension.containsKey(fileMimetype))|| (applicableTo.contains(lowerCaseFileFormat));
  boolean convertable=convertableTo.isEmpty() || convertableTo.contains(outputFormat.toLowerCase());
  LOGGER.debug("String_Node_Str",format,applicable,convertable);
  return format && applicable && convertable;
}

Fixed version (ground truth):
private boolean doPluginExecute(String fileFormat,String filePronom,String fileMimetype,List<String> applicableTo,List<String> convertableTo,Map<String,List<String>> pronomToExtension,Map<String,List<String>> mimetypeToExtension){
  String lowerCaseFileFormat=fileFormat == null ? null : fileFormat.toLowerCase();
  if (LOGGER.isDebugEnabled()) {
    LOGGER.debug("String_Node_Str",lowerCaseFileFormat,filePronom,fileMimetype,applicableTo,convertableTo,pronomToExtension,mimetypeToExtension);
  }
  boolean format=getInputFormat().isEmpty() || getInputFormat().equalsIgnoreCase(lowerCaseFileFormat);
  boolean applicable=applicableTo.isEmpty() || (filePronom != null && pronomToExtension.containsKey(filePronom)) || (fileMimetype != null && mimetypeToExtension.containsKey(fileMimetype))|| (applicableTo.contains(lowerCaseFileFormat));
  boolean convertable=convertableTo.isEmpty() || convertableTo.contains(outputFormat.toLowerCase());
  LOGGER.debug("String_Node_Str",format,applicable,convertable);
  return format && applicable && convertable;
}
Program: 188313
Project: 188313
Buggy source:
public void updateRepresentationType(String aipId,String representationId,String type) throws RequestNotValidException, NotFoundException, GenericException, AuthorizationDeniedException {
  AIP aip=retrieveAIP(aipId);
  for (Iterator<Representation> it=aip.getRepresentations().iterator(); it.hasNext(); ) {
    Representation representation=it.next();
    if (representation.getId().equals(representationId)) {
      representation.setType(type);
      notifyRepresentationUpdated(representation);
      break;
    }
  }
  updateAIPMetadata(aip);
}

Fixed version (ground truth):
public void updateRepresentationType(String aipId,String representationId,String type) throws RequestNotValidException, NotFoundException, GenericException, AuthorizationDeniedException {
  Representation representation=this.retrieveRepresentation(aipId,representationId);
  representation.setType(type);
  notifyRepresentationUpdated(representation);
  updateAIPMetadata(retrieveAIP(aipId));
}
Program: 188317
Project: 188317
Buggy source:
@Override public void onSuccess(Actionable.ActionImpact impact){
}

Fixed version (ground truth):
@Override public void onSuccess(IndexedRepresentation rep){
  representation=rep;
  representationType.setText(rep.getType());
}
Program: 188323
Project: 188323
Buggy source:
public <T extends IsIndexed>IterableIndexResult<T> findAll(final Class<T> returnClass,final Filter filter,final Sorter sorter,final Sublist sublist,final Facets facets,final User user,final boolean justActive,final boolean removeDuplicates,final List<String> fieldsToReturn){
  return new IterableIndexResult<>(getSolrClient(),returnClass,filter,sorter,sublist,facets,user,justActive,removeDuplicates,fieldsToReturn);
}

Fixed version (ground truth):
public <T extends IsIndexed>IterableIndexResult<T> findAll(final Class<T> returnClass,final Filter filter,final Sorter sorter,final Sublist sublist,final Facets facets,final User user,final boolean justActive,final List<String> fieldsToReturn){
  return new IterableIndexResult<>(getSolrClient(),returnClass,filter,sorter,sublist,facets,user,justActive,true,fieldsToReturn);
}
Program: 188324
Project: 188324
Buggy source:
public static void doJobObjectsCleanup(Job job,ModelService model,IndexService index){
  if (RodaCoreFactory.getNodeType() == NodeType.MASTER) {
    try {
      index.commit(IndexedAIP.class);
      Filter filter=new Filter();
      filter.add(new SimpleFilterParameter(RodaConstants.INGEST_JOB_ID,job.getId()));
      filter.add(new OneOfManyFilterParameter(RodaConstants.AIP_STATE,Arrays.asList(AIPState.CREATED.toString(),AIPState.INGEST_PROCESSING.toString())));
      doJobCleanup(model,index.findAll(IndexedAIP.class,filter,Arrays.asList(RodaConstants.INDEX_UUID)));
    }
 catch (    GenericException e) {
      LOGGER.error("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
public static void doJobObjectsCleanup(Job job,ModelService model,IndexService index){
  if (RodaCoreFactory.getNodeType() == NodeType.MASTER) {
    try {
      index.commit(IndexedAIP.class);
      Filter filter=new Filter();
      filter.add(new SimpleFilterParameter(RodaConstants.INGEST_JOB_ID,job.getId()));
      filter.add(new OneOfManyFilterParameter(RodaConstants.AIP_STATE,Arrays.asList(AIPState.CREATED.toString(),AIPState.INGEST_PROCESSING.toString())));
      doJobCleanup(model,index.findAll(IndexedAIP.class,filter,false,Arrays.asList(RodaConstants.INDEX_UUID)));
    }
 catch (    GenericException e) {
      LOGGER.error("String_Node_Str",e);
    }
  }
}
Program: 188325
Project: 188325
Buggy source:
private IterableIndexResult<IndexedAIP> findAipsToDelete(IndexService index,List<String> activeJobsIds){
  Filter aipsFilter=new Filter();
  activeJobsIds.forEach(e -> aipsFilter.add(new NotSimpleFilterParameter(RodaConstants.INGEST_JOB_ID,e)));
  aipsFilter.add(new SimpleFilterParameter(RodaConstants.AIP_STATE,AIPState.INGEST_PROCESSING.toString()));
  return index.findAll(IndexedAIP.class,aipsFilter,false,true,Arrays.asList(RodaConstants.INDEX_UUID));
}

Fixed version (ground truth):
private IterableIndexResult<IndexedAIP> findAipsToDelete(IndexService index,List<String> activeJobsIds){
  Filter aipsFilter=new Filter();
  activeJobsIds.forEach(e -> aipsFilter.add(new NotSimpleFilterParameter(RodaConstants.INGEST_JOB_ID,e)));
  aipsFilter.add(new SimpleFilterParameter(RodaConstants.AIP_STATE,AIPState.INGEST_PROCESSING.toString()));
  return index.findAll(IndexedAIP.class,aipsFilter,false,Arrays.asList(RodaConstants.INDEX_UUID));
}
Program: 188326
Project: 188326
Buggy source:
private List<String> findActiveJobs(IndexService index){
  Filter activeJobsViaStateFilter=new Filter();
  for (  Job.JOB_STATE jobState : Job.JOB_STATE.values()) {
    if (Job.isFinalState(jobState)) {
      activeJobsViaStateFilter.add(new NotSimpleFilterParameter(RodaConstants.JOB_STATE,jobState.toString()));
    }
  }
  List<String> activeJobsIds=new ArrayList<>();
  index.findAll(Job.class,activeJobsViaStateFilter,Arrays.asList(RodaConstants.JOB_ID)).forEach(e -> activeJobsIds.add(e.getId()));
  return activeJobsIds;
}

Fixed version (ground truth):
private List<String> findActiveJobs(IndexService index){
  Filter activeJobsViaStateFilter=new Filter();
  for (  Job.JOB_STATE jobState : Job.JOB_STATE.values()) {
    if (Job.isFinalState(jobState)) {
      activeJobsViaStateFilter.add(new NotSimpleFilterParameter(RodaConstants.JOB_STATE,jobState.toString()));
    }
  }
  List<String> activeJobsIds=new ArrayList<>();
  index.findAll(Job.class,activeJobsViaStateFilter,Arrays.asList(RodaConstants.INDEX_UUID)).forEach(e -> activeJobsIds.add(e.getId()));
  return activeJobsIds;
}