nus-yam/ex-repair huggingface dataset:
Program: 45059
Project: 45059
Buggy source:
/** 
 * Returns an Enumeration of property keys, or null if this FileURL contains no keys.
 */
public Enumeration getPropertyKeys(){
  return properties == null ? null : properties.keys();
}

Fixed version (ground truth):
/** 
 * Returns an Enumeration of property keys, or null if this FileURL contains no keys.
 * @return an <code>Enumaration</code> on all available property names, <code>null</code> if none.
 */
public Enumeration getPropertyKeys(){
  return properties == null ? null : properties.keys();
}
Program: 45060
Project: 45060
Buggy source:
/** 
 * Sets the source that will be used to read and write configuration information.
 * @param s new configuration source.
 */
public void setSource(ConfigurationSource s){
synchronized (sourceLock) {
    source=s;
  }
}

Fixed version (ground truth):
/** 
 * Sets the source that will be used to read and write configuration information.
 * @param s new configuration source.
 * @see #getSource()
 */
public void setSource(ConfigurationSource s){
synchronized (sourceLock) {
    source=s;
  }
}
Program: 45061
Project: 45061
Buggy source:
/** 
 * Returns the value of the specified variable as a double.
 * @param name fully qualified name of the variable whose value should be retrieved.
 * @return                       the variable's value if set, <code>0</code> otherwise.
 * @throws NumberFormatException if the variable's value cannot be cast to a double.
 */
public double getDoubleVariable(String name){
  return ConfigurationSection.getDoubleValue(getVariable(name));
}

Fixed version (ground truth):
/** 
 * Returns the value of the specified variable as a double.
 * @param name fully qualified name of the variable whose value should be retrieved.
 * @return                       the variable's value if set, <code>0</code> otherwise.
 * @throws NumberFormatException if the variable's value cannot be cast to a double.
 * @see #setVariable(String,double)
 * @see #getVariable(String,double)
 */
public double getDoubleVariable(String name){
  return ConfigurationSection.getDoubleValue(getVariable(name));
}
Program: 45062
Project: 45062
Buggy source:
/** 
 * Adds the specified object to the list of registered configuration listeners.
 * @param listener object to register as a configuration listener.
 */
public static void addConfigurationListener(ConfigurationListener listener){
  listeners.put(listener,null);
}

Fixed version (ground truth):
/** 
 * Adds the specified object to the list of registered configuration listeners.
 * @param listener object to register as a configuration listener.
 * @see #removeConfigurationListener(ConfigurationListener)
 */
public static void addConfigurationListener(ConfigurationListener listener){
  listeners.put(listener,null);
}
Program: 45063
Project: 45063
Buggy source:
/** 
 * Removes the specified object from the list of registered configuration listeners.
 * @param listener object to remove from the list of registered configuration listeners.
 */
public static void removeConfigurationListener(ConfigurationListener listener){
  listeners.remove(listener);
}

Fixed version (ground truth):
/** 
 * Removes the specified object from the list of registered configuration listeners.
 * @param listener object to remove from the list of registered configuration listeners.
 * @see #addConfigurationListener(ConfigurationListener)
 */
public static void removeConfigurationListener(ConfigurationListener listener){
  listeners.remove(listener);
}
Program: 45064
Project: 45064
Buggy source:
/** 
 * Returns the value of the specified variable as a long.
 * @param name fully qualified name of the variable whose value should be retrieved.
 * @return                       the variable's value if set, <code>0</code> otherwise.
 * @throws NumberFormatException if the variable's value cannot be cast to a long.
 */
public long getLongVariable(String name){
  return ConfigurationSection.getLongValue(getVariable(name));
}

Fixed version (ground truth):
/** 
 * Returns the value of the specified variable as a long.
 * @param name fully qualified name of the variable whose value should be retrieved.
 * @return                       the variable's value if set, <code>0</code> otherwise.
 * @throws NumberFormatException if the variable's value cannot be cast to a long.
 * @see #setVariable(String,long)
 * @see #getVariable(String,long)
 */
public long getLongVariable(String name){
  return ConfigurationSection.getLongValue(getVariable(name));
}
Program: 45065
Project: 45065
Buggy source:
/** 
 * Returns the value of the specified variable as an integer.
 * @param name fully qualified name of the variable whose value should be retrieved.
 * @return                       the variable's value if set, <code>0</code> otherwise.
 * @throws NumberFormatException if the variable's value cannot be cast to an integer.
 */
public int getIntegerVariable(String name){
  return ConfigurationSection.getIntegerValue(getVariable(name));
}

Fixed version (ground truth):
/** 
 * Returns the value of the specified variable as an integer.
 * @param name fully qualified name of the variable whose value should be retrieved.
 * @return                       the variable's value if set, <code>0</code> otherwise.
 * @throws NumberFormatException if the variable's value cannot be cast to an integer.
 * @see #setVariable(String,int)
 * @see #getVariable(String,int)
 */
public int getIntegerVariable(String name){
  return ConfigurationSection.getIntegerValue(getVariable(name));
}
Program: 45066
Project: 45066
Buggy source:
/** 
 * Returns the value of the specified variable as a   {@link ValueList}.
 * @param name      fully qualified name of the variable whose value should be retrieved.
 * @param separator character used to split the variable's value into a list.
 * @return           the variable's value if set, <code>null</code> otherwise.
 */
public ValueList getListVariable(String name,String separator){
  return ConfigurationSection.getListValue(getVariable(name),separator);
}

Fixed version (ground truth):
/** 
 * Returns the value of the specified variable as a   {@link ValueList}.
 * @param name      fully qualified name of the variable whose value should be retrieved.
 * @param separator character used to split the variable's value into a list.
 * @return           the variable's value if set, <code>null</code> otherwise.
 * @see #setVariable(String,List,String)
 * @see #getVariable(String,List,String)
 */
