nus-yam/ex-repair huggingface dataset:
Program: 51908
Project: 51908
Buggy source:
/** 
 * Allows developers to get the desired service singleton by the provided name and type. Provide   {@code null} for the name if it is not known, but it isbetter to ensure it is set. <p> <em>NOTE</em>: This also allows special access to the underlying service manager objects.  If using Spring this allows access to the underlying ApplicationContext object like so: <xmp> getServiceByName(ApplicationContext.class.getName(), ApplicationContext.class); </xmp> If using Guice then the same applies like so: <xmp> getServiceByName(Injector.class.getName(), Injector.class); </xmp> It is also possible to register a module and cause Guice to fill in any injected core services (see register method). </p>
 * @param < T >
 * @param name (optional) the unique name for this service.If null then the bean will be returned if there is only one service of this type.
 * @param type the type for the requested service (this will typically be the interface class but can be concrete as well)
 * @return the service singleton OR null if none is found
 */
public <T>T getServiceByName(String name,Class<T> type);

Fixed version (ground truth):
/** 
 * Allows developers to get the desired service singleton by the provided name and type. Provide   {@code null} for the name if it is not known, but it isbetter to ensure it is set. <p> <em>NOTE</em>: This also allows special access to the underlying service manager objects.  If using Spring this allows access to the underlying ApplicationContext object like so:<br> {@code getServiceByName(ApplicationContext.class.getName(), ApplicationContext.class);}If using Guice then the same applies like so:<br>  {@code getServiceByName(Injector.class.getName(), Injector.class);}It is also possible to register a module and cause Guice to fill in any injected core services (see register method). </p>
 * @param < T > Class type
 * @param name (optional) the unique name for this service.If null then the bean will be returned if there is only one service of this type.
 * @param type the type for the requested service (this will typically be the interface class but can be concrete as well)
 * @return the service singleton OR null if none is found
 */
public <T>T getServiceByName(String name,Class<T> type);
Program: 51909
Project: 51909
Buggy source:
/** 
 * Allows developers to get the desired service singleton by the provided type. <br/> This should return all instantiated objects of the type specified  (may not all be singletons).
 * @param < T >
 * @param type the type for the requested service (this will typically be the interface class but can be concrete as well)
 * @return the list of service singletons OR empty list if none is found
 */
public <T>List<T> getServicesByType(Class<T> type);

Fixed version (ground truth):
/** 
 * Allows developers to get the desired service singleton by the provided type. <br> This should return all instantiated objects of the type specified  (may not all be singletons).
 * @param < T > Class type
 * @param type the type for the requested service (this will typically be the interface class but can be concrete as well)
 * @return the list of service singletons OR empty list if none is found
 */
public <T>List<T> getServicesByType(Class<T> type);
Program: 51910
Project: 51910
Buggy source:
/** 
 * Time that this kernel was started, as a java.util.Date. 
 */
public Date getLastLoadDate(){
  return new Date(lastLoadDate.getTime());
}

Fixed version (ground truth):
/** 
 * Time that this kernel was started, as a java.util.Date. 
 * @return date object
 */
public Date getLastLoadDate(){
  return new Date(lastLoadDate.getTime());
}
Program: 51911
Project: 51911
Buggy source:
/** 
 * Time that this kernel was started, as seconds since the epoch. 
 */
public long getLoadTime(){
  return loadTime;
}

Fixed version (ground truth):
/** 
 * Time that this kernel was started, as seconds since the epoch. 
 * @return seconds since epoch (as a long)
 */
public long getLoadTime(){
  return loadTime;
}
Program: 51912
Project: 51912
Buggy source:
/** 
 * Creates or retrieves a DSpace Kernel with the given name.
 * @return a DSpace Kernel
 * @throws IllegalStateException if the Kernel cannot be created
 */
public static DSpaceKernelImpl getKernel(String name){
  if (name != null) {
    try {
      DSpaceKernel kernel=new DSpaceKernelManager().getKernel(name);
      if (kernel != null) {
        if (kernel instanceof DSpaceKernelImpl) {
          return (DSpaceKernelImpl)kernel;
        }
        throw new IllegalStateException("String_Node_Str");
      }
    }
 catch (    Exception e) {
    }
  }
synchronized (staticLock) {
    DSpaceKernelImpl kernelImpl=new DSpaceKernelImpl(name);
    log.info("String_Node_Str" + kernelImpl);
    if (name != null) {
      DSpaceKernelManager.registerMBean(kernelImpl.getMBeanName(),kernelImpl);
    }
 else {
      DSpaceKernelManager.setDefaultKernel(kernelImpl);
    }
    return kernelImpl;
  }
}

Fixed version (ground truth):
/** 
 * Creates or retrieves a DSpace Kernel with the given name.
 * @param name kernel name (or null for default kernel)
 * @return a DSpace Kernel
 * @throws IllegalStateException if the Kernel cannot be created
 */
public static DSpaceKernelImpl getKernel(String name){
  if (name != null) {
    try {
      DSpaceKernel kernel=new DSpaceKernelManager().getKernel(name);
      if (kernel != null) {
        if (kernel instanceof DSpaceKernelImpl) {
          return (DSpaceKernelImpl)kernel;
        }
        throw new IllegalStateException("String_Node_Str");
      }
    }
 catch (    Exception e) {
    }
  }
synchronized (staticLock) {
    DSpaceKernelImpl kernelImpl=new DSpaceKernelImpl(name);
    log.info("String_Node_Str" + kernelImpl);
    if (name != null) {
      DSpaceKernelManager.registerMBean(kernelImpl.getMBeanName(),kernelImpl);
    }
 else {
      DSpaceKernelManager.setDefaultKernel(kernelImpl);
    }
    return kernelImpl;
  }
}
Program: 51913
Project: 51913
Buggy source:
/** 
 * TESTING - This is for testing only.
 * @param springXmlConfigFiles
 */
protected DSpaceServiceManager(DSpaceConfigurationService configurationService,String... springXmlConfigFiles){
  this.configurationService=configurationService;
  this.springXmlConfigFiles=springXmlConfigFiles;
  this.testing=true;
  this.developing=true;
}

