nus-yam/ex-repair huggingface dataset:
Program: 78867
Project: 78867
Buggy source:
/** 
 * Returns the extended modifier mask for this event. <P> Extended modifiers are the modifiers that ends with the _DOWN_MASK suffix, such as ALT_DOWN_MASK, BUTTON1_DOWN_MASK, and others. <P> Extended modifiers represent the state of all modal keys, such as ALT, CTRL, META, and the mouse buttons just after the event occurred. <P> For example, if the user presses <b>button 1</b> followed by <b>button 2</b>, and then releases them in the same order, the following sequence of events is generated: <PRE> <code>MOUSE_PRESSED</code>:  <code>BUTTON1_DOWN_MASK</code> <code>MOUSE_PRESSED</code>:  <code>BUTTON1_DOWN_MASK | BUTTON2_DOWN_MASK</code> <code>MOUSE_RELEASED</code>: <code>BUTTON2_DOWN_MASK</code> <code>MOUSE_CLICKED</code>:  <code>BUTTON2_DOWN_MASK</code> <code>MOUSE_RELEASED</code>: <code>MOUSE_CLICKED</code>: </PRE> <P> It is not recommended to compare the return value of this method using <code>==</code> because new modifiers can be added in the future. For example, the appropriate way to check that SHIFT and BUTTON1 are down, but CTRL is up is demonstrated by the following code: <PRE> int onmask = SHIFT_DOWN_MASK | BUTTON1_DOWN_MASK; int offmask = CTRL_DOWN_MASK; if ((event.getModifiersEx() &amp; (onmask | offmask)) == onmask) { ... } </PRE> The above code will work even if new modifiers are added.
 * @since 1.4
 */
public int getModifiersEx(){
  return modifiers & ~JDK_1_3_MODIFIERS;
}

Fixed version (ground truth):
/** 
 * Returns the extended modifier mask for this event. <P> Extended modifiers are the modifiers that ends with the _DOWN_MASK suffix, such as ALT_DOWN_MASK, BUTTON1_DOWN_MASK, and others. <P> Extended modifiers represent the state of all modal keys, such as ALT, CTRL, META, and the mouse buttons just after the event occurred. <P> For example, if the user presses <b>button 1</b> followed by <b>button 2</b>, and then releases them in the same order, the following sequence of events is generated: <PRE> <code>MOUSE_PRESSED</code>:  <code>BUTTON1_DOWN_MASK</code> <code>MOUSE_PRESSED</code>:  <code>BUTTON1_DOWN_MASK | BUTTON2_DOWN_MASK</code> <code>MOUSE_RELEASED</code>: <code>BUTTON2_DOWN_MASK</code> <code>MOUSE_CLICKED</code>:  <code>BUTTON2_DOWN_MASK</code> <code>MOUSE_RELEASED</code>: <code>MOUSE_CLICKED</code>: </PRE> <P> It is not recommended to compare the return value of this method using <code>==</code> because new modifiers can be added in the future. For example, the appropriate way to check that SHIFT and BUTTON1 are down, but CTRL is up is demonstrated by the following code: <PRE> int onmask = SHIFT_DOWN_MASK | BUTTON1_DOWN_MASK; int offmask = CTRL_DOWN_MASK; if ((event.getModifiersEx() &amp; (onmask | offmask)) == onmask) { ... } </PRE> The above code will work even if new modifiers are added.
 * @return the extended modifier mask for this event
 * @since 1.4
 */
public int getModifiersEx(){
  return modifiers & ~JDK_1_3_MODIFIERS;
}
Program: 78868
Project: 78868
Buggy source:
/** 
 * Returns whether or not the Shift modifier is down on this event.
 */
public boolean isShiftDown(){
  return (modifiers & SHIFT_MASK) != 0;
}

Fixed version (ground truth):
/** 
 * Returns whether or not the Shift modifier is down on this event.
 * @return whether or not the Shift modifier is down on this event
 */
public boolean isShiftDown(){
  return (modifiers & SHIFT_MASK) != 0;
}
Program: 78869
Project: 78869
Buggy source:
/** 
 * Returns whether or not this event has been consumed.
 * @see #consume
 */
public boolean isConsumed(){
  return consumed;
}

Fixed version (ground truth):
/** 
 * Returns whether or not this event has been consumed.
 * @return whether or not this event has been consumed
 * @see #consume
 */
public boolean isConsumed(){
  return consumed;
}
Program: 78871
Project: 78871
Buggy source:
/** 
 * Returns whether or not the AltGraph modifier is down on this event.
 */
public boolean isAltGraphDown(){
  return (modifiers & ALT_GRAPH_MASK) != 0;
}

Fixed version (ground truth):
/** 
 * Returns whether or not the AltGraph modifier is down on this event.
 * @return whether or not the AltGraph modifier is down on this event
 */
public boolean isAltGraphDown(){
  return (modifiers & ALT_GRAPH_MASK) != 0;
}
Program: 78873
Project: 78873
Buggy source:
/** 
 * Returns the difference in milliseconds between the timestamp of when this event occurred and midnight, January 1, 1970 UTC.
 */
public long getWhen(){
  return when;
}

Fixed version (ground truth):
/** 
 * Returns the difference in milliseconds between the timestamp of when this event occurred and midnight, January 1, 1970 UTC.
 * @return the difference in milliseconds between the timestamp and midnight, January 1, 1970 UTC
 */
public long getWhen(){
  return when;
}
Program: 78874
Project: 78874
Buggy source:
/** 
 * Returns the modifier mask for this event.
 */
public int getModifiers(){
  return modifiers & (JDK_1_3_MODIFIERS | HIGH_MODIFIERS);
}

Fixed version (ground truth):
/** 
 * Returns the modifier mask for this event.
 * @return the modifier mask for this event
 */
public int getModifiers(){
  return modifiers & (JDK_1_3_MODIFIERS | HIGH_MODIFIERS);
}
Program: 78875
Project: 78875
Buggy source:
/** 
 * Returns whether or not the Alt modifier is down on this event.
 */
