nus-yam/ex-repair huggingface dataset:
Program: 77140
Project: 77140
Buggy source:
/** 
 * Invoked when a component loses the keyboard focus.
 */
public void focusLost(FocusEvent e);

Fixed version (ground truth):
/** 
 * Invoked when a component loses the keyboard focus.
 * @param e the event to be processed
 */
public void focusLost(FocusEvent e);
Program: 77141
Project: 77141
Buggy source:
/** 
 * Called when an ancestor of the source is moved.
 */
public void ancestorMoved(HierarchyEvent e);

Fixed version (ground truth):
/** 
 * Called when an ancestor of the source is moved.
 * @param e the event to be processed
 */
public void ancestorMoved(HierarchyEvent e);
Program: 77142
Project: 77142
Buggy source:
/** 
 * Called when an ancestor of the source is resized.
 */
public void ancestorResized(HierarchyEvent e);

Fixed version (ground truth):
/** 
 * Called when an ancestor of the source is resized.
 * @param e the event to be processed
 */
public void ancestorResized(HierarchyEvent e);
Program: 77143
Project: 77143
Buggy source:
/** 
 * Called when the hierarchy has been changed. To discern the actual type of change, call <code>HierarchyEvent.getChangeFlags()</code>.
 * @see HierarchyEvent#getChangeFlags()
 */
public void hierarchyChanged(HierarchyEvent e);

Fixed version (ground truth):
/** 
 * Called when the hierarchy has been changed. To discern the actual type of change, call <code>HierarchyEvent.getChangeFlags()</code>.
 * @param e the event to be processed
 * @see HierarchyEvent#getChangeFlags()
 */
public void hierarchyChanged(HierarchyEvent e);
Program: 77144
Project: 77144
Buggy source:
/** 
 * Returns whether or not the Control modifier is down on this event.
 */
public boolean isControlDown(){
  return (modifiers & CTRL_MASK) != 0;
}

Fixed version (ground truth):
/** 
 * Returns whether or not the Control modifier is down on this event.
 * @return whether or not the Control modifier is down on this event
 */
public boolean isControlDown(){
  return (modifiers & CTRL_MASK) != 0;
}
Program: 77145
Project: 77145
Buggy source:
/** 
 * Returns whether or not the Meta modifier is down on this event.
 */
public boolean isMetaDown(){
  return (modifiers & META_MASK) != 0;
}

Fixed version (ground truth):
/** 
 * Returns whether or not the Meta modifier is down on this event.
 * @return whether or not the Meta modifier is down on this event
 */
public boolean isMetaDown(){
  return (modifiers & META_MASK) != 0;
}
Program: 77146
Project: 77146
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: 77147
Project: 77147
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: 77148
Project: 77148
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: 77150
Project: 77150
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: 77152
Project: 77152
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: 77153
Project: 77153
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: 77154
Project: 77154
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: 77155
Project: 77155
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: 77156
Project: 77156
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: 77157
Project: 77157
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: 77158
Project: 77158
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: 77159
Project: 77159
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: 77160
Project: 77160
Buggy source:
/** 
 * Move the back buffer to the front buffer.
 * @param x1 the area to be flipped, upper left X coordinate
 * @param y1 the area to be flipped, upper left Y coordinate
 * @param x2 the area to be flipped, lower right X coordinate
 * @param y2 the area to be flipped, lower right Y coordinate
 * @param flipAction the flip action to perform
 * @see Component.FlipBufferStrategy#flip
 */
void flip(int x1,int y1,int x2,int y2,BufferCapabilities.FlipContents flipAction);

Fixed version (ground truth):
/** 
 * Move the back buffer to the front buffer.
 * @param x1 the area to be flipped, upper left X coordinate
 * @param y1 the area to be flipped, upper left Y coordinate
 * @param x2 the area to be flipped, lower right X coordinate
 * @param y2 the area to be flipped, lower right Y coordinate
 * @param flipAction the flip action to perform
 */
void flip(int x1,int y1,int x2,int y2,BufferCapabilities.FlipContents flipAction);
Program: 77161
Project: 77161
Buggy source:
/** 
 * Returns the back buffer as image.
 * @return the back buffer as image
 * @see Component.FlipBufferStrategy#getBackBuffer
 */
Image getBackBuffer();

Fixed version (ground truth):
/** 
 * Returns the back buffer as image.
 * @return the back buffer as image
 */
Image getBackBuffer();
Program: 77162
Project: 77162
Buggy source:
/** 
 * Create   {@code numBuffers} flipping buffers with the specifiedbuffer capabilities.
 * @param numBuffers the number of buffers to create
 * @param caps the buffer capabilities
 * @throws AWTException if flip buffering is not supported
 * @see Component.FlipBufferStrategy#createBuffers
 */
void createBuffers(int numBuffers,BufferCapabilities caps) throws AWTException ;

Fixed version (ground truth):
/** 
 * Create   {@code numBuffers} flipping buffers with the specifiedbuffer capabilities.
 * @param numBuffers the number of buffers to create
 * @param caps the buffer capabilities
 * @throws AWTException if flip buffering is not supported
 */
void createBuffers(int numBuffers,BufferCapabilities caps) throws AWTException ;
Program: 77163
Project: 77163
Buggy source:
/** 
 * Destroys all created buffers.
 * @see Component.FlipBufferStrategy#destroyBuffers
 */
void destroyBuffers();

Fixed version (ground truth):
/** 
 * Destroys all created buffers.
 */
void destroyBuffers();
Program: 77164
Project: 77164
Buggy source:
/** 
 * Block the specified windows. This is used for modal dialogs.
 * @param windows the windows to block
 * @see Dialog#modalShow()
 * @see Dialog#blockWindows()
 */
void blockWindows(java.util.List<Window> windows);

Fixed version (ground truth):
/** 
 * Block the specified windows. This is used for modal dialogs.
 * @param windows the windows to block
 * @see Dialog#modalShow()
 */
void blockWindows(java.util.List<Window> windows);
Program: 77165
Project: 77165
Buggy source:
/** 
 * Clears the current global focus owner.
 * @param activeWindow
 * @see KeyboardFocusManager#clearGlobalFocusOwner()
 */
void clearGlobalFocusOwner(Window activeWindow);

Fixed version (ground truth):
/** 
 * Clears the current global focus owner.
 * @param activeWindow the active window
 * @see KeyboardFocusManager#clearGlobalFocusOwner()
 */
void clearGlobalFocusOwner(Window activeWindow);
Program: 77166
Project: 77166
Buggy source:
/** 
 * Updates the window's always-on-top state. Sets if the window should always stay on top of all other windows or not.
 * @see Window#getAlwaysOnTop()
 * @see Window#setAlwaysOnTop(boolean)
 */
void updateAlwaysOnTopState();

Fixed version (ground truth):
/** 
 * Updates the window's always-on-top state. Sets if the window should always stay on top of all other windows or not.
 * @see Window#isAlwaysOnTop()
 * @see Window#setAlwaysOnTop(boolean)
 */
void updateAlwaysOnTopState();
Program: 77169
Project: 77169
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: 77170
Project: 77170
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: 77172
Project: 77172
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: 77173
Project: 77173
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: 77174
Project: 77174
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: 77175
Project: 77175
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: 77176
Project: 77176
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: 77177
Project: 77177
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: 77178
Project: 77178
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: 77179
Project: 77179
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: 77180
Project: 77180
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: 77181
Project: 77181
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: 77182
Project: 77182
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: 77183
Project: 77183
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: 77184
Project: 77184
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: 77185
Project: 77185
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: 77186
Project: 77186
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: 77187
Project: 77187
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;
}
}