nus-yam/ex-repair huggingface dataset:
Program: 188723
Project: 188723
Buggy source:
public static TransferredResource createTransferredResource(Path resourcePath,Path basePath){
  Path relativeToBase=basePath.relativize(resourcePath);
  TransferredResource tr=new TransferredResource();
  try {
    BasicFileAttributes attr=Files.readAttributes(resourcePath,BasicFileAttributes.class);
    Date d=new Date(attr.creationTime().toMillis());
    tr.setCreationDate(d);
  }
 catch (  IOException e) {
    LOGGER.warn("String_Node_Str");
    tr.setCreationDate(new Date());
  }
  tr.setFile(!Files.isDirectory(resourcePath));
  tr.setFullPath(resourcePath.toString());
  tr.setId(relativeToBase.toString());
  tr.setName(resourcePath.getFileName().toString());
  tr.setRelativePath(relativeToBase.toString());
  if (relativeToBase.getParent() != null) {
    tr.setParentId(relativeToBase.getParent().toString());
  }
  try {
    tr.setSize(Files.isDirectory(resourcePath) ? 0L : Files.size(resourcePath));
  }
 catch (  IOException e) {
    tr.setSize(0L);
  }
  List<String> ancestors=new ArrayList<String>();
  StringBuilder temp=new StringBuilder();
  Iterator<Path> pathIterator=relativeToBase.iterator();
  while (pathIterator.hasNext()) {
    temp.append(pathIterator.next().toString());
    ancestors.add(temp.toString());
    temp.append("String_Node_Str");
  }
  ancestors.remove(ancestors.size() - 1);
  tr.setAncestorsPaths(ancestors);
  return tr;
}

Fixed version (ground truth):
public static TransferredResource createTransferredResource(Path resourcePath,Path basePath){
  Path relativeToBase=basePath.relativize(resourcePath);
  TransferredResource tr=new TransferredResource();
  try {
    BasicFileAttributes attr=Files.readAttributes(resourcePath,BasicFileAttributes.class);
    Date d=new Date(attr.creationTime().toMillis());
    tr.setCreationDate(d);
  }
 catch (  IOException e) {
    LOGGER.warn("String_Node_Str");
    tr.setCreationDate(new Date());
  }
  tr.setFile(!Files.isDirectory(resourcePath));
  tr.setFullPath(resourcePath.toString());
  String id=relativeToBase.toString();
  tr.setId(id);
  tr.setUUID(UUID.nameUUIDFromBytes(id.getBytes()).toString());
  tr.setName(resourcePath.getFileName().toString());
  tr.setRelativePath(relativeToBase.toString());
  if (relativeToBase.getParent() != null) {
    String parentId=relativeToBase.getParent().toString();
    tr.setParentId(parentId);
    tr.setParentUUID(UUID.nameUUIDFromBytes(parentId.getBytes()).toString());
  }
  try {
    tr.setSize(Files.isDirectory(resourcePath) ? 0L : Files.size(resourcePath));
  }
 catch (  IOException e) {
    tr.setSize(0L);
  }
  List<String> ancestors=new ArrayList<String>();
  StringBuilder temp=new StringBuilder();
  Iterator<Path> pathIterator=relativeToBase.iterator();
  while (pathIterator.hasNext()) {
    temp.append(pathIterator.next().toString());
    ancestors.add(temp.toString());
    temp.append("String_Node_Str");
  }
  ancestors.remove(ancestors.size() - 1);
  tr.setAncestorsPaths(ancestors);
  return tr;
}
Program: 188724
Project: 188724
Buggy source:
public static SolrInputDocument transferredResourceToSolrDocument(TransferredResource resource) throws IOException {
  SolrInputDocument transferredResource=new SolrInputDocument();
  transferredResource.addField(RodaConstants.TRANSFERRED_RESOURCE_UUID,UUID.nameUUIDFromBytes(resource.getId().getBytes()).toString());
  transferredResource.addField(RodaConstants.TRANSFERRED_RESOURCE_ID,resource.getId());
  transferredResource.addField(RodaConstants.TRANSFERRED_RESOURCE_FULLPATH,resource.getFullPath());
  if (resource.getParentId() != null) {
    transferredResource.addField(RodaConstants.TRANSFERRED_RESOURCE_PARENT_ID,resource.getParentId());
  }
  if (resource.getRelativePath() != null) {
    transferredResource.addField(RodaConstants.TRANSFERRED_RESOURCE_RELATIVEPATH,resource.getRelativePath());
  }
  transferredResource.addField(RodaConstants.TRANSFERRED_RESOURCE_DATE,resource.getCreationDate());
  transferredResource.addField(RodaConstants.TRANSFERRED_RESOURCE_ISFILE,resource.isFile());
  transferredResource.addField(RodaConstants.TRANSFERRED_RESOURCE_SIZE,resource.getSize());
  transferredResource.addField(RodaConstants.TRANSFERRED_RESOURCE_NAME,resource.getName());
  if (resource.getAncestorsPaths() != null && !resource.getAncestorsPaths().isEmpty()) {
    transferredResource.addField(RodaConstants.TRANSFERRED_RESOURCE_ANCESTORS,resource.getAncestorsPaths());
  }
  return transferredResource;
}