public boolean isAltDown(){
  return (modifiers & ALT_MASK) != 0;
}

Fixed version (ground truth):
/** 
 * Returns whether or not the Alt modifier is down on this event.
 * @return whether or not the Alt modifier is down on this event
 */
public boolean isAltDown(){
  return (modifiers & ALT_MASK) != 0;
}
Program: 78876
Project: 78876
Buggy source:
/** 
 * Gets the number of committed characters in the text.
 */
public int getCommittedCharacterCount(){
  return committedCharacterCount;
}

Fixed version (ground truth):
/** 
 * Gets the number of committed characters in the text.
 * @return the number of committed characters in the text
 */
public int getCommittedCharacterCount(){
  return committedCharacterCount;
}
Program: 78877
Project: 78877
Buggy source:
/** 
 * Invoked when the text entered through an input method has changed.
 */
void inputMethodTextChanged(InputMethodEvent event);

Fixed version (ground truth):
/** 
 * Invoked when the text entered through an input method has changed.
 * @param event the event to be processed
 */
void inputMethodTextChanged(InputMethodEvent event);
Program: 78878
Project: 78878
Buggy source:
/** 
 * Invoked when the caret within composed text has changed.
 */
void caretPositionChanged(InputMethodEvent event);

Fixed version (ground truth):
/** 
 * Invoked when the caret within composed text has changed.
 * @param event the event to be processed
 */
void caretPositionChanged(InputMethodEvent event);
Program: 78879
Project: 78879
Buggy source:
/** 
 * Invoked when an item has been selected or deselected by the user. The code written for this method performs the operations that need to occur when an item is selected (or deselected).
 */
void itemStateChanged(ItemEvent e);

Fixed version (ground truth):
/** 
 * Invoked when an item has been selected or deselected by the user. The code written for this method performs the operations that need to occur when an item is selected (or deselected).
 * @param e the event to be processed
 */
void itemStateChanged(ItemEvent e);
Program: 78880
Project: 78880
Buggy source:
/** 
 * <p> Subclasses can override this method to insert their own subclass of Child without having to override add() or the other Collection methods that add children to the set. </p>
 * @param targetChild the child to create the Child on behalf of
 * @param peer        the peer if the tragetChild and the peer are related by an implementation of BeanContextProxy     * @return Subtype-specific subclass of Child without overriding collection methods
 */
protected BCSChild createBCSChild(Object targetChild,Object peer){
  return new BCSChild(targetChild,peer);
}

Fixed version (ground truth):
/** 
 * <p> Subclasses can override this method to insert their own subclass of Child without having to override add() or the other Collection methods that add children to the set. </p>
 * @param targetChild the child to create the Child on behalf of
 * @param peer        the peer if the tragetChild and the peer are related by an implementation of BeanContextProxy
 * @return Subtype-specific subclass of Child without overriding collection methods
 */
protected BCSChild createBCSChild(Object targetChild,Object peer){
  return new BCSChild(targetChild,peer);
}
Program: 78881
Project: 78881
Buggy source:
public void run(){
  Invoker.GroupAndInvokeCount myGroupAndInvokeCount=Invoker.getGroupAndInvokeCount();
  final boolean isPooledThread=(myGroupAndInvokeCount != null);
  boolean replaceMe=false;
  Event ev;
  try {
    for (; ; ) {
      if (isPooledThread)       myGroupAndInvokeCount.resetInvokeCount();
      try {
        replaceMe=false;
        ev=queue.take();
        if (ev == NEED_TO_POLL) {
          try {
            ev=poll();
          }
 catch (          IOException x) {
            x.printStackTrace();
            return;
          }
        }
      }
 catch (      InterruptedException x) {
        continue;
      }
      if (ev == EXECUTE_TASK_OR_SHUTDOWN) {
        Runnable task=pollTask();
        if (task == null) {
          return;
        }
        replaceMe=true;
        task.run();
        continue;
      }
      try {
        ev.channel().onEvent(ev.events(),isPooledThread);
      }
 catch (      Error x) {
        replaceMe=true;
        throw x;
      }
catch (      RuntimeException x) {
        replaceMe=true;
        throw x;
      }
    }
  }
  finally {
    int remaining=threadExit(this,replaceMe);
    if (remaining == 0 && isShutdown()) {
      implClose();
    }
  }
}