public ValueList getListVariable(String name,String separator){
  return ConfigurationSection.getListValue(getVariable(name),separator);
}
Program: 45067
Project: 45067
Buggy source:
/** 
 * Returns the value of the specified variable as a float.
 * @param name fully qualified name of the variable whose value should be retrieved.
 * @return                       the variable's value if set, <code>0</code> otherwise.
 * @throws NumberFormatException if the variable's value cannot be cast to a float.
 */
public float getFloatVariable(String name){
  return ConfigurationSection.getFloatValue(getVariable(name));
}

Fixed version (ground truth):
/** 
 * Returns the value of the specified variable as a float.
 * @param name fully qualified name of the variable whose value should be retrieved.
 * @return                       the variable's value if set, <code>0</code> otherwise.
 * @throws NumberFormatException if the variable's value cannot be cast to a float.
 * @see #setVariable(String,float)
 * @see #getVariable(String,float)
 */
public float getFloatVariable(String name){
  return ConfigurationSection.getFloatValue(getVariable(name));
}
Program: 45068
Project: 45068
Buggy source:
/** 
 * Sets the value of the specified variable. <p> This method will return <code>false</code> if it didn't modify <code>name</code>'s value. This, however, is not a way of indicating that the call failed: <code>false</code> is only ever returned if the previous value is equal to the new value. </p> <p> If the value of the specified variable is actually modified, an   {@link ConfigurationEvent event} will be passed to alllisteners. </p>
 * @param name  fully qualified name of the variable to set.
 * @param value new value for the variable.
 * @return       <code>true</code> if this call resulted in a modification of the variable's value, <code>false</code> otherwise.
 */
public boolean setVariable(String name,double value){
  return setVariable(name,ConfigurationSection.getValue(value));
}

Fixed version (ground truth):
/** 
 * Sets the value of the specified variable. <p> This method will return <code>false</code> if it didn't modify <code>name</code>'s value. This, however, is not a way of indicating that the call failed: <code>false</code> is only ever returned if the previous value is equal to the new value. </p> <p> If the value of the specified variable is actually modified, an   {@link ConfigurationEvent event} will be passed to alllisteners. </p>
 * @param name  fully qualified name of the variable to set.
 * @param value new value for the variable.
 * @return       <code>true</code> if this call resulted in a modification of the variable's value, <code>false</code> otherwise.
 * @see #getDoubleVariable(String)
 * @see #getVariable(String,double)
 */
public boolean setVariable(String name,double value){
  return setVariable(name,ConfigurationSection.getValue(value));
}
Program: 45069
Project: 45069
Buggy source:
/** 
 * Retrieves the value of the specified variable as a double. <p> If the variable isn't set, this method will set it to <code>defaultValue</code> before returning it. If this happens, a configuration   {@link ConfigurationEvent event} willbe sent to all registered listeners. </p>
 * @param name                  name of the variable to retrieve.
 * @param defaultValue          value to use if <code>name</code> is not set.
 * @return                       the specified variable's value.
 * @throws NumberFormatException if the variable's value cannot be cast to a double.
 */
public double getVariable(String name,double defaultValue){
  return ConfigurationSection.getDoubleValue(getVariable(name,ConfigurationSection.getValue(defaultValue)));
}

Fixed version (ground truth):
/** 
 * Retrieves the value of the specified variable as a double. <p> If the variable isn't set, this method will set it to <code>defaultValue</code> before returning it. If this happens, a configuration   {@link ConfigurationEvent event} willbe sent to all registered listeners. </p>
 * @param name                  name of the variable to retrieve.
 * @param defaultValue          value to use if <code>name</code> is not set.
 * @return                       the specified variable's value.
 * @throws NumberFormatException if the variable's value cannot be cast to a double.
 * @see #setVariable(String,double)
 * @see #getDoubleVariable(String)
 */
public double getVariable(String name,double defaultValue){
  return ConfigurationSection.getDoubleValue(getVariable(name,ConfigurationSection.getValue(defaultValue)));
}
Program: 45070
Project: 45070
Buggy source:
/** 
 * Returns the value of the specified variable as a boolean.
 * @param name fully qualified name of the variable whose value should be retrieved.
 * @return the variable's value if set, <code>false</code> otherwise.
 */
public boolean getBooleanVariable(String name){
  return ConfigurationSection.getBooleanValue(getVariable(name));
}

Fixed version (ground truth):
/** 
 * Returns the value of the specified variable as a boolean.
 * @param name fully qualified name of the variable whose value should be retrieved.
 * @return the variable's value if set, <code>false</code> otherwise.
 * @see #setVariable(String,boolean)
 * @see #getVariable(String,boolean)
 */
public boolean getBooleanVariable(String name){
  return ConfigurationSection.getBooleanValue(getVariable(name));
}
Program: 45071
Project: 45071
Buggy source:
/** 
 * Returns the current configuration source.
 * @return the current configuration source, or <code>null</code> if it hasn't been set.
 */
public ConfigurationSource getSource(){
synchronized (sourceLock) {
    return source;
  }
}

Fixed version (ground truth):
/** 
 * Returns the current configuration source.
 * @return the current configuration source, or <code>null</code> if it hasn't been set.
 * @see #setSource(ConfigurationSource)
 */
public ConfigurationSource getSource(){
synchronized (sourceLock) {
    return source;
  }
}
Program: 45072
Project: 45072
Buggy source:
public void testConstructor(){
  ConfigurationEvent event;
  event=new ConfigurationEvent(conf,VARIABLE_NAME,STRING_VALUE);
  assertEquals(conf,event.getConfiguration());
  assertEquals(VARIABLE_NAME,event.getVariable());
}

Fixed version (ground truth):
/** 
 * Tests event creation.
 */