Fixed version (ground truth):
public static SolrInputDocument transferredResourceToSolrDocument(TransferredResource resource) throws IOException {
  SolrInputDocument transferredResource=new SolrInputDocument();
  transferredResource.addField(RodaConstants.TRANSFERRED_RESOURCE_UUID,UUID.nameUUIDFromBytes(resource.getId().getBytes()).toString());
  transferredResource.addField(RodaConstants.TRANSFERRED_RESOURCE_ID,resource.getId());
  transferredResource.addField(RodaConstants.TRANSFERRED_RESOURCE_FULLPATH,resource.getFullPath());
  if (resource.getParentId() != null) {
    transferredResource.addField(RodaConstants.TRANSFERRED_RESOURCE_PARENT_ID,resource.getParentId());
    transferredResource.addField(RodaConstants.TRANSFERRED_RESOURCE_PARENT_UUID,UUID.nameUUIDFromBytes(resource.getParentId().getBytes()).toString());
  }
  if (resource.getRelativePath() != null) {
    transferredResource.addField(RodaConstants.TRANSFERRED_RESOURCE_RELATIVEPATH,resource.getRelativePath());
  }
  transferredResource.addField(RodaConstants.TRANSFERRED_RESOURCE_DATE,resource.getCreationDate());
  transferredResource.addField(RodaConstants.TRANSFERRED_RESOURCE_ISFILE,resource.isFile());
  transferredResource.addField(RodaConstants.TRANSFERRED_RESOURCE_SIZE,resource.getSize());
  transferredResource.addField(RodaConstants.TRANSFERRED_RESOURCE_NAME,resource.getName());
  if (resource.getAncestorsPaths() != null && !resource.getAncestorsPaths().isEmpty()) {
    transferredResource.addField(RodaConstants.TRANSFERRED_RESOURCE_ANCESTORS,resource.getAncestorsPaths());
  }
  return transferredResource;
}
Program: 188725
Project: 188725
Buggy source:
private static TransferredResource solrDocumentToTransferredResource(SolrDocument doc){
  TransferredResource tr=new TransferredResource();
  String id=objectToString(doc.get(RodaConstants.TRANSFERRED_RESOURCE_ID));
  String uuid=objectToString(doc.get(RodaConstants.TRANSFERRED_RESOURCE_UUID));
  String fullPath=objectToString(doc.get(RodaConstants.TRANSFERRED_RESOURCE_FULLPATH));
  String parentId=null;
  if (doc.containsKey(RodaConstants.TRANSFERRED_RESOURCE_PARENT_ID)) {
    parentId=objectToString(doc.get(RodaConstants.TRANSFERRED_RESOURCE_PARENT_ID));
  }
  String relativePath=objectToString(doc.get(RodaConstants.TRANSFERRED_RESOURCE_RELATIVEPATH));
  Date d=objectToDate(doc.get(RodaConstants.TRANSFERRED_RESOURCE_DATE));
  if (d == null) {
    LOGGER.warn("String_Node_Str");
    d=new Date();
  }
  boolean isFile=objectToBoolean(doc.get(RodaConstants.TRANSFERRED_RESOURCE_ISFILE));
  long size=objectToLong(doc.get(RodaConstants.TRANSFERRED_RESOURCE_SIZE),0L);
  String name=objectToString(doc.get(RodaConstants.TRANSFERRED_RESOURCE_NAME));
  List<String> ancestorsPath=objectToListString(doc.get(RodaConstants.TRANSFERRED_RESOURCE_ANCESTORS));
  tr.setId(id);
  tr.setUUID(uuid);
  tr.setCreationDate(d);
  tr.setFullPath(fullPath);
  tr.setName(name);
  tr.setRelativePath(relativePath);
  tr.setSize(size);
  tr.setParentId(parentId);
  tr.setFile(isFile);
  tr.setAncestorsPaths(ancestorsPath);
  return tr;
}

Fixed version (ground truth):
private static TransferredResource solrDocumentToTransferredResource(SolrDocument doc){
  TransferredResource tr=new TransferredResource();
  String id=objectToString(doc.get(RodaConstants.TRANSFERRED_RESOURCE_ID));
  String uuid=objectToString(doc.get(RodaConstants.TRANSFERRED_RESOURCE_UUID));
  String fullPath=objectToString(doc.get(RodaConstants.TRANSFERRED_RESOURCE_FULLPATH));
  String parentId=null;
  String parentUUID=null;
  if (doc.containsKey(RodaConstants.TRANSFERRED_RESOURCE_PARENT_ID)) {
    parentId=objectToString(doc.get(RodaConstants.TRANSFERRED_RESOURCE_PARENT_ID));
    parentUUID=objectToString(doc.get(RodaConstants.TRANSFERRED_RESOURCE_PARENT_UUID));
  }
  String relativePath=objectToString(doc.get(RodaConstants.TRANSFERRED_RESOURCE_RELATIVEPATH));
  Date d=objectToDate(doc.get(RodaConstants.TRANSFERRED_RESOURCE_DATE));
  if (d == null) {
    LOGGER.warn("String_Node_Str");
    d=new Date();
  }
  boolean isFile=objectToBoolean(doc.get(RodaConstants.TRANSFERRED_RESOURCE_ISFILE));
  long size=objectToLong(doc.get(RodaConstants.TRANSFERRED_RESOURCE_SIZE),0L);
  String name=objectToString(doc.get(RodaConstants.TRANSFERRED_RESOURCE_NAME));
  List<String> ancestorsPath=objectToListString(doc.get(RodaConstants.TRANSFERRED_RESOURCE_ANCESTORS));
  tr.setId(id);
  tr.setUUID(uuid);
  tr.setCreationDate(d);
  tr.setFullPath(fullPath);
  tr.setName(name);
  tr.setRelativePath(relativePath);
  tr.setSize(size);
  tr.setParentId(parentId);
  tr.setParentUUID(parentUUID);
  tr.setFile(isFile);
  tr.setAncestorsPaths(ancestorsPath);
  return tr;
}
Program: 188726
Project: 188726
Buggy source:
@Override public void onKeyPress(KeyPressEvent event){
  char keyCode=event.getCharCode();
  if (!(keyCode >= '0' && keyCode <= '9') && !(keyCode >= 'A' && keyCode <= 'Z') && !(keyCode >= 'a' && keyCode <= 'z')&& keyCode != '.' && keyCode != '_' && (keyCode != (char)KeyCodes.KEY_TAB) && (keyCode != (char)KeyCodes.KEY_BACKSPACE) && (keyCode != (char)KeyCodes.KEY_DELETE) && (keyCode != (char)KeyCodes.KEY_ENTER) && (keyCode != (char)KeyCodes.KEY_HOME) && (keyCode != (char)KeyCodes.KEY_END) && (keyCode != (char)KeyCodes.KEY_LEFT) && (keyCode != (char)KeyCodes.KEY_UP) && (keyCode != (char)KeyCodes.KEY_RIGHT) && (keyCode != (char)KeyCodes.KEY_DOWN)) {
    ((TextBox)event.getSource()).cancelKey();
  }
}

Fixed version (ground truth):
@Override public void onKeyPress(KeyPressEvent event){
  char keyCode=event.getCharCode();
  if (!(keyCode >= '0' && keyCode <= '9') && !(keyCode >= 'A' && keyCode <= 'Z') && !(keyCode >= 'a' && keyCode <= 'z')&& keyCode != '.' && keyCode != '_' && (keyCode != (char)KeyCodes.KEY_TAB) && (keyCode != (char)KeyCodes.KEY_DELETE) && (keyCode != (char)KeyCodes.KEY_ENTER) && (keyCode != (char)KeyCodes.KEY_HOME) && (keyCode != (char)KeyCodes.KEY_END) && (keyCode != (char)KeyCodes.KEY_LEFT) && (keyCode != (char)KeyCodes.KEY_UP) && (keyCode != (char)KeyCodes.KEY_RIGHT) && (keyCode != (char)KeyCodes.KEY_DOWN)) {
    ((TextBox)event.getSource()).cancelKey();
  }
}
Program: 188728
Project: 188728
Buggy source:
@Override public void onKeyPress(KeyPressEvent event){
  char keyCode=event.getCharCode();
  if (!(keyCode >= '0' && keyCode <= '9') && !(keyCode >= 'A' && keyCode <= 'Z') && !(keyCode >= 'a' && keyCode <= 'z')&& keyCode != '.' && keyCode != '_' && (keyCode != (char)KeyCodes.KEY_TAB) && (keyCode != (char)KeyCodes.KEY_BACKSPACE) && (keyCode != (char)KeyCodes.KEY_DELETE) && (keyCode != (char)KeyCodes.KEY_ENTER) && (keyCode != (char)KeyCodes.KEY_HOME) && (keyCode != (char)KeyCodes.KEY_END) && (keyCode != (char)KeyCodes.KEY_LEFT) && (keyCode != (char)KeyCodes.KEY_UP) && (keyCode != (char)KeyCodes.KEY_RIGHT) && (keyCode != (char)KeyCodes.KEY_DOWN)) {
    ((TextBox)event.getSource()).cancelKey();
  }
}