Fixed version (ground truth):
public void run(){
  Invoker.GroupAndInvokeCount myGroupAndInvokeCount=Invoker.getGroupAndInvokeCount();
  final boolean isPooledThread=(myGroupAndInvokeCount != null);
  boolean replaceMe=false;
  Event ev;
  try {
    for (; ; ) {
      if (isPooledThread)       myGroupAndInvokeCount.resetInvokeCount();
      try {
        replaceMe=false;
        ev=queue.take();
        if (ev == NEED_TO_POLL) {
          try {
            ev=poll();
          }
 catch (          IOException x) {
            x.printStackTrace();
            return;
          }
        }
      }
 catch (      InterruptedException x) {
        continue;
      }
      if (ev == CONTINUE_AFTER_CTL_EVENT) {
        continue;
      }
      if (ev == EXECUTE_TASK_OR_SHUTDOWN) {
        Runnable task=pollTask();
        if (task == null) {
          return;
        }
        replaceMe=true;
        task.run();
        continue;
      }
      try {
        ev.channel().onEvent(ev.events(),isPooledThread);
      }
 catch (      Error x) {
        replaceMe=true;
        throw x;
      }
catch (      RuntimeException x) {
        replaceMe=true;
        throw x;
      }
    }
  }
  finally {
    int remaining=threadExit(this,replaceMe);
    if (remaining == 0 && isShutdown()) {
      implClose();
    }
  }
}
Program: 78882
Project: 78882
Buggy source:
private Event poll() throws IOException {
  try {
    for (; ; ) {
      int n;
      controlLock.lock();
      try {
        n=pollsetPoll(pollset,address,MAX_POLL_EVENTS);
      }
  finally {
        controlLock.unlock();
      }
      fdToChannelLock.readLock().lock();
      try {
        while (n-- > 0) {
          long eventAddress=getEvent(address,n);
          int fd=getDescriptor(eventAddress);
          pollsetCtl(pollset,PS_DELETE,fd,0);
          if (fd == sp[0]) {
            if (wakeupCount.decrementAndGet() == 0) {
              drain1(sp[0]);
            }
            pollsetCtl(pollset,PS_ADD,sp[0],Net.POLLIN);
            if (n > 0) {
              queue.offer(EXECUTE_TASK_OR_SHUTDOWN);
              continue;
            }
            return EXECUTE_TASK_OR_SHUTDOWN;
          }
          if (fd == ctlSp[0]) {
synchronized (controlQueue) {
              drain1(ctlSp[0]);
              pollsetCtl(pollset,PS_ADD,ctlSp[0],Net.POLLIN);
              processControlQueue();
            }
            continue;
          }
          PollableChannel channel=fdToChannel.get(fd);
          if (channel != null) {
            int events=getRevents(eventAddress);
            Event ev=new Event(channel,events);
            if (n > 0) {
              queue.offer(ev);
            }
 else {
              return ev;
            }
          }
        }
      }
  finally {
        fdToChannelLock.readLock().unlock();
      }
    }
  }
  finally {
    queue.offer(NEED_TO_POLL);
  }
}

Fixed version (ground truth):
private Event poll() throws IOException {
  try {
    for (; ; ) {
      int n;
      controlLock.lock();
      try {
        n=pollsetPoll(pollset,address,MAX_POLL_EVENTS);
      }
  finally {
        controlLock.unlock();
      }
      fdToChannelLock.readLock().lock();
      try {
        while (n-- > 0) {
          long eventAddress=getEvent(address,n);
          int fd=getDescriptor(eventAddress);
          if (fd != sp[0] && fd != ctlSp[0]) {
synchronized (controlQueue) {
              pollsetCtl(pollset,PS_DELETE,fd,0);
            }
          }
          if (fd == sp[0]) {
            if (wakeupCount.decrementAndGet() == 0) {
              drain1(sp[0]);
            }
            if (n > 0) {
              queue.offer(EXECUTE_TASK_OR_SHUTDOWN);
              continue;
            }
            return EXECUTE_TASK_OR_SHUTDOWN;
          }
          if (fd == ctlSp[0]) {
synchronized (controlQueue) {
              drain1(ctlSp[0]);
              processControlQueue();
            }
            if (n > 0) {
              continue;
            }
            return CONTINUE_AFTER_CTL_EVENT;
          }
          PollableChannel channel=fdToChannel.get(fd);
          if (channel != null) {
            int events=getRevents(eventAddress);
            Event ev=new Event(channel,events);
            if (n > 0) {
              queue.offer(ev);
            }
 else {
              return ev;
            }
          }
        }
      }
  finally {
        fdToChannelLock.readLock().unlock();
      }
    }
  }
  finally {
    queue.offer(NEED_TO_POLL);
  }
}
Program: 78884
Project: 78884
Buggy source:
/** 
 * Returns the pre-digested input stream, if <a href="XMLSignContext.html#Supported Properties">reference caching</a> is enabled. This is the input to the digest operation during a validation or signing operation.
 * @return an input stream containing the pre-digested input, or<code>null</code> if reference caching is not enabled or this reference has not been generated or validated
 */
InputStream getDigestInputStream();

Fixed version (ground truth):
/** 
 * Returns the pre-digested input stream, if <a href="XMLSignContext.html#Supported%20Properties">reference caching</a> is enabled. This is the input to the digest operation during a validation or signing operation.
 * @return an input stream containing the pre-digested input, or<code>null</code> if reference caching is not enabled or this reference has not been generated or validated
 */
InputStream getDigestInputStream();
Program: 78885
Project: 78885
Buggy source:
/** 
 * Returns the dereferenced data, if <a href="XMLSignContext.html#Supported Properties">reference caching</a> is enabled. This is the result of dereferencing the URI of this reference during a validation or generation operation.
 * @return the dereferenced data, or <code>null</code> if referencecaching is not enabled or this reference has not been generated or validated
 */
Data getDereferencedData();

Fixed version (ground truth):
/** 
 * Returns the dereferenced data, if <a href="XMLSignContext.html#Supported%20Properties">reference caching</a> is enabled. This is the result of dereferencing the URI of this reference during a validation or generation operation.
 * @return the dereferenced data, or <code>null</code> if referencecaching is not enabled or this reference has not been generated or validated
 */
Data getDereferencedData();
Program: 78886
Project: 78886
Buggy source:
/** 
 * Returns a valid scripting language executable program with given statements. For instance an implementation for a PHP engine might be: <p> <pre>  {@code}public String getProgram(String... statements)  String retval = "<?\n"; int len = statements.length; for (int i = 0; i < len; i++) { retval += statements[i] + ";\n"; } return retval += "?>"; } }</pre>
 * @param statements The statements to be executed.  May be return values ofcalls to the <code>getMethodCallSyntax</code> and <code>getOutputStatement</code> methods.
 * @return The Program
 */
public String getProgram(String... statements);

Fixed version (ground truth):
/** 
 * Returns a valid scripting language executable program with given statements. For instance an implementation for a PHP engine might be: <pre>  {@code}public String getProgram(String... statements)  String retval = "<?\n"; int len = statements.length; for (int i = 0; i < len; i++) { retval += statements[i] + ";\n"; } return retval += "?>"; } }</pre>
 * @param statements The statements to be executed.  May be return values ofcalls to the <code>getMethodCallSyntax</code> and <code>getOutputStatement</code> methods.
 * @return The Program
 */
