nus-yam/ex-repair huggingface dataset:
Program: 188691
Project: 188691
Buggy source:
public String createFile(String path,String fileName,InputStream inputStream) throws GenericException, RequestNotValidException {
  Path parent=path != null ? basePath.resolve(path) : basePath;
  try {
    Files.createDirectories(parent);
    Path file=parent.resolve(fileName);
    Files.copy(inputStream,file);
    BasicFileAttributes attrs=Files.readAttributes(file,BasicFileAttributes.class);
    TransferredResource resource=createTransferredResource(file,attrs,attrs.size(),basePath,new Date());
    index.create(TransferredResource.class,resource);
    return resource.getUUID();
  }
 catch (  IOException e) {
    throw new GenericException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public String createFile(String parentUUID,String fileName,InputStream inputStream) throws GenericException, RequestNotValidException, NotFoundException {
  Path parentPath;
  if (parentUUID != null) {
    TransferredResource parent=index.retrieve(TransferredResource.class,parentUUID);
    parentPath=basePath.resolve(parent.getRelativePath());
  }
 else {
    parentPath=basePath;
  }
  try {
    try {
      Files.createDirectories(parentPath);
    }
 catch (    FileAlreadyExistsException e) {
    }
    Path file=parentPath.resolve(fileName);
    Files.copy(inputStream,file);
    BasicFileAttributes attrs=Files.readAttributes(file,BasicFileAttributes.class);
    TransferredResource resource=createTransferredResource(file,attrs,attrs.size(),basePath,new Date());
    index.create(TransferredResource.class,resource);
    return resource.getUUID();
  }
 catch (  IOException e) {
    LOGGER.error("String_Node_Str",e);
    throw new GenericException("String_Node_Str",e);
  }
}
Program: 188692
Project: 188692
Buggy source:
public static String createTransferredResourcesFolder(RodaUser user,String parent,String folderName,boolean forceCommit) throws AuthorizationDeniedException, GenericException, RequestNotValidException {
  Date startDate=new Date();
  UserUtility.checkRoles(user,INGEST_TRANSFER_ROLE);
  UserUtility.checkTransferredResourceAccess(user,Arrays.asList(parent));
  try {
    String uuid=BrowserHelper.createTransferredResourcesFolder(parent,folderName,forceCommit);
    long duration=new Date().getTime() - startDate.getTime();
    registerAction(user,BROWSER_COMPONENT,"String_Node_Str",null,duration,PARENT_PARAM,parent,FOLDERNAME_PARAM,folderName,SUCCESS_PARAM,true);
    return uuid;
  }
 catch (  GenericException e) {
    long duration=new Date().getTime() - startDate.getTime();
    registerAction(user,BROWSER_COMPONENT,"String_Node_Str",null,duration,PARENT_PARAM,parent,FOLDERNAME_PARAM,folderName,SUCCESS_PARAM,false,ERROR_PARAM,e.getMessage());
    throw e;
  }
}

Fixed version (ground truth):
public static String createTransferredResourcesFolder(RodaUser user,String parentUUID,String folderName,boolean forceCommit) throws AuthorizationDeniedException, GenericException, RequestNotValidException, NotFoundException {
  Date startDate=new Date();
  UserUtility.checkRoles(user,INGEST_TRANSFER_ROLE);
  UserUtility.checkTransferredResourceAccess(user,Arrays.asList(parentUUID));
  try {
    String uuid=BrowserHelper.createTransferredResourcesFolder(parentUUID,folderName,forceCommit);
    long duration=new Date().getTime() - startDate.getTime();
    registerAction(user,BROWSER_COMPONENT,"String_Node_Str",null,duration,PARENT_PARAM,parentUUID,FOLDERNAME_PARAM,folderName,SUCCESS_PARAM,true);
    return uuid;
  }
 catch (  GenericException e) {
    long duration=new Date().getTime() - startDate.getTime();
    registerAction(user,BROWSER_COMPONENT,"String_Node_Str",null,duration,PARENT_PARAM,parentUUID,FOLDERNAME_PARAM,folderName,SUCCESS_PARAM,false,ERROR_PARAM,e.getMessage());
    throw e;
  }
}
Program: 188693
Project: 188693
Buggy source:
public static void createTransferredResource(RodaUser user,String parentId,String fileName,InputStream inputStream,String name,boolean forceCommit) throws AuthorizationDeniedException, GenericException, AlreadyExistsException, RequestNotValidException {
  if (name == null) {
    Browser.createTransferredResourceFile(user,parentId,fileName,inputStream,forceCommit);
  }
 else {
    Browser.createTransferredResourcesFolder(user,parentId,name,forceCommit);
  }
}

Fixed version (ground truth):
public static void createTransferredResource(RodaUser user,String parentUUID,String fileName,InputStream inputStream,String name,boolean forceCommit) throws AuthorizationDeniedException, GenericException, AlreadyExistsException, RequestNotValidException, NotFoundException {
  if (name == null) {
    Browser.createTransferredResourceFile(user,parentUUID,fileName,inputStream,forceCommit);
  }
 else {
    Browser.createTransferredResourcesFolder(user,parentUUID,name,forceCommit);
  }
}
Program: 188694
Project: 188694
Buggy source:
public static void createTransferredResourceFile(RodaUser user,String path,String fileName,InputStream inputStream,boolean forceCommit) throws AuthorizationDeniedException, GenericException, AlreadyExistsException, RequestNotValidException {
  Date startDate=new Date();
  UserUtility.checkRoles(user,INGEST_TRANSFER_ROLE);
  UserUtility.checkTransferredResourceAccess(user,Arrays.asList(path));
  try {
    BrowserHelper.createTransferredResourceFile(path,fileName,inputStream,forceCommit);
    long duration=new Date().getTime() - startDate.getTime();
    registerAction(user,BROWSER_COMPONENT,"String_Node_Str",null,duration,PATH_PARAM,path,FILENAME_PARAM,fileName,SUCCESS_PARAM,true);
  }
 catch (  GenericException e) {
    long duration=new Date().getTime() - startDate.getTime();
    registerAction(user,BROWSER_COMPONENT,"String_Node_Str",null,duration,PATH_PARAM,path,FILENAME_PARAM,fileName,SUCCESS_PARAM,false,ERROR_PARAM,e.getMessage());
    throw e;
  }
}

Fixed version (ground truth):
public static void createTransferredResourceFile(RodaUser user,String parentUUID,String fileName,InputStream inputStream,boolean forceCommit) throws AuthorizationDeniedException, GenericException, AlreadyExistsException, RequestNotValidException, NotFoundException {
  Date startDate=new Date();
  UserUtility.checkRoles(user,INGEST_TRANSFER_ROLE);
  UserUtility.checkTransferredResourceAccess(user,Arrays.asList(parentUUID));
  try {
    BrowserHelper.createTransferredResourceFile(parentUUID,fileName,inputStream,forceCommit);
    long duration=new Date().getTime() - startDate.getTime();
    registerAction(user,BROWSER_COMPONENT,"String_Node_Str",null,duration,PATH_PARAM,parentUUID,FILENAME_PARAM,fileName,SUCCESS_PARAM,true);
  }
 catch (  GenericException e) {
    long duration=new Date().getTime() - startDate.getTime();
    registerAction(user,BROWSER_COMPONENT,"String_Node_Str",null,duration,PATH_PARAM,parentUUID,FILENAME_PARAM,fileName,SUCCESS_PARAM,false,ERROR_PARAM,e.getMessage());
    throw e;
  }
}
Program: 188695
Project: 188695
Buggy source:
public static String createTransferredResourcesFolder(String parent,String folderName,boolean forceCommit) throws GenericException, RequestNotValidException {
  String uuid=RodaCoreFactory.getTransferredResourcesScanner().createFolder(parent,folderName);
  if (forceCommit) {
    RodaCoreFactory.getTransferredResourcesScanner().commit();
  }
  return uuid;
}

Fixed version (ground truth):
public static String createTransferredResourcesFolder(String parentUUID,String folderName,boolean forceCommit) throws GenericException, RequestNotValidException, NotFoundException {
  String uuid=RodaCoreFactory.getTransferredResourcesScanner().createFolder(parentUUID,folderName);
  if (forceCommit) {
    RodaCoreFactory.getTransferredResourcesScanner().commit();
  }
  return uuid;
}
Program: 188696
Project: 188696
Buggy source:
public static void createTransferredResourceFile(String path,String fileName,InputStream inputStream,boolean forceCommit) throws GenericException, AlreadyExistsException, RequestNotValidException {
  LOGGER.debug("String_Node_Str",path,fileName);
  RodaCoreFactory.getTransferredResourcesScanner().createFile(path,fileName,inputStream);
  if (forceCommit) {
    RodaCoreFactory.getTransferredResourcesScanner().commit();
  }
}

Fixed version (ground truth):
public static void createTransferredResourceFile(String parentUUID,String fileName,InputStream inputStream,boolean forceCommit) throws GenericException, AlreadyExistsException, RequestNotValidException, NotFoundException {
  LOGGER.debug("String_Node_Str",parentUUID,fileName);
  RodaCoreFactory.getTransferredResourcesScanner().createFile(parentUUID,fileName,inputStream);
  if (forceCommit) {
    RodaCoreFactory.getTransferredResourcesScanner().commit();
  }
}
Program: 188697
Project: 188697
Buggy source:
@Override public Response toResponse(RODAException e){
  Response response;
  if (e instanceof AuthorizationDeniedException) {
    response=Response.status(Status.UNAUTHORIZED).entity(new ApiResponseMessage(ApiResponseMessage.ERROR,e.getMessage())).build();
  }
 else   if (e instanceof NotImplementedException) {
    response=Response.serverError().entity(new ApiResponseMessage(ApiResponseMessage.ERROR,"String_Node_Str")).build();
  }
 else   if (e instanceof RequestNotValidException) {
    response=Response.status(Status.BAD_REQUEST).entity(new ApiResponseMessage(ApiResponseMessage.ERROR,e.getMessage())).build();
  }
 else   if (e instanceof GenericException) {
    response=Response.serverError().entity(new ApiResponseMessage(ApiResponseMessage.ERROR,e.getMessage())).build();
  }
 else   if (e instanceof NotFoundException) {
    response=Response.status(Status.NOT_FOUND).entity(new ApiResponseMessage(ApiResponseMessage.ERROR,e.getMessage())).build();
  }
 else   if (e instanceof AlreadyExistsException) {
    response=Response.status(Status.CONFLICT).entity(new ApiResponseMessage(ApiResponseMessage.ERROR,e.getMessage())).build();
  }
 else {
    response=Response.serverError().entity(new ApiResponseMessage(ApiResponseMessage.ERROR,e.getMessage())).build();
  }
  return response;
}

Fixed version (ground truth):
@Override public Response toResponse(RODAException e){
  Response response;
  String message=e.getClass().getSimpleName() + "String_Node_Str" + e.getMessage();
  if (e.getCause() != null) {
    message+="String_Node_Str" + e.getCause().getClass().getCanonicalName() + "String_Node_Str"+ e.getCause().getMessage();
  }
  if (e instanceof AuthorizationDeniedException) {
    response=Response.status(Status.UNAUTHORIZED).entity(new ApiResponseMessage(ApiResponseMessage.ERROR,message)).build();
  }
 else   if (e instanceof NotImplementedException) {
    response=Response.serverError().entity(new ApiResponseMessage(ApiResponseMessage.ERROR,"String_Node_Str")).build();
  }
 else   if (e instanceof RequestNotValidException) {
    response=Response.status(Status.BAD_REQUEST).entity(new ApiResponseMessage(ApiResponseMessage.ERROR,message)).build();
  }
 else   if (e instanceof GenericException) {
    response=Response.serverError().entity(new ApiResponseMessage(ApiResponseMessage.ERROR,message)).build();
  }
 else   if (e instanceof NotFoundException) {
    response=Response.status(Status.NOT_FOUND).entity(new ApiResponseMessage(ApiResponseMessage.ERROR,message)).build();
  }
 else   if (e instanceof AlreadyExistsException) {
    response=Response.status(Status.CONFLICT).entity(new ApiResponseMessage(ApiResponseMessage.ERROR,message)).build();
  }
 else {
    response=Response.serverError().entity(new ApiResponseMessage(ApiResponseMessage.ERROR,message)).build();
  }
  return response;
}
Program: 188698
Project: 188698
Buggy source:
@POST public Response createResource(@ApiParam(value="String_Node_Str",required=true) @QueryParam("String_Node_Str") String parentId,@ApiParam(value="String_Node_Str",required=false) @QueryParam("String_Node_Str") String name,@FormDataParam("String_Node_Str") InputStream inputStream,@FormDataParam("String_Node_Str") FormDataContentDisposition fileDetail) throws RODAException {
  RodaUser user=UserUtility.getApiUser(request,RodaCoreFactory.getIndexService());
  Browser.createTransferredResource(user,parentId,fileDetail.getFileName(),inputStream,name,true);
  return Response.ok().entity("String_Node_Str").build();
}

Fixed version (ground truth):
@POST public Response createResource(@ApiParam(value="String_Node_Str",required=true) @QueryParam(RodaConstants.TRANSFERRED_RESOURCE_PARENT_UUID) String parentUUID,@ApiParam(value="String_Node_Str",required=false) @QueryParam("String_Node_Str") String name,@FormDataParam("String_Node_Str") InputStream inputStream,@FormDataParam("String_Node_Str") FormDataContentDisposition fileDetail) throws RODAException {
  RodaUser user=UserUtility.getApiUser(request,RodaCoreFactory.getIndexService());
  Browser.createTransferredResource(user,parentUUID,fileDetail.getFileName(),inputStream,name,true);
  return Response.ok().entity("String_Node_Str").build();
}
Program: 188699
Project: 188699
Buggy source:
String createTransferredResourcesFolder(String parent,String folderName) throws AuthorizationDeniedException, GenericException, RequestNotValidException ;

Fixed version (ground truth):
String createTransferredResourcesFolder(String parent,String folderName) throws AuthorizationDeniedException, GenericException, RequestNotValidException, NotFoundException ;
Program: 188700
Project: 188700
Buggy source:
private String getUploadUrl(){
  String ret;
  if (resource == null) {
    ret=RestUtils.createTransferredResourceUploadUri(null);
  }
 else   if (resource != null && !resource.isFile()) {
    String id=resource.getId();
    ret=RestUtils.createTransferredResourceUploadUri(id);
  }
 else {
    ret=null;
  }
  return ret;
}

Fixed version (ground truth):
private String getUploadUrl(){
  String ret;
  if (resource == null) {
    ret=RestUtils.createTransferredResourceUploadUri(null);
  }
 else   if (resource != null && !resource.isFile()) {
    ret=RestUtils.createTransferredResourceUploadUri(resource.getUUID());
  }
 else {
    ret=null;
  }
  return ret;
}
Program: 188701
Project: 188701
Buggy source:
public static String createTransferredResourceUploadUri(String parentId){
  StringBuilder b=new StringBuilder();
  b.append(RodaConstants.API_REST_V1_TRANSFERRED);
  if (parentId != null) {
    b.append(RodaConstants.API_QUERY_START).append("String_Node_Str").append(RodaConstants.API_QUERY_ASSIGN_SYMBOL).append(parentId);
  }
  return b.toString();
}

Fixed version (ground truth):
public static String createTransferredResourceUploadUri(String parentUUID){
  StringBuilder b=new StringBuilder();
  b.append(RodaConstants.API_REST_V1_TRANSFERRED);
  if (parentUUID != null) {
    b.append(RodaConstants.API_QUERY_START).append(RodaConstants.TRANSFERRED_RESOURCE_PARENT_UUID).append(RodaConstants.API_QUERY_ASSIGN_SYMBOL).append(parentUUID);
  }
  return b.toString();
}
Program: 188702
Project: 188702
Buggy source:
public static <T extends Serializable>void updateJobReport(Plugin<T> plugin,ModelService model,IndexService index,Report reportItem,boolean replaceReportItem){
  String jobId=getJobId(plugin);
  try {
    Report jobReport;
    try {
      jobReport=model.retrieveJobReport(jobId,reportItem.getItemId());
    }
 catch (    NotFoundException e) {
      jobReport=createPluginReportItem(plugin,reportItem.getItemId(),reportItem.getOtherId());
      jobReport.setId(IdUtils.getJobReportId(jobId,reportItem.getItemId()));
      jobReport.addReport(reportItem);
    }
    jobReport.setDateUpdated(new Date());
    if (!replaceReportItem) {
      jobReport.addReport(reportItem);
    }
 else {
      List<Report> reportItems=jobReport.getReports();
      Report report=reportItems.get(reportItems.size() - 1);
      if (report.getPlugin().equalsIgnoreCase(reportItem.getPlugin())) {
        reportItems.remove(reportItems.size() - 1);
        jobReport.addReport(reportItem);
      }
    }
    model.createOrUpdateJobReport(jobReport);
  }
 catch (  GenericException|RequestNotValidException|AuthorizationDeniedException e) {
    LOGGER.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public static <T extends Serializable>void updateJobReport(Plugin<T> plugin,ModelService model,IndexService index,Report reportItem,boolean replaceReportItem){
  String jobId=getJobId(plugin);
  try {
    Report jobReport;
    try {
      jobReport=model.retrieveJobReport(jobId,reportItem.getItemId());
    }
 catch (    NotFoundException e) {
      jobReport=createPluginReportItem(plugin,reportItem.getItemId(),reportItem.getOtherId());
      jobReport.setId(IdUtils.getJobReportId(jobId,reportItem.getItemId()));
      jobReport.addReport(reportItem);
    }
    jobReport.setDateUpdated(new Date());
    if (!replaceReportItem) {
      jobReport.addReport(reportItem);
    }
 else {
      List<Report> reportItems=jobReport.getReports();
      Report report=reportItems.get(reportItems.size() - 1);
      if (report.getPlugin().equalsIgnoreCase(reportItem.getPlugin())) {
        reportItems.remove(reportItems.size() - 1);
        jobReport.setStepsCompleted(jobReport.getStepsCompleted() - 1);
        jobReport.addReport(reportItem);
      }
    }
    model.createOrUpdateJobReport(jobReport);
  }
 catch (  GenericException|RequestNotValidException|AuthorizationDeniedException e) {
    LOGGER.error("String_Node_Str",e);
  }
}
Program: 188703
Project: 188703
Buggy source:
protected static void validateAndSetCreateJobInformation(RodaUser user,Job job) throws RequestNotValidException {
  if (!ORCHESTRATOR_METHODS.contains(job.getOrchestratorMethod())) {
    throw new RequestNotValidException("String_Node_Str" + job.getOrchestratorMethod() + "String_Node_Str");
  }
  validateJobPluginInformation(job);
  if (org.apache.commons.lang3.StringUtils.isBlank(job.getId())) {
    job.setId(UUID.randomUUID().toString());
  }
  if (org.apache.commons.lang3.StringUtils.isBlank(job.getName())) {
    job.setName(job.getId());
  }
  job.setUsername(user.getName());
}

Fixed version (ground truth):
protected static void validateAndSetCreateJobInformation(RodaUser user,Job job) throws RequestNotValidException {
  if (!ORCHESTRATOR_METHODS.contains(job.getOrchestratorMethod())) {
    throw new RequestNotValidException("String_Node_Str" + job.getOrchestratorMethod() + "String_Node_Str");
  }
  validateJobPluginInformation(job);
  job.setId(UUID.randomUUID().toString());
  if (org.apache.commons.lang3.StringUtils.isBlank(job.getName())) {
    job.setName(job.getId());
  }
  job.setUsername(user.getName());
}
Program: 188704
Project: 188704
Buggy source:
public static void runReindexAipsPlugin(List<String> aipIds){
  Plugin<AIP> reindexPlugin=new ReindexAIPPlugin();
  ((ReindexAIPPlugin)reindexPlugin).setClearIndexes(false);
  getPluginOrchestrator().runPluginOnAIPs(reindexPlugin,aipIds);
}

Fixed version (ground truth):
public static void runReindexAipsPlugin(List<String> aipIds){
  Plugin<AIP> reindexPlugin=new ReindexAIPPlugin();
  getPluginOrchestrator().runPluginOnAIPs(reindexPlugin,aipIds);
}
Program: 188705
Project: 188705
Buggy source:
private ApiResponseMessage createJobToReindexAllAIPs(RodaUser user,Date startDate){
  ApiResponseMessage response=new ApiResponseMessage(ApiResponseMessage.OK,"String_Node_Str");
  Job job=new Job();
  job.setName("String_Node_Str").setOrchestratorMethod(ORCHESTRATOR_METHOD.ON_ALL_AIPS).setPlugin(ReindexAIPPlugin.class.getCanonicalName());
  try {
    Job jobCreated=Jobs.createJob(user,job);
    response.setMessage("String_Node_Str" + jobCreated + "String_Node_Str");
    long duration=new Date().getTime() - startDate.getTime();
    registerAction(user,"String_Node_Str","String_Node_Str",null,duration);
  }
 catch (  AuthorizationDeniedException|RequestNotValidException|NotFoundException|GenericException e) {
    LOGGER.error("String_Node_Str",e);
  }
  return response;
}

Fixed version (ground truth):
private ApiResponseMessage createJobToReindexAllAIPs(RodaUser user,Date startDate){
  ApiResponseMessage response=new ApiResponseMessage(ApiResponseMessage.OK,"String_Node_Str");
  Job job=new Job();
  job.setName("String_Node_Str").setOrchestratorMethod(ORCHESTRATOR_METHOD.ON_ALL_AIPS).setPlugin(ReindexAIPPlugin.class.getCanonicalName());
  Map<String,String> pluginParameters=new HashMap<>();
  pluginParameters.put(RodaConstants.PLUGIN_PARAMS_BOOLEAN_VALUE,"String_Node_Str");
  job.setPluginParameters(pluginParameters);
  try {
    Job jobCreated=Jobs.createJob(user,job);
    response.setMessage("String_Node_Str" + jobCreated + "String_Node_Str");
    long duration=new Date().getTime() - startDate.getTime();
    registerAction(user,"String_Node_Str","String_Node_Str",null,duration);
  }
 catch (  AuthorizationDeniedException|RequestNotValidException|NotFoundException|GenericException e) {
    LOGGER.error("String_Node_Str",e);
  }
  return response;
}
Program: 188706
Project: 188706
Buggy source:
/** 
 * Recalculates (if failures must be noticed) and updates AIP objects (by obtaining them from model)
 */
private List<AIP> recalculateAIPsList(ModelService model,List<AIP> aips,Map<String,Report> reports,Map<String,String> aipIdToTransferredResourceId,boolean removeAIPProcessingFailed){
  List<AIP> newAips=new ArrayList<>();
  for (int i=0; i < aips.size(); i++) {
    AIP aip=aips.get(i);
    String transferredResourceId=aipIdToTransferredResourceId.get(aip.getId());
    Report report=reports.get(transferredResourceId);
    if (removeAIPProcessingFailed && report.getPluginState() == PluginState.FAILURE) {
      aips.remove(i);
    }
 else {
      try {
        newAips.add(model.retrieveAIP(aip.getId()));
      }
 catch (      RequestNotValidException|NotFoundException|GenericException|AuthorizationDeniedException e) {
        LOGGER.error("String_Node_Str",e);
      }
    }
  }
  return newAips;
}

Fixed version (ground truth):
/** 
 * Recalculates (if failures must be noticed) and updates AIP objects (by obtaining them from model)
 */
private List<AIP> recalculateAIPsList(ModelService model,List<AIP> aips,Map<String,Report> reports,Map<String,String> aipIdToTransferredResourceId,boolean removeAIPProcessingFailed){
  List<AIP> newAips=new ArrayList<>();
  for (  AIP aip : aips) {
    String transferredResourceId=aipIdToTransferredResourceId.get(aip.getId());
    Report report=reports.get(transferredResourceId);
    if (removeAIPProcessingFailed && report.getPluginState() == PluginState.FAILURE) {
      LOGGER.debug("String_Node_Str",aip.getId());
    }
 else {
      try {
        newAips.add(model.retrieveAIP(aip.getId()));
      }
 catch (      RequestNotValidException|NotFoundException|GenericException|AuthorizationDeniedException e) {
        LOGGER.error("String_Node_Str",e);
      }
    }
  }
  return newAips;
}
Program: 188707
Project: 188707
Buggy source:
private static String getSiegfriedServerEndpoint(Path sourceDirectory){
  String siegfriedServer=RodaCoreFactory.getRodaConfigurationAsString("String_Node_Str","String_Node_Str","String_Node_Str");
  String endpoint=siegfriedServer + "String_Node_Str" + new String(Base64.encode(sourceDirectory.toString().getBytes()));
  return endpoint;
}

Fixed version (ground truth):
private static String getSiegfriedServerEndpoint(Path sourceDirectory){
  String siegfriedServer=RodaCoreFactory.getRodaConfigurationAsString("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  String endpoint=siegfriedServer + "String_Node_Str" + new String(Base64.encode(sourceDirectory.toString().getBytes()));
  return endpoint;
}
Program: 188709
Project: 188709
Buggy source:
@Override public <T extends Serializable>void updateJobPercentage(Plugin<T> plugin,int stepsCompleted,int totalSteps){
  String jobId=PluginHelper.getJobId(plugin);
  if (jobId != null) {
synchronized (runningTasks) {
      Integer totalNumberOfObjects=runningTasksTotalObjects.get(jobId);
      Map<Plugin<?>,JobPluginInfo> map=runningTasks.get(jobId);
      map.get(plugin).setStepsCompleted(stepsCompleted);
      float percentage=0f;
      for (      JobPluginInfo entry : map.values()) {
        float pluginPercentage=((float)entry.getStepsCompleted()) / totalSteps;
        float pluginWeight=((float)entry.getNumberOfObjects()) / totalNumberOfObjects;
        percentage+=(pluginPercentage * pluginWeight);
      }
      PluginHelper.updateJobStatus(plugin,index,model,Math.round((percentage * 100)));
    }
  }
}

Fixed version (ground truth):
@Override public <T extends Serializable>void updateJobPercentage(Plugin<T> plugin,int stepsCompleted,int totalSteps){
  String jobId=PluginHelper.getJobId(plugin);
  if (jobId != null) {
synchronized (runningTasks) {
      Integer totalNumberOfObjects=runningTasksTotalObjects.get(jobId);
      Map<Plugin<?>,JobPluginInfo> map=runningTasks.get(jobId);
      map.get(plugin).setStepsCompleted(stepsCompleted);
      float percentage=0f;
      for (      JobPluginInfo entry : map.values()) {
        float pluginPercentage=((float)entry.getStepsCompleted()) / totalSteps;
        float pluginWeight=((float)entry.getNumberOfObjects()) / totalNumberOfObjects;
        percentage+=(pluginPercentage * pluginWeight);
      }
      PluginHelper.updateJobStatus(plugin,model,Math.round((percentage * 100)));
    }
  }
}
Program: 188710
Project: 188710
Buggy source:
@Override public void onReceive(Object msg) throws Exception {
  if (msg instanceof Job) {
    List<Report> reports=new ArrayList<>();
    Job job=(Job)msg;
    Plugin<?> plugin=(Plugin<?>)RodaCoreFactory.getPluginManager().getPlugin(job.getPlugin());
    PluginHelper.setPluginParameters(plugin,job);
    PluginHelper.updateJobStatus(plugin,RodaCoreFactory.getIndexService(),RodaCoreFactory.getModelService(),0);
    if (ORCHESTRATOR_METHOD.ON_TRANSFERRED_RESOURCES == job.getOrchestratorMethod()) {
      reports=RodaCoreFactory.getPluginOrchestrator().runPluginOnTransferredResources((Plugin<TransferredResource>)plugin,getTransferredResourcesFromObjectIds(job.getObjectIds()));
    }
 else     if (ORCHESTRATOR_METHOD.ON_ALL_AIPS == job.getOrchestratorMethod()) {
      reports=RodaCoreFactory.getPluginOrchestrator().runPluginOnAllAIPs((Plugin<AIP>)plugin);
    }
 else     if (ORCHESTRATOR_METHOD.ON_AIPS == job.getOrchestratorMethod()) {
      reports=RodaCoreFactory.getPluginOrchestrator().runPluginOnAIPs((Plugin<AIP>)plugin,job.getObjectIds());
    }
 else     if (ORCHESTRATOR_METHOD.RUN_PLUGIN == job.getOrchestratorMethod()) {
      RodaCoreFactory.getPluginOrchestrator().runPlugin(plugin);
    }
    PluginHelper.updateJobStatus(plugin,RodaCoreFactory.getIndexService(),RodaCoreFactory.getModelService(),100);
    getSender().tell(reports,getSelf());
  }
}

Fixed version (ground truth):
@Override public void onReceive(Object msg) throws Exception {
  if (msg instanceof Job) {
    List<Report> reports=new ArrayList<>();
    Job job=(Job)msg;
    Plugin<?> plugin=(Plugin<?>)RodaCoreFactory.getPluginManager().getPlugin(job.getPlugin());
    PluginHelper.setPluginParameters(plugin,job);
    PluginHelper.updateJobStatus(plugin,RodaCoreFactory.getModelService(),0);
    if (ORCHESTRATOR_METHOD.ON_TRANSFERRED_RESOURCES == job.getOrchestratorMethod()) {
      reports=RodaCoreFactory.getPluginOrchestrator().runPluginOnTransferredResources((Plugin<TransferredResource>)plugin,getTransferredResourcesFromObjectIds(job.getObjectIds()));
    }
 else     if (ORCHESTRATOR_METHOD.ON_ALL_AIPS == job.getOrchestratorMethod()) {
      reports=RodaCoreFactory.getPluginOrchestrator().runPluginOnAllAIPs((Plugin<AIP>)plugin);
    }
 else     if (ORCHESTRATOR_METHOD.ON_AIPS == job.getOrchestratorMethod()) {
      reports=RodaCoreFactory.getPluginOrchestrator().runPluginOnAIPs((Plugin<AIP>)plugin,job.getObjectIds());
    }
 else     if (ORCHESTRATOR_METHOD.RUN_PLUGIN == job.getOrchestratorMethod()) {
      RodaCoreFactory.getPluginOrchestrator().runPlugin(plugin);
    }
    PluginHelper.updateJobStatus(plugin,RodaCoreFactory.getModelService(),100);
    getSender().tell(reports,getSelf());
  }
}
Program: 188711
Project: 188711
Buggy source:
public static <T extends Serializable>void updateJobStatus(Plugin<T> plugin,IndexService index,ModelService model,int newCompletionPercentage){
  try {
    LOGGER.debug("String_Node_Str",newCompletionPercentage);
    Job job=PluginHelper.getJobFromIndex(plugin,index);
    job.setCompletionPercentage(newCompletionPercentage);
    if (newCompletionPercentage == 0) {
      job.setState(JOB_STATE.STARTED);
    }
 else     if (newCompletionPercentage == 100) {
      job.setState(JOB_STATE.COMPLETED);
      job.setEndDate(new Date());
    }
    model.createOrUpdateJob(job);
  }
 catch (  NotFoundException|GenericException e) {
    LOGGER.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public static <T extends Serializable>void updateJobStatus(Plugin<T> plugin,ModelService model,int newCompletionPercentage){
  try {
    LOGGER.debug("String_Node_Str",newCompletionPercentage);
    Job job=PluginHelper.getJobFromModel(plugin,model);
    job.setCompletionPercentage(newCompletionPercentage);
    if (newCompletionPercentage == 0) {
      job.setState(JOB_STATE.STARTED);
    }
 else     if (newCompletionPercentage == 100) {
      job.setState(JOB_STATE.COMPLETED);
      job.setEndDate(new Date());
    }
    model.createOrUpdateJob(job);
  }
 catch (  NotFoundException|GenericException|RequestNotValidException|AuthorizationDeniedException e) {
    LOGGER.error("String_Node_Str",e);
  }
}
Program: 188712
Project: 188712
Buggy source:
public static <T extends Serializable>Job getJobFromIndex(Plugin<T> plugin,IndexService index) throws NotFoundException, GenericException {
  String jobID=getJobId(plugin);
  if (jobID != null) {
    return index.retrieve(Job.class,jobID);
  }
 else {
    throw new NotFoundException("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * 20160329 hsilva: use this method only to get job information that most certainly won't change in time (e.g. username, etc.)
 */
public static <T extends Serializable>Job getJobFromIndex(Plugin<T> plugin,IndexService index) throws NotFoundException, GenericException {
  String jobID=getJobId(plugin);
  if (jobID != null) {
    return index.retrieve(Job.class,jobID);
  }
 else {
    throw new NotFoundException("String_Node_Str");
  }
}
Program: 188713
Project: 188713
Buggy source:
private AIP ingestCorpora() throws RequestNotValidException, NotFoundException, GenericException, AlreadyExistsException, AuthorizationDeniedException, InvalidParameterException, InterruptedException, IOException, FileAlreadyExistsException {
  AIP root=model.createAIP(null);
  Plugin<TransferredResource> plugin=new BagitToAIPPlugin();
  Map<String,String> parameters=new HashMap<>();
  parameters.put(RodaConstants.PLUGIN_PARAMS_PARENT_ID,root.getId());
  plugin.setParameterValues(parameters);
  TransferredResource transferredResource=createCorpora();
  Assert.assertNotNull(transferredResource);
  List<Report> reports=RodaCoreFactory.getPluginOrchestrator().runPluginOnTransferredResources(plugin,Arrays.asList(transferredResource));
  assertReports(reports);
  IndexResult<IndexedAIP> find=index.find(IndexedAIP.class,new Filter(new SimpleFilterParameter(RodaConstants.AIP_PARENT_ID,root.getId())),null,new Sublist(0,10));
  Assert.assertEquals(1L,find.getTotalCount());
  IndexedAIP indexedAIP=find.getResults().get(0);
  AIP aip=model.retrieveAIP(indexedAIP.getId());
  return aip;
}

Fixed version (ground truth):
private AIP ingestCorpora() throws RequestNotValidException, NotFoundException, GenericException, AlreadyExistsException, AuthorizationDeniedException, InvalidParameterException, InterruptedException, IOException, FileAlreadyExistsException {
  AIP root=model.createAIP(null,new Permissions());
  Plugin<TransferredResource> plugin=new BagitToAIPPlugin();
  Map<String,String> parameters=new HashMap<>();
  parameters.put(RodaConstants.PLUGIN_PARAMS_PARENT_ID,root.getId());
  plugin.setParameterValues(parameters);
  TransferredResource transferredResource=createCorpora();
  Assert.assertNotNull(transferredResource);
  List<Report> reports=RodaCoreFactory.getPluginOrchestrator().runPluginOnTransferredResources(plugin,Arrays.asList(transferredResource));
  assertReports(reports);
  IndexResult<IndexedAIP> find=index.find(IndexedAIP.class,new Filter(new SimpleFilterParameter(RodaConstants.AIP_PARENT_ID,root.getId())),null,new Sublist(0,10));
  Assert.assertEquals(1L,find.getTotalCount());
  IndexedAIP indexedAIP=find.getResults().get(0);
  AIP aip=model.retrieveAIP(indexedAIP.getId());
  return aip;
}
Program: 188714
Project: 188714
Buggy source:
private AIP ingestCorpora() throws RequestNotValidException, NotFoundException, GenericException, AlreadyExistsException, AuthorizationDeniedException, InvalidParameterException, InterruptedException, IOException, FileAlreadyExistsException {
  AIP root=model.createAIP(null);
  Plugin<TransferredResource> plugin=new EARKSIPToAIPPlugin();
  Map<String,String> parameters=new HashMap<>();
  parameters.put(RodaConstants.PLUGIN_PARAMS_PARENT_ID,root.getId());
  plugin.setParameterValues(parameters);
  TransferredResource transferredResource=createCorpora();
  Assert.assertNotNull(transferredResource);
  List<Report> reports=RodaCoreFactory.getPluginOrchestrator().runPluginOnTransferredResources(plugin,Arrays.asList(transferredResource));
  assertReports(reports);
  index.commitAIPs();
  IndexResult<IndexedAIP> find=index.find(IndexedAIP.class,new Filter(new SimpleFilterParameter(RodaConstants.AIP_PARENT_ID,root.getId())),null,new Sublist(0,10));
  Assert.assertEquals(1L,find.getTotalCount());
  IndexedAIP indexedAIP=find.getResults().get(0);
  AIP aip=model.retrieveAIP(indexedAIP.getId());
  return aip;
}

Fixed version (ground truth):
private AIP ingestCorpora() throws RequestNotValidException, NotFoundException, GenericException, AlreadyExistsException, AuthorizationDeniedException, InvalidParameterException, InterruptedException, IOException, FileAlreadyExistsException {
  AIP root=model.createAIP(null,new Permissions());
  Plugin<TransferredResource> plugin=new EARKSIPToAIPPlugin();
  Map<String,String> parameters=new HashMap<>();
  parameters.put(RodaConstants.PLUGIN_PARAMS_PARENT_ID,root.getId());
  plugin.setParameterValues(parameters);
  TransferredResource transferredResource=createCorpora();
  Assert.assertNotNull(transferredResource);
  List<Report> reports=RodaCoreFactory.getPluginOrchestrator().runPluginOnTransferredResources(plugin,Arrays.asList(transferredResource));
  assertReports(reports);
  index.commitAIPs();
  IndexResult<IndexedAIP> find=index.find(IndexedAIP.class,new Filter(new SimpleFilterParameter(RodaConstants.AIP_PARENT_ID,root.getId())),null,new Sublist(0,10));
  Assert.assertEquals(1L,find.getTotalCount());
  IndexedAIP indexedAIP=find.getResults().get(0);
  AIP aip=model.retrieveAIP(indexedAIP.getId());
  return aip;
}
Program: 188715
Project: 188715
Buggy source:
private AIP ingestCorpora(int corporaId) throws RequestNotValidException, NotFoundException, GenericException, AlreadyExistsException, AuthorizationDeniedException, InvalidParameterException, InterruptedException, IOException, FileAlreadyExistsException {
  AIP root=model.createAIP(null);
  Plugin<TransferredResource> plugin=new TransferredResourceToAIPPlugin();
  Map<String,String> parameters=new HashMap<>();
  parameters.put(RodaConstants.PLUGIN_PARAMS_JOB_ID,FAKE_JOB_ID);
  parameters.put(RodaConstants.PLUGIN_PARAMS_PARENT_ID,root.getId());
  plugin.setParameterValues(parameters);
  List<TransferredResource> transferredResources=new ArrayList<TransferredResource>();
  transferredResources=createCorpora(corporaId);
  Assert.assertEquals(1,transferredResources.size());
  RodaCoreFactory.getPluginOrchestrator().runPluginOnTransferredResources(plugin,transferredResources);
  index.commitAIPs();
  IndexResult<IndexedAIP> find=index.find(IndexedAIP.class,new Filter(new SimpleFilterParameter(RodaConstants.AIP_PARENT_ID,root.getId())),null,new Sublist(0,10));
  Assert.assertEquals(1L,find.getTotalCount());
  IndexedAIP indexedAIP=find.getResults().get(0);
  AIP aip=model.retrieveAIP(indexedAIP.getId());
  return aip;
}

Fixed version (ground truth):
private AIP ingestCorpora(int corporaId) throws RequestNotValidException, NotFoundException, GenericException, AlreadyExistsException, AuthorizationDeniedException, InvalidParameterException, InterruptedException, IOException, FileAlreadyExistsException {
  AIP root=model.createAIP(null,new Permissions());
  Plugin<TransferredResource> plugin=new TransferredResourceToAIPPlugin();
  Map<String,String> parameters=new HashMap<>();
  parameters.put(RodaConstants.PLUGIN_PARAMS_JOB_ID,FAKE_JOB_ID);
  parameters.put(RodaConstants.PLUGIN_PARAMS_PARENT_ID,root.getId());
  plugin.setParameterValues(parameters);
  List<TransferredResource> transferredResources=new ArrayList<TransferredResource>();
  transferredResources=createCorpora(corporaId);
  Assert.assertEquals(1,transferredResources.size());
  RodaCoreFactory.getPluginOrchestrator().runPluginOnTransferredResources(plugin,transferredResources);
  index.commitAIPs();
  IndexResult<IndexedAIP> find=index.find(IndexedAIP.class,new Filter(new SimpleFilterParameter(RodaConstants.AIP_PARENT_ID,root.getId())),null,new Sublist(0,10));
  Assert.assertEquals(1L,find.getTotalCount());
  IndexedAIP indexedAIP=find.getResults().get(0);
  AIP aip=model.retrieveAIP(indexedAIP.getId());
  return aip;
}
Program: 188716
Project: 188716
Buggy source:
private AIP ingestCorpora(int corporaId) throws RequestNotValidException, NotFoundException, GenericException, AlreadyExistsException, AuthorizationDeniedException, InvalidParameterException, InterruptedException, IOException, FileAlreadyExistsException {
  AIP root=model.createAIP(null);
  Plugin<TransferredResource> plugin=new TransferredResourceToAIPPlugin();
  Map<String,String> parameters=new HashMap<>();
  parameters.put(RodaConstants.PLUGIN_PARAMS_PARENT_ID,root.getId());
  plugin.setParameterValues(parameters);
  List<TransferredResource> transferredResources=new ArrayList<TransferredResource>();
  transferredResources=createCorpora(corporaId);
  Assert.assertEquals(1,transferredResources.size());
  RodaCoreFactory.getPluginOrchestrator().runPluginOnTransferredResources(plugin,transferredResources);
  IndexResult<IndexedAIP> find=index.find(IndexedAIP.class,new Filter(new SimpleFilterParameter(RodaConstants.AIP_PARENT_ID,root.getId())),null,new Sublist(0,10));
  Assert.assertEquals(1L,find.getTotalCount());
  IndexedAIP indexedAIP=find.getResults().get(0);
  AIP aip=model.retrieveAIP(indexedAIP.getId());
  return aip;
}

Fixed version (ground truth):
private AIP ingestCorpora(int corporaId) throws RequestNotValidException, NotFoundException, GenericException, AlreadyExistsException, AuthorizationDeniedException, InvalidParameterException, InterruptedException, IOException, FileAlreadyExistsException {
  AIP root=model.createAIP(null,new Permissions());
  Plugin<TransferredResource> plugin=new TransferredResourceToAIPPlugin();
  Map<String,String> parameters=new HashMap<>();
  parameters.put(RodaConstants.PLUGIN_PARAMS_PARENT_ID,root.getId());
  plugin.setParameterValues(parameters);
  List<TransferredResource> transferredResources=new ArrayList<TransferredResource>();
  transferredResources=createCorpora(corporaId);
  Assert.assertEquals(1,transferredResources.size());
  RodaCoreFactory.getPluginOrchestrator().runPluginOnTransferredResources(plugin,transferredResources);
  IndexResult<IndexedAIP> find=index.find(IndexedAIP.class,new Filter(new SimpleFilterParameter(RodaConstants.AIP_PARENT_ID,root.getId())),null,new Sublist(0,10));
  Assert.assertEquals(1L,find.getTotalCount());
  IndexedAIP indexedAIP=find.getResults().get(0);
  AIP aip=model.retrieveAIP(indexedAIP.getId());
  return aip;
}
Program: 188717
Project: 188717
Buggy source:
private AIP ingestCorpora() throws RequestNotValidException, NotFoundException, GenericException, AlreadyExistsException, AuthorizationDeniedException, InvalidParameterException, InterruptedException, IOException, FileAlreadyExistsException {
  AIP root=model.createAIP(null);
  Plugin<TransferredResource> plugin=new TransferredResourceToAIPPlugin();
  Map<String,String> parameters=new HashMap<>();
  parameters.put(RodaConstants.PLUGIN_PARAMS_PARENT_ID,root.getId());
  parameters.put(RodaConstants.PLUGIN_PARAMS_JOB_ID,FAKE_JOB_ID);
  plugin.setParameterValues(parameters);
  TransferredResource transferredResource=createCorpora();
  Assert.assertNotNull(transferredResource);
  List<TransferredResource> items=Arrays.asList(transferredResource);
  List<Report> reports=RodaCoreFactory.getPluginOrchestrator().runPluginOnTransferredResources(plugin,items);
  assertReports(reports,null,items.stream().map(tr -> tr.getId()).collect(Collectors.toList()));
  index.commitAIPs();
  IndexResult<IndexedAIP> find=index.find(IndexedAIP.class,new Filter(new SimpleFilterParameter(RodaConstants.AIP_PARENT_ID,root.getId())),null,new Sublist(0,10));
  Assert.assertEquals(1L,find.getTotalCount());
  IndexedAIP indexedAIP=find.getResults().get(0);
  AIP aip=model.retrieveAIP(indexedAIP.getId());
  return aip;
}

Fixed version (ground truth):
private AIP ingestCorpora() throws RequestNotValidException, NotFoundException, GenericException, AlreadyExistsException, AuthorizationDeniedException, InvalidParameterException, InterruptedException, IOException, FileAlreadyExistsException {
  AIP root=model.createAIP(null,new Permissions());
  Plugin<TransferredResource> plugin=new TransferredResourceToAIPPlugin();
  Map<String,String> parameters=new HashMap<>();
  parameters.put(RodaConstants.PLUGIN_PARAMS_PARENT_ID,root.getId());
  parameters.put(RodaConstants.PLUGIN_PARAMS_JOB_ID,FAKE_JOB_ID);
  plugin.setParameterValues(parameters);
  TransferredResource transferredResource=createCorpora();
  Assert.assertNotNull(transferredResource);
  List<TransferredResource> items=Arrays.asList(transferredResource);
  List<Report> reports=RodaCoreFactory.getPluginOrchestrator().runPluginOnTransferredResources(plugin,items);
  assertReports(reports,null,items.stream().map(tr -> tr.getId()).collect(Collectors.toList()));
  index.commitAIPs();
  IndexResult<IndexedAIP> find=index.find(IndexedAIP.class,new Filter(new SimpleFilterParameter(RodaConstants.AIP_PARENT_ID,root.getId())),null,new Sublist(0,10));
  Assert.assertEquals(1L,find.getTotalCount());
  IndexedAIP indexedAIP=find.getResults().get(0);
  AIP aip=model.retrieveAIP(indexedAIP.getId());
  return aip;
}
Program: 188718
Project: 188718
Buggy source:
public static AIP createAIP(RodaUser user,String parentId) throws AuthorizationDeniedException, GenericException, NotFoundException, RequestNotValidException, AlreadyExistsException {
  Date start=new Date();
  UserUtility.checkRoles(user,ADMINISTRATION_METADATA_EDITOR_ROLE);
  if (parentId != null) {
    IndexedAIP parentSDO=BrowserHelper.retrieve(IndexedAIP.class,parentId);
    UserUtility.checkObjectPermissions(user,parentSDO,PermissionType.CREATE);
  }
 else {
  }
  AIP aip=BrowserHelper.createAIP(parentId);
  long duration=new Date().getTime() - start.getTime();
  registerAction(user,BROWSER_COMPONENT,"String_Node_Str",aip.getId(),duration,"String_Node_Str",parentId);
  return aip;
}

Fixed version (ground truth):
public static AIP createAIP(RodaUser user,String parentId) throws AuthorizationDeniedException, GenericException, NotFoundException, RequestNotValidException, AlreadyExistsException {
  Date start=new Date();
  UserUtility.checkRoles(user,ADMINISTRATION_METADATA_EDITOR_ROLE);
  if (parentId != null) {
    IndexedAIP parentSDO=BrowserHelper.retrieve(IndexedAIP.class,parentId);
    UserUtility.checkObjectPermissions(user,parentSDO,PermissionType.CREATE);
  }
 else {
  }
  Permissions permissions=new Permissions();
  permissions.setUserPermissions(user.getId(),new HashSet<PermissionType>(Arrays.asList(PermissionType.values())));
  AIP aip=BrowserHelper.createAIP(parentId,permissions);
  long duration=new Date().getTime() - start.getTime();
  registerAction(user,BROWSER_COMPONENT,"String_Node_Str",aip.getId(),duration,"String_Node_Str",parentId);
  return aip;
}
Program: 188719
Project: 188719
Buggy source:
public static AIP createAIP(String parentAipId) throws GenericException, AuthorizationDeniedException, RequestNotValidException, NotFoundException, AlreadyExistsException {
  ModelService model=RodaCoreFactory.getModelService();
  AIP aip=model.createAIP(parentAipId);
  return aip;
}

Fixed version (ground truth):
public static AIP createAIP(String parentAipId,Permissions permissions) throws GenericException, AuthorizationDeniedException, RequestNotValidException, NotFoundException, AlreadyExistsException {
  ModelService model=RodaCoreFactory.getModelService();
  AIP aip=model.createAIP(parentAipId,permissions);
  return aip;
}
Program: 188721
Project: 188721
Buggy source:
protected static Job createJob(Job job) throws NotFoundException, GenericException {
  Job updatedJob=new Job(job);
  RodaCoreFactory.getModelService().createOrUpdateJob(updatedJob);
  RodaCoreFactory.getPluginOrchestrator().executeJob(updatedJob);
  return updatedJob;
}

Fixed version (ground truth):
protected static Job createJob(Job job) throws NotFoundException, GenericException {
  Job updatedJob=new Job(job);
  RodaCoreFactory.getModelService().createOrUpdateJob(updatedJob);
  RodaCoreFactory.getPluginOrchestrator().executeJob(updatedJob);
  RodaCoreFactory.getIndexService().commit(Job.class);
  return updatedJob;
}
Program: 188722
Project: 188722
Buggy source:
@Override public void transferredResourceDeleted(String transferredResourceID){
  boolean forceCommit=false;
  deleteDocumentFromIndex(RodaConstants.INDEX_TRANSFERRED_RESOURCE,transferredResourceID,"String_Node_Str" + transferredResourceID + "String_Node_Str",forceCommit);
}

Fixed version (ground truth):
@Override public void transferredResourceDeleted(String transferredResourceID){
  deleteDocumentFromIndex(RodaConstants.INDEX_TRANSFERRED_RESOURCE,transferredResourceID,"String_Node_Str" + transferredResourceID + "String_Node_Str");
}