Fixed version (ground truth):
@Override public void onKeyPress(KeyPressEvent event){
  char keyCode=event.getCharCode();
  if (!(keyCode >= '0' && keyCode <= '9') && !(keyCode >= 'A' && keyCode <= 'Z') && !(keyCode >= 'a' && keyCode <= 'z')&& keyCode != '.' && keyCode != '_' && (keyCode != (char)KeyCodes.KEY_TAB) && (keyCode != (char)KeyCodes.KEY_DELETE) && (keyCode != (char)KeyCodes.KEY_ENTER) && (keyCode != (char)KeyCodes.KEY_HOME) && (keyCode != (char)KeyCodes.KEY_END) && (keyCode != (char)KeyCodes.KEY_LEFT) && (keyCode != (char)KeyCodes.KEY_UP) && (keyCode != (char)KeyCodes.KEY_RIGHT) && (keyCode != (char)KeyCodes.KEY_DOWN)) {
    ((TextBox)event.getSource()).cancelKey();
  }
}
Program: 188730
Project: 188730
Buggy source:
public static <T extends Serializable>IndexResult<T> find(SolrClient index,Class<T> classToRetrieve,Filter filter,Sorter sorter,Sublist sublist,Facets facets,RodaUser user,boolean showInactive) throws GenericException, RequestNotValidException {
  IndexResult<T> ret;
  SolrQuery query=new SolrQuery();
  String queryString=parseFilter(filter);
  query.setQuery(queryString);
  query.setSorts(parseSorter(sorter));
  query.setStart(sublist.getFirstElementIndex());
  query.setRows(sublist.getMaximumElementCount());
  parseAndConfigureFacets(facets,query);
  if (hasPermissionFilters(classToRetrieve)) {
    query.setFilterQueries(getFilterQueries(user,showInactive));
  }
  try {
    QueryResponse response=index.query(getIndexName(classToRetrieve),query);
    ret=queryResponseToIndexResult(response,classToRetrieve,facets);
  }
 catch (  SolrServerException|IOException e) {
    throw new GenericException("String_Node_Str",e);
  }
  return ret;
}

Fixed version (ground truth):
public static <T extends Serializable>IndexResult<T> find(SolrClient index,Class<T> classToRetrieve,Filter filter,Sorter sorter,Sublist sublist,Facets facets,RodaUser user,boolean showInactive) throws GenericException, RequestNotValidException {
  IndexResult<T> ret;
  SolrQuery query=new SolrQuery();
  String queryString=parseFilter(filter);
  query.setQuery(queryString);
  query.setSorts(parseSorter(sorter));
  query.setStart(sublist.getFirstElementIndex());
  query.setRows(sublist.getMaximumElementCount());
  parseAndConfigureFacets(facets,query);
  if (hasPermissionFilters(classToRetrieve)) {
    query.addFilterQuery(getFilterQueries(user,showInactive));
  }
  try {
    QueryResponse response=index.query(getIndexName(classToRetrieve),query);
    ret=queryResponseToIndexResult(response,classToRetrieve,facets);
  }
 catch (  SolrServerException|IOException e) {
    throw new GenericException("String_Node_Str",e);
  }
  return ret;
}
Program: 188732
Project: 188732
Buggy source:
/** 
 * Returns an instance of the   {@link Plugin} with the specified ID(classname).
 * @param pluginID the ID (classname) of the  {@link Plugin}.
 * @return a {@link Plugin} or <code>null</code> if the specified classname ifnot a  {@link Plugin}.
 */
public Plugin<?> getPlugin(String pluginID){
  Plugin<?> plugin=null;
  if (internalPluginChache.get(pluginID) != null) {
    plugin=internalPluginChache.get(pluginID).cloneMe();
  }
  boolean internalPluginTakesPrecedence=RodaCoreFactory.getRodaConfiguration().getBoolean("String_Node_Str");
  if (plugin == null || !internalPluginTakesPrecedence) {
    for (    JarPlugin jarPlugin : this.jarPluginCache.values()) {
      if (jarPlugin.plugin != null && jarPlugin.plugin.getClass().getName().equals(pluginID)) {
        plugin=jarPlugin.plugin.cloneMe();
        break;
      }
    }
  }
  return plugin;
}

Fixed version (ground truth):
public <T extends Serializable>Plugin<T> getPlugin(String pluginID,Class<T> pluginClass){
  return (Plugin<T>)getPlugin(pluginID);
}
Program: 188734
Project: 188734
Buggy source:
/** 
 * Performs a virus check on the specified path.
 * @param path a path to scan.
 * @return the results of the virus check as a {@link VirusCheckResult}.
 * @throws RuntimeException if some problem prevented the virus check from run a normal test.
 * @see AntiVirus
 */
public VirusCheckResult checkForVirus(Path path) throws RuntimeException {
  VirusCheckResult result=new VirusCheckResult();
  try {
    LOGGER.debug("String_Node_Str" + path.toString());
    String clamavBin=RodaCoreFactory.getRodaConfiguration().getString("String_Node_Str","String_Node_Str");
    String clamavParams=RodaCoreFactory.getRodaConfiguration().getString("String_Node_Str","String_Node_Str");
    ProcessBuilder processBuilder=new ProcessBuilder(clamavBin,clamavParams,path.toString());
    Process process=processBuilder.start();
    StringWriter outputWriter=new StringWriter();
    IOUtils.copy(process.getInputStream(),outputWriter);
    result.setReport(outputWriter.toString());
    int exitValue=process.waitFor();
switch (exitValue) {
case NO_VIRUS_FOUND:
      result.setClean(true);
    break;
default :
  result.setClean(false);
break;
}
}
 catch (IOException e) {
LOGGER.debug("String_Node_Str" + e.getMessage(),e);
throw new RuntimeException("String_Node_Str" + e.getMessage(),e);
}
catch (InterruptedException e) {
LOGGER.debug("String_Node_Str" + e.getMessage(),e);
throw new RuntimeException("String_Node_Str" + e.getMessage(),e);
}
return result;
}

Fixed version (ground truth):
/** 
 * Performs a virus check on the specified path.
 * @param path a path to scan.
 * @return the results of the virus check as a {@link VirusCheckResult}.
 * @throws RuntimeException if some problem prevented the virus check from run a normal test.
 * @see AntiVirus
 */