public String getProgram(String... statements);
Program: 78887
Project: 78887
Buggy source:
/** 
 * Returns a String that can be used as a statement to display the specified String  using the syntax of the supported scripting language.  For instance, the implementation for a Perl engine might be; <p> <pre><code> public String getOutputStatement(String toDisplay) { return "print(" + toDisplay + ")"; } </code></pre>
 * @param toDisplay The String to be displayed by the returned statement.
 * @return The string used to display the String in the syntax of the scripting language.
 */
public String getOutputStatement(String toDisplay);

Fixed version (ground truth):
/** 
 * Returns a String that can be used as a statement to display the specified String  using the syntax of the supported scripting language.  For instance, the implementation for a Perl engine might be; <pre><code> public String getOutputStatement(String toDisplay) { return "print(" + toDisplay + ")"; } </code></pre>
 * @param toDisplay The String to be displayed by the returned statement.
 * @return The string used to display the String in the syntax of the scripting language.
 */
public String getOutputStatement(String toDisplay);
Program: 78888
Project: 78888
Buggy source:
/** 
 * Returns a String which can be used to invoke a method of a  Java object using the syntax of the supported scripting language.  For instance, an implementation for a Javascript engine might be; <p> <pre>  {@code public String getMethodCallSyntax(String obj,}String m, String... args)  String ret = obj; ret += "." + m + "("; for (int i = 0; i < args.length; i++) { ret += args[i]; if (i < args.length - 1) { ret += ","; } } ret += ")"; return ret; } } </pre> <p>
 * @param obj The name representing the object whose method is to be invoked. Thename is the one used to create bindings using the <code>put</code> method of <code>ScriptEngine</code>, the <code>put</code> method of an <code>ENGINE_SCOPE</code> <code>Bindings</code>,or the <code>setAttribute</code> method of <code>ScriptContext</code>.  The identifier used in scripts may be a decorated form of the specified one.
 * @param m The name of the method to invoke.
 * @param args names of the arguments in the method call.
 * @return The String used to invoke the method in the syntax of the scripting language.
 */
public String getMethodCallSyntax(String obj,String m,String... args);

Fixed version (ground truth):
/** 
 * Returns a String which can be used to invoke a method of a  Java object using the syntax of the supported scripting language.  For instance, an implementation for a Javascript engine might be; <pre>  {@code public String getMethodCallSyntax(String obj,}String m, String... args)  String ret = obj; ret += "." + m + "("; for (int i = 0; i < args.length; i++) { ret += args[i]; if (i < args.length - 1) { ret += ","; } } ret += ")"; return ret; } } </pre> <p>
 * @param obj The name representing the object whose method is to be invoked. Thename is the one used to create bindings using the <code>put</code> method of <code>ScriptEngine</code>, the <code>put</code> method of an <code>ENGINE_SCOPE</code> <code>Bindings</code>,or the <code>setAttribute</code> method of <code>ScriptContext</code>.  The identifier used in scripts may be a decorated form of the specified one.
 * @param m The name of the method to invoke.
 * @param args names of the arguments in the method call.
 * @return The String used to invoke the method in the syntax of the scripting language.
 */
public String getMethodCallSyntax(String obj,String m,String... args);
Program: 78889
Project: 78889
Buggy source:
/** 
 * Overwrites the Transform in the <code>Graphics2D</code> context. WARNING: This method should <b>never</b> be used to apply a new coordinate transform on top of an existing transform because the <code>Graphics2D</code> might already have a transform that is needed for other purposes, such as rendering Swing components or applying a scaling transformation to adjust for the resolution of a printer. <p>To add a coordinate transform, use the <code>transform</code>, <code>rotate</code>, <code>scale</code>, or <code>shear</code> methods.  The <code>setTransform</code> method is intended only for restoring the original <code>Graphics2D</code> transform after rendering, as shown in this example: <pre><blockquote> // Get the current transform AffineTransform saveAT = g2.getTransform(); // Perform transformation g2d.transform(...); // Render g2d.draw(...); // Restore original transform g2d.setTransform(saveAT); </blockquote></pre>
 * @param Tx the <code>AffineTransform</code> that was retrievedfrom the <code>getTransform</code> method
 * @see #transform
 * @see #getTransform
 * @see AffineTransform
 */
public abstract void setTransform(AffineTransform Tx);

Fixed version (ground truth):
/** 
 * Overwrites the Transform in the <code>Graphics2D</code> context. WARNING: This method should <b>never</b> be used to apply a new coordinate transform on top of an existing transform because the <code>Graphics2D</code> might already have a transform that is needed for other purposes, such as rendering Swing components or applying a scaling transformation to adjust for the resolution of a printer. <p>To add a coordinate transform, use the <code>transform</code>, <code>rotate</code>, <code>scale</code>, or <code>shear</code> methods.  The <code>setTransform</code> method is intended only for restoring the original <code>Graphics2D</code> transform after rendering, as shown in this example: <pre> // Get the current transform AffineTransform saveAT = g2.getTransform(); // Perform transformation g2d.transform(...); // Render g2d.draw(...); // Restore original transform g2d.setTransform(saveAT); </pre>
 * @param Tx the <code>AffineTransform</code> that was retrievedfrom the <code>getTransform</code> method
 * @see #transform
 * @see #getTransform
 * @see AffineTransform
 */
public abstract void setTransform(AffineTransform Tx);
Program: 78890
Project: 78890
Buggy source:
/** 
 * Gets a property of this image by name. <p> Individual property names are defined by the various image formats. If a property is not defined for a particular image, this method returns the <code>UndefinedProperty</code> object. <p> If the properties for this image are not yet known, this method returns <code>null</code>, and the <code>ImageObserver</code> object is notified later. <p> The property name <code>"comment"</code> should be used to store an optional comment which can be presented to the application as a description of the image, its source, or its author.
 * @param name   a property name.
 * @param observer   an object waiting for this image to be loaded.
 * @return      the value of the named property.
 * @throws      <code>NullPointerException</code> if the property name is null.
 * @see java.awt.image.ImageObserver
 * @see java.awt.Image#UndefinedProperty
 */