Fixed version (ground truth):
/** 
 * TESTING - This is for testing only.
 * @param configurationService current DSpace configuration service
 * @param springXmlConfigFiles one or more Spring XML configs
 */
protected DSpaceServiceManager(DSpaceConfigurationService configurationService,String... springXmlConfigFiles){
  this.configurationService=configurationService;
  this.springXmlConfigFiles=springXmlConfigFiles;
  this.testing=true;
  this.developing=true;
}
Program: 51914
Project: 51914
Buggy source:
/** 
 * Initialize the service manager's configuration.
 * @param parent
 * @param configurationService
 * @param testMode
 * @param developmentMode
 * @param serviceManagers
 */
void init(ServiceManagerSystem parent,DSpaceConfigurationService configurationService,boolean testMode,boolean developmentMode,List<ServiceManagerSystem> serviceManagers);

Fixed version (ground truth):
/** 
 * Initialize the service manager's configuration.
 * @param parent parent ServiceManagerSystem
 * @param configurationService current DSpace configuration service
 * @param testMode whether in test mode
 * @param developmentMode whether in development mode
 * @param serviceManagers List of ServiceManagerSystems
 */
void init(ServiceManagerSystem parent,DSpaceConfigurationService configurationService,boolean testMode,boolean developmentMode,List<ServiceManagerSystem> serviceManagers);
Program: 51915
Project: 51915
Buggy source:
/** 
 * Map service names to their beans.
 * @return a map of name -> bean for all services that are currently known
 */
public Map<String,Object> getServices();

Fixed version (ground truth):
/** 
 * Map service names to their beans.
 * @return a map of name to bean for all services that are currently known
 */
public Map<String,Object> getServices();
Program: 51916
Project: 51916
Buggy source:
/** 
 * @see org.springframework.beans.factory.FactoryBean#getObject()
 */
public Object getObject() throws Exception {
  return (configuration != null) ? ConfigurationConverter.getProperties(configuration) : null;
}

Fixed version (ground truth):
/** 
 * @see org.springframework.beans.factory.FactoryBean#getObject()
 */
@Override public Object getObject() throws Exception {
  return (configuration != null) ? ConfigurationConverter.getProperties(configuration) : null;
}
Program: 51917
Project: 51917
Buggy source:
/** 
 * Getter for the underlying CompositeConfiguration object.
 * @return
 */
public CompositeConfiguration getConfiguration(){
  return configuration;
}

Fixed version (ground truth):
/** 
 * Getter for the underlying CompositeConfiguration object.
 * @return CompositeConfiguration object
 */
public CompositeConfiguration getConfiguration(){
  return configuration;
}
Program: 51918
Project: 51918
Buggy source:
/** 
 * Set the underlying Commons CompositeConfiguration throwExceptionOnMissing flag.
 * @param throwExceptionOnMissing
 */
public void setThrowExceptionOnMissing(boolean throwExceptionOnMissing){
  this.throwExceptionOnMissing=throwExceptionOnMissing;
}

Fixed version (ground truth):
/** 
 * Set the underlying Commons CompositeConfiguration throwExceptionOnMissing flag.
 * @see org.apache.commons.configuration.AbstractConfiguration
 * @param throwExceptionOnMissing whether to throw an exception if a config is missing
 */
public void setThrowExceptionOnMissing(boolean throwExceptionOnMissing){
  this.throwExceptionOnMissing=throwExceptionOnMissing;
}
Program: 51919
Project: 51919
Buggy source:
/** 
 * Set the commons configurations objects which will be used as properties.
 * @param configurations
 */
public void setConfigurations(Configuration[] configurations){
  this.configurations=configurations;
}

Fixed version (ground truth):
/** 
 * Set the commons configurations objects which will be used as properties.
 * @param configurations array of Commons Configuration objects
 */
public void setConfigurations(Configuration[] configurations){
  this.configurations=configurations;
}
Program: 51920
Project: 51920
Buggy source:
/** 
 * @see org.springframework.beans.factory.FactoryBean#getObjectType()
 */
public Class getObjectType(){
  return java.util.Properties.class;
}

Fixed version (ground truth):
/** 
 * @see org.springframework.beans.factory.FactoryBean#getObjectType()
 */
@Override public Class getObjectType(){
  return java.util.Properties.class;
}
Program: 51921
Project: 51921
Buggy source:
/** 
 * @see org.springframework.beans.factory.FactoryBean#isSingleton()
 */
public boolean isSingleton(){
  return true;
}

Fixed version (ground truth):
/** 
 * @see org.springframework.beans.factory.FactoryBean#isSingleton()
 */
@Override public boolean isSingleton(){
  return true;
}
Program: 51922
Project: 51922
Buggy source:
/** 
 * Shortcut for loading configuration from Spring resources. It will internally create a PropertiesConfiguration object based on the URL retrieved from the given Resources.
 * @param locations
 */
public void setLocations(Resource[] locations){
  this.locations=locations;
}

Fixed version (ground truth):
/** 
 * Shortcut for loading configuration from Spring resources. It will internally create a PropertiesConfiguration object based on the URL retrieved from the given Resources.
 * @param locations array of resource locations
 */
public void setLocations(Resource[] locations){
  this.locations=locations;
}
Program: 51923
Project: 51923
Buggy source:
public boolean isThrowExceptionOnMissing(){
  return throwExceptionOnMissing;
}

Fixed version (ground truth):
/** 
 * Return whether to throw an exception if a configuration is missing.
 * @return true if exception should be throw, false otherwise.
 */
public boolean isThrowExceptionOnMissing(){
  return throwExceptionOnMissing;
}
Program: 51924
Project: 51924
Buggy source:
/** 
 * Initialize all properties via the passed in Commons Configuration
 * @param configuration
 */
public DSpaceConfigurationFactoryBean(Configuration configuration){
  Assert.notNull(configuration);
  this.configuration=new CompositeConfiguration(configuration);
}

Fixed version (ground truth):
/** 
 * Initialize all properties via the passed in Commons Configuration
 * @param configuration Commons configuration
 */
public DSpaceConfigurationFactoryBean(Configuration configuration){
  Assert.notNull(configuration);
  this.configuration=new CompositeConfiguration(configuration);
}
Program: 51925
Project: 51925
Buggy source:
/** 
 * Loads (i.e. Adds) a single additional config setting into the system.
 * @param key
 * @param value
 * @return true if the config is new or changed
 */