public void testConstructor(){
  ConfigurationEvent event;
  event=new ConfigurationEvent(conf,VARIABLE_NAME,STRING_VALUE);
  assertEquals(conf,event.getConfiguration());
  assertEquals(VARIABLE_NAME,event.getVariable());
}
Program: 45073
Project: 45073
Buggy source:
/** 
 * Returns a configuration explorer on the test section.
 */
protected ConfigurationExplorer getExplorer(){
  return new ConfigurationExplorer(conf.getRoot());
}

Fixed version (ground truth):
/** 
 * Returns a configuration explorer on the test section.
 * @return a configuration explorer on the test section.
 */
protected ConfigurationExplorer getExplorer(){
  return new ConfigurationExplorer(conf.getRoot());
}
Program: 45074
Project: 45074
Buggy source:
/** 
 * Moves to the specified depth.
 */
protected ConfigurationSection moveTo(ConfigurationExplorer explorer,int depth){
  ConfigurationSection section;
  section=conf.getRoot();
  for (int i=0; i < depth; i++) {
    assertTrue(explorer.moveTo(SECTION_NAME + i,false));
    section=explorer.getSection();
  }
  return section;
}

Fixed version (ground truth):
/** 
 * Moves to the specified depth.
 * @param explorer explorer to use when moving to the specified depth.
 * @param depth    depth in the configuration tree at which to move.
 * @return          section that was found at the specified depth.
 */
protected ConfigurationSection moveTo(ConfigurationExplorer explorer,int depth){
  ConfigurationSection section;
  section=conf.getRoot();
  for (int i=0; i < depth; i++) {
    assertTrue(explorer.moveTo(SECTION_NAME + i,false));
    section=explorer.getSection();
  }
  return section;
}
Program: 45075
Project: 45075
Buggy source:
/** 
 * Creates an instance of   {@link ConfigurationReader}.
 * @return an instance of {@link ConfigurationReader}.
 */
public ConfigurationReader getReaderInstance() throws ReaderConfigurationException ;

Fixed version (ground truth):
/** 
 * Creates an instance of   {@link ConfigurationReader}.
 * @return                              an instance of {@link ConfigurationReader}.
 * @throws ReaderConfigurationException if the factory wasn't properly configured.
 */
public ConfigurationReader getReaderInstance() throws ReaderConfigurationException ;
Program: 45076
Project: 45076
Buggy source:
/** 
 * Ignored.
 */
public void setOutputStream(OutputStream out){
}

Fixed version (ground truth):
/** 
 * Ignored.
 * @see #getOutputStream()
 */
public void setOutputStream(OutputStream out){
}
Program: 45077
Project: 45077
Buggy source:
/** 
 * Ignored.
 */
public OutputStream getOutputStream(){
  return null;
}

Fixed version (ground truth):
/** 
 * Ignored.
 * @see #setOutputStream(OutputStream)
 */
public OutputStream getOutputStream(){
  return null;
}
Program: 45078
Project: 45078
Buggy source:
/** 
 * Creates an instance of   {@link ConfigurationWriter}.
 * @return an instance of {@link ConfigurationWriter}.
 */
public ConfigurationWriter getWriterInstance() throws WriterConfigurationException ;

Fixed version (ground truth):
/** 
 * Creates an instance of   {@link ConfigurationWriter}.
 * @return                              an instance of {@link ConfigurationWriter}.
 * @throws WriterConfigurationException if the factory wasn't properly configured.
 */
public ConfigurationWriter getWriterInstance() throws WriterConfigurationException ;
Program: 45079
Project: 45079
Buggy source:
/** 
 * Sets the file on which input and output streams will be opened.
 * @param path path to the file on which input and output streams will be opened.
 */
public synchronized void setFile(String path){
  file=new File(path);
}

Fixed version (ground truth):
/** 
 * Sets the file on which input and output streams will be opened.
 * @param path path to the file on which input and output streams will be opened.
 * @see #setFile(File)
 * @see #getFile()
 */
public synchronized void setFile(String path){
  file=new File(path);
}
Program: 45080
Project: 45080
Buggy source:
/** 
 * Returns the file on which input and output streams are opened.
 * @return the file on which input and output streams are opened.
 */
public synchronized File getFile(){
  return file;
}

Fixed version (ground truth):
/** 
 * Returns the file on which input and output streams are opened.
 * @return the file on which input and output streams are opened.
 * @see #setFile(File)
 * @see #setFile(String)
 */
public synchronized File getFile(){
  return file;
}
Program: 45081
Project: 45081
Buggy source:
/** 
 * Tests the source's streams.
 */