public abstract Object getProperty(String name,ImageObserver observer);

Fixed version (ground truth):
/** 
 * Gets a property of this image by name. <p> Individual property names are defined by the various image formats. If a property is not defined for a particular image, this method returns the <code>UndefinedProperty</code> object. <p> If the properties for this image are not yet known, this method returns <code>null</code>, and the <code>ImageObserver</code> object is notified later. <p> The property name <code>"comment"</code> should be used to store an optional comment which can be presented to the application as a description of the image, its source, or its author.
 * @param name   a property name.
 * @param observer   an object waiting for this image to be loaded.
 * @return      the value of the named property.
 * @throws NullPointerException if the property name is null.
 * @see java.awt.image.ImageObserver
 * @see java.awt.Image#UndefinedProperty
 */
public abstract Object getProperty(String name,ImageObserver observer);
Program: 78891
Project: 78891
Buggy source:
/** 
 * Returns <code>true</code> if this <code>RenderingHints</code> contains a mapping for the specified key.
 * @param key key whose presence in this<code>RenderingHints</code> is to be tested.
 * @return <code>true</code> if this <code>RenderingHints</code>contains a mapping for the specified key.
 * @exception <code>ClassCastException</code> if the key can notbe cast to <code>RenderingHints.Key</code>
 */
public boolean containsKey(Object key){
  return hintmap.containsKey((Key)key);
}

Fixed version (ground truth):
/** 
 * Returns   {@code true} if this {@code RenderingHints}contains a mapping for the specified key.
 * @param key key whose presence in this{@code RenderingHints} is to be tested.
 * @return {@code true} if this {@code RenderingHints}contains a mapping for the specified key.
 * @exception ClassCastException if the key can notbe cast to  {@code RenderingHints.Key}
 */
public boolean containsKey(Object key){
  return hintmap.containsKey((Key)key);
}
Program: 78892
Project: 78892
Buggy source:
/** 
 * Maps the specified <code>key</code> to the specified <code>value</code> in this <code>RenderingHints</code> object. Neither the key nor the value can be <code>null</code>. The value can be retrieved by calling the <code>get</code> method with a key that is equal to the original key.
 * @param key     the rendering hint key.
 * @param value   the rendering hint value.
 * @return     the previous value of the specified key in this objector <code>null</code> if it did not have one.
 * @exception <code>NullPointerException</code> if the key is<code>null</code>.
 * @exception <code>ClassCastException</code> if the key can notbe cast to <code>RenderingHints.Key</code>
 * @exception <code>IllegalArgumentException</code> if the{@link Key#isCompatibleValue(java.lang.Object) Key.isCompatibleValue()}method of the specified key returns false for the specified value
 * @see #get(Object)
 */
public Object put(Object key,Object value){
  if (!((Key)key).isCompatibleValue(value)) {
    throw new IllegalArgumentException(value + "String_Node_Str" + key);
  }
  return hintmap.put((Key)key,value);
}

Fixed version (ground truth):
/** 
 * Maps the specified   {@code key} to the specified{@code value} in this {@code RenderingHints} object.Neither the key nor the value can be  {@code null}. The value can be retrieved by calling the   {@code get} methodwith a key that is equal to the original key.
 * @param key     the rendering hint key.
 * @param value   the rendering hint value.
 * @return     the previous value of the specified key in this objector  {@code null} if it did not have one.
 * @exception NullPointerException if the key is{@code null}.
 * @exception ClassCastException if the key can notbe cast to  {@code RenderingHints.Key}
 * @exception IllegalArgumentException if the{@link Key#isCompatibleValue(java.lang.Object) Key.isCompatibleValue()}method of the specified key returns false for the specified value
 * @see #get(Object)
 */
public Object put(Object key,Object value){
  if (!((Key)key).isCompatibleValue(value)) {
    throw new IllegalArgumentException(value + "String_Node_Str" + key);
  }
  return hintmap.put((Key)key,value);
}
Program: 78893
Project: 78893
Buggy source:
/** 
 * Removes the key and its corresponding value from this <code>RenderingHints</code> object. This method does nothing if the key is not in this <code>RenderingHints</code> object.
 * @param key   the rendering hints key that needs to be removed
 * @exception <code>ClassCastException</code> if the key can notbe cast to <code>RenderingHints.Key</code>
 * @return  the value to which the key had previously been mapped in this<code>RenderingHints</code> object, or <code>null</code> if the key did not have a mapping.
 */
public Object remove(Object key){
  return hintmap.remove((Key)key);
}

Fixed version (ground truth):
/** 
 * Removes the key and its corresponding value from this  {@code RenderingHints} object. This method does nothing if thekey is not in this  {@code RenderingHints} object.
 * @param key   the rendering hints key that needs to be removed
 * @exception ClassCastException if the key can notbe cast to  {@code RenderingHints.Key}
 * @return  the value to which the key had previously been mapped in this{@code RenderingHints} object, or {@code null}if the key did not have a mapping.
 */
public Object remove(Object key){
  return hintmap.remove((Key)key);
}
Program: 78894
Project: 78894
Buggy source:
/** 
 * Returns the value to which the specified key is mapped.
 * @param key   a rendering hint key
 * @return  the value to which the key is mapped in this object or<code>null</code> if the key is not mapped to any value in this object.
 * @exception <code>ClassCastException</code> if the key can notbe cast to <code>RenderingHints.Key</code>
 * @see #put(Object,Object)
 */
public Object get(Object key){
  return hintmap.get((Key)key);
}

Fixed version (ground truth):
/** 
 * Returns the value to which the specified key is mapped.
 * @param key   a rendering hint key
 * @return  the value to which the key is mapped in this object or{@code null} if the key is not mapped to any value inthis object.
 * @exception ClassCastException if the key can notbe cast to  {@code RenderingHints.Key}
 * @see #put(Object,Object)
 */