public VirusCheckResult checkForVirus(Path path) throws RuntimeException {
  VirusCheckResult result=new VirusCheckResult();
  try {
    LOGGER.debug("String_Node_Str",path);
    String clamavBin=RodaCoreFactory.getRodaConfiguration().getString("String_Node_Str","String_Node_Str");
    String clamavParams=RodaCoreFactory.getRodaConfiguration().getString("String_Node_Str","String_Node_Str");
    ProcessBuilder processBuilder=new ProcessBuilder(clamavBin,clamavParams,path.toString());
    Process process=processBuilder.start();
    StringWriter outputWriter=new StringWriter();
    IOUtils.copy(process.getInputStream(),outputWriter);
    result.setReport(outputWriter.toString());
    int exitValue=process.waitFor();
switch (exitValue) {
case NO_VIRUS_FOUND:
      result.setClean(true);
    break;
default :
  result.setClean(false);
break;
}
}
 catch (IOException e) {
LOGGER.debug("String_Node_Str" + e.getMessage(),e);
throw new RuntimeException("String_Node_Str" + e.getMessage(),e);
}
catch (InterruptedException e) {
LOGGER.debug("String_Node_Str" + e.getMessage(),e);
throw new RuntimeException("String_Node_Str" + e.getMessage(),e);
}
return result;
}
Program: 188735
Project: 188735
Buggy source:
private Map<String,Report> mergeReports(Map<String,Report> reports,Report plugin){
  if (plugin != null) {
    for (    Report reportItem : plugin.getReports()) {
      if (StringUtils.isNotBlank(reportItem.getOtherId())) {
        aipIdToTransferredResourceId.put(reportItem.getItemId(),reportItem.getOtherId());
        Report report=new Report();
        report.addReport(reportItem);
        reports.put(reportItem.getOtherId(),report);
      }
 else       if (StringUtils.isNotBlank(reportItem.getItemId()) && aipIdToTransferredResourceId.get(reportItem.getItemId()) != null) {
        reports.get(aipIdToTransferredResourceId.get(reportItem.getItemId())).addReport(reportItem);
      }
    }
  }
  return reports;
}

Fixed version (ground truth):
private Map<String,Report> mergeReports(Map<String,Report> reports,Map<String,String> aipIdToTransferredResourceId,Report plugin){
  if (plugin != null) {
    for (    Report reportItem : plugin.getReports()) {
      if (StringUtils.isNotBlank(reportItem.getOtherId())) {
        aipIdToTransferredResourceId.put(reportItem.getItemId(),reportItem.getOtherId());
        Report report=new Report();
        report.addReport(reportItem);
        reports.put(reportItem.getOtherId(),report);
      }
 else       if (StringUtils.isNotBlank(reportItem.getItemId()) && aipIdToTransferredResourceId.get(reportItem.getItemId()) != null) {
        reports.get(aipIdToTransferredResourceId.get(reportItem.getItemId())).addReport(reportItem);
      }
    }
  }
  return reports;
}
Program: 188736
Project: 188736
Buggy source:
private List<AIP> recalculateAIPsList(List<AIP> aips,Map<String,Report> reports,Map<String,String> aipIdToObjectId){
  for (int i=0; i < aips.size(); i++) {
    AIP aip=aips.get(i);
    String transferredResourceId=aipIdToObjectId.get(aip.getId());
    Report report=reports.get(transferredResourceId);
    if (report.getPluginState() == PluginState.FAILURE) {
      aips.remove(i);
    }
  }
  return aips;
}

Fixed version (ground truth):
private List<AIP> recalculateAIPsList(List<AIP> aips,Map<String,Report> reports,Map<String,String> aipIdToTransferredResourceId){
  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 (report.getPluginState() == PluginState.FAILURE) {
      aips.remove(i);
    }
  }
  return aips;
}
Program: 188737
Project: 188737
Buggy source:
private List<AIP> getAIPsFromReports(IndexService index,ModelService model,StorageService storage,Map<String,Report> reports){
  List<AIP> aips=new ArrayList<>();
  List<String> aipIds=getAIPsIdsFromReport(reports);
  LOGGER.debug("String_Node_Str",aipIds);
  for (  String aipId : aipIds) {
    try {
      aips.add(model.retrieveAIP(aipId));
    }
 catch (    RequestNotValidException|NotFoundException|GenericException|AuthorizationDeniedException e) {
      LOGGER.error("String_Node_Str",e);
    }
  }
  return aips;
}

Fixed version (ground truth):
private List<AIP> getAIPsFromReports(IndexService index,ModelService model,StorageService storage,Map<String,Report> reports){
  List<AIP> aips=new ArrayList<>();
  List<String> aipIds=getAIPsIdsFromReport(reports);
  LOGGER.debug("String_Node_Str",aipIds);
  for (  String aipId : aipIds) {
    try {
      aips.add(model.retrieveAIP(aipId));
    }
 catch (    RequestNotValidException|NotFoundException|GenericException|AuthorizationDeniedException e) {
      LOGGER.error("String_Node_Str",e);
    }
  }
  LOGGER.debug("String_Node_Str");
  return aips;
}
Program: 188738
Project: 188738
Buggy source:
private void createIngestEndedEvent(ModelService model,IndexService index,List<AIP> aips,Map<String,Report> reports,Map<String,String> aipIdToObjectId){
  setPreservationEventType(END_TYPE);
  setPreservationSuccessMessage(END_SUCCESS);
  setPreservationFailureMessage(END_FAILURE);
  setPreservationEventDescription(END_DESCRIPTION);
  for (  AIP aip : aips) {
    try {
      boolean notify=true;
      PluginHelper.createPluginEvent(this,aip.getId(),model,index,PluginState.SUCCESS,"String_Node_Str",notify);
    }
 catch (    NotFoundException|RequestNotValidException|GenericException|AuthorizationDeniedException|ValidationException|AlreadyExistsException e) {
      LOGGER.warn("String_Node_Str" + e.getMessage(),e);
    }
  }
}

Fixed version (ground truth):
private void createIngestEndedEvent(ModelService model,IndexService index,List<AIP> aips,Map<String,Report> reports,Map<String,String> aipIdToTransferredResourceId){
  setPreservationEventType(END_TYPE);
  setPreservationSuccessMessage(END_SUCCESS);
  setPreservationFailureMessage(END_FAILURE);
  setPreservationEventDescription(END_DESCRIPTION);
  for (  AIP aip : aips) {
    try {
      boolean notify=true;
      PluginHelper.createPluginEvent(this,aip.getId(),model,index,PluginState.SUCCESS,"String_Node_Str",notify);
    }
 catch (    NotFoundException|RequestNotValidException|GenericException|AuthorizationDeniedException|ValidationException|AlreadyExistsException e) {
      LOGGER.warn("String_Node_Str" + e.getMessage(),e);
    }
  }
}
Program: 188739
Project: 188739
Buggy source:
private void createIngestStartedEvent(ModelService model,IndexService index,Map<String,String> sipToAIP,Date startDate){
  setPreservationEventType(START_TYPE);
  setPreservationSuccessMessage(START_SUCCESS);
  setPreservationFailureMessage(START_FAILURE);
  setPreservationEventDescription(START_DESCRIPTION);
  for (  Map.Entry<String,String> entry : sipToAIP.entrySet()) {
    try {
      AIP aip=model.retrieveAIP(entry.getKey());
      TransferredResource tr=index.retrieve(TransferredResource.class,entry.getValue());
      boolean notify=true;
      PluginHelper.createPluginEvent(this,aip.getId(),model,index,tr,PluginState.SUCCESS,"String_Node_Str",notify,startDate);
    }
 catch (    NotFoundException|RequestNotValidException|GenericException|AuthorizationDeniedException|ValidationException|AlreadyExistsException e) {
      LOGGER.warn("String_Node_Str" + e.getMessage(),e);
    }
  }
}