public boolean loadConfig(String key,Object value){
  if (key == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (this.configuration.containsKey(key) && this.configuration.getProperty(key).equals(value)) {
    return false;
  }
 else {
    this.configuration.setProperty(key,value);
    return true;
  }
}

Fixed version (ground truth):
/** 
 * Loads (i.e. Adds) a single additional config setting into the system.
 * @param key configuration key to add
 * @param value configuration value to add
 * @return true if the config is new or changed
 */
public boolean loadConfig(String key,Object value){
  if (key == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (this.configuration.containsKey(key) && this.configuration.getProperty(key).equals(value)) {
    return false;
  }
 else {
    this.configuration.setProperty(key,value);
    return true;
  }
}
Program: 51926
Project: 51926
Buggy source:
/** 
 * Returns whether a given path seems to have the required DSpace configurations in order to make it a valid DSpace home directory
 * @param path
 * @return true if path seems valid, false otherwise
 */
protected boolean isValidDSpaceHome(String path){
  if (path == null)   return false;
  String configDefinition=path + File.separatorChar + DSPACE_CONFIG_DEFINITION_PATH;
  File configDefFile=new File(configDefinition);
  if (configDefFile.exists())   return true;
 else   return false;
}

Fixed version (ground truth):
/** 
 * Returns whether a given path seems to have the required DSpace configurations in order to make it a valid DSpace home directory
 * @param path path to validate
 * @return true if path seems valid, false otherwise
 */
protected boolean isValidDSpaceHome(String path){
  if (path == null)   return false;
  String configDefinition=path + File.separatorChar + DSPACE_CONFIG_DEFINITION_PATH;
  File configDefFile=new File(configDefinition);
  if (configDefFile.exists())   return true;
 else   return false;
}
Program: 51927
Project: 51927
Buggy source:
/** 
 * Initializes a ConfigurationService based on the provided home directory for DSpace
 * @param providedHome
 */
public DSpaceConfigurationService(String providedHome){
  loadInitialConfig(providedHome);
}

Fixed version (ground truth):
/** 
 * Initializes a ConfigurationService based on the provided home directory for DSpace
 * @param providedHome provided home directory
 */
public DSpaceConfigurationService(String providedHome){
  loadInitialConfig(providedHome);
}
Program: 51928
Project: 51928
Buggy source:
/** 
 * Load (i.e. Add) a series of properties into the configuration. Checks to see if the settings exist or are changed and only loads changes. <P> This only adds/updates configurations, if you wish to first clear all existing configurations, see clear() method.
 * @param properties a map of key -> value settings
 * @return the list of changed configuration keys
 */
public String[] loadConfiguration(Map<String,Object> properties){
  if (properties == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  ArrayList<String> changed=new ArrayList<String>();
  for (  Entry<String,Object> entry : properties.entrySet()) {
    String key=entry.getKey();
    Object value=entry.getValue();
    boolean updated=loadConfig(key,value);
    if (updated) {
      changed.add(key);
    }
  }
  return changed.toArray(new String[changed.size()]);
}

Fixed version (ground truth):
/** 
 * Load (i.e. Add) a series of properties into the configuration. Checks to see if the settings exist or are changed and only loads changes. <P> This only adds/updates configurations, if you wish to first clear all existing configurations, see clear() method.
 * @param properties a map of key to value settings
 * @return the list of changed configuration keys
 */
public String[] loadConfiguration(Map<String,Object> properties){
  if (properties == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  ArrayList<String> changed=new ArrayList<String>();
  for (  Entry<String,Object> entry : properties.entrySet()) {
    String key=entry.getKey();
    Object value=entry.getValue();
    boolean updated=loadConfig(key,value);
    if (updated) {
      changed.add(key);
    }
  }
  return changed.toArray(new String[changed.size()]);
}
Program: 51929
Project: 51929
Buggy source:
/** 
 * Returns property value as an Object. If property is not found, null is returned.
 * @see org.dspace.services.ConfigurationService#getPropertyValue(java.lang.Object)
 */
@Override public Object getPropertyValue(String name){
  return configuration.getProperty(name);
}

Fixed version (ground truth):
/** 
 * Returns property value as an Object. If property is not found, null is returned.
 * @see org.dspace.services.ConfigurationService#getPropertyValue(java.lang.String)
 */
@Override public Object getPropertyValue(String name){
  return configuration.getProperty(name);
}
Program: 51931
Project: 51931
Buggy source:
/** 
 * Constructor which will inject the instantiated  Interceptor into a service handed to it.
 * @param service
 */
public RequestInterceptorExample(RequestService service){
  service.registerRequestInterceptor(this);
}

Fixed version (ground truth):
/** 
 * Constructor which will inject the instantiated  Interceptor into a service handed to it.
 * @param service the service
 */
public RequestInterceptorExample(RequestService service){
  service.registerRequestInterceptor(this);
}
Program: 51932
Project: 51932
Buggy source:
public void onEnd(String requestId,Session session,boolean succeeded,Exception failure){
  log.info("String_Node_Str" + requestId + "String_Node_Str"+ session.getId()+ "String_Node_Str"+ succeeded);
}

Fixed version (ground truth):
@Override public void onEnd(String requestId,Session session,boolean succeeded,Exception failure){
  log.info("String_Node_Str" + requestId + "String_Node_Str"+ session.getId()+ "String_Node_Str"+ succeeded);
}
Program: 51933
Project: 51933
Buggy source:
public void onStart(String requestId,Session session){
  log.info("String_Node_Str" + requestId + "String_Node_Str"+ session.getId());
}

Fixed version (ground truth):
@Override public void onStart(String requestId,Session session){
  log.info("String_Node_Str" + requestId + "String_Node_Str"+ session.getId());
}
Program: 51934
Project: 51934
Buggy source:
public int getOrder(){
  return 0;
}

Fixed version (ground truth):
@Override public int getOrder(){
  return 0;
}
Program: 51935
Project: 51935
Buggy source:
@Override public boolean supports(String identifier){
  for (  String prefix : supportedPrefixes) {
    if (identifier.startsWith(prefix)) {
      return true;
    }
  }
  try {
    String outOfUrl=retrieveHandleOutOfUrl(identifier);
    if (outOfUrl != null) {
      return true;
    }
  }
 catch (  SQLException e) {
    log.error(e.getMessage(),e);
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean supports(String identifier){
  String prefix=handleService.getPrefix();
  String handleResolver=ConfigurationManager.getProperty("String_Node_Str");
  if (identifier == null) {
    return false;
  }
  if (identifier.startsWith(prefix) || identifier.startsWith(handleResolver) || identifier.startsWith("String_Node_Str")|| identifier.startsWith("String_Node_Str")|| identifier.startsWith("String_Node_Str")) {
    return true;
  }
  return false;
}
Program: 51936
Project: 51936
Buggy source:
@Override public boolean supports(String identifier){
  for (  String prefix : supportedPrefixes) {
    if (identifier.startsWith(prefix)) {
      return true;
    }
  }
  try {
    String outOfUrl=retrieveHandleOutOfUrl(identifier);
    if (outOfUrl != null) {
      return true;
    }
  }
 catch (  SQLException e) {
    log.error(e.getMessage(),e);
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean supports(String identifier){
  String prefix=handleService.getPrefix();
  String handleResolver=ConfigurationManager.getProperty("String_Node_Str");
  if (identifier == null) {
    return false;
  }
  if (identifier.startsWith(prefix) || identifier.startsWith(handleResolver) || identifier.startsWith("String_Node_Str")|| identifier.startsWith("String_Node_Str")|| identifier.startsWith("String_Node_Str")) {
    return true;
  }
  return false;
}
Program: 51937
Project: 51937
Buggy source:
protected void modifyHandleMetadata(Context context,Item item,String handle) throws SQLException, IOException, AuthorizeException {
  String handleref=getCanonicalForm(handle);
  itemService.clearMetadata(context,item,MetadataSchema.DC_SCHEMA,"String_Node_Str","String_Node_Str",Item.ANY);
  itemService.addMetadata(context,item,MetadataSchema.DC_SCHEMA,"String_Node_Str","String_Node_Str",null,handleref);
  itemService.update(context,item);
}

Fixed version (ground truth):
protected void modifyHandleMetadata(Context context,Item item,String handle) throws SQLException, IOException, AuthorizeException {
  String handleref=getCanonicalForm(handle);
  List<MetadataValue> identifiers=itemService.getMetadata(item,MetadataSchema.DC_SCHEMA,"String_Node_Str","String_Node_Str",Item.ANY);
  itemService.clearMetadata(context,item,MetadataSchema.DC_SCHEMA,"String_Node_Str","String_Node_Str",Item.ANY);
  for (  MetadataValue identifier : identifiers) {
    if (this.supports(identifier.getValue())) {
      log.warn("String_Node_Str" + identifier.getValue());
      continue;
    }
    log.warn("String_Node_Str" + identifier.getValue());
    itemService.addMetadata(context,item,identifier.getMetadataField(),identifier.getLanguage(),identifier.getValue(),identifier.getAuthority(),identifier.getConfidence());
  }
  if (!StringUtils.isEmpty(handleref)) {
    itemService.addMetadata(context,item,MetadataSchema.DC_SCHEMA,"String_Node_Str","String_Node_Str",null,handleref);
  }
  itemService.update(context,item);
}
Program: 51938
Project: 51938
Buggy source:
public static String retrieveHandleOutOfUrl(String url) throws SQLException {
  if (!url.contains("String_Node_Str"))   return null;
  String[] splitUrl=url.split("String_Node_Str");
  return splitUrl[splitUrl.length - 2] + "String_Node_Str" + splitUrl[splitUrl.length - 1];
}

Fixed version (ground truth):
public static String retrieveHandleOutOfUrl(String url){
  if (!url.contains("String_Node_Str"))   return null;
  String[] splitUrl=url.split("String_Node_Str");
  return splitUrl[splitUrl.length - 2] + "String_Node_Str" + splitUrl[splitUrl.length - 1];
}
Program: 51939
Project: 51939
Buggy source:
@Override public boolean supports(String identifier){
  for (  String prefix : supportedPrefixes) {
    if (identifier.startsWith(prefix)) {
      return true;
    }
  }
  try {
    String outOfUrl=retrieveHandleOutOfUrl(identifier);
    if (outOfUrl != null) {
      return true;
    }
  }
 catch (  SQLException e) {
    log.error(e.getMessage(),e);
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean supports(String identifier){
  String prefix=handleService.getPrefix();
  String handleResolver=ConfigurationManager.getProperty("String_Node_Str");
  if (identifier == null) {
    return false;
  }
  if (identifier.startsWith(prefix) || identifier.startsWith(handleResolver) || identifier.startsWith("String_Node_Str")|| identifier.startsWith("String_Node_Str")|| identifier.startsWith("String_Node_Str")) {
    return true;
  }
  return false;
}
Program: 51940
Project: 51940
Buggy source:
@Override public int countWithdrawnItems(Context context) throws SQLException {
  return itemDAO.countItems(context,true,true);
}

Fixed version (ground truth):
@Override public int countWithdrawnItems(Context context) throws SQLException {
  return itemDAO.countItems(context,false,true);
}
Program: 51943
Project: 51943
Buggy source:
private String getPreviousPageURL(SearchFilterParam browseParams,Request request) throws UnsupportedEncodingException, UIException {
  boolean currentOffsetSmallerOrEqualTO0=currentOffset <= 0;
  if (0 == queryArgs.getFacetOffset() && Util.getIntParameter(request,"String_Node_Str") == -1 && currentOffsetSmallerOrEqualTO0) {
    return null;
  }
  int offset=Util.getIntParameter(request,SearchFilterParam.OFFSET);
  if (currentOffsetSmallerOrEqualTO0 && (offset == -1 || offset == 0)) {
    return null;
  }
  Map<String,String> parameters=new HashMap<String,String>();
  parameters.putAll(browseParams.getCommonBrowseParams());
  parameters.putAll(browseParams.getControlParameters());
  String offSet=String.valueOf((currentOffset - getPageSize() < 0) ? 0 : currentOffset - getPageSize());
  parameters.put(SearchFilterParam.OFFSET,offSet);
  String url=generateURL("String_Node_Str",parameters);
  url=addFilterQueriesToUrl(url);
  return url;
}

Fixed version (ground truth):
private String getPreviousPageURL(SearchFilterParam browseParams,Request request) throws UnsupportedEncodingException, UIException {
  boolean currentOffsetSmallerOrEqualTO0=currentOffset <= 0;
  if (0 == queryArgs.getFacetOffset() && Util.getIntParameter(request,"String_Node_Str") == -1 && currentOffsetSmallerOrEqualTO0) {
    return null;
  }
  int offset=Util.getIntParameter(request,SearchFilterParam.OFFSET);
  if (currentOffsetSmallerOrEqualTO0 && (offset == -1 || offset == 0)) {
    return null;
  }
  Map<String,String> parameters=new HashMap<String,String>();
  parameters.putAll(browseParams.getCommonBrowseParams());
  parameters.putAll(browseParams.getControlParameters());
  parameters.put(SearchFilterParam.ORDER,getSortOrder(request).name());
  String offSet=String.valueOf((currentOffset - getPageSize() < 0) ? 0 : currentOffset - getPageSize());
  parameters.put(SearchFilterParam.OFFSET,offSet);
  String url=generateURL("String_Node_Str",parameters);
  url=addFilterQueriesToUrl(url);
  return url;
}
Program: 51944
Project: 51944
Buggy source:
private String getNextPageURL(SearchFilterParam browseParams,Request request) throws UnsupportedEncodingException, UIException {
  int offSet=Util.getIntParameter(request,SearchFilterParam.OFFSET);
  if (offSet == -1) {
    offSet=currentOffset;
  }
  Map<String,String> parameters=new HashMap<String,String>();
  parameters.putAll(browseParams.getCommonBrowseParams());
  parameters.putAll(browseParams.getControlParameters());
  parameters.put(SearchFilterParam.OFFSET,String.valueOf(offSet + getPageSize()));
  String url=generateURL("String_Node_Str",parameters);
  url=addFilterQueriesToUrl(url);
  return url;
}

Fixed version (ground truth):
private String getNextPageURL(SearchFilterParam browseParams,Request request) throws UnsupportedEncodingException, UIException {
  int offSet=Util.getIntParameter(request,SearchFilterParam.OFFSET);
  if (offSet == -1) {
    offSet=currentOffset;
  }
  Map<String,String> parameters=new HashMap<String,String>();
  parameters.putAll(browseParams.getCommonBrowseParams());
  parameters.putAll(browseParams.getControlParameters());
  parameters.put(SearchFilterParam.OFFSET,String.valueOf(offSet + getPageSize()));
  parameters.put(SearchFilterParam.ORDER,getSortOrder(request).name());
  String url=generateURL("String_Node_Str",parameters);
  url=addFilterQueriesToUrl(url);
  return url;
}
Program: 51946
Project: 51946
Buggy source:
/** 
 * Actually migrate the existing database
 * @param connection 
 */
@Override public void migrate(Connection connection) throws IOException, SQLException {
  if (StringUtils.equals(ConfigurationManager.getProperty("String_Node_Str"),"String_Node_Str") && DatabaseUtils.getCurrentFlywayDSpaceState(connection) < 6) {
    if (!DatabaseUtils.tableExists(connection,"String_Node_Str")) {
      String dbtype=connection.getMetaData().getDatabaseProductName();
      String dbFileLocation=null;
      if (dbtype.toLowerCase().contains("String_Node_Str")) {
        dbFileLocation="String_Node_Str";
      }
 else       if (dbtype.toLowerCase().contains("String_Node_Str")) {
        dbFileLocation="String_Node_Str";
      }
      String packagePath=V5_0_2014_11_04__Enable_XMLWorkflow_Migration.class.getPackage().getName().replace("String_Node_Str","String_Node_Str");
      String dbMigrateSQL=new ClassPathResource(packagePath + "String_Node_Str" + dbFileLocation+ "String_Node_Str",getClass().getClassLoader()).loadAsString(Constants.DEFAULT_ENCODING);
      DatabaseUtils.executeSql(connection,dbMigrateSQL);
      String dataMigrateSQL=new ClassPathResource(packagePath + "String_Node_Str" + dbFileLocation+ "String_Node_Str",getClass().getClassLoader()).loadAsString(Constants.DEFAULT_ENCODING);
      DatabaseUtils.executeSql(connection,dataMigrateSQL);
      migration_file_size=dbMigrateSQL.length() + dataMigrateSQL.length();
    }
  }
}

Fixed version (ground truth):
/** 
 * Actually migrate the existing database
 * @param connection 
 */
@Override public void migrate(Connection connection) throws IOException, SQLException {
  if (WorkflowServiceFactory.getInstance().getWorkflowService() instanceof XmlWorkflowService && DatabaseUtils.getCurrentFlywayDSpaceState(connection) < 6) {
    if (!DatabaseUtils.tableExists(connection,"String_Node_Str")) {
      String dbtype=connection.getMetaData().getDatabaseProductName();
      String dbFileLocation=null;
      if (dbtype.toLowerCase().contains("String_Node_Str")) {
        dbFileLocation="String_Node_Str";
      }
 else       if (dbtype.toLowerCase().contains("String_Node_Str")) {
        dbFileLocation="String_Node_Str";
      }
      String packagePath=V5_0_2014_11_04__Enable_XMLWorkflow_Migration.class.getPackage().getName().replace("String_Node_Str","String_Node_Str");
      String dbMigrateSQL=new ClassPathResource(packagePath + "String_Node_Str" + dbFileLocation+ "String_Node_Str",getClass().getClassLoader()).loadAsString(Constants.DEFAULT_ENCODING);
      DatabaseUtils.executeSql(connection,dbMigrateSQL);
      String dataMigrateSQL=new ClassPathResource(packagePath + "String_Node_Str" + dbFileLocation+ "String_Node_Str",getClass().getClassLoader()).loadAsString(Constants.DEFAULT_ENCODING);
      DatabaseUtils.executeSql(connection,dataMigrateSQL);
      migration_file_size=dbMigrateSQL.length() + dataMigrateSQL.length();
    }
  }
}
Program: 51947
Project: 51947
Buggy source:
@Override public void migrate(Connection connection) throws Exception {
  if (StringUtils.equals(ConfigurationManager.getProperty("String_Node_Str"),"String_Node_Str")) {
    if (!DatabaseUtils.tableExists(connection,"String_Node_Str")) {
      String dbtype=connection.getMetaData().getDatabaseProductName();
      String dbFileLocation=null;
      if (dbtype.toLowerCase().contains("String_Node_Str")) {
        dbFileLocation="String_Node_Str";
      }
 else       if (dbtype.toLowerCase().contains("String_Node_Str")) {
        dbFileLocation="String_Node_Str";
      }
      String packagePath=V6_0_2015_09_01__DS_2701_Enable_XMLWorkflow_Migration.class.getPackage().getName().replace("String_Node_Str","String_Node_Str");
      String dbMigrateSQL=new ClassPathResource(packagePath + "String_Node_Str" + dbFileLocation+ "String_Node_Str",getClass().getClassLoader()).loadAsString(Constants.DEFAULT_ENCODING);
      DatabaseUtils.executeSql(connection,dbMigrateSQL);
      String dataMigrateSQL=new ClassPathResource(packagePath + "String_Node_Str" + dbFileLocation+ "String_Node_Str",getClass().getClassLoader()).loadAsString(Constants.DEFAULT_ENCODING);
      DatabaseUtils.executeSql(connection,dataMigrateSQL);
      migration_file_size=dbMigrateSQL.length() + dataMigrateSQL.length();
    }
  }
}

Fixed version (ground truth):
@Override public void migrate(Connection connection) throws Exception {
  if (WorkflowServiceFactory.getInstance().getWorkflowService() instanceof XmlWorkflowService) {
    if (!DatabaseUtils.tableExists(connection,"String_Node_Str")) {
      String dbtype=connection.getMetaData().getDatabaseProductName();
      String dbFileLocation=null;
      if (dbtype.toLowerCase().contains("String_Node_Str")) {
        dbFileLocation="String_Node_Str";
      }
 else       if (dbtype.toLowerCase().contains("String_Node_Str")) {
        dbFileLocation="String_Node_Str";
      }
      String packagePath=V6_0_2015_09_01__DS_2701_Enable_XMLWorkflow_Migration.class.getPackage().getName().replace("String_Node_Str","String_Node_Str");
      String dbMigrateSQL=new ClassPathResource(packagePath + "String_Node_Str" + dbFileLocation+ "String_Node_Str",getClass().getClassLoader()).loadAsString(Constants.DEFAULT_ENCODING);
      DatabaseUtils.executeSql(connection,dbMigrateSQL);
      String dataMigrateSQL=new ClassPathResource(packagePath + "String_Node_Str" + dbFileLocation+ "String_Node_Str",getClass().getClassLoader()).loadAsString(Constants.DEFAULT_ENCODING);
      DatabaseUtils.executeSql(connection,dataMigrateSQL);
      migration_file_size=dbMigrateSQL.length() + dataMigrateSQL.length();
    }
  }
}
Program: 51948
Project: 51948
Buggy source:
/** 
 * Command-line interface for running configuration tasks. Possible arguments: <ul> <li><code>-property name</code> prints the value of the property <code>name</code> from <code>dspace.cfg</code> to the standard output. If the property does not exist, nothing is written.</li> </ul>
 * @param argv command-line arguments
 */
public static void main(String[] argv){
  if ((argv.length == 2) && argv[0].equals("String_Node_Str")) {
    String val=getProperty(argv[1]);
    if (val != null) {
      System.out.println(val);
    }
 else {
      System.out.println("String_Node_Str");
    }
    System.exit(0);
  }
 else   if ((argv.length == 4) && argv[0].equals("String_Node_Str") && argv[2].equals("String_Node_Str")) {
    String val=getProperty(argv[1],argv[3]);
    if (val != null) {
      System.out.println(val);
    }
 else {
      System.out.println("String_Node_Str");
    }
    System.exit(0);
  }
 else {
    System.err.println("String_Node_Str");
  }
  System.exit(1);
}

Fixed version (ground truth):
/** 
 * Command-line interface for running configuration tasks. Possible arguments: <ul> <li><code>-property name</code> prints the value of the property <code>name</code> from <code>dspace.cfg</code> to the standard output. If the property does not exist, nothing is written.</li> </ul>
 * @param argv command-line arguments
 */
public static void main(String[] argv){
  if ((argv.length == 2) && argv[0].equals("String_Node_Str")) {
    Object val=DSpaceServicesFactory.getInstance().getConfigurationService().getPropertyValue(argv[1]);
    if (val != null) {
      System.out.println(val.toString());
    }
 else {
      System.out.println("String_Node_Str");
    }
    System.exit(0);
  }
 else   if ((argv.length == 4) && argv[0].equals("String_Node_Str") && argv[2].equals("String_Node_Str")) {
    Object val=DSpaceServicesFactory.getInstance().getConfigurationService().getPropertyValue(argv[1] + "String_Node_Str" + argv[3]);
    if (val != null) {
      System.out.println(val.toString());
    }
 else {
      System.out.println("String_Node_Str");
    }
    System.exit(0);
  }
 else {
    System.err.println("String_Node_Str");
  }
  System.exit(1);
}
Program: 51949
Project: 51949
Buggy source:
/** 
 * get the available Locales for the User Interface as defined in dspace.cfg property webui.supported.locales returns an array of Locales or null
 * @return an array of supported Locales or null
 */
private static Locale[] getSupportedLocales(){
  String ll=ConfigurationManager.getProperty("String_Node_Str");
  if (ll != null) {
    return I18nUtil.parseLocales(ll);
  }
 else {
    Locale result[]=new Locale[1];
    result[0]=I18nUtil.DEFAULTLOCALE;
    return result;
  }
}

Fixed version (ground truth):
/** 
 * get the available Locales for the User Interface as defined in dspace.cfg property webui.supported.locales returns an array of Locales or null
 * @return an array of supported Locales or null
 */
private static Locale[] getSupportedLocales(){
  String[] ll=new DSpace().getConfigurationService().getArrayProperty("String_Node_Str");
  if (ll != null && ll.length > 0) {
    return I18nUtil.parseLocales(ll);
  }
 else {
    Locale result[]=new Locale[1];
    result[0]=I18nUtil.DEFAULTLOCALE;
    return result;
  }
}
Program: 51950
Project: 51950
Buggy source:
/** 
 * Command to list known EPersons. 
 */
private static int cmdList(Context context,String[] argv){
  try {
    for (    EPerson person : ePersonService.findAll(context,EPerson.EMAIL)) {
      System.out.printf("String_Node_Str",person.getID(),person.getEmail(),person.getNetid(),person.getLastName(),person.getFirstName());
    }
  }
 catch (  SQLException ex) {
    System.err.println(ex.getMessage());
    return 1;
  }
  return 0;
}

Fixed version (ground truth):
/** 
 * Command to list known EPersons. 
 */
private static int cmdList(Context context,String[] argv){
  try {
    for (    EPerson person : ePersonService.findAll(context,EPerson.EMAIL)) {
      System.out.printf("String_Node_Str",person.getID().toString(),person.getEmail(),person.getNetid(),person.getLastName(),person.getFirstName());
    }
  }
 catch (  SQLException ex) {
    System.err.println(ex.getMessage());
    return 1;
  }
  return 0;
}
Program: 51951
Project: 51951
Buggy source:
private List<Element> disseminateListInternal(DSpaceObject dso,boolean addSchema) throws CrosswalkException, IOException, SQLException, AuthorizeException {
  if (dso.getType() != Constants.ITEM) {
    throw new CrosswalkObjectNotSupported("String_Node_Str");
  }
  Item item=(Item)dso;
  init();
  List<MetadataValue> dc=itemService.getMetadata(item,Item.ANY,Item.ANY,Item.ANY,Item.ANY);
  List<Element> result=new ArrayList<Element>(dc.size());
  for (int i=0; i < dc.size(); i++) {
    MetadataValue metadataValue=dc.get(i);
    MetadataField metadataField=metadataValue.getMetadataField();
    MetadataSchema metadataSchema=metadataField.getMetadataSchema();
    String qdc=metadataSchema.getName() + "String_Node_Str" + ((metadataField.getQualifier() == null) ? metadataField.getElement() : (metadataField.getElement() + "String_Node_Str" + metadataField.getQualifier()));
    Element elt=qdc2element.get(qdc);
    if (elt == null) {
      if (metadataField.getMetadataSchema().equals(MetadataSchema.DC_SCHEMA)) {
        log.warn("String_Node_Str" + myName + "String_Node_Str"+ qdc+ "String_Node_Str");
      }
    }
 else {
      Element qe=(Element)elt.clone();
      qe.setText(metadataValue.getValue());
      if (addSchema && schemaLocation != null) {
        qe.setAttribute("String_Node_Str",schemaLocation,XSI_NS);
      }
      if (metadataValue.getLanguage() != null) {
        qe.setAttribute("String_Node_Str",metadataValue.getLanguage(),Namespace.XML_NAMESPACE);
      }
      result.add(qe);
    }
  }
  return result;
}

Fixed version (ground truth):
private List<Element> disseminateListInternal(DSpaceObject dso,boolean addSchema) throws CrosswalkException, IOException, SQLException, AuthorizeException {
  if (dso.getType() != Constants.ITEM) {
    throw new CrosswalkObjectNotSupported("String_Node_Str");
  }
  Item item=(Item)dso;
  init();
  List<MetadataValue> dc=itemService.getMetadata(item,Item.ANY,Item.ANY,Item.ANY,Item.ANY);
  List<Element> result=new ArrayList<Element>(dc.size());
  for (int i=0; i < dc.size(); i++) {
    MetadataValue metadataValue=dc.get(i);
    MetadataField metadataField=metadataValue.getMetadataField();
    MetadataSchema metadataSchema=metadataField.getMetadataSchema();
    String qdc=metadataSchema.getName() + "String_Node_Str" + ((metadataField.getQualifier() == null) ? metadataField.getElement() : (metadataField.getElement() + "String_Node_Str" + metadataField.getQualifier()));
    Element elt=qdc2element.get(qdc);
    if (elt == null) {
      if (metadataField.getMetadataSchema().getName().equals(MetadataSchema.DC_SCHEMA)) {
        log.warn("String_Node_Str" + myName + "String_Node_Str"+ qdc+ "String_Node_Str");
      }
    }
 else {
      Element qe=(Element)elt.clone();
      qe.setText(metadataValue.getValue());
      if (addSchema && schemaLocation != null) {
        qe.setAttribute("String_Node_Str",schemaLocation,XSI_NS);
      }
      if (metadataValue.getLanguage() != null) {
        qe.setAttribute("String_Node_Str",metadataValue.getLanguage(),Namespace.XML_NAMESPACE);
      }
      result.add(qe);
    }
  }
  return result;
}
Program: 51962
Project: 51962
Buggy source:
@Override public List<EPerson> search(Context context,String query,int offset,int limit) throws SQLException {
  try {
    List<EPerson> ePerson=new ArrayList<>();
    EPerson person=find(context,UUID.fromString(query));
    if (person != null) {
      ePerson.add(person);
    }
    return ePerson;
  }
 catch (  IllegalArgumentException e) {
    MetadataField firstNameField=metadataFieldService.findByElement(context,"String_Node_Str","String_Node_Str",null);
    MetadataField lastNameField=metadataFieldService.findByElement(context,"String_Node_Str","String_Node_Str",null);
    if (StringUtils.isBlank(query))     query=null;
    return ePersonDAO.search(context,query,Arrays.asList(firstNameField,lastNameField),Arrays.asList(firstNameField,lastNameField),offset,limit);
  }
}

Fixed version (ground truth):
@Override public List<EPerson> search(Context context,String query,int offset,int limit) throws SQLException {
  try {
    List<EPerson> ePerson=new ArrayList<>();
    EPerson person=find(context,UUID.fromString(query));
    if (person != null) {
      ePerson.add(person);
    }
    return ePerson;
  }
 catch (  IllegalArgumentException e) {
    MetadataField firstNameField=metadataFieldService.findByElement(context,"String_Node_Str","String_Node_Str",null);
    MetadataField lastNameField=metadataFieldService.findByElement(context,"String_Node_Str","String_Node_Str",null);
    if (StringUtils.isBlank(query)) {
      query=null;
    }
    return ePersonDAO.search(context,query,Arrays.asList(firstNameField,lastNameField),Arrays.asList(firstNameField,lastNameField),offset,limit);
  }
}
Program: 51965
Project: 51965
Buggy source:
@Override public ActionResult execute(Context c,XmlWorkflowItem wfi,Step step,HttpServletRequest request) throws SQLException, AuthorizeException, IOException, WorkflowException {
  EPerson submitter=wfi.getSubmitter();
  Step currentStep=getParent().getStep();
  WorkflowActionConfig nextAction=getParent().getStep().getNextAction(this.getParent());
  while (nextAction != null && !nextAction.requiresUI()) {
    nextAction=nextAction.getStep().getNextAction(nextAction);
  }
  createTaskForEPerson(c,wfi,step,nextAction,submitter);
  return new ActionResult(ActionResult.TYPE.TYPE_OUTCOME,ActionResult.OUTCOME_COMPLETE);
}

Fixed version (ground truth):
@Override public ActionResult execute(Context c,XmlWorkflowItem wfi,Step step,HttpServletRequest request) throws SQLException, AuthorizeException, IOException, WorkflowException {
  EPerson submitter=wfi.getSubmitter();
  Step currentStep=getParent().getStep();
  WorkflowActionConfig nextAction=getParent().getStep().getNextAction(this.getParent());
  while (nextAction != null && !nextAction.requiresUI()) {
    nextAction=nextAction.getStep().getNextAction(nextAction);
  }
  if (nextAction == null) {
    log.error("String_Node_Str" + step.getId() + "String_Node_Str");
    throw new IllegalStateException();
  }
  createTaskForEPerson(c,wfi,step,nextAction,submitter);
  return new ActionResult(ActionResult.TYPE.TYPE_OUTCOME,ActionResult.OUTCOME_COMPLETE);
}
Program: 51966
Project: 51966
Buggy source:
private void processToken(Context context,HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException {
  String token=request.getParameter("String_Node_Str");
  RequestItem requestItem=requestItemService.findByToken(context,token);
  if (requestItem != null) {
    Item item=requestItem.getItem();
    String title="String_Node_Str";
    if (item != null) {
      title=itemService.getMetadataFirstValue(item,"String_Node_Str","String_Node_Str",null,Item.ANY);
      if (title == null) {
        title="String_Node_Str";
      }
    }
    request.setAttribute("String_Node_Str",requestItem.getReqName());
    request.setAttribute("String_Node_Str",item.getHandle());
    request.setAttribute("String_Node_Str",title);
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else {
    JSPManager.showInvalidIDError(request,response,token,-1);
  }
}

Fixed version (ground truth):
private void processToken(Context context,HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException {
  String token=request.getParameter("String_Node_Str");
  RequestItem requestItem=requestItemService.findByToken(context,token);
  if (requestItem != null) {
    Item item=requestItem.getItem();
    String title="String_Node_Str";
    String handle="String_Node_Str";
    if (item != null) {
      title=itemService.getMetadataFirstValue(item,"String_Node_Str","String_Node_Str",null,Item.ANY);
      if (title == null) {
        title="String_Node_Str";
      }
      handle=item.getHandle();
    }
    request.setAttribute("String_Node_Str",requestItem.getReqName());
    request.setAttribute("String_Node_Str",handle);
    request.setAttribute("String_Node_Str",title);
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else {
    JSPManager.showInvalidIDError(request,response,token,-1);
  }
}
Program: 51969
Project: 51969
Buggy source:
List<UUID> getAllSubCollections(UUID communityId) throws SQLException ;

Fixed version (ground truth):
List<UUID> getAllSubCollections(ContextService contextService,UUID communityId) throws SQLException ;
Program: 51970
Project: 51970
Buggy source:
@Override public List<UUID> getAllSubCollections(UUID communityId) throws SQLException {
  Queue<Community> comqueue=new LinkedList<>();
  List<UUID> list=new ArrayList<>();
  try {
    comqueue.add(communityService.find(contextService.getContext(),communityId));
  }
 catch (  ContextServiceException e) {
    throw new SQLException(e);
  }
  while (!comqueue.isEmpty()) {
    Community c=comqueue.poll();
    for (    Community sub : c.getSubcommunities())     comqueue.add(sub);
    for (    Collection col : c.getCollections())     if (!list.contains(col.getID()))     list.add(col.getID());
  }
  return list;
}

Fixed version (ground truth):
@Override public List<UUID> getAllSubCollections(ContextService contextService,UUID communityId) throws SQLException {
  Queue<Community> comqueue=new LinkedList<>();
  List<UUID> list=new ArrayList<>();
  try {
    comqueue.add(communityService.find(contextService.getContext(),communityId));
  }
 catch (  ContextServiceException e) {
    throw new SQLException(e);
  }
  while (!comqueue.isEmpty()) {
    Community c=comqueue.poll();
    for (    Community sub : c.getSubcommunities())     comqueue.add(sub);
    for (    Collection col : c.getCollections())     if (!list.contains(col.getID()))     list.add(col.getID());
  }
  return list;
}
Program: 51978
Project: 51978
Buggy source:
@Override public SolrFilterResult buildSolrQuery(){
  String format=dateProvider.format(date).replace("String_Node_Str","String_Node_Str");
  return new SolrFilterResult("String_Node_Str" + ClientUtils.escapeQueryChars(format) + "String_Node_Str");
}

Fixed version (ground truth):
@Override public SolrFilterResult buildSolrQuery(){
  String format=dateProvider.format(date).replace("String_Node_Str","String_Node_Str");
  if (format.substring(11,19).equals("String_Node_Str")) {
    format=format.substring(0,11) + "String_Node_Str" + format.substring(19);
  }
  return new SolrFilterResult("String_Node_Str" + ClientUtils.escapeQueryChars(format) + "String_Node_Str");
}