public Object get(Object key){
  return hintmap.get((Key)key);
}
Program: 78895
Project: 78895
Buggy source:
/** 
 * Copies all of the mappings from the specified <code>Map</code> to this <code>RenderingHints</code>.  These mappings replace any mappings that this <code>RenderingHints</code> had for any of the keys currently in the specified <code>Map</code>.
 * @param m the specified <code>Map</code>
 * @exception <code>ClassCastException</code> class of a key or valuein the specified <code>Map</code> prevents it from being stored in this <code>RenderingHints</code>.
 * @exception <code>IllegalArgumentException</code> some aspectof a key or value in the specified <code>Map</code> prevents it from being stored in this <code>RenderingHints</code>.
 */
public void putAll(Map<?,?> m){
  if (RenderingHints.class.isInstance(m)) {
    for (    Map.Entry<?,?> entry : m.entrySet())     hintmap.put(entry.getKey(),entry.getValue());
  }
 else {
    for (    Map.Entry<?,?> entry : m.entrySet())     put(entry.getKey(),entry.getValue());
  }
}

Fixed version (ground truth):
/** 
 * Copies all of the mappings from the specified   {@code Map}to this   {@code RenderingHints}.  These mappings replace any mappings that this   {@code RenderingHints} had for anyof the keys currently in the specified  {@code Map}.
 * @param m the specified {@code Map}
 * @exception ClassCastException class of a key or valuein the specified  {@code Map} prevents it from beingstored in this  {@code RenderingHints}.
 * @exception IllegalArgumentException some aspectof a key or value in the specified  {@code Map}prevents it from being stored in this   {@code RenderingHints}.
 */
public void putAll(Map<?,?> m){
  if (RenderingHints.class.isInstance(m)) {
    for (    Map.Entry<?,?> entry : m.entrySet())     hintmap.put(entry.getKey(),entry.getValue());
  }
 else {
    for (    Map.Entry<?,?> entry : m.entrySet())     put(entry.getKey(),entry.getValue());
  }
}
Program: 78896
Project: 78896
Buggy source:
/** 
 * Returns an <code>int</code> that ORs together the values for all the ranges that will be shaped. <p> For example, to check if a shaper shapes to Arabic, you would use the following: <blockquote> <code>if ((shaper.getRanges() &amp; shaper.ARABIC) != 0) { ... </code> </blockquote> <p>Note that this method supports only the bit mask-based ranges. Call   {@link #getRangeSet()} for the enum-based ranges.
 * @return the values for all the ranges to be shaped.
 */
public int getRanges(){
  return mask & ~CONTEXTUAL_MASK;
}

Fixed version (ground truth):
/** 
 * Returns an <code>int</code> that ORs together the values for all the ranges that will be shaped. <p> For example, to check if a shaper shapes to Arabic, you would use the following: <blockquote>  {@code if ((shaper.getRanges() & shaper.ARABIC) != 0) &#123; ... }</blockquote> <p>Note that this method supports only the bit mask-based ranges. Call   {@link #getRangeSet()} for the enum-based ranges.
 * @return the values for all the ranges to be shaped.
 */
public int getRanges(){
  return mask & ~CONTEXTUAL_MASK;
}
Program: 78897
Project: 78897
Buggy source:
/** 
 * Constructs a new <code>FlatteningPathIterator</code> object that flattens a path as it iterates over it. The <code>limit</code> parameter allows you to control the maximum number of recursive subdivisions that the iterator can make before it assumes that the curve is flat enough without measuring against the <code>flatness</code> parameter. The flattened iteration therefore never generates more than a maximum of <code>(2^limit)</code> line segments per curve.
 * @param src the original unflattened path being iterated over
 * @param flatness the maximum allowable distance between thecontrol points and the flattened curve
 * @param limit the maximum number of recursive subdivisionsallowed for any curved segment
 * @exception <code>IllegalArgumentException</code> if<code>flatness</code> or <code>limit</code> is less than zero
 */