public void testStreams() throws IOException {
  FileConfigurationSource source;
  OutputStream out;
  InputStream in;
  out=null;
  in=null;
  source=new FileConfigurationSource(file);
  try {
    (out=source.getOutputStream()).write(TEST_VALUE.getBytes());
  }
  finally {
    if (out != null) {
      try {
        out.close();
      }
 catch (      Exception e) {
      }
    }
  }
  try {
    assertEquals(TEST_VALUE,read(in=source.getInputStream()));
  }
  finally {
    if (in != null) {
      try {
        in.close();
      }
 catch (      Exception e) {
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Tests the source's streams.
 * @throws IOException if an IO related error occurs.
 */
public void testStreams() throws IOException {
  FileConfigurationSource source;
  OutputStream out;
  InputStream in;
  out=null;
  in=null;
  source=new FileConfigurationSource(file);
  try {
    (out=source.getOutputStream()).write(TEST_VALUE.getBytes());
  }
  finally {
    if (out != null) {
      try {
        out.close();
      }
 catch (      Exception e) {
      }
    }
  }
  try {
    assertEquals(TEST_VALUE,read(in=source.getInputStream()));
  }
  finally {
    if (in != null) {
      try {
        in.close();
      }
 catch (      Exception e) {
      }
    }
  }
}
Program: 45082
Project: 45082
Buggy source:
/** 
 * Path to your application's JAR file. <p> In order for the application to start, the JAR file must be executable. Click <a href="http://java.sun.com/j2se/javadoc/">here</a> to learn more about making JAR files executable. </p>
 * @ant.required
 */
public void setJar(File f){
  jar=f;
}

Fixed version (ground truth):
/** 
 * Path to your application's JAR file. <p> In order for the application to start, the JAR file must be executable. Click <a href="http://java.sun.com/developer/Books/javaprogramming/JAR/basics/manifest.html">here</a> to learn more about making JAR files executable. </p>
 * @ant.required
 */
public void setJar(File f){
  jar=f;
}
Program: 45083
Project: 45083
Buggy source:
/** 
 * Enables/disables Bonjour services discovery. If currently active and false is specified, current services will be lost and   {@link #getServices()} will return an empty array. If currently inactive and true is specified,services discovery will be immediately started but it may take a while (a few seconds at least) to collect services.
 */
public static void setActive(boolean enabled){
  if (enabled && jmDNS == null) {
    try {
      jmDNS=new JmDNS();
      int nbServices=KNOWN_SERVICE_TYPES.length;
      for (int i=0; i < nbServices; i++)       jmDNS.addServiceListener(KNOWN_SERVICE_TYPES[i][0],instance);
    }
 catch (    IOException e) {
      if (Debug.ON)       Debug.trace("String_Node_Str" + e);
    }
  }
 else   if (!enabled && jmDNS != null) {
    jmDNS.close();
    services.clear();
    jmDNS=null;
  }
}

Fixed version (ground truth):
/** 
 * Enables/disables Bonjour services discovery. If currently active and false is specified, current services will be lost and   {@link #getServices()} will return an empty array. If currently inactive and true is specified,services discovery will be immediately started but it may take a while (a few seconds at least) to collect services.
 * @param enabled whether Bonjour services discovery should be enabled.
 */
public static void setActive(boolean enabled){
  if (enabled && jmDNS == null) {
    try {
      jmDNS=new JmDNS();
      int nbServices=KNOWN_SERVICE_TYPES.length;
      for (int i=0; i < nbServices; i++)       jmDNS.addServiceListener(KNOWN_SERVICE_TYPES[i][0],instance);
    }
 catch (    IOException e) {
      if (Debug.ON)       Debug.trace("String_Node_Str" + e);
    }
  }
 else   if (!enabled && jmDNS != null) {
    jmDNS.close();
    services.clear();
    jmDNS=null;
  }
}
Program: 45084
Project: 45084
Buggy source:
/** 
 * Returns all currently available Bonjour services. The returned array may be empty but never null. If BonjourDirectory is not currently active (  {@link #isActive()}, an empty array will be returned.
 */
public static BonjourService[] getServices(){
  BonjourService servicesArray[]=new BonjourService[services.size()];
  services.toArray(servicesArray);
  return servicesArray;
}

Fixed version (ground truth):
/** 
 * Returns all currently available Bonjour services. The returned array may be empty but never null. If BonjourDirectory is not currently active (  {@link #isActive()}, an empty array will be returned.
 * @return all currently available Bonjour services
 */
public static BonjourService[] getServices(){
  BonjourService servicesArray[]=new BonjourService[services.size()];
  services.toArray(servicesArray);
  return servicesArray;
}
Program: 45085
Project: 45085
Buggy source:
/** 
 * Returns true if Bonjour services discovery is currently running.
 */
public static boolean isActive(){
  return jmDNS != null;
}

Fixed version (ground truth):
/** 
 * Returns <code>true</code> if Bonjour services discovery is currently running.
 * @return <code>true</code> if Bonjour services discovery is currently running, <code>false</code> otherwise.
 */
public static boolean isActive(){
  return jmDNS != null;
}
Program: 45086
Project: 45086
Buggy source:
public BonjourMenu(MainFrame mainFrame){
  super(Translator.get("String_Node_Str"));
  this.mainFrame=mainFrame;
  setIcon(IconManager.getIcon(IconManager.FILE_ICON_SET,"String_Node_Str"));
  addMenuListener(this);
}

Fixed version (ground truth):
/** 
 * Creates a new instance of <code>BonjourMenu</code>.
 * @param mainFrame frame to which the menu will be attached.
 */
public BonjourMenu(MainFrame mainFrame){
  super(Translator.get("String_Node_Str"));
  this.mainFrame=mainFrame;
  setIcon(IconManager.getIcon(IconManager.FILE_ICON_SET,"String_Node_Str"));
  addMenuListener(this);
}
Program: 45087
Project: 45087
Buggy source:
/** 
 * Returns the name appended with the URL's protocol.
 */
public String getNameWithProtocol(){
  return name + "String_Node_Str" + url.getProtocol().toUpperCase()+ "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Returns the name appended with the URL's protocol.
 * @return the name appended with the URL's protocol.
 */
public String getNameWithProtocol(){
  return name + "String_Node_Str" + url.getProtocol().toUpperCase()+ "String_Node_Str";
}
Program: 45088
Project: 45088
Buggy source:
/** 
 * Returns the location of this service.
 */
public FileURL getURL(){
  return url;
}

Fixed version (ground truth):
/** 
 * Returns the location of this service.
 * @return the location of this service.
 */
public FileURL getURL(){
  return url;
}
Program: 45089
Project: 45089
Buggy source:
/** 
 * Returns the service's name.
 */
public String getName(){
  return name;
}

Fixed version (ground truth):
/** 
 * Returns the service's name.
 * @return the service's name.
 */
public String getName(){
  return name;
}
Program: 45090
Project: 45090
Buggy source:
/** 
 * Changes this bookmark's name to the given one and fires an event to registered   {@link BookmarkListener}instances.
 */
public void setName(String newName){
  if (newName == null)   newName="String_Node_Str";
  if (!newName.equals(this.name)) {
    this.name=newName;
    BookmarkManager.fireBookmarksChanged();
  }
}

Fixed version (ground truth):
/** 
 * Changes this bookmark's name to the given one and fires an event to registered   {@link BookmarkListener}instances.
 * @param newName bookmark's new name.
 * @see #getName()
 */
public void setName(String newName){
  if (newName == null)   newName="String_Node_Str";
  if (!newName.equals(this.name)) {
    this.name=newName;
    BookmarkManager.fireBookmarksChanged();
  }
}
Program: 45091
Project: 45091
Buggy source:
/** 
 * Returns this bookmark's location which should normally designate a path or file URL, but which isn't necessarily valid nor exists.
 */
public String getLocation(){
  return location;
}

Fixed version (ground truth):
/** 
 * Returns this bookmark's location which should normally designate a path or file URL, but which isn't necessarily valid nor exists.
 * @return this bookmark's location.
 * @see #setLocation(String)
 */
public String getLocation(){
  return location;
}
Program: 45092
Project: 45092
Buggy source:
/** 
 * Returns this bookmark's name.
 */
public String getName(){
  return name;
}

Fixed version (ground truth):
/** 
 * Returns this bookmark's name.
 * @return this bookmark's name.
 * @see #setName(String)
 */
public String getName(){
  return name;
}
Program: 45093
Project: 45093
Buggy source:
/** 
 * Changes this bookmark's location to the given one and fires an event to registered   {@link BookmarkListener}instances.
 */
public void setLocation(String newLocation){
  if (newLocation == null)   newLocation="String_Node_Str";
  if (!newLocation.equals(this.location)) {
    this.location=newLocation;
    BookmarkManager.fireBookmarksChanged();
  }
}

Fixed version (ground truth):
/** 
 * Changes this bookmark's location to the given one and fires an event to registered   {@link BookmarkListener}instances.
 * @param newLocation bookmark's new location.
 * @see #getLocation()
 */
public void setLocation(String newLocation){
  if (newLocation == null)   newLocation="String_Node_Str";
  if (!newLocation.equals(this.location)) {
    this.location=newLocation;
    BookmarkManager.fireBookmarksChanged();
  }
}
Program: 45094
Project: 45094
Buggy source:
public void addBookmark(String name,String location) throws BookmarkException ;

Fixed version (ground truth):
/** 
 * Notifies the builder of a new bookmark in the list.
 * @param name              bookmark's name.
 * @param location          bookmark's location.
 * @throws BookmarkException if an error occurs.
 */
public void addBookmark(String name,String location) throws BookmarkException ;
Program: 45095
Project: 45095
Buggy source:
public void startBookmarks() throws BookmarkException ;

Fixed version (ground truth):
/** 
 * Notifies the builder that the bookmark list is starting.
 * @throws BookmarkException if an error occurs.
 */
public void startBookmarks() throws BookmarkException ;
Program: 45096
Project: 45096
Buggy source:
public void endBookmarks() throws BookmarkException ;

Fixed version (ground truth):
/** 
 * Notifies the builder that the bookmark list is finished.
 * @throws BookmarkException if an error occurs.
 */
public void endBookmarks() throws BookmarkException ;
Program: 45097
Project: 45097
Buggy source:
public BookmarkException(String message,Throwable cause){
  super(message,cause);
}

Fixed version (ground truth):
/** 
 * Creates a new exception with the specified message and cause.
 * @param message exception's message.
 * @param cause   root cause of the new exception.
 */
public BookmarkException(String message,Throwable cause){
  super(message,cause);
}
Program: 45098
Project: 45098
Buggy source:
/** 
 * Removes the specified BookmarkListener from the list of registered listeners.
 * @param listener the BookmarkListener to remove from the list of registered listeners.
 */
public static void removeBookmarkListener(BookmarkListener listener){
synchronized (listeners) {
    listeners.remove(listener);
  }
}

Fixed version (ground truth):
/** 
 * Removes the specified BookmarkListener from the list of registered listeners.
 * @param listener the BookmarkListener to remove from the list of registered listeners.
 * @see #addBookmarkListener(BookmarkListener)
 */
public static void removeBookmarkListener(BookmarkListener listener){
synchronized (listeners) {
    listeners.remove(listener);
  }
}
Program: 45099
Project: 45099
Buggy source:
public static synchronized void readBookmarks(InputStream in,BookmarkBuilder builder) throws Exception {
  new BookmarkParser().parse(in,builder);
}

Fixed version (ground truth):
/** 
 * Reads bookmarks from the specified <code>InputStream</code> and passes messages to the specified   {@link BookmarkBuilder}.
 * @param in        where to read bookmarks from.
 * @param builder   where to send builing messages to.
 * @throws Exception if an error occurs.
 */
public static synchronized void readBookmarks(InputStream in,BookmarkBuilder builder) throws Exception {
  new BookmarkParser().parse(in,builder);
}
Program: 45100
Project: 45100
Buggy source:
/** 
 * Adds the specified BookmarkListener to the list of registered listeners. <p>Listeners are stored as weak references so   {@link #removeBookmarkListener(BookmarkListener)}doesn't need to be called for listeners to be garbage collected when they're not used anymore.
 * @param listener the BookmarkListener to add to the list of registered listeners.
 */
public static void addBookmarkListener(BookmarkListener listener){
synchronized (listeners) {
    listeners.put(listener,null);
  }
}

Fixed version (ground truth):
/** 
 * Adds the specified BookmarkListener to the list of registered listeners. <p>Listeners are stored as weak references so   {@link #removeBookmarkListener(BookmarkListener)}doesn't need to be called for listeners to be garbage collected when they're not used anymore.
 * @param listener the BookmarkListener to add to the list of registered listeners.
 * @see #removeBookmarkListener(BookmarkListener)
 */
public static void addBookmarkListener(BookmarkListener listener){
synchronized (listeners) {
    listeners.put(listener,null);
  }
}
Program: 45101
Project: 45101
Buggy source:
/** 
 * Specifies whether bookmark events should be fired when a change in the bookmarks is detected. This allows to temporarily suspend events firing when a lot of them are made, for example when editing the bookmarks list. <p>If true is speicified, any subsequent calls to fireBookmarksChanged will be ignored, until this method is called again with false.
 */
public static synchronized void setFireEvents(boolean b){
  if (b) {
    if (!fireEvents && lastBookmarkChangeTime >= lastEventPauseTime) {
      fireEvents=true;
      fireBookmarksChanged();
    }
  }
 else {
    if (fireEvents) {
      fireEvents=false;
      lastEventPauseTime=System.currentTimeMillis();
    }
  }
}

Fixed version (ground truth):
/** 
 * Specifies whether bookmark events should be fired when a change in the bookmarks is detected. This allows to temporarily suspend events firing when a lot of them are made, for example when editing the bookmarks list. <p>If true is speicified, any subsequent calls to fireBookmarksChanged will be ignored, until this method is called again with false.</p>
 * @param b whether to fire events.
 */
public static synchronized void setFireEvents(boolean b){
  if (b) {
    if (!fireEvents && lastBookmarkChangeTime >= lastEventPauseTime) {
      fireEvents=true;
      fireBookmarksChanged();
    }
  }
 else {
    if (fireEvents) {
      fireEvents=false;
      lastEventPauseTime=System.currentTimeMillis();
    }
  }
}
Program: 45102
Project: 45102
Buggy source:
public static BookmarkBuilder getBookmarkWriter(OutputStream out) throws IOException {
  return new BookmarkWriter(out);
}

Fixed version (ground truth):
/** 
 * Returns a   {@link BookmarkBuilder} that will write all building messages as XML to the specified output stream.
 * @param out where to write the bookmarks' XML content.
 * @return             a {@link BookmarkBuilder} that will write all building messages as XML to the specified output stream.
 * @throws IOException if an IO related error occurs.
 */
public static BookmarkBuilder getBookmarkWriter(OutputStream out) throws IOException {
  return new BookmarkWriter(out);
}
Program: 45103
Project: 45103
Buggy source:
public static synchronized void loadBookmarks() throws Exception {
  InputStream in;
  in=null;
  isLoading=true;
  try {
    readBookmarks(in=new BackupInputStream(getBookmarksFile()),new Loader());
  }
  finally {
    if (in != null) {
      try {
        in.close();
      }
 catch (      Exception e) {
      }
    }
    isLoading=false;
  }
}

Fixed version (ground truth):
/** 
 * Loads all available bookmarks.
 * @throws Exception if an error occurs.
 */
public static synchronized void loadBookmarks() throws Exception {
  InputStream in;
  in=null;
  isLoading=true;
  try {
    readBookmarks(in=new BackupInputStream(getBookmarksFile()),new Loader());
  }
  finally {
    if (in != null) {
      try {
        in.close();
      }
 catch (      Exception e) {
      }
    }
    isLoading=false;
  }
}
Program: 45104
Project: 45104
Buggy source:
/** 
 * Returns an   {@link AlteredVector} that contains all bookmarks.<p>Important: the returned Vector should not directly be used to add or remove bookmarks, doing so won't trigger any event to registered bookmark listeners. However, it is safe to modify bookmarks individually, events will be properly fired.
 */
public static synchronized AlteredVector getBookmarks(){
  return bookmarks;
}

Fixed version (ground truth):
/** 
 * Returns an   {@link AlteredVector} that contains all bookmarks.<p>Important: the returned Vector should not directly be used to add or remove bookmarks, doing so won't trigger any event to registered bookmark listeners. However, it is safe to modify bookmarks individually, events will be properly fired.
 * @return an {@link AlteredVector} that contains all bookmarks.
 */
public static synchronized AlteredVector getBookmarks(){
  return bookmarks;
}
Program: 45105
Project: 45105
Buggy source:
public static synchronized void buildBookmarks(BookmarkBuilder builder) throws BookmarkException {
  Iterator iterator;
  Bookmark bookmark;
  builder.startBookmarks();
  iterator=bookmarks.iterator();
  while (iterator.hasNext()) {
    bookmark=(Bookmark)iterator.next();
    builder.addBookmark(bookmark.getName(),bookmark.getLocation());
  }
  builder.endBookmarks();
}

Fixed version (ground truth):
/** 
 * Passes messages about all known bookmarks to the specified builder.
 * @param builder           where to send bookmark building messages.
 * @throws BookmarkException if an error occurs.
 */
public static synchronized void buildBookmarks(BookmarkBuilder builder) throws BookmarkException {
  Iterator iterator;
  Bookmark bookmark;
  builder.startBookmarks();
  iterator=bookmarks.iterator();
  while (iterator.hasNext()) {
    bookmark=(Bookmark)iterator.next();
    builder.addBookmark(bookmark.getName(),bookmark.getLocation());
  }
  builder.endBookmarks();
}
Program: 45106
Project: 45106
Buggy source:
public Bookmark getBookmark(){
  return bookmark;
}

Fixed version (ground truth):
/** 
 * Returns the underlying bookmark.
 * @return the underlying bookmark.
 */
public Bookmark getBookmark(){
  return bookmark;
}
Program: 45107
Project: 45107
Buggy source:
/** 
 * Sets the wrapped file's parent.
 * @param parent object to use as the wrapped file's parent.
 */
public void setParent(AbstractFile parent){
  getUnderlyingFile().setParent(parent);
}

Fixed version (ground truth):
/** 
 * Sets the wrapped file's parent.
 * @param parent object to use as the wrapped file's parent.
 * @see #getParent()
 */
public void setParent(AbstractFile parent){
  getUnderlyingFile().setParent(parent);
}
Program: 45108
Project: 45108
Buggy source:
/** 
 * Returns <code>false</code>. <p> Bookmarks always have all permissions, this is not changeable. Calls to this method will always be ignored. </p>
 * @param access     ignored.
 * @param permission ignored.
 * @param enabled    ignored.
 * @return            <code>false</code>.
 */
public boolean setPermission(int access,int permission,boolean enabled){
  return false;
}

Fixed version (ground truth):
/** 
 * Returns <code>false</code>. <p> Bookmarks always have all permissions, this is not changeable. Calls to this method will always be ignored. </p>
 * @param access     ignored.
 * @param permission ignored.
 * @param enabled    ignored.
 * @return            <code>false</code>.
 * @see #getPermission(int,int)
 */
public boolean setPermission(int access,int permission,boolean enabled){
  return false;
}
Program: 45109
Project: 45109
Buggy source:
/** 
 * Returns the wrapped file's parent.
 * @return the wrapped file's parent.
 */
public AbstractFile getParent() throws IOException {
  return new BookmarkRoot();
}

Fixed version (ground truth):
/** 
 * Returns the wrapped file's parent.
 * @return             the wrapped file's parent.
 * @throws IOException if an IO error occurs.
 * @see #setParent(AbstractFile)
 */
public AbstractFile getParent() throws IOException {
  return new BookmarkRoot();
}
Program: 45110
Project: 45110
Buggy source:
/** 
 * Returns <code>true</code>. <p> Since bookmarks are always readable, writable and 'openable' by the current user, all permissions are always granted. </p>
 * @param access     ignored.
 * @param permission ignored.
 * @return            <code>true</code>.
 */
public boolean getPermission(int access,int permission){
  return true;
}

Fixed version (ground truth):
/** 
 * Returns <code>true</code>. <p> Since bookmarks are always readable, writable and 'openable' by the current user, all permissions are always granted. </p>
 * @param access     ignored.
 * @param permission ignored.
 * @return            <code>true</code>.
 * @see #setPermission(int,int,boolean)
 */
public boolean getPermission(int access,int permission){
  return true;
}
Program: 45111
Project: 45111
Buggy source:
/** 
 * Runs the specified command on the wrapped file.
 * @param tokens command to run.
 * @return        a process running the specified command.
 */
public AbstractProcess runProcess(String[] tokens) throws IOException {
  return getUnderlyingFile().runProcess(tokens);
}

Fixed version (ground truth):
/** 
 * Runs the specified command on the wrapped file.
 * @param tokens      command to run.
 * @return             a process running the specified command.
 * @throws IOException if an IO error occurs.
 */
public AbstractProcess runProcess(String[] tokens) throws IOException {
  return getUnderlyingFile().runProcess(tokens);
}
Program: 45112
Project: 45112
Buggy source:
/** 
 * Returns a message describing the exception.
 */
public String getMessage(){
  return msg;
}

Fixed version (ground truth):
/** 
 * Returns a message describing the exception.
 * @return a message describing the exception.
 */
public String getMessage(){
  return msg;
}
Program: 45113
Project: 45113
Buggy source:
/** 
 * Returns the URL of the file for which authentication failed.
 */
public FileURL getFileURL(){
  return fileURL;
}

Fixed version (ground truth):
/** 
 * Returns the URL of the file for which authentication failed.
 * @return the URL of the file for which authentication failed.
 */
public FileURL getFileURL(){
  return fileURL;
}
Program: 45114
Project: 45114
Buggy source:
/** 
 * Returns the login part. Returned login may be an empty string but never null.
 */
public String getLogin(){
  return login;
}

Fixed version (ground truth):
/** 
 * Returns the login part. <p> Returned login may be an empty string but never <code>null</code>. </p>
 * @return the login part.
 */
public String getLogin(){
  return login;
}
Program: 45115
Project: 45115
Buggy source:
/** 
 * Returns the password part. Returned password may be an empty string but never null.
 */
public String getPassword(){
  return password;
}

Fixed version (ground truth):
/** 
 * Returns the password part. <p> Returned password may be an empty string but never <code>null</code>. </p>
 * @return the password part.
 */
public String getPassword(){
  return password;
}
Program: 45116
Project: 45116
Buggy source:
/** 
 * Returns the password as a masked string, each of the characters replaced by '*' characters. 
 */
public String getMaskedPassword(){
  int passwordLength=password.length();
  StringBuffer maskedPasswordSb=new StringBuffer(passwordLength);
  for (int i=0; i < passwordLength; i++)   maskedPasswordSb.append('*');
  return maskedPasswordSb.toString();
}

Fixed version (ground truth):
/** 
 * Returns the password as a masked string, each of the characters replaced by '*' characters. 
 * @return the password as a masked string.
 */
public String getMaskedPassword(){
  int passwordLength=password.length();
  StringBuffer maskedPasswordSb=new StringBuffer(passwordLength);
  for (int i=0; i < passwordLength; i++)   maskedPasswordSb.append('*');
  return maskedPasswordSb.toString();
}
Program: 45117
Project: 45117
Buggy source:
/** 
 * Returns true if these credentials are empty, that is both the login and password are empty strings.
 */
public boolean isEmpty(){
  return "String_Node_Str".equals(login) && "String_Node_Str".equals(password);
}

Fixed version (ground truth):
/** 
 * Returns <code>true</code> if these credentials are empty. <p> Credentials are said to be empty if both login and password are empty strings. </p>
 * @return <code>true</code> if these credentials are empty, <code>false</code> otherwise.
 */
public boolean isEmpty(){
  return "String_Node_Str".equals(login) && "String_Node_Str".equals(password);
}
Program: 45118
Project: 45118
Buggy source:
/** 
 * Returns the password as a weakly encrypted string.
 */
public String getEncryptedPassword(){
  return XORCipher.encryptXORBase64(password);
}

Fixed version (ground truth):
/** 
 * Returns the password as a weakly encrypted string.
 * @return the password as a weakly encrypted string.
 */
public String getEncryptedPassword(){
  return XORCipher.encryptXORBase64(password);
}
Program: 45119
Project: 45119
Buggy source:
/** 
 * Returns the list of known volatile MappedCredentials, stored in a Vector. The returned Vector instance is the one actually used by CredentialsManager, so use it with care.
 */
public static Vector getVolatileCredentials(){
  return volatileCredentials;
}

Fixed version (ground truth):
/** 
 * Returns the list of known volatile   {@link MappedCredentials}, stored in a Vector. <p> The returned Vector instance is the one actually used by CredentialsManager, so use it with care. </p>
 * @return the list of known volatile {@link MappedCredentials}.
 */
public static Vector getVolatileCredentials(){
  return volatileCredentials;
}
Program: 45120
Project: 45120
Buggy source:
/** 
 * Returns the list of known persistent MappedCredentials, stored in an AlteredVector. Any changes made to the Vector will be detected and will yield to writing the credentials file when  {@link #writeCredentials(boolean)} is called with false.
 */
public static AlteredVector getPersistentCredentials(){
  return persistentCredentials;
}

Fixed version (ground truth):
/** 
 * Returns the list of known persistent   {@link MappedCredentials}, stored in an   {@link AlteredVector}. <p> Any changes made to the Vector will be detected and will yield to writing the credentials file when  {@link #writeCredentials(boolean)} is called with false.</p>
 * @return the list of known persistent {@link MappedCredentials}.
 */
public static AlteredVector getPersistentCredentials(){
  return persistentCredentials;
}
Program: 45121
Project: 45121
Buggy source:
/** 
 * Returns true if these credentials should be saved when the application terminates.
 */
public boolean isPersistent(){
  return isPersistent;
}

Fixed version (ground truth):
/** 
 * Returns <code>true</code> if these credentials should be saved when the application terminates.
 * @return <code>true</code> if these credentials should be saved when the application terminates, <code>false</code> otherwise.
 */
public boolean isPersistent(){
  return isPersistent;
}
Program: 45122
Project: 45122
Buggy source:
/** 
 * Returns the location to the server these credentials are associated with. The returned   {@link FileURL} will notcontain any credentials.
 */
public FileURL getRealm(){
  return realm;
}

Fixed version (ground truth):
/** 
 * Returns the location to the server these credentials are associated with. <p> The returned   {@link FileURL} will not contain any credentials.</p>
 * @return the location to the server these credentials are associated with.
 */
public FileURL getRealm(){
  return realm;
}
Program: 45123
Project: 45123
Buggy source:
public void setIsReadable(boolean isReadable) throws CommandException ;

Fixed version (ground truth):
/** 
 * Adds a <i>readable</i> filter on the current association.
 * @param isReadable       whether readable files must be refused or accepted by the association.
 * @throws CommandException if an error occurs.
 */
public void setIsReadable(boolean isReadable) throws CommandException ;
Program: 45124
Project: 45124
Buggy source:
public void setIsWritable(boolean isWritable) throws CommandException ;

Fixed version (ground truth):
/** 
 * Adds a <i>writable</i> filter on the current association.
 * @param isWritable       whether writable files must be refused or accepted by the association.
 * @throws CommandException if an error occurs.
 */
public void setIsWritable(boolean isWritable) throws CommandException ;
Program: 45125
Project: 45125
Buggy source:
public void endAssociation() throws CommandException ;

Fixed version (ground truth):
/** 
 * Notifies the builder that the current association declaration is finished.
 * @throws CommandException if an error ocurs.
 */
public void endAssociation() throws CommandException ;
Program: 45126
Project: 45126
Buggy source:
public void setMask(String mask,boolean isCaseSensitive) throws CommandException ;

Fixed version (ground truth):
/** 
 * Adds a mask to the current association.
 * @param mask             regular expression that a file name must match in order to match the association.
 * @param isCaseSensitive  whether the regular expression is case sensitive.
 * @throws CommandException if an error occurs.
 */
public void setMask(String mask,boolean isCaseSensitive) throws CommandException ;
Program: 45127
Project: 45127
Buggy source:
public void setIsHidden(boolean isHidden) throws CommandException ;

Fixed version (ground truth):
/** 
 * Adds a <i>hidden</i> filter on the current association.
 * @param isHidden         whether hidden files must be refused or accepted by the association.
 * @throws CommandException if an error occurs.
 */
public void setIsHidden(boolean isHidden) throws CommandException ;
Program: 45128
Project: 45128
Buggy source:
public void startAssociation(String command) throws CommandException ;

Fixed version (ground truth):
/** 
 * Notifies the builder that a new association declaration is starting.
 * @param command          command to call when the association is matched.
 * @throws CommandException if an error occurs.
 */
public void startAssociation(String command) throws CommandException ;
Program: 45129
Project: 45129
Buggy source:
public void setIsSymlink(boolean isSymlink) throws CommandException ;

Fixed version (ground truth):
/** 
 * Adds a <i>symlink</i> filter on the current association.
 * @param isSymlink        whether symbolic links must be refused or accepted by the association.
 * @throws CommandException if an error occurs.
 */
public void setIsSymlink(boolean isSymlink) throws CommandException ;
Program: 45130
Project: 45130
Buggy source:
public void setIsExecutable(boolean isExecutable) throws CommandException ;

Fixed version (ground truth):
/** 
 * Adds a <i>executable</i> filter on the current association.
 * @param isExecutable     whether executable files must be refused or accepted by the association.
 * @throws CommandException if an error occurs.
 */
public void setIsExecutable(boolean isExecutable) throws CommandException ;