Fixed version (ground truth):
private void createIngestStartedEvent(ModelService model,IndexService index,Map<String,String> aipIdToTransferredResourceId,Date startDate){
  setPreservationEventType(START_TYPE);
  setPreservationSuccessMessage(START_SUCCESS);
  setPreservationFailureMessage(START_FAILURE);
  setPreservationEventDescription(START_DESCRIPTION);
  for (  Map.Entry<String,String> entry : aipIdToTransferredResourceId.entrySet()) {
    try {
      AIP aip=model.retrieveAIP(entry.getKey());
      TransferredResource tr=index.retrieve(TransferredResource.class,entry.getValue());
      boolean notify=true;
      PluginHelper.createPluginEvent(this,aip.getId(),model,index,tr,PluginState.SUCCESS,"String_Node_Str",notify,startDate);
    }
 catch (    NotFoundException|RequestNotValidException|GenericException|AuthorizationDeniedException|ValidationException|AlreadyExistsException e) {
      LOGGER.warn("String_Node_Str" + e.getMessage(),e);
    }
  }
}
Program: 188741
Project: 188741
Buggy source:
private Filter buildSearchFilter(String basicQuery,Filter defaultFilter,String allFilter,FlowPanel fieldsPanel){
  List<FilterParameter> parameters=new ArrayList<FilterParameter>();
  if (basicQuery != null && basicQuery.trim().length() > 0) {
    parameters.add(new BasicSearchFilterParameter(allFilter,basicQuery));
  }
  if (fieldsPanel != null && fieldsPanel.getParent() != null && fieldsPanel.getParent().isVisible()) {
    for (int i=0; i < fieldsPanel.getWidgetCount(); i++) {
      SearchFieldPanel searchAdvancedFieldPanel=(SearchFieldPanel)fieldsPanel.getWidget(i);
      FilterParameter filterParameter=searchAdvancedFieldPanel.getFilter();
      if (filterParameter != null) {
        parameters.add(filterParameter);
      }
    }
  }
  Filter filter;
  if (parameters.size() == 0) {
    filter=defaultFilter;
  }
 else {
    filter=new Filter(parameters);
  }
  return filter;
}

Fixed version (ground truth):
private Filter buildSearchFilter(String basicQuery,Filter defaultFilter,String allFilter,FlowPanel fieldsPanel,boolean defaultFilterIncremental){
  List<FilterParameter> parameters=new ArrayList<FilterParameter>();
  if (basicQuery != null && basicQuery.trim().length() > 0) {
    parameters.add(new BasicSearchFilterParameter(allFilter,basicQuery));
  }
  if (fieldsPanel != null && fieldsPanel.getParent() != null && fieldsPanel.getParent().isVisible()) {
    for (int i=0; i < fieldsPanel.getWidgetCount(); i++) {
      SearchFieldPanel searchAdvancedFieldPanel=(SearchFieldPanel)fieldsPanel.getWidget(i);
      FilterParameter filterParameter=searchAdvancedFieldPanel.getFilter();
      if (filterParameter != null) {
        parameters.add(filterParameter);
      }
    }
  }
  Filter filter;
  if (defaultFilterIncremental) {
    filter=new Filter(defaultFilter);
    filter.add(parameters);
  }
 else   if (parameters.size() == 0) {
    filter=defaultFilter;
  }
 else {
    filter=new Filter(parameters);
  }
  return filter;
}
Program: 188742
Project: 188742
Buggy source:
public void doSearch(){
  Filter filter=buildSearchFilter(searchInputBox.getText(),defaultFilter,allFilter,fieldsPanel);
  list.setFilter(filter);
}

Fixed version (ground truth):
public void doSearch(){
  Filter filter=buildSearchFilter(searchInputBox.getText(),defaultFilter,allFilter,fieldsPanel,defaultFilterIncremental);
  list.setFilter(filter);
}
Program: 188743
Project: 188743
Buggy source:
protected void view(){
  resource=null;
  ingestTransferTitle.setVisible(true);
  ingestTransferDescription.setVisible(true);
  HTML itemIconHtmlPanel=new HTML(TOP_ICON);
  itemIconHtmlPanel.addStyleName("String_Node_Str");
  itemIcon.setWidget(itemIconHtmlPanel);
  itemTitle.setText("String_Node_Str");
  itemDates.setText("String_Node_Str");
  itemTitle.addStyleName("String_Node_Str");
  itemIcon.getParent().addStyleName("String_Node_Str");
  basicSearch.setVisible(true);
  transferredResourceList.setVisible(true);
  download.setVisible(false);
  transferredResourceList.setFilter(DEFAULT_FILTER);
  breadcrumb.setVisible(false);
  updateVisibles();
}

Fixed version (ground truth):
protected void view(){
  resource=null;
  ingestTransferTitle.setVisible(true);
  ingestTransferDescription.setVisible(true);
  HTML itemIconHtmlPanel=new HTML(TOP_ICON);
  itemIconHtmlPanel.addStyleName("String_Node_Str");
  itemIcon.setWidget(itemIconHtmlPanel);
  itemTitle.setText("String_Node_Str");
  itemDates.setText("String_Node_Str");
  itemTitle.addStyleName("String_Node_Str");
  itemIcon.getParent().addStyleName("String_Node_Str");
  basicSearch.setVisible(true);
  transferredResourceList.setVisible(true);
  download.setVisible(false);
  transferredResourceList.setFilter(DEFAULT_FILTER);
  basicSearch.setDefaultFilter(DEFAULT_FILTER);
  breadcrumb.setVisible(false);
  updateVisibles();
}
Program: 188745
Project: 188745
Buggy source:
private static void runPDFtoPDFAPlugin(){
  try {
    Plugin<AIP> plugin=new PdfToPdfaPlugin<AIP>();
    Map<String,String> params=new HashMap<String,String>();
    params.put("String_Node_Str","String_Node_Str");
    params.put("String_Node_Str","String_Node_Str");
    plugin.setParameterValues(params);
    getPluginOrchestrator().runPluginOnAIPs(plugin,Arrays.asList(aipId));
  }
 catch (  InvalidParameterException ipe) {
    LOGGER.error(ipe.getMessage(),ipe);
  }
}

Fixed version (ground truth):
private static void runPDFtoPDFAPlugin(){
  Plugin<AIP> plugin=new PdfToPdfaPlugin<AIP>();
  getPluginOrchestrator().runPluginOnAllAIPs(plugin);
}
Program: 188753
Project: 188753
Buggy source:
public Messages(Locale locale,Path folder){
  this.resourceBundle=ResourceBundle.getBundle(MESSAGES_BUNDLE,locale,new FolderBasedUTF8Control(folder));
}