public FlatteningPathIterator(PathIterator src,double flatness,int limit){
  if (flatness < 0.0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (limit < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.src=src;
  this.squareflat=flatness * flatness;
  this.limit=limit;
  this.levels=new int[limit + 1];
  next(false);
}

Fixed version (ground truth):
/** 
 * Constructs a new <code>FlatteningPathIterator</code> object that flattens a path as it iterates over it. The <code>limit</code> parameter allows you to control the maximum number of recursive subdivisions that the iterator can make before it assumes that the curve is flat enough without measuring against the <code>flatness</code> parameter. The flattened iteration therefore never generates more than a maximum of <code>(2^limit)</code> line segments per curve.
 * @param src the original unflattened path being iterated over
 * @param flatness the maximum allowable distance between thecontrol points and the flattened curve
 * @param limit the maximum number of recursive subdivisionsallowed for any curved segment
 * @exception IllegalArgumentException if<code>flatness</code> or <code>limit</code> is less than zero
 */
public FlatteningPathIterator(PathIterator src,double flatness,int limit){
  if (flatness < 0.0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (limit < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.src=src;
  this.squareflat=flatness * flatness;
  this.limit=limit;
  this.levels=new int[limit + 1];
  next(false);
}
Program: 78898
Project: 78898
Buggy source:
/** 
 * Returns the coordinates and type of the current path segment in the iteration. The return value is the path segment type: SEG_MOVETO, SEG_LINETO, or SEG_CLOSE. A double array of length 6 must be passed in and can be used to store the coordinates of the point(s). Each point is stored as a pair of double x,y coordinates. SEG_MOVETO and SEG_LINETO types return one point, and SEG_CLOSE does not return any points.
 * @param coords an array that holds the data returned fromthis method
 * @return the path segment type of the current path segment.
 * @exception <code>NoSuchElementException</code> if thereare no more elements in the flattening path to be returned.
 * @see PathIterator#SEG_MOVETO
 * @see PathIterator#SEG_LINETO
 * @see PathIterator#SEG_CLOSE
 */
public int currentSegment(double[] coords){
  if (isDone()) {
    throw new NoSuchElementException("String_Node_Str");
  }
  int type=holdType;
  if (type != SEG_CLOSE) {
    coords[0]=hold[holdIndex + 0];
    coords[1]=hold[holdIndex + 1];
    if (type != SEG_MOVETO) {
      type=SEG_LINETO;
    }
  }
  return type;
}

Fixed version (ground truth):
/** 
 * Returns the coordinates and type of the current path segment in the iteration. The return value is the path segment type: SEG_MOVETO, SEG_LINETO, or SEG_CLOSE. A double array of length 6 must be passed in and can be used to store the coordinates of the point(s). Each point is stored as a pair of double x,y coordinates. SEG_MOVETO and SEG_LINETO types return one point, and SEG_CLOSE does not return any points.
 * @param coords an array that holds the data returned fromthis method
 * @return the path segment type of the current path segment.
 * @exception NoSuchElementException if thereare no more elements in the flattening path to be returned.
 * @see PathIterator#SEG_MOVETO
 * @see PathIterator#SEG_LINETO
 * @see PathIterator#SEG_CLOSE
 */
public int currentSegment(double[] coords){
  if (isDone()) {
    throw new NoSuchElementException("String_Node_Str");
  }
  int type=holdType;
  if (type != SEG_CLOSE) {
    coords[0]=hold[holdIndex + 0];
    coords[1]=hold[holdIndex + 1];
    if (type != SEG_MOVETO) {
      type=SEG_LINETO;
    }
  }
  return type;
}
Program: 78899
Project: 78899
Buggy source:
/** 
 * Returns the String before a given index.
 * @param part the AccessibleText.CHARACTER, AccessibleText.WORD,or AccessibleText.SENTENCE to retrieve
 * @param index an index within the text >= 0
 * @return the letter, word, or sentence, null for an invalid indexor part
 * @since 1.3
 */
public String getBeforeIndex(int part,int index){
  if (index < 0 || index > getCharCount() - 1) {
    return null;
  }
switch (part) {
case AccessibleText.CHARACTER:
    if (index == 0) {
      return null;
    }
  try {
    return getText(index - 1,1);
  }
 catch (  BadLocationException e) {
    return null;
  }
case AccessibleText.WORD:
try {
  String s=getText(0,getCharCount());
  BreakIterator words=BreakIterator.getWordInstance(getLocale());
  words.setText(s);
  int end=words.following(index);
  end=words.previous();
  int start=words.previous();
  if (start == BreakIterator.DONE) {
    return null;
  }
  return s.substring(start,end);
}
 catch (BadLocationException e) {
  return null;
}
case AccessibleText.SENTENCE:
try {
String s=getText(0,getCharCount());
BreakIterator sentence=BreakIterator.getSentenceInstance(getLocale());
sentence.setText(s);
int end=sentence.following(index);
end=sentence.previous();
int start=sentence.previous();
if (start == BreakIterator.DONE) {
  return null;
}
return s.substring(start,end);
}
 catch (BadLocationException e) {
return null;
}
default :
return null;
}
}

Fixed version (ground truth):
/** 
 * Returns the String before a given index.
 * @param part the AccessibleText.CHARACTER, AccessibleText.WORD,or AccessibleText.SENTENCE to retrieve
 * @param index an index within the text &gt;= 0
 * @return the letter, word, or sentence, null for an invalid indexor part
 * @since 1.3
 */
public String getBeforeIndex(int part,int index){
  if (index < 0 || index > getCharCount() - 1) {
    return null;
  }
switch (part) {
case AccessibleText.CHARACTER:
    if (index == 0) {
      return null;
    }
  try {
    return getText(index - 1,1);
  }
 catch (  BadLocationException e) {
    return null;
  }
case AccessibleText.WORD:
try {
  String s=getText(0,getCharCount());
  BreakIterator words=BreakIterator.getWordInstance(getLocale());
  words.setText(s);
  int end=words.following(index);
  end=words.previous();
  int start=words.previous();
  if (start == BreakIterator.DONE) {
    return null;
  }
  return s.substring(start,end);
}
 catch (BadLocationException e) {
  return null;
}
case AccessibleText.SENTENCE:
try {
String s=getText(0,getCharCount());
BreakIterator sentence=BreakIterator.getSentenceInstance(getLocale());
sentence.setText(s);
int end=sentence.following(index);
end=sentence.previous();
int start=sentence.previous();
if (start == BreakIterator.DONE) {
  return null;
}
return s.substring(start,end);
}
 catch (BadLocationException e) {
return null;
}
default :
return null;
}
}
Program: 78900
Project: 78900
Buggy source:
/** 
 * Returns the String at a given index.
 * @param part the AccessibleText.CHARACTER, AccessibleText.WORD,or AccessibleText.SENTENCE to retrieve
 * @param index an index within the text >= 0
 * @return the letter, word, or sentence,null for an invalid index or part
 * @since 1.3
 */
public String getAtIndex(int part,int index){
  if (index < 0 || index >= getCharCount()) {
    return null;
  }
switch (part) {
case AccessibleText.CHARACTER:
    try {
      return getText(index,1);
    }
 catch (    BadLocationException e) {
      return null;
    }
case AccessibleText.WORD:
  try {
    String s=getText(0,getCharCount());
    BreakIterator words=BreakIterator.getWordInstance(getLocale());
    words.setText(s);
    int end=words.following(index);
    return s.substring(words.previous(),end);
  }
 catch (  BadLocationException e) {
    return null;
  }
case AccessibleText.SENTENCE:
try {
  String s=getText(0,getCharCount());
  BreakIterator sentence=BreakIterator.getSentenceInstance(getLocale());
  sentence.setText(s);
  int end=sentence.following(index);
  return s.substring(sentence.previous(),end);
}
 catch (BadLocationException e) {
  return null;
}
default :
return null;
}
}

Fixed version (ground truth):
/** 
 * Returns the String at a given index.
 * @param part the AccessibleText.CHARACTER, AccessibleText.WORD,or AccessibleText.SENTENCE to retrieve
 * @param index an index within the text &gt;= 0
 * @return the letter, word, or sentence,null for an invalid index or part
 * @since 1.3
 */
public String getAtIndex(int part,int index){
  if (index < 0 || index >= getCharCount()) {
    return null;
  }
switch (part) {
case AccessibleText.CHARACTER:
    try {
      return getText(index,1);
    }
 catch (    BadLocationException e) {
      return null;
    }
case AccessibleText.WORD:
  try {
    String s=getText(0,getCharCount());
    BreakIterator words=BreakIterator.getWordInstance(getLocale());
    words.setText(s);
    int end=words.following(index);
    return s.substring(words.previous(),end);
  }
 catch (  BadLocationException e) {
    return null;
  }
case AccessibleText.SENTENCE:
try {
  String s=getText(0,getCharCount());
  BreakIterator sentence=BreakIterator.getSentenceInstance(getLocale());
  sentence.setText(s);
  int end=sentence.following(index);
  return s.substring(sentence.previous(),end);
}
 catch (BadLocationException e) {
  return null;
}
default :
return null;
}
}
Program: 78901
Project: 78901
Buggy source:
/** 
 * Sets the <code>contentAreaFilled</code> property. If <code>true</code> the button will paint the content area.  If you wish to have a transparent button, such as an icon only button, for example, then you should set this to <code>false</code>. Do not call <code>setOpaque(false)</code>. The default value for the the <code>contentAreaFilled</code> property is <code>true</code>. <p> This function may cause the component's opaque property to change. <p> The exact behavior of calling this function varies on a component-by-component and L&F-by-L&F basis.
 * @param b if true, the content should be filled; if falsethe content area is not filled
 * @see #isContentAreaFilled
 * @see #setOpaque
 * @beaninfo bound: true attribute: visualUpdate true description: Whether the button should paint the content area or leave it transparent.
 */
public void setContentAreaFilled(boolean b){
  boolean oldValue=contentAreaFilled;
  contentAreaFilled=b;
  contentAreaFilledSet=true;
  firePropertyChange(CONTENT_AREA_FILLED_CHANGED_PROPERTY,oldValue,contentAreaFilled);
  if (b != oldValue) {
    repaint();
  }
}

Fixed version (ground truth):
/** 
 * Sets the <code>contentAreaFilled</code> property. If <code>true</code> the button will paint the content area.  If you wish to have a transparent button, such as an icon only button, for example, then you should set this to <code>false</code>. Do not call <code>setOpaque(false)</code>. The default value for the the <code>contentAreaFilled</code> property is <code>true</code>. <p> This function may cause the component's opaque property to change. <p> The exact behavior of calling this function varies on a component-by-component and L&amp;F-by-L&amp;F basis.
 * @param b if true, the content should be filled; if falsethe content area is not filled
 * @see #isContentAreaFilled
 * @see #setOpaque
 * @beaninfo bound: true attribute: visualUpdate true description: Whether the button should paint the content area or leave it transparent.
 */
public void setContentAreaFilled(boolean b){
  boolean oldValue=contentAreaFilled;
  contentAreaFilled=b;
  contentAreaFilledSet=true;
  firePropertyChange(CONTENT_AREA_FILLED_CHANGED_PROPERTY,oldValue,contentAreaFilled);
  if (b != oldValue) {
    repaint();
  }
}
Program: 78902
Project: 78902
Buggy source:
/** 
 * Returns the L&F object that renders this component.
 * @return the ButtonUI object
 * @see #setUI
 */
public ButtonUI getUI(){
  return (ButtonUI)ui;
}

Fixed version (ground truth):
/** 
 * Returns the L&amp;F object that renders this component.
 * @return the ButtonUI object
 * @see #setUI
 */
public ButtonUI getUI(){
  return (ButtonUI)ui;
}
Program: 78904
Project: 78904
Buggy source:
/** 
 * Sets the amount of time (in milliseconds) required between mouse press events for the button to generate the corresponding action events.  After the initial mouse press occurs (and action event generated) any subsequent mouse press events which occur on intervals less than the threshhold will be ignored and no corresponding action event generated.  By default the threshhold is 0, which means that for each mouse press, an action event will be fired, no matter how quickly the mouse clicks occur.  In buttons where this behavior is not desirable (for example, the "OK" button in a dialog), this threshhold should be set to an appropriate positive value.
 * @see #getMultiClickThreshhold
 * @param threshhold the amount of time required between mousepress events to generate corresponding action events
 * @exception IllegalArgumentException if threshhold < 0
 * @since 1.4
 */
public void setMultiClickThreshhold(long threshhold){
  if (threshhold < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.multiClickThreshhold=threshhold;
}

Fixed version (ground truth):
/** 
 * Sets the amount of time (in milliseconds) required between mouse press events for the button to generate the corresponding action events.  After the initial mouse press occurs (and action event generated) any subsequent mouse press events which occur on intervals less than the threshhold will be ignored and no corresponding action event generated.  By default the threshhold is 0, which means that for each mouse press, an action event will be fired, no matter how quickly the mouse clicks occur.  In buttons where this behavior is not desirable (for example, the "OK" button in a dialog), this threshhold should be set to an appropriate positive value.
 * @see #getMultiClickThreshhold
 * @param threshhold the amount of time required between mousepress events to generate corresponding action events
 * @exception IllegalArgumentException if threshhold &lt; 0
 * @since 1.4
 */
public void setMultiClickThreshhold(long threshhold){
  if (threshhold < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.multiClickThreshhold=threshhold;
}