nus-yam/ex-repair huggingface dataset:
Program: 188456
Project: 188456
Buggy source:
/** 
 * Init inner filter.
 * @throws ServletException if some error occurs.
 */
private void initInnerFilter() throws ServletException {
  final Configuration rodaConfig=RodaCoreFactory.getRodaConfiguration();
  if (rodaConfig == null) {
    LOGGER.info("String_Node_Str" + this.webXmlFilterConfig.getInitParameter(PARAM_INNER_FILTER_CLASS) + "String_Node_Str");
  }
 else {
    final String innerFilterClass=this.webXmlFilterConfig.getInitParameter(PARAM_INNER_FILTER_CLASS);
    final String configPrefix=this.webXmlFilterConfig.getInitParameter(PARAM_CONFIG_PREFIX);
    this.isOn=rodaConfig.getBoolean(configPrefix + "String_Node_Str",false);
    LOGGER.info(getFilterConfig().getFilterName() + "String_Node_Str" + (this.isOn ? "String_Node_Str" : "String_Node_Str"));
    if (this.isOn) {
      try {
        this.innerFilter=(Filter)Class.forName(innerFilterClass).newInstance();
        this.innerFilter.init(getFilterConfig());
      }
 catch (      final InstantiationException|IllegalAccessException|ClassNotFoundException e) {
        throw new ServletException("String_Node_Str" + e.getMessage(),e);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Init inner filter.
 * @throws ServletException if some error occurs.
 */
private void initInnerFilter() throws ServletException {
  final Configuration rodaConfig=RodaCoreFactory.getRodaConfiguration();
  if (rodaConfig == null) {
    LOGGER.info("String_Node_Str",this.webXmlFilterConfig.getInitParameter(PARAM_INNER_FILTER_CLASS));
  }
 else {
    final String innerFilterClass=this.webXmlFilterConfig.getInitParameter(PARAM_INNER_FILTER_CLASS);
    final String configPrefix=this.webXmlFilterConfig.getInitParameter(PARAM_CONFIG_PREFIX);
    if (rodaConfig.getBoolean(configPrefix + "String_Node_Str",false)) {
      try {
        this.innerFilter=(Filter)Class.forName(innerFilterClass).newInstance();
        this.innerFilter.init(getFilterConfig());
        this.isOn=true;
      }
 catch (      final InstantiationException|IllegalAccessException|ClassNotFoundException e) {
        this.isOn=false;
        throw new ServletException("String_Node_Str" + e.getMessage(),e);
      }
    }
 else {
      this.isOn=false;
    }
  }
  LOGGER.info("String_Node_Str",getFilterConfig().getFilterName(),(this.isOn ? "String_Node_Str" : "String_Node_Str"));
}
Program: 188457
Project: 188457
Buggy source:
/** 
 * Is this filter on?
 * @return <code>true</code> if the Filter is on and <code>false</code>otherwise.
 * @throws ServletException if some error occurs.
 */
private boolean isOn() throws ServletException {
  if (this.isOn == null && isConfigAvailable()) {
    initInnerFilter();
  }
  return this.isOn != null && this.isOn;
}

Fixed version (ground truth):
/** 
 * Is this filter on?
 * @return <code>true</code> if the Filter is on and <code>false</code>otherwise.
 * @throws ServletException if some error occurs.
 */
private synchronized boolean isOn() throws ServletException {
  if (this.isOn == null && isConfigAvailable()) {
    initInnerFilter();
  }
  return this.isOn != null && this.isOn;
}
Program: 188458
Project: 188458
Buggy source:
/** 
 * Constructor.
 * @param classToReturn Class name of resources to return.
 * @param filter Filter.
 */
public CountRequest(final String classToReturn,final Filter filter){
  this.classToReturn=classToReturn;
  this.filter=filter;
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param classToReturn Class name of resources to return.
 * @param filter Filter.
 */
public CountRequest(final String classToReturn,final Filter filter,final boolean onlyActive){
  this.classToReturn=classToReturn;
  this.filter=filter;
  this.onlyActive=onlyActive;
}
Program: 188459
Project: 188459
Buggy source:
/** 
 * Constructor.
 * @param classToReturn Class name of resources to return.
 * @param filter Filter.
 * @param sorter Sorter.
 * @param sublist Sublist (paging).
 * @param facets Facets to return.
 * @param onlyActive Return only active resources?
 * @param exportFacets for CSV results, export only facets?
 * @param filename the filename for exported CSV.
 */
public FindRequest(final String classToReturn,final Filter filter,final Sorter sorter,final Sublist sublist,final Facets facets,final boolean onlyActive,final boolean exportFacets,final String filename){
  super(classToReturn,filter);
  this.sorter=sorter;
  this.sublist=sublist;
  this.facets=facets;
  this.onlyActive=onlyActive;
  this.exportFacets=exportFacets;
  this.filename=filename;
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param classToReturn Class name of resources to return.
 * @param filter Filter.
 * @param sorter Sorter.
 * @param sublist Sublist (paging).
 * @param facets Facets to return.
 * @param onlyActive Return only active resources?
 * @param exportFacets for CSV results, export only facets?
 * @param filename the filename for exported CSV.
 */
public FindRequest(final String classToReturn,final Filter filter,final Sorter sorter,final Sublist sublist,final Facets facets,final boolean onlyActive,final boolean exportFacets,final String filename){
  super(classToReturn,filter,onlyActive);
  this.sorter=sorter;
  this.sublist=sublist;
  this.facets=facets;
  this.exportFacets=exportFacets;
  this.filename=filename;
}
Program: 188460
Project: 188460
Buggy source:
public static <T extends IsIndexed>Long count(final User user,final Class<T> classToReturn,final Filter filter) throws AuthorizationDeniedException, GenericException, RequestNotValidException {
  final ControllerAssistant controllerAssistant=new ControllerAssistant(){
  }
;
  controllerAssistant.checkRoles(user,classToReturn);
  final Long count=BrowserHelper.count(classToReturn,filter,user);
  controllerAssistant.registerAction(user,LOG_ENTRY_STATE.SUCCESS,RodaConstants.CONTROLLER_CLASS_PARAM,classToReturn.getSimpleName(),RodaConstants.CONTROLLER_FILTER_PARAM,filter.toString());
  return count;
}

Fixed version (ground truth):
public static <T extends IsIndexed>Long count(final User user,final Class<T> classToReturn,final Filter filter,boolean justActive) throws AuthorizationDeniedException, GenericException, RequestNotValidException {
  final ControllerAssistant controllerAssistant=new ControllerAssistant(){
  }
;
  controllerAssistant.checkRoles(user,classToReturn);
  final Long count=BrowserHelper.count(classToReturn,filter,justActive,user);
  controllerAssistant.registerAction(user,LOG_ENTRY_STATE.SUCCESS,RodaConstants.CONTROLLER_CLASS_PARAM,classToReturn.getSimpleName(),RodaConstants.CONTROLLER_FILTER_PARAM,filter.toString());
  return count;
}
Program: 188461
Project: 188461
Buggy source:
private static <T extends IsIndexed>List<String> consolidate(User user,Class<T> classToReturn,SelectedItems<T> selected) throws GenericException, AuthorizationDeniedException, RequestNotValidException {
  List<String> ret;
  if (selected instanceof SelectedItemsList) {
    ret=((SelectedItemsList<T>)selected).getIds();
  }
 else   if (selected instanceof SelectedItemsFilter) {
    SelectedItemsFilter<T> selectedItemsFilter=(SelectedItemsFilter<T>)selected;
    Filter filter=selectedItemsFilter.getFilter();
    Long count=count(classToReturn,filter,user);
    IndexResult<T> find=find(classToReturn,filter,Sorter.NONE,new Sublist(0,count.intValue()),Facets.NONE,user,selectedItemsFilter.justActive());
    ret=find.getResults().stream().map(i -> i.getUUID()).collect(Collectors.toList());
  }
 else {
    throw new RequestNotValidException("String_Node_Str" + selected.getClass().getName());
  }
  return ret;
}

Fixed version (ground truth):
private static <T extends IsIndexed>List<String> consolidate(User user,Class<T> classToReturn,SelectedItems<T> selected) throws GenericException, AuthorizationDeniedException, RequestNotValidException {
  List<String> ret;
  if (selected instanceof SelectedItemsList) {
    ret=((SelectedItemsList<T>)selected).getIds();
  }
 else   if (selected instanceof SelectedItemsFilter) {
    SelectedItemsFilter<T> selectedItemsFilter=(SelectedItemsFilter<T>)selected;
    Filter filter=selectedItemsFilter.getFilter();
    boolean justActive=selectedItemsFilter.justActive();
    Long count=count(classToReturn,filter,justActive,user);
    IndexResult<T> find=find(classToReturn,filter,Sorter.NONE,new Sublist(0,count.intValue()),Facets.NONE,user,justActive);
    ret=find.getResults().stream().map(i -> i.getUUID()).collect(Collectors.toList());
  }
 else {
    throw new RequestNotValidException("String_Node_Str" + selected.getClass().getName());
  }
  return ret;
}
Program: 188462
Project: 188462
Buggy source:
protected static <T extends IsIndexed>Long count(Class<T> returnClass,Filter filter,User user) throws GenericException, RequestNotValidException {
  boolean justActive=false;
  return RodaCoreFactory.getIndexService().count(returnClass,filter,user,justActive);
}

Fixed version (ground truth):
protected static <T extends IsIndexed>Long count(Class<T> returnClass,Filter filter,boolean justActive,User user) throws GenericException, RequestNotValidException {
  return RodaCoreFactory.getIndexService().count(returnClass,filter,user,justActive);
}
Program: 188463
Project: 188463
Buggy source:
public static BrowseFileBundle retrieveBrowseFileBundle(IndexedAIP aip,String representationId,List<String> filePath,String fileId,Locale locale,User user) throws NotFoundException, GenericException, RequestNotValidException {
  BrowseFileBundle bundle=new BrowseFileBundle();
  bundle.setAip(aip);
  bundle.setRepresentation(retrieve(IndexedRepresentation.class,IdUtils.getRepresentationId(aip.getId(),representationId)));
  String fileUUID=IdUtils.getFileId(aip.getId(),representationId,filePath,fileId);
  bundle.setFile(retrieve(IndexedFile.class,fileUUID));
  try {
    bundle.setAipAncestors(retrieveAncestors(aip));
  }
 catch (  NotFoundException e) {
    LOGGER.warn("String_Node_Str",aip.getId(),e);
  }
  String parentUUID=bundle.getFile().getParentUUID();
  Filter siblingFilter=new Filter(new SimpleFilterParameter(RodaConstants.FILE_REPRESENTATION_UUID,bundle.getFile().getRepresentationUUID()));
  if (parentUUID != null) {
    siblingFilter.add(new SimpleFilterParameter(RodaConstants.FILE_PARENT_UUID,parentUUID));
  }
 else {
    siblingFilter.add(new EmptyKeyFilterParameter(RodaConstants.FILE_PARENT_UUID));
  }
  bundle.setTotalSiblingCount(count(IndexedFile.class,siblingFilter,user));
  Filter dipsFilter=new Filter(new SimpleFilterParameter(RodaConstants.DIP_FILE_UUIDS,fileUUID));
  Long dipCount=RodaCoreFactory.getIndexService().count(IndexedDIP.class,dipsFilter);
  bundle.setDipCount(dipCount);
  return bundle;
}

Fixed version (ground truth):
public static BrowseFileBundle retrieveBrowseFileBundle(IndexedAIP aip,String representationId,List<String> filePath,String fileId,Locale locale,User user) throws NotFoundException, GenericException, RequestNotValidException {
  BrowseFileBundle bundle=new BrowseFileBundle();
  bundle.setAip(aip);
  bundle.setRepresentation(retrieve(IndexedRepresentation.class,IdUtils.getRepresentationId(aip.getId(),representationId)));
  String fileUUID=IdUtils.getFileId(aip.getId(),representationId,filePath,fileId);
  bundle.setFile(retrieve(IndexedFile.class,fileUUID));
  try {
    bundle.setAipAncestors(retrieveAncestors(aip));
  }
 catch (  NotFoundException e) {
    LOGGER.warn("String_Node_Str",aip.getId(),e);
  }
  String parentUUID=bundle.getFile().getParentUUID();
  Filter siblingFilter=new Filter(new SimpleFilterParameter(RodaConstants.FILE_REPRESENTATION_UUID,bundle.getFile().getRepresentationUUID()));
  if (parentUUID != null) {
    siblingFilter.add(new SimpleFilterParameter(RodaConstants.FILE_PARENT_UUID,parentUUID));
  }
 else {
    siblingFilter.add(new EmptyKeyFilterParameter(RodaConstants.FILE_PARENT_UUID));
  }
  boolean justActive=AIPState.ACTIVE.equals(aip.getState());
  bundle.setTotalSiblingCount(count(IndexedFile.class,siblingFilter,justActive,user));
  Filter dipsFilter=new Filter(new SimpleFilterParameter(RodaConstants.DIP_FILE_UUIDS,fileUUID));
  Long dipCount=RodaCoreFactory.getIndexService().count(IndexedDIP.class,dipsFilter);
  bundle.setDipCount(dipCount);
  return bundle;
}
Program: 188464
Project: 188464
Buggy source:
/** 
 * Count indexed resources.
 * @param countRequest count parameters.
 * @return a {@link Response} with the count.
 * @throws RODAException if some error occurs.
 */
@POST @Path("String_Node_Str") @Consumes({MediaType.APPLICATION_JSON}) @Produces({MediaType.APPLICATION_JSON}) @ApiOperation(value="String_Node_Str",notes="String_Node_Str",response=Long.class) public Response count(@ApiParam(value="String_Node_Str") final CountRequest countRequest) throws RODAException {
  final String mediaType=ApiUtils.getMediaType(null,request);
  final User user=UserUtility.getApiUser(request);
  final long result=Browser.count(user,getClass(countRequest.classToReturn),countRequest.filter);
  return Response.ok(result,mediaType).build();
}

Fixed version (ground truth):
/** 
 * Count indexed resources.
 * @param countRequest count parameters.
 * @return a {@link Response} with the count.
 * @throws RODAException if some error occurs.
 */
@POST @Path("String_Node_Str") @Consumes({MediaType.APPLICATION_JSON}) @Produces({MediaType.APPLICATION_JSON}) @ApiOperation(value="String_Node_Str",notes="String_Node_Str",response=Long.class) public Response count(@ApiParam(value="String_Node_Str") final CountRequest countRequest) throws RODAException {
  final String mediaType=ApiUtils.getMediaType(null,request);
  final User user=UserUtility.getApiUser(request);
  final long result=Browser.count(user,getClass(countRequest.classToReturn),countRequest.filter,countRequest.onlyActive);
  return Response.ok(result,mediaType).build();
}
Program: 188467
Project: 188467
Buggy source:
@Override public void execute(){
  Filter filter=new Filter(new SimpleFilterParameter(RodaConstants.DIP_FILE_UUIDS,bundle.getFile().getUUID()));
  BrowserService.Util.getInstance().count(IndexedDIP.class.getName(),filter,new AsyncCallback<Long>(){
    @Override public void onFailure(    Throwable caught){
      AsyncCallbackUtils.defaultFailureTreatment(caught);
    }
    @Override public void onSuccess(    Long dipCount){
      if (dipCount > 0) {
        disseminationsSlider.open();
      }
    }
  }
);
}

Fixed version (ground truth):
@Override public void execute(){
  Filter filter=new Filter(new SimpleFilterParameter(RodaConstants.DIP_FILE_UUIDS,bundle.getFile().getUUID()));
  boolean justActive=AIPState.ACTIVE.equals(bundle.getAip().getState());
  BrowserService.Util.getInstance().count(IndexedDIP.class.getName(),filter,justActive,new AsyncCallback<Long>(){
    @Override public void onFailure(    Throwable caught){
      AsyncCallbackUtils.defaultFailureTreatment(caught);
    }
    @Override public void onSuccess(    Long dipCount){
      if (dipCount > 0) {
        disseminationsSlider.open();
      }
    }
  }
);
}
Program: 188468
Project: 188468
Buggy source:
<T extends IsIndexed>Long count(String classNameToReturn,Filter filter) throws AuthorizationDeniedException, GenericException, RequestNotValidException ;

Fixed version (ground truth):
<T extends IsIndexed>Long count(String classNameToReturn,Filter filter,boolean justActive) throws AuthorizationDeniedException, GenericException, RequestNotValidException ;
Program: 188469
Project: 188469
Buggy source:
void count(String classNameToReturn,Filter filter,AsyncCallback<Long> callback);

Fixed version (ground truth):
void count(String classNameToReturn,Filter filter,boolean justActive,AsyncCallback<Long> callback);
Program: 188470
Project: 188470
Buggy source:
public static <T extends IsIndexed>void hasPreviousOrNext(final T object,final AsyncCallback<Pair<Boolean,Boolean>> callback){
  @SuppressWarnings("String_Node_Str") Class<T> objectClass=(Class<T>)object.getClass();
  final ListSelectionState<T> last=last(objectClass);
  if (last != null) {
    if (last.getSelected().getUUID().equals(object.getUUID())) {
      BrowserService.Util.getInstance().count(objectClass.getName(),last.getFilter(),new AsyncCallback<Long>(){
        @Override public void onFailure(        Throwable caught){
          callback.onFailure(caught);
        }
        @Override public void onSuccess(        Long totalCount){
          Integer lastIndex=last.getIndex();
          Boolean hasPrevious=lastIndex > 0;
          Boolean hasNext=lastIndex < totalCount - 1;
          callback.onSuccess(Pair.create(hasPrevious,hasNext));
        }
      }
);
    }
 else {
      callback.onSuccess(Pair.create(Boolean.FALSE,Boolean.FALSE));
    }
  }
 else {
    callback.onSuccess(Pair.create(Boolean.FALSE,Boolean.FALSE));
  }
}

Fixed version (ground truth):
public static <T extends IsIndexed>void hasPreviousOrNext(final T object,final AsyncCallback<Pair<Boolean,Boolean>> callback){
  @SuppressWarnings("String_Node_Str") Class<T> objectClass=(Class<T>)object.getClass();
  final ListSelectionState<T> last=last(objectClass);
  if (last != null) {
    if (last.getSelected().getUUID().equals(object.getUUID())) {
      BrowserService.Util.getInstance().count(objectClass.getName(),last.getFilter(),last.getJustActive(),new AsyncCallback<Long>(){
        @Override public void onFailure(        Throwable caught){
          callback.onFailure(caught);
        }
        @Override public void onSuccess(        Long totalCount){
          Integer lastIndex=last.getIndex();
          Boolean hasPrevious=lastIndex > 0;
          Boolean hasNext=lastIndex < totalCount - 1;
          callback.onSuccess(Pair.create(hasPrevious,hasNext));
        }
      }
);
    }
 else {
      callback.onSuccess(Pair.create(Boolean.FALSE,Boolean.FALSE));
    }
  }
 else {
    callback.onSuccess(Pair.create(Boolean.FALSE,Boolean.FALSE));
  }
}
Program: 188471
Project: 188471
Buggy source:
public static <T extends IsIndexed>void size(Class<T> classToReturn,SelectedItems<T> selected,final AsyncCallback<Long> callback){
  if (selected instanceof SelectedItemsList) {
    Long size=(long)((SelectedItemsList<T>)selected).getIds().size();
    callback.onSuccess(size);
  }
 else   if (selected instanceof SelectedItemsFilter) {
    Filter filter=((SelectedItemsFilter<T>)selected).getFilter();
    BrowserService.Util.getInstance().count(classToReturn.getName(),filter,new AsyncCallback<Long>(){
      @Override public void onFailure(      Throwable caught){
        callback.onFailure(caught);
      }
      @Override public void onSuccess(      Long result){
        callback.onSuccess(result);
      }
    }
);
  }
 else {
    callback.onFailure(new RequestNotValidException("String_Node_Str" + selected.getClass().getName()));
  }
}

Fixed version (ground truth):
public static <T extends IsIndexed>void size(Class<T> classToReturn,SelectedItems<T> selected,final AsyncCallback<Long> callback){
  if (selected instanceof SelectedItemsList) {
    Long size=(long)((SelectedItemsList<T>)selected).getIds().size();
    callback.onSuccess(size);
  }
 else   if (selected instanceof SelectedItemsFilter) {
    SelectedItemsFilter<T> selectedItemsFilter=(SelectedItemsFilter<T>)selected;
    Filter filter=selectedItemsFilter.getFilter();
    boolean justActive=selectedItemsFilter.justActive();
    BrowserService.Util.getInstance().count(classToReturn.getName(),filter,justActive,new AsyncCallback<Long>(){
      @Override public void onFailure(      Throwable caught){
        callback.onFailure(caught);
      }
      @Override public void onSuccess(      Long result){
        callback.onSuccess(result);
      }
    }
);
  }
 else {
    callback.onFailure(new RequestNotValidException("String_Node_Str" + selected.getClass().getName()));
  }
}
Program: 188472
Project: 188472
Buggy source:
@Override public <T extends IsIndexed>Long count(String classNameToReturn,Filter filter) throws AuthorizationDeniedException, GenericException, RequestNotValidException {
  User user=UserUtility.getUser(getThreadLocalRequest());
  Class<T> classToReturn=SelectedItemsUtils.parseClass(classNameToReturn);
  return Browser.count(user,classToReturn,filter);
}

Fixed version (ground truth):
@Override public <T extends IsIndexed>Long count(String classNameToReturn,Filter filter,boolean justActive) throws AuthorizationDeniedException, GenericException, RequestNotValidException {
  User user=UserUtility.getUser(getThreadLocalRequest());
  Class<T> classToReturn=SelectedItemsUtils.parseClass(classNameToReturn);
  return Browser.count(user,classToReturn,filter,justActive);
}
Program: 188473
Project: 188473
Buggy source:
@Override public List<String> getCategories(){
  return Arrays.asList(RodaConstants.PLUGIN_CATEGORY_MISC);
}

Fixed version (ground truth):
@Override public List<String> getCategories(){
  return Arrays.asList(RodaConstants.PLUGIN_CATEGORY_NOT_LISTABLE);
}
Program: 188475
Project: 188475
Buggy source:
private static OtherMetadata convertResourceToOtherMetadata(Resource resource) throws RequestNotValidException {
  if (resource == null) {
    throw new RequestNotValidException("String_Node_Str");
  }
  StoragePath resourcePath=resource.getStoragePath();
  String filename=resourcePath.getName();
  OtherMetadata om=new OtherMetadata();
  String aipId=ModelUtils.extractAipId(resourcePath);
  String representationId=ModelUtils.extractRepresentationId(resourcePath);
  String type=representationId != null ? ModelUtils.extractTypeFromRepresentationOtherMetadata(resourcePath) : ModelUtils.extractTypeFromAipOtherMetadata(resourcePath);
  List<String> fileDirectoryPath=representationId != null ? ModelUtils.extractFilePathFromRepresentationOtherMetadata(resourcePath) : ModelUtils.extractFilePathFromAipOtherMetadata(resourcePath);
  String fileId=filename.substring(0,filename.lastIndexOf('.'));
  String suffix=filename.substring(filename.lastIndexOf('.'),filename.length());
  om.setAipId(aipId);
  om.setRepresentationId(representationId);
  om.setFileDirectoryPath(fileDirectoryPath);
  om.setFileId(fileId);
  om.setType(type);
  om.setFileSuffix(suffix);
  return om;
}

Fixed version (ground truth):
private static OtherMetadata convertResourceToOtherMetadata(Resource resource) throws RequestNotValidException {
  if (resource == null) {
    throw new RequestNotValidException("String_Node_Str");
  }
  StoragePath resourcePath=resource.getStoragePath();
  String filename=resourcePath.getName();
  String aipId=ModelUtils.extractAipId(resourcePath);
  String representationId=ModelUtils.extractRepresentationId(resourcePath);
  String type=representationId != null ? ModelUtils.extractTypeFromRepresentationOtherMetadata(resourcePath) : ModelUtils.extractTypeFromAipOtherMetadata(resourcePath);
  List<String> fileDirectoryPath=representationId != null ? ModelUtils.extractFilePathFromRepresentationOtherMetadata(resourcePath) : ModelUtils.extractFilePathFromAipOtherMetadata(resourcePath);
  String fileId=filename.substring(0,filename.lastIndexOf('.'));
  String suffix=filename.substring(filename.lastIndexOf('.'),filename.length());
  OtherMetadata om=new OtherMetadata();
  om.setId(IdUtils.getOtherMetadataId(type,aipId,representationId,fileDirectoryPath,fileId));
  om.setAipId(aipId);
  om.setRepresentationId(representationId);
  om.setFileDirectoryPath(fileDirectoryPath);
  om.setFileId(fileId);
  om.setType(type);
  om.setFileSuffix(suffix);
  return om;
}
Program: 188476
Project: 188476
Buggy source:
@Override public void onKeyDown(KeyDownEvent event){
  if (!bundle.getFile().isDirectory()) {
    NativeEvent ne=event.getNativeEvent();
    if (ne.getKeyCode() == KeyCodes.KEY_RIGHT) {
      ne.preventDefault();
      next();
    }
 else     if (ne.getKeyCode() == KeyCodes.KEY_LEFT) {
      ne.preventDefault();
      previous();
    }
  }
}

Fixed version (ground truth):
@Override public void onKeyDown(KeyDownEvent event){
  if (event.isControlKeyDown()) {
    NativeEvent ne=event.getNativeEvent();
    if (ne.getKeyCode() == KeyCodes.KEY_RIGHT) {
      ne.preventDefault();
      next();
    }
 else     if (ne.getKeyCode() == KeyCodes.KEY_LEFT) {
      ne.preventDefault();
      previous();
    }
  }
}
Program: 188477
Project: 188477
Buggy source:
private void load(final Viewers viewers,final List<String> historyTokens,final AsyncCallback<Widget> callback){
  if (historyTokens.size() > 2) {
    final String historyAipId=historyTokens.get(0);
    final String historyRepresentationId=historyTokens.get(1);
    final List<String> historyFilePath=new ArrayList<String>(historyTokens.subList(2,historyTokens.size() - 1));
    final String historyFileId=historyTokens.get(historyTokens.size() - 1);
    Pair<Sorter,Integer> lastSelectionDetails=LastSelectedItemsSingleton.getInstance().getLastSelectionDetails();
    final Sorter sorter=lastSelectionDetails.getFirst() != null ? lastSelectionDetails.getFirst() : DEFAULT_FILE_SORTER;
    final Integer index=lastSelectionDetails.getSecond() != null ? lastSelectionDetails.getSecond() : DEFAULT_FILE_INDEX;
    BrowserService.Util.getInstance().retrieveBrowseFileBundle(historyAipId,historyRepresentationId,historyFilePath,historyFileId,LocaleInfo.getCurrentLocale().getLocaleName(),new AsyncCallback<BrowseFileBundle>(){
      @Override public void onFailure(      Throwable caught){
        AsyncCallbackUtils.defaultFailureTreatment(caught);
      }
      @Override public void onSuccess(      final BrowseFileBundle bundle){
        callback.onSuccess(new BrowseFile(viewers,bundle,sorter,index));
      }
    }
);
  }
 else {
    errorRedirect(callback);
  }
}

Fixed version (ground truth):
private void load(final Viewers viewers,final List<String> historyTokens,final AsyncCallback<Widget> callback){
  if (historyTokens.size() > 2) {
    final String historyAipId=historyTokens.get(0);
    final String historyRepresentationId=historyTokens.get(1);
    final List<String> historyFilePath=new ArrayList<String>(historyTokens.subList(2,historyTokens.size() - 1));
    final String historyFileId=historyTokens.get(historyTokens.size() - 1);
    Pair<Sorter,Integer> lastSelectionDetails=LastSelectedItemsSingleton.getInstance().getLastSelectionDetails();
    final Sorter sorter=lastSelectionDetails.getFirst() != null ? lastSelectionDetails.getFirst() : DEFAULT_FILE_SORTER;
    final Integer index=lastSelectionDetails.getSecond() != null ? lastSelectionDetails.getSecond() : DEFAULT_FILE_INDEX;
    LastSelectedItemsSingleton.getInstance().resetLastSelectionDetails();
    BrowserService.Util.getInstance().retrieveBrowseFileBundle(historyAipId,historyRepresentationId,historyFilePath,historyFileId,LocaleInfo.getCurrentLocale().getLocaleName(),new AsyncCallback<BrowseFileBundle>(){
      @Override public void onFailure(      Throwable caught){
        AsyncCallbackUtils.defaultFailureTreatment(caught);
      }
      @Override public void onSuccess(      final BrowseFileBundle bundle){
        callback.onSuccess(new BrowseFile(viewers,bundle,sorter,index));
      }
    }
);
  }
 else {
    errorRedirect(callback);
  }
}
Program: 188479
Project: 188479
Buggy source:
public void open(String parentUUID,final Sorter sorter,final int openIndex){
  Filter filter=new Filter(new SimpleFilterParameter(RodaConstants.FILE_PARENT_UUID,parentUUID));
  Sublist sublist=new Sublist(openIndex,1);
  String localeString=LocaleInfo.getCurrentLocale().getLocaleName();
  boolean justActive=true;
  BrowserService.Util.getInstance().find(IndexedFile.class.getName(),filter,sorter,sublist,Facets.NONE,localeString,justActive,new AsyncCallback<IndexResult<IndexedFile>>(){
    @Override public void onFailure(    Throwable caught){
      AsyncCallbackUtils.defaultFailureTreatment(caught);
    }
    @Override public void onSuccess(    IndexResult<IndexedFile> result){
      if (!result.getResults().isEmpty()) {
        IndexedFile firstFile=result.getResults().get(0);
        HistoryUtils.openBrowse(firstFile,sorter,openIndex);
      }
 else {
        Toast.showError("String_Node_Str");
      }
    }
  }
);
}

Fixed version (ground truth):
public void open(final String parentUUID,final Sorter sorter,final int openIndex){
  Filter filter=new Filter(new SimpleFilterParameter(RodaConstants.FILE_REPRESENTATION_UUID,bundle.getFile().getRepresentationUUID()));
  if (parentUUID != null) {
    filter.add(new SimpleFilterParameter(RodaConstants.FILE_PARENT_UUID,parentUUID));
  }
 else {
    filter.add(new EmptyKeyFilterParameter(RodaConstants.FILE_PARENT_UUID));
  }
  Sublist sublist=new Sublist(openIndex,1);
  String localeString=LocaleInfo.getCurrentLocale().getLocaleName();
  boolean justActive=true;
  BrowserService.Util.getInstance().find(IndexedFile.class.getName(),filter,sorter,sublist,Facets.NONE,localeString,justActive,new AsyncCallback<IndexResult<IndexedFile>>(){
    @Override public void onFailure(    Throwable caught){
      AsyncCallbackUtils.defaultFailureTreatment(caught);
    }
    @Override public void onSuccess(    IndexResult<IndexedFile> result){
      if (!result.getResults().isEmpty()) {
        IndexedFile firstFile=result.getResults().get(0);
        if (firstFile.getUUID().equals(bundle.getFile().getUUID())) {
          open(parentUUID,sorter,openIndex + 1);
        }
 else {
          HistoryUtils.openBrowse(firstFile,sorter,openIndex);
        }
      }
 else {
        Toast.showError("String_Node_Str");
      }
    }
  }
);
}
Program: 188480
Project: 188480
Buggy source:
@Test public void testJobExecutingPluginThatFailsDuringInit() throws RequestNotValidException, GenericException, NotFoundException, AuthorizationDeniedException {
  Job job=TestsHelper.executeJob(PluginThatFailsDuringInit.class,PluginType.MISC,SelectedItemsNone.create(),JOB_STATE.FAILED_TO_COMPLETE);
  Assert.assertEquals(job.getStateDetails(),"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testJobExecutingPluginThatFailsDuringInit() throws RequestNotValidException, GenericException, NotFoundException, AuthorizationDeniedException {
  try {
    RodaCoreFactory.getPluginManager().registerPlugin(new PluginThatFailsDuringInit());
    Assert.fail("String_Node_Str");
  }
 catch (  PluginException e) {
  }
  Job job=TestsHelper.executeJob(PluginThatFailsDuringInit.class,PluginType.MISC,SelectedItemsNone.create(),JOB_STATE.FAILED_TO_COMPLETE);
  Assert.assertEquals(job.getStateDetails(),"String_Node_Str");
}
Program: 188481
Project: 188481
Buggy source:
public <T extends IsRODAObject>void registerPlugin(Plugin<T> plugin) throws PluginException {
  plugin.init();
  externalPluginChache.put(plugin.getClass().getName(),plugin);
  processAndCachePluginInformation(plugin);
  LOGGER.debug("String_Node_Str",plugin.getName(),plugin.getVersion());
}

Fixed version (ground truth):
public <T extends IsRODAObject>void registerPlugin(Plugin<T> plugin) throws PluginException {
  try {
    plugin.init();
    externalPluginChache.put(plugin.getClass().getName(),plugin);
    processAndCachePluginInformation(plugin);
    LOGGER.debug("String_Node_Str",plugin.getName(),plugin.getVersion());
  }
 catch (  Exception e) {
    throw new PluginException("String_Node_Str",e);
  }
}
Program: 188482
Project: 188482
Buggy source:
private AbstractMessage(){
  if (LOGGER.isTraceEnabled()) {
    uuid=UUID.randomUUID().toString();
    LOGGER.trace("String_Node_Str",uuid,getClass().getSimpleName());
  }
  creationTime=new Date().getTime();
}

Fixed version (ground truth):
private AbstractMessage(){
  if (LOGGER.isTraceEnabled()) {
    uuid=UUID.randomUUID().toString();
    LOGGER.trace("String_Node_Str",uuid,getClass().getSimpleName());
  }
  creationTime=System.currentTimeMillis();
}
Program: 188483
Project: 188483
Buggy source:
public long getTimeSinceCreation(){
  return new Date().getTime() - creationTime;
}

Fixed version (ground truth):
public long getTimeSinceCreation(){
  return System.currentTimeMillis() - creationTime;
}
Program: 188485
Project: 188485
Buggy source:
public static <T extends IsRODAObject>void updatePartialJobReport(Plugin<T> plugin,ModelService model,IndexService index,Report reportItem,boolean replaceLastReportItemIfTheSame){
  String jobId=getJobId(plugin);
  boolean retrieved=true;
  try {
    Report jobReport;
    try {
      jobReport=model.retrieveJobReport(jobId,reportItem.getOutcomeObjectId(),true);
    }
 catch (    NotFoundException e) {
      jobReport=initPluginReportItem(plugin,reportItem.getOutcomeObjectId(),reportItem.getSourceObjectId()).setSourceObjectClass(reportItem.getSourceObjectClass()).setOutcomeObjectClass(reportItem.getOutcomeObjectClass());
      jobReport.setId(reportItem.getOutcomeObjectId());
      jobReport.addReport(reportItem);
      retrieved=false;
    }
    if (retrieved) {
      if (!replaceLastReportItemIfTheSame) {
        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);
        }
      }
    }
    Job job=model.retrieveJob(jobId);
    model.createOrUpdateJobReport(jobReport,job);
  }
 catch (  GenericException|RequestNotValidException|AuthorizationDeniedException|NotFoundException e) {
    LOGGER.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public static <T extends IsRODAObject>void updatePartialJobReport(Plugin<T> plugin,ModelService model,IndexService index,Report reportItem,boolean replaceLastReportItemIfTheSame,Job cachedJob){
  String jobId=getJobId(plugin);
  boolean retrieved=true;
  try {
    Report jobReport;
    try {
      jobReport=model.retrieveJobReport(jobId,reportItem.getOutcomeObjectId(),true);
    }
 catch (    NotFoundException e) {
      jobReport=initPluginReportItem(plugin,reportItem.getOutcomeObjectId(),reportItem.getSourceObjectId()).setSourceObjectClass(reportItem.getSourceObjectClass()).setOutcomeObjectClass(reportItem.getOutcomeObjectClass());
      jobReport.setId(reportItem.getOutcomeObjectId());
      jobReport.addReport(reportItem);
      retrieved=false;
    }
    if (retrieved) {
      if (!replaceLastReportItemIfTheSame) {
        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,cachedJob);
  }
 catch (  GenericException|RequestNotValidException|AuthorizationDeniedException e) {
    LOGGER.error("String_Node_Str",e);
  }
}
Program: 188494
Project: 188494
Buggy source:
@Override public Report execute(IndexService index,ModelService model,StorageService storage,List<LiteOptionalWithCause> liteList) throws PluginException {
  try {
    String username=PluginHelper.getJobUsername(this,index);
    List<AIP> aipList=PluginHelper.transformLitesIntoObjects(model,index,this,null,null,liteList);
    List<String> aipIds=aipList.stream().map(aip -> aip.getId()).collect(Collectors.toList());
    IndexResult<IndexedAIP> indexResults=index.find(IndexedAIP.class,new Filter(new OneOfManyFilterParameter(RodaConstants.AIP_AIP_ID,aipIds)),Sorter.NONE,new Sublist(0,aipIds.size()));
    for (    IndexedAIP indexedAIP : indexResults.getResults()) {
      try {
        LOGGER.debug("String_Node_Str",indexedAIP.getId());
        if (indexedAIP.getLevel() == null || !indexedAIP.getLevel().trim().equalsIgnoreCase("String_Node_Str")) {
          AIP aip=model.retrieveAIP(indexedAIP.getId());
          aip.setParentId(newParent.getId());
          model.updateAIP(aip,username);
        }
 else {
          LOGGER.debug("String_Node_Str",indexedAIP.getLevel());
        }
      }
 catch (      RODAException e) {
        LOGGER.error("String_Node_Str" + indexedAIP.getId() + "String_Node_Str",e);
      }
    }
  }
 catch (  RODAException e) {
    LOGGER.error("String_Node_Str",e);
  }
  return null;
}

Fixed version (ground truth):
@Override public Report execute(IndexService index,ModelService model,StorageService storage,List<LiteOptionalWithCause> liteList) throws PluginException {
  try {
    String username=PluginHelper.getJobUsername(this,index);
    Job job=PluginHelper.getJob(this,model);
    List<AIP> aipList=PluginHelper.transformLitesIntoObjects(model,index,this,null,null,liteList,job);
    List<String> aipIds=aipList.stream().map(aip -> aip.getId()).collect(Collectors.toList());
    IndexResult<IndexedAIP> indexResults=index.find(IndexedAIP.class,new Filter(new OneOfManyFilterParameter(RodaConstants.AIP_AIP_ID,aipIds)),Sorter.NONE,new Sublist(0,aipIds.size()));
    for (    IndexedAIP indexedAIP : indexResults.getResults()) {
      try {
        LOGGER.debug("String_Node_Str",indexedAIP.getId());
        if (indexedAIP.getLevel() == null || !indexedAIP.getLevel().trim().equalsIgnoreCase("String_Node_Str")) {
          AIP aip=model.retrieveAIP(indexedAIP.getId());
          aip.setParentId(newParent.getId());
          model.updateAIP(aip,username);
        }
 else {
          LOGGER.debug("String_Node_Str",indexedAIP.getLevel());
        }
      }
 catch (      RODAException e) {
        LOGGER.error("String_Node_Str" + indexedAIP.getId() + "String_Node_Str",e);
      }
    }
  }
 catch (  RODAException e) {
    LOGGER.error("String_Node_Str",e);
  }
  return null;
}
Program: 188495
Project: 188495
Buggy source:
@SuppressWarnings("String_Node_Str") private <T extends IsRODAObject>void loadInternalPlugins(){
  Reflections reflections=new Reflections(RodaCoreFactory.getRodaConfigurationAsString("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  Set<Class<? extends AbstractPlugin>> plugins=reflections.getSubTypesOf(AbstractPlugin.class);
  plugins.addAll(reflections.getSubTypesOf(AbstractAIPComponentsPlugin.class));
  for (  Class<? extends AbstractPlugin> plugin : plugins) {
    String name=plugin.getName();
    if (!Modifier.isAbstract(plugin.getModifiers()) && !blacklistedPlugins.contains(name)) {
      LOGGER.debug("String_Node_Str",name);
      try {
        Plugin<? extends IsRODAObject> p=(Plugin<?>)ClassLoaderUtility.createObject(plugin.getName());
        p.init();
        internalPluginChache.put(plugin.getName(),p);
        processAndCachePluginInformation(p);
      }
 catch (      ClassNotFoundException|InstantiationException|IllegalAccessException|PluginException|RuntimeException e) {
        LOGGER.error("String_Node_Str",plugin.getName(),e);
      }
    }
  }
  internalPluginStarted=true;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private <T extends IsRODAObject>void loadInternalPlugins(){
  Reflections reflections=new Reflections(RodaCoreFactory.getRodaConfigurationAsString("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  Set<Class<? extends AbstractPlugin>> plugins=reflections.getSubTypesOf(AbstractPlugin.class);
  plugins.addAll(reflections.getSubTypesOf(AbstractAIPComponentsPlugin.class));
  for (  Class<? extends AbstractPlugin> plugin : plugins) {
    String name=plugin.getName();
    if (!Modifier.isAbstract(plugin.getModifiers()) && !blacklistedPlugins.contains(name)) {
      LOGGER.info("String_Node_Str",name);
      try {
        Plugin<? extends IsRODAObject> p=(Plugin<?>)ClassLoaderUtility.createObject(plugin.getName());
        p.init();
        internalPluginChache.put(plugin.getName(),p);
        processAndCachePluginInformation(p);
      }
 catch (      ClassNotFoundException|InstantiationException|IllegalAccessException|PluginException|RuntimeException e) {
        LOGGER.error("String_Node_Str",plugin.getName(),e);
      }
    }
  }
  internalPluginStarted=true;
}
Program: 188496
Project: 188496
Buggy source:
public void run(){
  LOGGER.debug("String_Node_Str");
  blacklistedPlugins=RodaCoreFactory.getRodaConfigurationAsList("String_Node_Str","String_Node_Str","String_Node_Str");
  loadPlugins();
  LOGGER.debug("String_Node_Str",jarPluginCache.size());
  for (  Path jarFile : jarPluginCache.keySet()) {
    List<Plugin<?>> plugins=jarPluginCache.get(jarFile).plugins;
    if (!plugins.isEmpty()) {
      for (      Plugin<?> plugin : plugins) {
        LOGGER.debug("String_Node_Str",jarFile.getFileName());
        LOGGER.debug("String_Node_Str",plugin.getName(),plugin.getVersion(),plugin.getDescription());
      }
    }
  }
}

Fixed version (ground truth):
public void run(){
  LOGGER.debug("String_Node_Str");
  loadPlugins();
  if (LOGGER.isDebugEnabled()) {
    LOGGER.debug("String_Node_Str",jarPluginCache.size());
    for (    Path jarFile : jarPluginCache.keySet()) {
      List<Plugin<?>> plugins=jarPluginCache.get(jarFile).plugins;
      if (!plugins.isEmpty()) {
        for (        Plugin<?> plugin : plugins) {
          LOGGER.debug("String_Node_Str",jarFile.getFileName());
          LOGGER.debug("String_Node_Str",plugin.getName(),plugin.getVersion(),plugin.getDescription());
        }
      }
    }
  }
}
Program: 188497
Project: 188497
Buggy source:
private void loadPlugins(){
  loadExternalPlugins();
  if (!internalPluginStarted) {
    loadInternalPlugins();
  }
}

Fixed version (ground truth):
private void loadPlugins(){
  blacklistedPlugins=RodaCoreFactory.getRodaConfigurationAsList("String_Node_Str","String_Node_Str","String_Node_Str");
  if (Files.exists(RODA_PLUGINS_PATH) && Files.isDirectory(RODA_PLUGINS_PATH)) {
    loadExternalPlugins();
  }
  if (!internalPluginStarted) {
    loadInternalPlugins();
  }
}
Program: 188498
Project: 188498
Buggy source:
/** 
 * Constructs a new   {@link PluginManager}.
 * @throws PluginManagerException
 */
private PluginManager() throws PluginManagerException {
  LOGGER.debug("String_Node_Str");
  int timeInSeconds=RodaCoreFactory.getRodaConfiguration().getInt("String_Node_Str");
  this.loadPluginsTimer=new Timer("String_Node_Str",true);
  this.loadPluginsTimer.schedule(new SearchPluginsTask(),1000,timeInSeconds * 1000);
  LOGGER.info("String_Node_Str",getClass().getSimpleName());
}

Fixed version (ground truth):
/** 
 * Constructs a new   {@link PluginManager}.
 * @throws PluginManagerException
 */
private PluginManager() throws PluginManagerException {
  loadPlugins();
  LOGGER.debug("String_Node_Str");
  int timeInSeconds=RodaCoreFactory.getRodaConfiguration().getInt("String_Node_Str");
  this.loadPluginsTimer=new Timer("String_Node_Str",true);
  this.loadPluginsTimer.schedule(new SearchPluginsTask(),timeInSeconds * 1000,timeInSeconds * 1000);
  LOGGER.info("String_Node_Str",getClass().getSimpleName());
}
Program: 188500
Project: 188500
Buggy source:
@Override public void onClick(ClickEvent event){
  RestUtils.requestCSVExport(getClassToReturn(),getFilter(),dataProvider.getSorter(),dataProvider.getSublist(),getFacets(),getJustActive(),false,notNullSummary + "String_Node_Str");
}

Fixed version (ground truth):
@Override public void onClick(ClickEvent event){
  for (  Map.Entry<String,FacetParameter> entry : getFacets().getParameters().entrySet()) {
    entry.getValue().getValues().clear();
  }
  update();
}
Program: 188502
Project: 188502
Buggy source:
public void refresh(){
  selected=new HashSet<T>();
  hideSelectAllPanel();
  display.setVisibleRangeAndClearData(new Range(0,getInitialPageSize()),true);
  getSelectionModel().clear();
}

Fixed version (ground truth):
public void refresh(){
  selected=new HashSet<T>();
  hideSelectAllPanel();
  display.setVisibleRangeAndClearData(new Range(0,getInitialPageSize()),true);
  getSelectionModel().clear();
  updateEmptyTableWidget();
}
Program: 188505
Project: 188505
Buggy source:
@UiHandler("String_Node_Str") void buttonApplyHandler(ClickEvent e){
  String xmlText=metadataXML.getText();
  if (inXML) {
    updateMetadataOnServer(xmlText);
  }
 else {
    BrowserService.Util.getInstance().retrieveDescriptiveMetadataPreview(supportedBundle,new AsyncCallback<String>(){
      @Override public void onFailure(      Throwable caught){
        AsyncCallbackUtils.defaultFailureTreatment(caught);
      }
      @Override public void onSuccess(      String preview){
        updateMetadataOnServer(preview);
      }
    }
);
  }
}

Fixed version (ground truth):
@UiHandler("String_Node_Str") void buttonApplyHandler(ClickEvent e){
  Window.scrollTo(0,0);
  String xmlText=metadataXML.getText();
  if (inXML) {
    updateMetadataOnServer(xmlText);
  }
 else {
    BrowserService.Util.getInstance().retrieveDescriptiveMetadataPreview(supportedBundle,new AsyncCallback<String>(){
      @Override public void onFailure(      Throwable caught){
        AsyncCallbackUtils.defaultFailureTreatment(caught);
      }
      @Override public void onSuccess(      String preview){
        updateMetadataOnServer(preview);
      }
    }
);
  }
}
Program: 188506
Project: 188506
Buggy source:
public String renameTransferredResource(TransferredResource resource,String newName,boolean replaceExisting,boolean reindexResources) throws AlreadyExistsException, GenericException, IsStillUpdatingException, NotFoundException {
  if (Files.exists(Paths.get(resource.getFullPath()))) {
    Path resourcePath=Paths.get(resource.getFullPath());
    FSUtils.move(resourcePath,resourcePath.getParent().resolve(newName),replaceExisting);
    if (reindexResources) {
      if (resource.getParentUUID() != null) {
        try {
          TransferredResource parent=index.retrieve(TransferredResource.class,resource.getParentUUID());
          updateTransferredResources(Optional.of(parent.getRelativePath()),true);
        }
 catch (        GenericException|NotFoundException e) {
          LOGGER.error("String_Node_Str");
        }
      }
 else {
        updateTransferredResources(Optional.empty(),true);
      }
    }
    Path relativeToBase=basePath.relativize(resourcePath.getParent().resolve(newName));
    return UUID.nameUUIDFromBytes(relativeToBase.toString().getBytes()).toString();
  }
 else {
    throw new NotFoundException("String_Node_Str");
  }
}

Fixed version (ground truth):
public String renameTransferredResource(TransferredResource resource,String newName,boolean replaceExisting,boolean reindexResources) throws AlreadyExistsException, GenericException, IsStillUpdatingException, NotFoundException {
  if (Files.exists(Paths.get(resource.getFullPath()))) {
    Path resourcePath=Paths.get(resource.getFullPath());
    Path newPath=resourcePath.getParent().resolve(newName);
    FSUtils.move(resourcePath,newPath,replaceExisting);
    if (reindexResources) {
      if (resource.getParentUUID() != null) {
        try {
          TransferredResource parent=index.retrieve(TransferredResource.class,resource.getParentUUID());
          if (parent != null) {
            updateTransferredResources(Optional.of(parent.getRelativePath()),true);
          }
 else {
            updateTransferredResources(Optional.empty(),true);
          }
        }
 catch (        GenericException|NotFoundException e) {
          LOGGER.error("String_Node_Str");
        }
      }
 else {
        updateTransferredResources(Optional.empty(),true);
      }
    }
    Path relativeToBase=basePath.relativize(resourcePath.getParent().resolve(newName));
    return UUID.nameUUIDFromBytes(relativeToBase.toString().getBytes()).toString();
  }
 else {
    throw new NotFoundException("String_Node_Str");
  }
}
Program: 188510
Project: 188510
Buggy source:
/** 
 * Constructs a   {@link OrFiltersParameters} from a list of values.
 * @param name the name of the attribute.
 * @param values the list of values for this filter.
 */
public OrFiltersParameters(String name,List<FilterParameter> values){
  setName(name);
  setValues(values);
}

Fixed version (ground truth):
/** 
 * Constructs a   {@link OrFiltersParameters} from a list of values.
 * @param name the name of the attribute.
 * @param values the list of values for this filter.
 */
public OrFiltersParameters(String name,List<FilterParameter> values){
  super(name,values);
}
Program: 188511
Project: 188511
Buggy source:
/** 
 * @see Object#toString()
 */
public String toString(){
  return "String_Node_Str" + getName() + "String_Node_Str"+ getValues()+ "String_Node_Str";
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + super.toString() + "String_Node_Str";
}