Fixed version (ground truth):
public Messages(Locale locale,Path folder){
  this.resourceBundle=ResourceBundle.getBundle(MESSAGES_BUNDLE,locale,new FolderBasedUTF8Control(folder));
  this.translationsCache=new HashMap<String,Map<String,Object>>();
}
Program: 188754
Project: 188754
Buggy source:
/** 
 * prefix will be replaced by "i18n." for simplicity purposes
 */
public <T>Map<String,T> getTranslations(String prefix,Class<T> valueClass,boolean replacePrefixFromKey){
  Map<String,T> map=new HashMap<String,T>();
  Enumeration<String> keys=resourceBundle.getKeys();
  String fullPrefix=prefix + "String_Node_Str";
  while (keys.hasMoreElements()) {
    String key=keys.nextElement();
    if (key.startsWith(fullPrefix)) {
      map.put(replacePrefixFromKey ? key.replaceFirst(fullPrefix,"String_Node_Str") : key,valueClass.cast(resourceBundle.getString(key)));
    }
  }
  return map;
}

Fixed version (ground truth):
/** 
 * prefix will be replaced by "i18n." for simplicity purposes
 */
public <T>Map<String,T> getTranslations(String prefix,Class<T> valueClass,boolean replacePrefixFromKey){
  if (translationsCache.get(prefix) != null) {
    return (Map<String,T>)translationsCache.get(prefix);
  }
  Map<String,T> map=new HashMap<String,T>();
  Enumeration<String> keys=resourceBundle.getKeys();
  String fullPrefix=prefix + "String_Node_Str";
  while (keys.hasMoreElements()) {
    String key=keys.nextElement();
    if (key.startsWith(fullPrefix)) {
      map.put(replacePrefixFromKey ? key.replaceFirst(fullPrefix,"String_Node_Str") : key,valueClass.cast(resourceBundle.getString(key)));
    }
  }
  translationsCache.put(prefix,(Map<String,Object>)map);
  return map;
}
Program: 188755
Project: 188755
Buggy source:
private static String runDigitalSignatureVerifyOOXML(Path input) throws IOException, GeneralSecurityException {
  boolean isValid=true;
  try {
    OPCPackage pkg=OPCPackage.open(input.toString(),PackageAccess.READ);
    SignatureConfig sic=new SignatureConfig();
    sic.setOpcPackage(pkg);
    SignatureInfo si=new SignatureInfo();
    si.setSignatureConfig(sic);
    for (    SignaturePart sp : si.getSignatureParts()) {
      isValid=isValid && sp.validate();
      Set<Certificate> trustedRootCerts=new HashSet<Certificate>();
      Set<Certificate> intermediateCerts=new HashSet<Certificate>();
      List<X509Certificate> certChain=sp.getCertChain();
      for (      X509Certificate c : certChain) {
        c.checkValidity();
        if (DigitalSignaturePluginUtils.isCertificateSelfSigned(c))         trustedRootCerts.add(c);
 else         intermediateCerts.add(c);
      }
      verifyCertificateChain(trustedRootCerts,intermediateCerts,certChain.get(0));
    }
    pkg.close();
  }
 catch (  InvalidFormatException e) {
    return "String_Node_Str";
  }
catch (  CertificateExpiredException|CertificateNotYetValidException e) {
    return "String_Node_Str";
  }
catch (  CertPathBuilderException e) {
    return "String_Node_Str";
  }
  return isValid ? "String_Node_Str" : "String_Node_Str";
}

Fixed version (ground truth):
private static String runDigitalSignatureVerifyOOXML(Path input) throws IOException, GeneralSecurityException {
  boolean isValid=true;
  try {
    OPCPackage pkg=OPCPackage.open(input.toString(),PackageAccess.READ);
    SignatureConfig sic=new SignatureConfig();
    sic.setOpcPackage(pkg);
    SignatureInfo si=new SignatureInfo();
    si.setSignatureConfig(sic);
    Iterable<SignaturePart> it=si.getSignatureParts();
    if (it != null) {
      for (      SignaturePart sp : it) {
        isValid=isValid && sp.validate();
        Set<Certificate> trustedRootCerts=new HashSet<Certificate>();
        Set<Certificate> intermediateCerts=new HashSet<Certificate>();
        List<X509Certificate> certChain=sp.getCertChain();
        for (        X509Certificate c : certChain) {
          c.checkValidity();
          if (DigitalSignaturePluginUtils.isCertificateSelfSigned(c))           trustedRootCerts.add(c);
 else           intermediateCerts.add(c);
        }
        verifyCertificateChain(trustedRootCerts,intermediateCerts,certChain.get(0));
      }
    }
    pkg.close();
  }
 catch (  InvalidFormatException e) {
    return "String_Node_Str";
  }
catch (  CertificateExpiredException|CertificateNotYetValidException e) {
    return "String_Node_Str";
  }
catch (  CertPathBuilderException e) {
    return "String_Node_Str";
  }
  return isValid ? "String_Node_Str" : "String_Node_Str";
}
Program: 188756
Project: 188756
Buggy source:
private static void runDigitalSignatureStripOOXML(Path input,Path output) throws IOException, AlreadyExistsException, GenericException, InvalidFormatException {
  FSUtils.copy(input,output,true);
  OPCPackage pkg=OPCPackage.open(output.toString(),PackageAccess.READ_WRITE);
  String signatureContentType="String_Node_Str";
  String signatureRelType="String_Node_Str";
  ArrayList<PackagePart> pps=pkg.getPartsByContentType(signatureContentType);
  for (  PackagePart pp : pps) {
    pkg.removePart(pp);
  }
  ArrayList<PackagePart> ppct=pkg.getPartsByRelationshipType(signatureRelType);
  for (  PackagePart pp : ppct) {
    pkg.removePart(pp);
  }
  pkg.close();
}

Fixed version (ground truth):
private static void runDigitalSignatureStripOOXML(Path input,Path output) throws IOException, AlreadyExistsException, GenericException, InvalidFormatException {
  FSUtils.copy(input,output,true);
  OPCPackage pkg=OPCPackage.open(output.toString(),PackageAccess.READ_WRITE);
  ArrayList<PackagePart> pps=pkg.getPartsByContentType(SIGN_CONTENT_TYPE_OOXML);
  for (  PackagePart pp : pps) {
    pkg.removePart(pp);
  }
  ArrayList<PackagePart> ppct=pkg.getPartsByRelationshipType(SIGN_REL_TYPE_OOXML);
  for (  PackagePart pp : ppct) {
    pkg.removePart(pp);
  }
  for (  PackageRelationship r : pkg.getRelationships()) {
    if (r.getRelationshipType().equals(SIGN_REL_TYPE_OOXML)) {
      pkg.removeRelationship(r.getId());
    }
  }
  pkg.close();
}
Program: 188757
Project: 188757
Buggy source:
@UiHandler("String_Node_Str") void buttonCancelHandler(ClickEvent e){
  callback.onSuccess(false);
  hide();
}

Fixed version (ground truth):
@UiHandler("String_Node_Str") void buttonCancelHandler(ClickEvent e){
  hide();
}
Program: 188758
Project: 188758
Buggy source:
public static List<String> extractFilePathFromRepresentationPreservationMetadata(StoragePath path){
  String container=path.getContainerName();
  List<String> directoryPath=path.getDirectoryPath();
  if (container.equals(RodaConstants.STORAGE_CONTAINER_AIP) && directoryPath.size() > 4 && directoryPath.get(1).equals(RodaConstants.STORAGE_DIRECTORY_REPRESENTATIONS) && directoryPath.get(3).equals(RodaConstants.STORAGE_DIRECTORY_METADATA) && directoryPath.get(4).equals(RodaConstants.STORAGE_DIRECTORY_METADATA)) {
    return directoryPath.subList(5,directoryPath.size());
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
public static List<String> extractFilePathFromRepresentationPreservationMetadata(StoragePath path){
  String container=path.getContainerName();
  List<String> directoryPath=path.getDirectoryPath();
  if (container.equals(RodaConstants.STORAGE_CONTAINER_AIP) && directoryPath.size() > 4 && directoryPath.get(1).equals(RodaConstants.STORAGE_DIRECTORY_REPRESENTATIONS) && directoryPath.get(3).equals(RodaConstants.STORAGE_DIRECTORY_METADATA) && directoryPath.get(4).equals(RodaConstants.STORAGE_DIRECTORY_PRESERVATION)) {
    return directoryPath.subList(5,directoryPath.size());
  }
 else {
    return null;
  }
}
Program: 188761
Project: 188761
Buggy source:
@Override protected void getData(Sublist sublist,ColumnSortList columnSortList,AsyncCallback<IndexResult<Report>> callback){
  Filter filter=getFilter();
  Map<Column<Report,?>,String> columnSortingKeyMap=new HashMap<Column<Report,?>,String>();
  columnSortingKeyMap.put(objectIdColumn,RodaConstants.JOB_REPORT_OTHER_ID);
  columnSortingKeyMap.put(updatedDateColumn,RodaConstants.JOB_REPORT_DATE_UPDATE);
  columnSortingKeyMap.put(lastPluginRunColumn,RodaConstants.JOB_REPORT_PLUGIN);
  columnSortingKeyMap.put(lastPluginRunStateColumn,RodaConstants.JOB_REPORT_PLUGIN_STATE);
  Sorter sorter=createSorter(columnSortList,columnSortingKeyMap);
  BrowserService.Util.getInstance().find(JobReport.class.getName(),filter,sorter,sublist,getFacets(),LocaleInfo.getCurrentLocale().getLocaleName(),callback);
}

Fixed version (ground truth):
@Override protected void getData(Sublist sublist,ColumnSortList columnSortList,AsyncCallback<IndexResult<Report>> callback){
  Filter filter=getFilter();
  Map<Column<Report,?>,String> columnSortingKeyMap=new HashMap<Column<Report,?>,String>();
  columnSortingKeyMap.put(objectIdColumn,RodaConstants.JOB_REPORT_OTHER_ID);
  columnSortingKeyMap.put(updatedDateColumn,RodaConstants.JOB_REPORT_DATE_UPDATE);
  columnSortingKeyMap.put(lastPluginRunColumn,RodaConstants.JOB_REPORT_PLUGIN);
  columnSortingKeyMap.put(lastPluginRunStateColumn,RodaConstants.JOB_REPORT_PLUGIN_STATE);
  Sorter sorter=createSorter(columnSortList,columnSortingKeyMap);
  BrowserService.Util.getInstance().find(Report.class.getName(),filter,sorter,sublist,getFacets(),LocaleInfo.getCurrentLocale().getLocaleName(),callback);
}
Program: 188762
Project: 188762
Buggy source:
@SuppressWarnings("String_Node_Str") private <T extends Serializable>Class<T> parseClass(String classNameToReturn) throws GenericException {
  Class<T> classToReturn;
  try {
    classToReturn=(Class<T>)Class.forName(classNameToReturn);
  }
 catch (  ClassNotFoundException e) {
    throw new GenericException("String_Node_Str" + classNameToReturn);
  }
  return classToReturn;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private <T extends IsIndexed>Class<T> parseClass(String classNameToReturn) throws GenericException {
  Class<T> classToReturn;
  try {
    classToReturn=(Class<T>)Class.forName(classNameToReturn);
  }
 catch (  ClassNotFoundException e) {
    throw new GenericException("String_Node_Str" + classNameToReturn);
  }
  return classToReturn;
}
Program: 188764
Project: 188764
Buggy source:
public static <T>List<T> getListFromJson(String json,Class<T> objectClass) throws GenericException {
  List<T> ret;
  try {
    JsonFactory factory=new JsonFactory();
    ObjectMapper mapper=new ObjectMapper(factory);
    ret=mapper.readValue(json,new TypeReference<List<T>>(){
    }
);
  }
 catch (  IOException e) {
    throw new GenericException("String_Node_Str",e);
  }
  return ret;
}

Fixed version (ground truth):
public static <T>List<T> getListFromJson(String json,Class<T> objectClass) throws GenericException {
  List<T> ret;
  try {
    JsonFactory factory=new JsonFactory();
    ObjectMapper mapper=new ObjectMapper(factory);
    TypeFactory t=TypeFactory.defaultInstance();
    ret=mapper.readValue(json,t.constructCollectionType(ArrayList.class,objectClass));
  }
 catch (  IOException e) {
    throw new GenericException("String_Node_Str",e);
  }
  return ret;
}
Program: 188765
Project: 188765
Buggy source:
@Override public void deleteResource(StoragePath storagePath) throws NotFoundException, GenericException {
  Path resourcePath=FSUtils.getEntityPath(basePath,storagePath);
  FSUtils.deletePath(resourcePath);
  Path resourceHistoryPath=historyPath.resolve(resourcePath);
  FSUtils.deletePath(resourceHistoryPath);
  FSUtils.deleteEmptyAncestorsQuietly(resourceHistoryPath);
}

Fixed version (ground truth):
@Override public void deleteResource(StoragePath storagePath) throws NotFoundException, GenericException {
  Path resourcePath=FSUtils.getEntityPath(basePath,storagePath);
  FSUtils.deletePath(resourcePath);
  Path resourceHistoryPath=historyPath.resolve(resourcePath);
  try {
    FSUtils.deletePath(resourceHistoryPath);
    FSUtils.deleteEmptyAncestorsQuietly(resourceHistoryPath);
  }
 catch (  NotFoundException e) {
  }
}
Program: 188766
Project: 188766
Buggy source:
@Override public void deleteContainer(StoragePath storagePath) throws NotFoundException, GenericException {
  Path containerPath=FSUtils.getEntityPath(basePath,storagePath);
  FSUtils.deletePath(containerPath);
  Path resourceHistoryPath=historyPath.resolve(containerPath);
  FSUtils.deletePath(resourceHistoryPath);
  FSUtils.deleteEmptyAncestorsQuietly(resourceHistoryPath);
}

Fixed version (ground truth):
@Override public void deleteContainer(StoragePath storagePath) throws NotFoundException, GenericException {
  Path containerPath=FSUtils.getEntityPath(basePath,storagePath);
  FSUtils.deletePath(containerPath);
  Path resourceHistoryPath=historyPath.resolve(containerPath);
  try {
    FSUtils.deletePath(resourceHistoryPath);
    FSUtils.deleteEmptyAncestorsQuietly(resourceHistoryPath);
  }
 catch (  NotFoundException e) {
  }
}
Program: 188768
Project: 188768
Buggy source:
public void setParameterValues(Map<String,String> parameters) throws InvalidParameterException {
  if (parameters.containsKey("String_Node_Str")) {
    maxKbytes=Long.parseLong(parameters.get("String_Node_Str"));
  }
  if (parameters.containsKey("String_Node_Str")) {
    inputFormat=parameters.get("String_Node_Str");
  }
  if (parameters.containsKey("String_Node_Str")) {
    outputFormat=parameters.get("String_Node_Str");
  }
}

Fixed version (ground truth):
public void setParameterValues(Map<String,String> parameters) throws InvalidParameterException {
  if (parameters.containsKey("String_Node_Str")) {
    setOutputFormat(parameters.get("String_Node_Str"));
  }
  if (parameters.containsKey("String_Node_Str")) {
    setOutputFormat(parameters.get("String_Node_Str"));
  }
}
Program: 188769
Project: 188769
Buggy source:
public abstract String getInputFormat();

Fixed version (ground truth):
public String getInputFormat(){
  return this.inputFormat;
}
Program: 188772
Project: 188772
Buggy source:
public Map<String,String> getParameterValues(){
  Map<String,String> parametersMap=new HashMap<String,String>();
  parametersMap.put("String_Node_Str",inputFormat);
  parametersMap.put("String_Node_Str",outputFormat);
  parametersMap.put("String_Node_Str",Long.toString(maxKbytes));
  parametersMap.put("String_Node_Str",Boolean.toString(hasPartialSuccessOnOutcome));
  return parametersMap;
}

Fixed version (ground truth):
public Map<String,String> getParameterValues(){
  Map<String,String> parametersMap=new HashMap<String,String>();
  parametersMap.put("String_Node_Str",getInputFormat());
  parametersMap.put("String_Node_Str",getOutputFormat());
  parametersMap.put("String_Node_Str",Boolean.toString(hasPartialSuccessOnOutcome()));
  return parametersMap;
}
Program: 188775
Project: 188775
Buggy source:
public Report execute(IndexService index,ModelService model,StorageService storage,List<Serializable> list) throws PluginException {
  IndexedPreservationAgent agent=null;
  try {
    boolean notify=true;
    agent=PremisUtils.createPremisAgentBinary(this,RodaConstants.PRESERVATION_AGENT_TYPE_CONVERSION_PLUGIN,model,notify);
  }
 catch (  AlreadyExistsException e) {
    agent=PremisUtils.getPreservationAgent(this,RodaConstants.PRESERVATION_AGENT_TYPE_CONVERSION_PLUGIN,model);
  }
catch (  RODAException e) {
    logger.error("String_Node_Str" + e.getMessage(),e);
  }
  if (list.size() > 0) {
    if (list.get(0) instanceof AIP)     return executeOnAIP(index,model,storage,(List<AIP>)(List<?>)list,agent);
    if (list.get(0) instanceof Representation)     return executeOnRepresentation(index,model,storage,(List<Representation>)(List<?>)list,agent);
    if (list.get(0) instanceof File)     return executeOnFile(index,model,storage,(List<File>)(List<?>)list,agent);
  }
  return new Report();
}

Fixed version (ground truth):
public Report execute(IndexService index,ModelService model,StorageService storage,List<Serializable> list) throws PluginException {
  IndexedPreservationAgent agent=null;
  try {
    boolean notify=true;
    agent=PremisUtils.createPremisAgentBinary(this,RodaConstants.PRESERVATION_AGENT_TYPE_CONVERSION_PLUGIN,model,notify);
  }
 catch (  AlreadyExistsException e) {
    agent=PremisUtils.getPreservationAgent(this,RodaConstants.PRESERVATION_AGENT_TYPE_CONVERSION_PLUGIN,model);
  }
catch (  RODAException e) {
    LOGGER.error("String_Node_Str" + e.getMessage(),e);
  }
  if (list.size() > 0) {
    if (list.get(0) instanceof AIP)     return executeOnAIP(index,model,storage,(List<AIP>)(List<?>)list,agent);
    if (list.get(0) instanceof Representation)     return executeOnRepresentation(index,model,storage,(List<Representation>)(List<?>)list,agent);
    if (list.get(0) instanceof File)     return executeOnFile(index,model,storage,(List<File>)(List<?>)list,agent);
  }
  return new Report();
}
Program: 188776
Project: 188776
Buggy source:
public abstract String getOutputFormat();

Fixed version (ground truth):
public String getOutputFormat(){
  return this.outputFormat;
}
Program: 188777
Project: 188777
Buggy source:
public List<PluginParameter> getParameters(){
  List<PluginParameter> params=new ArrayList<PluginParameter>();
  PluginParameter outputParam=new PluginParameter("String_Node_Str","String_Node_Str",PluginParameterType.STRING,"String_Node_Str",convertableTo,true,true,"String_Node_Str");
  params.add(outputParam);
  return params;
}

Fixed version (ground truth):
public List<PluginParameter> getParameters(){
  List<PluginParameter> params=new ArrayList<PluginParameter>();
  PluginParameter outputParam=new PluginParameter("String_Node_Str","String_Node_Str",PluginParameterType.STRING,"String_Node_Str",getConvertableTo(),true,true,"String_Node_Str");
  params.add(outputParam);
  return params;
}
Program: 188778
Project: 188778
Buggy source:
@Override public String getVersion(){
  try {
    return AvconvConvertPluginUtils.getVersion();
  }
 catch (  CommandException|IOException|UnsupportedOperationException e) {
    logger.debug("String_Node_Str");
    return new String();
  }
}

Fixed version (ground truth):
@Override public String getVersion(){
  try {
    return AvconvConvertPluginUtils.getVersion();
  }
 catch (  CommandException|IOException|UnsupportedOperationException e) {
    LoggerFactory.getLogger(SoxConvertPlugin.class).debug("String_Node_Str");
    return new String();
  }
}
Program: 188779
Project: 188779
Buggy source:
@Override public Path executePlugin(Path uriPath,String fileFormat) throws UnsupportedOperationException, IOException, CommandException {
  return AvconvConvertPluginUtils.runAvconvVideoConvert(uriPath,fileFormat,outputFormat,commandArguments,outputArguments);
}

Fixed version (ground truth):
@Override public String executePlugin(Path inputPath,Path outputPath,String fileFormat) throws UnsupportedOperationException, IOException, CommandException {
  return AvconvConvertPluginUtils.executeAvconv(inputPath,outputPath,commandArguments,outputArguments);
}