nus-yam/ex-repair huggingface dataset:
Program: 35887
Project: 35887
Buggy source:
@Override public Type sub(final MethodVisitor method,final int programPoint){
  if (programPoint == INVALID_PROGRAM_POINT) {
    method.visitInsn(ISUB);
  }
 else {
    method.visitInvokeDynamicInsn("String_Node_Str","String_Node_Str",MATHBOOTSTRAP,programPoint);
  }
  return INT;
}

Fixed version (ground truth):
@Override public Type sub(final MethodVisitor method,final int programPoint){
  if (programPoint == INVALID_PROGRAM_POINT) {
    method.visitInsn(ISUB);
  }
 else {
    ldc(method,programPoint);
    JSType.SUB_EXACT.invoke(method);
  }
  return INT;
}
Program: 35888
Project: 35888
Buggy source:
@Override public Type mul(final MethodVisitor method,final int programPoint){
  if (programPoint == INVALID_PROGRAM_POINT) {
    method.visitInsn(IMUL);
  }
 else {
    method.visitInvokeDynamicInsn("String_Node_Str","String_Node_Str",MATHBOOTSTRAP,programPoint);
  }
  return INT;
}

Fixed version (ground truth):
@Override public Type mul(final MethodVisitor method,final int programPoint){
  if (programPoint == INVALID_PROGRAM_POINT) {
    method.visitInsn(IMUL);
  }
 else {
    ldc(method,programPoint);
    JSType.MUL_EXACT.invoke(method);
  }
  return INT;
}
Program: 35889
Project: 35889
Buggy source:
@Override public Type div(final MethodVisitor method,final int programPoint){
  if (programPoint == INVALID_PROGRAM_POINT) {
    JSType.DIV_ZERO.invoke(method);
  }
 else {
    method.visitInvokeDynamicInsn("String_Node_Str","String_Node_Str",MATHBOOTSTRAP,programPoint);
  }
  return INT;
}

Fixed version (ground truth):
@Override public Type div(final MethodVisitor method,final int programPoint){
  if (programPoint == INVALID_PROGRAM_POINT) {
    JSType.DIV_ZERO.invoke(method);
  }
 else {
    ldc(method,programPoint);
    JSType.DIV_EXACT.invoke(method);
  }
  return INT;
}
Program: 35890
Project: 35890
Buggy source:
@Override public Type neg(final MethodVisitor method,final int programPoint){
  if (programPoint == INVALID_PROGRAM_POINT) {
    method.visitInsn(INEG);
  }
 else {
    method.visitInvokeDynamicInsn("String_Node_Str","String_Node_Str",MATHBOOTSTRAP,programPoint);
  }
  return INT;
}

Fixed version (ground truth):
@Override public Type neg(final MethodVisitor method,final int programPoint){
  if (programPoint == INVALID_PROGRAM_POINT) {
    method.visitInsn(INEG);
  }
 else {
    ldc(method,programPoint);
    JSType.NEGATE_EXACT.invoke(method);
  }
  return INT;
}
Program: 35891
Project: 35891
Buggy source:
@Override public Type rem(final MethodVisitor method,final int programPoint){
  if (programPoint == INVALID_PROGRAM_POINT) {
    JSType.REM_ZERO.invoke(method);
  }
 else {
    method.visitInvokeDynamicInsn("String_Node_Str","String_Node_Str",MATHBOOTSTRAP,programPoint);
  }
  return INT;
}

Fixed version (ground truth):
@Override public Type rem(final MethodVisitor method,final int programPoint){
  if (programPoint == INVALID_PROGRAM_POINT) {
    JSType.REM_ZERO.invoke(method);
  }
 else {
    ldc(method,programPoint);
    JSType.REM_EXACT.invoke(method);
  }
  return INT;
}
Program: 35892
Project: 35892
Buggy source:
@Override public Type add(final MethodVisitor method,final int programPoint){
  if (programPoint == INVALID_PROGRAM_POINT) {
    method.visitInsn(LADD);
  }
 else {
    method.visitInvokeDynamicInsn("String_Node_Str","String_Node_Str",MATHBOOTSTRAP,programPoint);
  }
  return LONG;
}

Fixed version (ground truth):
@Override public Type add(final MethodVisitor method,final int programPoint){
  throw new UnsupportedOperationException("String_Node_Str");
}
Program: 35893
Project: 35893
Buggy source:
/** 
 * Get the next XMLEvent
 * @see XMLEvent
 * @throws XMLStreamException if there is an error with the underlying XML.
 * @throws NoSuchElementException iteration has no more elements.
 */
public XMLEvent nextEvent() throws XMLStreamException ;

Fixed version (ground truth):
/** 
 * Get the next XMLEvent
 * @see XMLEvent
 * @throws XMLStreamException if there is an error with the underlying XML.
 * @throws java.util.NoSuchElementException iteration has no more elements.
 */
public XMLEvent nextEvent() throws XMLStreamException ;
Program: 35894
Project: 35894
Buggy source:
/** 
 * This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters. No indentation or whitespace should be outputted. Any user defined event type SHALL have this method called when being written to on an output stream. Built in Event types MUST implement this method, but implementations MAY choose not call these methods for optimizations reasons when writing out built in Events to an output stream. The output generated MUST be equivalent in terms of the infoset expressed.
 * @param writer The writer that will output the data
 * @throws XMLStreamException if there is a fatal error writing the event
 */
public void writeAsEncodedUnicode(Writer writer) throws javax.xml.stream.XMLStreamException ;

Fixed version (ground truth):
/** 
 * This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters. No indentation or whitespace should be outputted. Any user defined event type SHALL have this method called when being written to on an output stream. Built in Event types MUST implement this method, but implementations MAY choose not call these methods for optimizations reasons when writing out built in Events to an output stream. The output generated MUST be equivalent in terms of the infoset expressed.
 * @param writer The writer that will output the data
 * @throws javax.xml.stream.XMLStreamException if there is a fatal error writing the event
 */
public void writeAsEncodedUnicode(Writer writer) throws javax.xml.stream.XMLStreamException ;
Program: 35895
Project: 35895
Buggy source:
/** 
 * Get the next XMLEvent
 * @see XMLEvent
 * @throws XMLStreamException if there is an error with the underlying XML.
 * @throws NoSuchElementException iteration has no more elements.
 */
public XMLEvent nextEvent() throws XMLStreamException ;

Fixed version (ground truth):
/** 
 * Get the next XMLEvent
 * @see XMLEvent
 * @throws XMLStreamException if there is an error with the underlying XML.
 * @throws java.util.NoSuchElementException iteration has no more elements.
 */
public XMLEvent nextEvent() throws XMLStreamException ;
Program: 35896
Project: 35896
Buggy source:
/** 
 * This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters. No indentation or whitespace should be outputted. Any user defined event type SHALL have this method called when being written to on an output stream. Built in Event types MUST implement this method, but implementations MAY choose not call these methods for optimizations reasons when writing out built in Events to an output stream. The output generated MUST be equivalent in terms of the infoset expressed.
 * @param writer The writer that will output the data
 * @throws XMLStreamException if there is a fatal error writing the event
 */
public void writeAsEncodedUnicode(Writer writer) throws javax.xml.stream.XMLStreamException ;

Fixed version (ground truth):
/** 
 * This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters. No indentation or whitespace should be outputted. Any user defined event type SHALL have this method called when being written to on an output stream. Built in Event types MUST implement this method, but implementations MAY choose not call these methods for optimizations reasons when writing out built in Events to an output stream. The output generated MUST be equivalent in terms of the infoset expressed.
 * @param writer The writer that will output the data
 * @throws javax.xml.stream.XMLStreamException if there is a fatal error writing the event
 */
public void writeAsEncodedUnicode(Writer writer) throws javax.xml.stream.XMLStreamException ;
Program: 35897
Project: 35897
Buggy source:
/** 
 * Transmits a control command to the terminal device. <p>This can be used to, for example, control terminal functions like a built-in PIN pad or biometrics.
 * @param controlCode the control code of the command
 * @param command the command data
 * @throws SecurityException if a SecurityManager exists and thecaller does not have the required {@linkplain CardPermission permission}
 * @throws NullPointerException if command is null
 * @throws CardException if the card operation failed
 * @throws IllegalStateException if this card object has been disposed ofvia the  {@linkplain #disconnect disconnect()} method
 */
public abstract byte[] transmitControlCommand(int controlCode,byte[] command) throws CardException ;

Fixed version (ground truth):
/** 
 * Transmits a control command to the terminal device. <p>This can be used to, for example, control terminal functions like a built-in PIN pad or biometrics.
 * @param controlCode the control code of the command
 * @param command the command data
 * @return the response from the terminal device
 * @throws SecurityException if a SecurityManager exists and thecaller does not have the required {@linkplain CardPermission permission}
 * @throws NullPointerException if command is null
 * @throws CardException if the card operation failed
 * @throws IllegalStateException if this card object has been disposed ofvia the  {@linkplain #disconnect disconnect()} method
 */
public abstract byte[] transmitControlCommand(int controlCode,byte[] command) throws CardException ;
Program: 35898
Project: 35898
Buggy source:
/** 
 * Returns the CardChannel for the basic logical channel. The basic logical channel has a channel number of 0.
 * @throws SecurityException if a SecurityManager exists and thecaller does not have the required {@linkplain CardPermission permission}
 * @throws IllegalStateException if this card object has been disposed ofvia the  {@linkplain #disconnect disconnect()} method
 */
public abstract CardChannel getBasicChannel();

Fixed version (ground truth):
/** 
 * Returns the CardChannel for the basic logical channel. The basic logical channel has a channel number of 0.
 * @return the CardChannel for the basic logical channel
 * @throws SecurityException if a SecurityManager exists and thecaller does not have the required {@linkplain CardPermission permission}
 * @throws IllegalStateException if this card object has been disposed ofvia the  {@linkplain #disconnect disconnect()} method
 */
public abstract CardChannel getBasicChannel();
Program: 35899
Project: 35899
Buggy source:
/** 
 * Opens a new logical channel to the card and returns it. The channel is opened by issuing a <code>MANAGE CHANNEL</code> command that should use the format <code>[00 70 00 00 01]</code>.
 * @throws SecurityException if a SecurityManager exists and thecaller does not have the required {@linkplain CardPermission permission}
 * @throws CardException is a new logical channel could not be opened
 * @throws IllegalStateException if this card object has been disposed ofvia the  {@linkplain #disconnect disconnect()} method
 */
public abstract CardChannel openLogicalChannel() throws CardException ;

Fixed version (ground truth):
/** 
 * Opens a new logical channel to the card and returns it. The channel is opened by issuing a <code>MANAGE CHANNEL</code> command that should use the format <code>[00 70 00 00 01]</code>.
 * @return the logical channel which has been opened
 * @throws SecurityException if a SecurityManager exists and thecaller does not have the required {@linkplain CardPermission permission}
 * @throws CardException is a new logical channel could not be opened
 * @throws IllegalStateException if this card object has been disposed ofvia the  {@linkplain #disconnect disconnect()} method
 */
public abstract CardChannel openLogicalChannel() throws CardException ;
Program: 35900
Project: 35900
Buggy source:
/** 
 * Establishes a connection to the card. If a connection has previously established using the specified protocol, this method returns the same Card object as the previous call.
 * @param protocol the protocol to use ("T=0", "T=1", or "T=CL"), or "*" toconnect using any available protocol.
 * @throws NullPointerException if protocol is null
 * @throws IllegalArgumentException if protocol is an invalid protocolspecification
 * @throws CardNotPresentException if no card is present in this terminal
 * @throws CardException if a connection could not be establishedusing the specified protocol or if a connection has previously been established using a different protocol
 * @throws SecurityException if a SecurityManager exists and thecaller does not have the required {@linkplain CardPermission permission}
 */
public abstract Card connect(String protocol) throws CardException ;

Fixed version (ground truth):
/** 
 * Establishes a connection to the card. If a connection has previously established using the specified protocol, this method returns the same Card object as the previous call.
 * @param protocol the protocol to use ("T=0", "T=1", or "T=CL"), or "*" toconnect using any available protocol.
 * @throws NullPointerException if protocol is null
 * @throws IllegalArgumentException if protocol is an invalid protocolspecification
 * @throws CardNotPresentException if no card is present in this terminal
 * @throws CardException if a connection could not be establishedusing the specified protocol or if a connection has previously been established using a different protocol
 * @throws SecurityException if a SecurityManager exists and thecaller does not have the required {@linkplain CardPermission permission}
 * @return the card the connection has been established with
 */
public abstract Card connect(String protocol) throws CardException ;
Program: 35901
Project: 35901
Buggy source:
/** 
 * Returns the terminal with the specified name or null if no such terminal exists.
 * @return the terminal with the specified name or null if no suchterminal exists.
 * @throws NullPointerException if name is null
 */
public CardTerminal getTerminal(String name){
  if (name == null) {
    throw new NullPointerException();
  }
  try {
    for (    CardTerminal terminal : list()) {
      if (terminal.getName().equals(name)) {
        return terminal;
      }
    }
    return null;
  }
 catch (  CardException e) {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Returns the terminal with the specified name or null if no such terminal exists.
 * @param name the terminal name
 * @return the terminal with the specified name or null if no suchterminal exists.
 * @throws NullPointerException if name is null
 */
public CardTerminal getTerminal(String name){
  if (name == null) {
    throw new NullPointerException();
  }
  try {
    for (    CardTerminal terminal : list()) {
      if (terminal.getName().equals(name)) {
        return terminal;
      }
    }
    return null;
  }
 catch (  CardException e) {
    return null;
  }
}
Program: 35902
Project: 35902
Buggy source:
/** 
 * Transmits a control command to the terminal device. <p>This can be used to, for example, control terminal functions like a built-in PIN pad or biometrics.
 * @param controlCode the control code of the command
 * @param command the command data
 * @throws SecurityException if a SecurityManager exists and thecaller does not have the required {@linkplain CardPermission permission}
 * @throws NullPointerException if command is null
 * @throws CardException if the card operation failed
 * @throws IllegalStateException if this card object has been disposed ofvia the  {@linkplain #disconnect disconnect()} method
 */
public abstract byte[] transmitControlCommand(int controlCode,byte[] command) throws CardException ;

Fixed version (ground truth):
/** 
 * Transmits a control command to the terminal device. <p>This can be used to, for example, control terminal functions like a built-in PIN pad or biometrics.
 * @param controlCode the control code of the command
 * @param command the command data
 * @return the response from the terminal device
 * @throws SecurityException if a SecurityManager exists and thecaller does not have the required {@linkplain CardPermission permission}
 * @throws NullPointerException if command is null
 * @throws CardException if the card operation failed
 * @throws IllegalStateException if this card object has been disposed ofvia the  {@linkplain #disconnect disconnect()} method
 */
public abstract byte[] transmitControlCommand(int controlCode,byte[] command) throws CardException ;
Program: 35903
Project: 35903
Buggy source:
/** 
 * Returns the CardChannel for the basic logical channel. The basic logical channel has a channel number of 0.
 * @throws SecurityException if a SecurityManager exists and thecaller does not have the required {@linkplain CardPermission permission}
 * @throws IllegalStateException if this card object has been disposed ofvia the  {@linkplain #disconnect disconnect()} method
 */
public abstract CardChannel getBasicChannel();

Fixed version (ground truth):
/** 
 * Returns the CardChannel for the basic logical channel. The basic logical channel has a channel number of 0.
 * @return the CardChannel for the basic logical channel
 * @throws SecurityException if a SecurityManager exists and thecaller does not have the required {@linkplain CardPermission permission}
 * @throws IllegalStateException if this card object has been disposed ofvia the  {@linkplain #disconnect disconnect()} method
 */
public abstract CardChannel getBasicChannel();
Program: 35904
Project: 35904
Buggy source:
/** 
 * Opens a new logical channel to the card and returns it. The channel is opened by issuing a <code>MANAGE CHANNEL</code> command that should use the format <code>[00 70 00 00 01]</code>.
 * @throws SecurityException if a SecurityManager exists and thecaller does not have the required {@linkplain CardPermission permission}
 * @throws CardException is a new logical channel could not be opened
 * @throws IllegalStateException if this card object has been disposed ofvia the  {@linkplain #disconnect disconnect()} method
 */
public abstract CardChannel openLogicalChannel() throws CardException ;

Fixed version (ground truth):
/** 
 * Opens a new logical channel to the card and returns it. The channel is opened by issuing a <code>MANAGE CHANNEL</code> command that should use the format <code>[00 70 00 00 01]</code>.
 * @return the logical channel which has been opened
 * @throws SecurityException if a SecurityManager exists and thecaller does not have the required {@linkplain CardPermission permission}
 * @throws CardException is a new logical channel could not be opened
 * @throws IllegalStateException if this card object has been disposed ofvia the  {@linkplain #disconnect disconnect()} method
 */
public abstract CardChannel openLogicalChannel() throws CardException ;
Program: 35905
Project: 35905
Buggy source:
/** 
 * Establishes a connection to the card. If a connection has previously established using the specified protocol, this method returns the same Card object as the previous call.
 * @param protocol the protocol to use ("T=0", "T=1", or "T=CL"), or "*" toconnect using any available protocol.
 * @throws NullPointerException if protocol is null
 * @throws IllegalArgumentException if protocol is an invalid protocolspecification
 * @throws CardNotPresentException if no card is present in this terminal
 * @throws CardException if a connection could not be establishedusing the specified protocol or if a connection has previously been established using a different protocol
 * @throws SecurityException if a SecurityManager exists and thecaller does not have the required {@linkplain CardPermission permission}
 */
public abstract Card connect(String protocol) throws CardException ;

Fixed version (ground truth):
/** 
 * Establishes a connection to the card. If a connection has previously established using the specified protocol, this method returns the same Card object as the previous call.
 * @param protocol the protocol to use ("T=0", "T=1", or "T=CL"), or "*" toconnect using any available protocol.
 * @throws NullPointerException if protocol is null
 * @throws IllegalArgumentException if protocol is an invalid protocolspecification
 * @throws CardNotPresentException if no card is present in this terminal
 * @throws CardException if a connection could not be establishedusing the specified protocol or if a connection has previously been established using a different protocol
 * @throws SecurityException if a SecurityManager exists and thecaller does not have the required {@linkplain CardPermission permission}
 * @return the card the connection has been established with
 */
public abstract Card connect(String protocol) throws CardException ;
Program: 35906
Project: 35906
Buggy source:
/** 
 * displays a dialog box describing an error which occurred.
 */
void displayErrorDialog(Window w,Throwable t){
  if (t instanceof NoDisplayException) {
    return;
  }
  displayErrorDialog(w,t.toString());
}

Fixed version (ground truth):
/** 
 * displays a dialog box describing an error which occurred.
 */
void displayErrorDialog(Window w,Throwable t){
  if (t instanceof NoDisplayException) {
    return;
  }
  if (t.getClass() == Exception.class) {
    displayErrorDialog(w,t.getLocalizedMessage());
  }
 else {
    displayErrorDialog(w,t.toString());
  }
}
Program: 35907
Project: 35907
Buggy source:
/** 
 * displays a dialog box describing an error which occurred.
 */
void displayErrorDialog(Window w,Throwable t){
  if (t instanceof NoDisplayException) {
    return;
  }
  displayErrorDialog(w,t.toString());
}

Fixed version (ground truth):
/** 
 * displays a dialog box describing an error which occurred.
 */
void displayErrorDialog(Window w,Throwable t){
  if (t instanceof NoDisplayException) {
    return;
  }
  if (t.getClass() == Exception.class) {
    displayErrorDialog(w,t.getLocalizedMessage());
  }
 else {
    displayErrorDialog(w,t.toString());
  }
}
Program: 35908
Project: 35908
Buggy source:
/** 
 * Returns an array of all the objects currently registered as <code><em>Foo</em>Listener</code>s upon this model. <code><em>Foo</em>Listener</code>s are registered using the <code>add<em>Foo</em>Listener</code> method. <p> You can specify the <code>listenerType</code> argument with a class literal, such as <code><em>Foo</em>Listener.class</code>. For example, you can query a list model <code>m</code> for its list data listeners with the following code: <pre>ListDataListener[] ldls = (ListDataListener[])(m.getListeners(ListDataListener.class));</pre> If no such listeners exist, this method returns an empty array.
 * @param listenerType  the type of listeners requested;this parameter should specify an interface that descends from <code>java.util.EventListener</code>
 * @return an array of all objects registered as<code><em>Foo</em>Listener</code>s on this model, or an empty array if no such listeners have been added
 * @exception ClassCastException if <code>listenerType</code> doesn'tspecify a class or interface that implements <code>java.util.EventListener</code>
 * @see #getListDataListeners
 * @since 1.3
 */
public <T extends EventListener>T[] getListeners(Class<T> listenerType){
  return listenerList.getListeners(listenerType);
}

Fixed version (ground truth):
/** 
 * Returns an array of all the objects currently registered as <code><em>Foo</em>Listener</code>s upon this model. <code><em>Foo</em>Listener</code>s are registered using the <code>add<em>Foo</em>Listener</code> method. <p> You can specify the <code>listenerType</code> argument with a class literal, such as <code><em>Foo</em>Listener.class</code>. For example, you can query a list model <code>m</code> for its list data listeners with the following code: <pre>ListDataListener[] ldls = (ListDataListener[])(m.getListeners(ListDataListener.class));</pre> If no such listeners exist, this method returns an empty array.
 * @param < T > the type of {@code EventListener} class being requested
 * @param listenerType  the type of listeners requested;this parameter should specify an interface that descends from <code>java.util.EventListener</code>
 * @return an array of all objects registered as<code><em>Foo</em>Listener</code>s on this model, or an empty array if no such listeners have been added
 * @exception ClassCastException if <code>listenerType</code> doesn'tspecify a class or interface that implements <code>java.util.EventListener</code>
 * @see #getListDataListeners
 * @since 1.3
 */
public <T extends EventListener>T[] getListeners(Class<T> listenerType){
  return listenerList.getListeners(listenerType);
}
Program: 35909
Project: 35909
Buggy source:
/** 
 * Returns the element at the specified position in this list. <p> Throws an <code>ArrayIndexOutOfBoundsException</code> if the index is out of range (<code>index &lt; 0 || index &gt;= size()</code>).
 * @param index index of element to return
 */
public E get(int index){
  return delegate.elementAt(index);
}

Fixed version (ground truth):
/** 
 * Returns the element at the specified position in this list. <p> Throws an <code>ArrayIndexOutOfBoundsException</code> if the index is out of range (<code>index &lt; 0 || index &gt;= size()</code>).
 * @param index index of element to return
 * @return the element at the specified position in this list
 */
public E get(int index){
  return delegate.elementAt(index);
}
Program: 35910
Project: 35910
Buggy source:
/** 
 * Returns an array of all the objects currently registered as <code><em>Foo</em>Listener</code>s upon this model. <code><em>Foo</em>Listener</code>s are registered using the <code>add<em>Foo</em>Listener</code> method. <p> You can specify the <code>listenerType</code> argument with a class literal, such as <code><em>Foo</em>Listener.class</code>. For example, you can query a <code>DefaultListSelectionModel</code> instance <code>m</code> for its list selection listeners with the following code: <pre>ListSelectionListener[] lsls = (ListSelectionListener[])(m.getListeners(ListSelectionListener.class));</pre> If no such listeners exist, this method returns an empty array.
 * @param listenerType  the type of listeners requested;this parameter should specify an interface that descends from <code>java.util.EventListener</code>
 * @return an array of all objects registered as<code><em>Foo</em>Listener</code>s on this model, or an empty array if no such listeners have been added
 * @exception ClassCastException if <code>listenerType</code> doesn'tspecify a class or interface that implements <code>java.util.EventListener</code>
 * @see #getListSelectionListeners
 * @since 1.3
 */
public <T extends EventListener>T[] getListeners(Class<T> listenerType){
  return listenerList.getListeners(listenerType);
}

Fixed version (ground truth):
/** 
 * Returns an array of all the objects currently registered as <code><em>Foo</em>Listener</code>s upon this model. <code><em>Foo</em>Listener</code>s are registered using the <code>add<em>Foo</em>Listener</code> method. <p> You can specify the <code>listenerType</code> argument with a class literal, such as <code><em>Foo</em>Listener.class</code>. For example, you can query a <code>DefaultListSelectionModel</code> instance <code>m</code> for its list selection listeners with the following code: <pre>ListSelectionListener[] lsls = (ListSelectionListener[])(m.getListeners(ListSelectionListener.class));</pre> If no such listeners exist, this method returns an empty array.
 * @param < T > the type of {@code EventListener} class being requested
 * @param listenerType  the type of listeners requested;this parameter should specify an interface that descends from <code>java.util.EventListener</code>
 * @return an array of all objects registered as<code><em>Foo</em>Listener</code>s on this model, or an empty array if no such listeners have been added
 * @exception ClassCastException if <code>listenerType</code> doesn'tspecify a class or interface that implements <code>java.util.EventListener</code>
 * @see #getListSelectionListeners
 * @since 1.3
 */
public <T extends EventListener>T[] getListeners(Class<T> listenerType){
  return listenerList.getListeners(listenerType);
}
Program: 35911
Project: 35911
Buggy source:
/** 
 * Sets the value of the leadAnchorNotificationEnabled flag.
 * @see #isLeadAnchorNotificationEnabled()
 */
public void setLeadAnchorNotificationEnabled(boolean flag){
  leadAnchorNotificationEnabled=flag;
}

Fixed version (ground truth):
/** 
 * Sets the value of the leadAnchorNotificationEnabled flag.
 * @param flag boolean value for {@code leadAnchorNotificationEnabled}
 * @see #isLeadAnchorNotificationEnabled()
 */
public void setLeadAnchorNotificationEnabled(boolean flag){
  leadAnchorNotificationEnabled=flag;
}
Program: 35912
Project: 35912
Buggy source:
/** 
 * Returns whether or not to convert the value to a string before doing comparisons when sorting.  If true <code>ModelWrapper.getStringValueAt</code> will be used, otherwise <code>ModelWrapper.getValueAt</code> will be used.  It is up to subclasses, such as <code>TableRowSorter</code>, to honor this value in their <code>ModelWrapper</code> implementation.
 * @param column the index of the column to test, in terms of theunderlying model
 * @throws IndexOutOfBoundsException if <code>column</code> is not valid
 */
protected boolean useToString(int column){
  return (getComparator(column) == null);
}

Fixed version (ground truth):
/** 
 * Returns whether or not to convert the value to a string before doing comparisons when sorting.  If true <code>ModelWrapper.getStringValueAt</code> will be used, otherwise <code>ModelWrapper.getValueAt</code> will be used.  It is up to subclasses, such as <code>TableRowSorter</code>, to honor this value in their <code>ModelWrapper</code> implementation.
 * @param column the index of the column to test, in terms of theunderlying model
 * @return true if values are to be converted to strings before doingcomparisons when sorting
 * @throws IndexOutOfBoundsException if <code>column</code> is not valid
 */
protected boolean useToString(int column){
  return (getComparator(column) == null);
}
Program: 35913
Project: 35913
Buggy source:
/** 
 * Gets this <code>InputMap</code>'s parent.
 * @return map  the <code>InputMap</code> that is the parent of this one,or null if this <code>InputMap</code> has no parent
 */
public InputMap getParent(){
  return parent;
}

Fixed version (ground truth):
/** 
 * Gets this   {@code InputMap}'s parent.
 * @return map the {@code InputMap} that is the parent of this one,or null if this  {@code InputMap} has no parent
 */
public InputMap getParent(){
  return parent;
}
Program: 35914
Project: 35914
Buggy source:
/** 
 * Returns the number of <code>KeyStroke</code> bindings.
 */
public int size(){
  if (arrayTable == null) {
    return 0;
  }
  return arrayTable.size();
}

Fixed version (ground truth):
/** 
 * Returns the number of   {@code KeyStroke} bindings.
 * @return the number of {@code KeyStroke} bindings
 */
public int size(){
  if (arrayTable == null) {
    return 0;
  }
  return arrayTable.size();
}
Program: 35915
Project: 35915
Buggy source:
/** 
 * Returns the <code>KeyStroke</code>s that are bound in this <code>InputMap</code>.
 */
public KeyStroke[] keys(){
  if (arrayTable == null) {
    return null;
  }
  KeyStroke[] keys=new KeyStroke[arrayTable.size()];
  arrayTable.getKeys(keys);
  return keys;
}

Fixed version (ground truth):
/** 
 * Returns the   {@code KeyStroke}s that are bound in this   {@code InputMap}.
 * @return an array of the {@code KeyStroke}s that are bound in this  {@code InputMap}
 */
public KeyStroke[] keys(){
  if (arrayTable == null) {
    return null;
  }
  KeyStroke[] keys=new KeyStroke[arrayTable.size()];
  arrayTable.getKeys(keys);
  return keys;
}
Program: 35916
Project: 35916
Buggy source:
/** 
 * Returns the binding for <code>keyStroke</code>, messaging the parent <code>InputMap</code> if the binding is not locally defined.
 */
public Object get(KeyStroke keyStroke){
  if (arrayTable == null) {
    InputMap parent=getParent();
    if (parent != null) {
      return parent.get(keyStroke);
    }
    return null;
  }
  Object value=arrayTable.get(keyStroke);
  if (value == null) {
    InputMap parent=getParent();
    if (parent != null) {
      return parent.get(keyStroke);
    }
  }
  return value;
}

Fixed version (ground truth):
/** 
 * Returns the binding for   {@code keyStroke}, messaging the parent   {@code InputMap} if the binding is not locally defined.
 * @param keyStroke the {@code KeyStroke} for which to get the binding
 * @return the binding for {@code keyStroke}
 */
public Object get(KeyStroke keyStroke){
  if (arrayTable == null) {
    InputMap parent=getParent();
    if (parent != null) {
      return parent.get(keyStroke);
    }
    return null;
  }
  Object value=arrayTable.get(keyStroke);
  if (value == null) {
    InputMap parent=getParent();
    if (parent != null) {
      return parent.get(keyStroke);
    }
  }
  return value;
}
Program: 35917
Project: 35917
Buggy source:
/** 
 * Removes all the mappings from this <code>InputMap</code>.
 */
public void clear(){
  if (arrayTable != null) {
    arrayTable.clear();
  }
}

Fixed version (ground truth):
/** 
 * Removes all the mappings from this   {@code InputMap}.
 */
public void clear(){
  if (arrayTable != null) {
    arrayTable.clear();
  }
}
Program: 35918
Project: 35918
Buggy source:
/** 
 * Returns an array of the <code>KeyStroke</code>s defined in this <code>InputMap</code> and its parent. This differs from <code>keys()</code> in that this method includes the keys defined in the parent.
 */
public KeyStroke[] allKeys(){
  int count=size();
  InputMap parent=getParent();
  if (count == 0) {
    if (parent != null) {
      return parent.allKeys();
    }
    return keys();
  }
  if (parent == null) {
    return keys();
  }
  KeyStroke[] keys=keys();
  KeyStroke[] pKeys=parent.allKeys();
  if (pKeys == null) {
    return keys;
  }
  if (keys == null) {
    return pKeys;
  }
  HashMap<KeyStroke,KeyStroke> keyMap=new HashMap<KeyStroke,KeyStroke>();
  int counter;
  for (counter=keys.length - 1; counter >= 0; counter--) {
    keyMap.put(keys[counter],keys[counter]);
  }
  for (counter=pKeys.length - 1; counter >= 0; counter--) {
    keyMap.put(pKeys[counter],pKeys[counter]);
  }
  KeyStroke[] allKeys=new KeyStroke[keyMap.size()];
  return keyMap.keySet().toArray(allKeys);
}

Fixed version (ground truth):
/** 
 * Returns an array of the   {@code KeyStroke}s defined in this  {@code InputMap} and its parent. This differs from {@code keys()}in that this method includes the keys defined in the parent.
 * @return an array of the {@code KeyStroke}s defined in this  {@code InputMap} and its parent
 */
public KeyStroke[] allKeys(){
  int count=size();
  InputMap parent=getParent();
  if (count == 0) {
    if (parent != null) {
      return parent.allKeys();
    }
    return keys();
  }
  if (parent == null) {
    return keys();
  }
  KeyStroke[] keys=keys();
  KeyStroke[] pKeys=parent.allKeys();
  if (pKeys == null) {
    return keys;
  }
  if (keys == null) {
    return pKeys;
  }
  HashMap<KeyStroke,KeyStroke> keyMap=new HashMap<KeyStroke,KeyStroke>();
  int counter;
  for (counter=keys.length - 1; counter >= 0; counter--) {
    keyMap.put(keys[counter],keys[counter]);
  }
  for (counter=pKeys.length - 1; counter >= 0; counter--) {
    keyMap.put(pKeys[counter],pKeys[counter]);
  }
  KeyStroke[] allKeys=new KeyStroke[keyMap.size()];
  return keyMap.keySet().toArray(allKeys);
}
Program: 35919
Project: 35919
Buggy source:
/** 
 * Creates an <code>InputMap</code> with no parent and no mappings.
 */
public InputMap(){
}

Fixed version (ground truth):
/** 
 * Creates an   {@code InputMap} with no parent and no mappings.
 */
public InputMap(){
}
Program: 35920
Project: 35920
Buggy source:
/** 
 * Sets this <code>InputMap</code>'s parent.
 * @param map  the <code>InputMap</code> that is the parent of this one
 */
public void setParent(InputMap map){
  this.parent=map;
}

Fixed version (ground truth):
/** 
 * Sets this   {@code InputMap}'s parent.
 * @param map the {@code InputMap} that is the parent of this one
 */
public void setParent(InputMap map){
  this.parent=map;
}
Program: 35921
Project: 35921
Buggy source:
/** 
 * Adds a binding for <code>keyStroke</code> to <code>actionMapKey</code>. If <code>actionMapKey</code> is null, this removes the current binding for <code>keyStroke</code>.
 */
public void put(KeyStroke keyStroke,Object actionMapKey){
  if (keyStroke == null) {
    return;
  }
  if (actionMapKey == null) {
    remove(keyStroke);
  }
 else {
    if (arrayTable == null) {
      arrayTable=new ArrayTable();
    }
    arrayTable.put(keyStroke,actionMapKey);
  }
}

Fixed version (ground truth):
/** 
 * Adds a binding for   {@code keyStroke} to {@code actionMapKey}. If   {@code actionMapKey} is null, this removes the current bindingfor  {@code keyStroke}.
 * @param keyStroke a {@code KeyStroke}
 * @param actionMapKey an action map key
 */
public void put(KeyStroke keyStroke,Object actionMapKey){
  if (keyStroke == null) {
    return;
  }
  if (actionMapKey == null) {
    remove(keyStroke);
  }
 else {
    if (arrayTable == null) {
      arrayTable=new ArrayTable();
    }
    arrayTable.put(keyStroke,actionMapKey);
  }
}
Program: 35922
Project: 35922
Buggy source:
/** 
 * Removes the binding for <code>key</code> from this <code>InputMap</code>.
 */
public void remove(KeyStroke key){
  if (arrayTable != null) {
    arrayTable.remove(key);
  }
}

Fixed version (ground truth):
/** 
 * Removes the binding for   {@code key} from this {@code InputMap}.
 * @param key the {@code KeyStroke} for which to remove the binding
 */
public void remove(KeyStroke key){
  if (arrayTable != null) {
    arrayTable.remove(key);
  }
}
Program: 35923
Project: 35923
Buggy source:
/** 
 * Returns the currently registered <code>EditorKit</code> class name for the type <code>type</code>.
 * @param type  the non-<code>null</code> content type
 * @since 1.3
 */
public static String getEditorKitClassNameForContentType(String type){
  return getKitTypeRegistry().get(type);
}

Fixed version (ground truth):
/** 
 * Returns the currently registered   {@code EditorKit} class name for thetype  {@code type}.
 * @param type  the non-{@code null} content type
 * @return a {@code String} containing the {@code EditorKit} class namefor  {@code type}
 * @since 1.3
 */
public static String getEditorKitClassNameForContentType(String type){
  return getKitTypeRegistry().get(type);
}
Program: 35924
Project: 35924
Buggy source:
/** 
 * Returns an array of all the objects currently registered as <code><em>Foo</em>Listener</code>s upon this model. <code><em>Foo</em>Listener</code>s are registered using the <code>add<em>Foo</em>Listener</code> method. <p> You can specify the <code>listenerType</code> argument with a class literal, such as <code><em>Foo</em>Listener.class</code>. For example, you can query a list model <code>m</code> for its list data listeners with the following code: <pre>ListDataListener[] ldls = (ListDataListener[])(m.getListeners(ListDataListener.class));</pre> If no such listeners exist, this method returns an empty array.
 * @param listenerType  the type of listeners requested;this parameter should specify an interface that descends from <code>java.util.EventListener</code>
 * @return an array of all objects registered as<code><em>Foo</em>Listener</code>s on this model, or an empty array if no such listeners have been added
 * @exception ClassCastException if <code>listenerType</code> doesn'tspecify a class or interface that implements <code>java.util.EventListener</code>
 * @see #getListDataListeners
 * @since 1.3
 */
public <T extends EventListener>T[] getListeners(Class<T> listenerType){
  return listenerList.getListeners(listenerType);
}

Fixed version (ground truth):
/** 
 * Returns an array of all the objects currently registered as <code><em>Foo</em>Listener</code>s upon this model. <code><em>Foo</em>Listener</code>s are registered using the <code>add<em>Foo</em>Listener</code> method. <p> You can specify the <code>listenerType</code> argument with a class literal, such as <code><em>Foo</em>Listener.class</code>. For example, you can query a list model <code>m</code> for its list data listeners with the following code: <pre>ListDataListener[] ldls = (ListDataListener[])(m.getListeners(ListDataListener.class));</pre> If no such listeners exist, this method returns an empty array.
 * @param < T > the type of {@code EventListener} class being requested
 * @param listenerType  the type of listeners requested;this parameter should specify an interface that descends from <code>java.util.EventListener</code>
 * @return an array of all objects registered as<code><em>Foo</em>Listener</code>s on this model, or an empty array if no such listeners have been added
 * @exception ClassCastException if <code>listenerType</code> doesn'tspecify a class or interface that implements <code>java.util.EventListener</code>
 * @see #getListDataListeners
 * @since 1.3
 */
public <T extends EventListener>T[] getListeners(Class<T> listenerType){
  return listenerList.getListeners(listenerType);
}
Program: 35925
Project: 35925
Buggy source:
/** 
 * Returns true to indicate that editing has begun.
 * @param anEvent          the event
 */
public boolean startCellEditing(EventObject anEvent){
  return true;
}

Fixed version (ground truth):
/** 
 * Returns true to indicate that editing has begun.
 * @param anEvent          the event
 * @return true to indicate editing has begun
 */
public boolean startCellEditing(EventObject anEvent){
  return true;
}
Program: 35926
Project: 35926
Buggy source:
/** 
 * Sets that the component has been iconized and the bounds of the <code>desktopIcon</code> are valid.
 */
protected void setWasIcon(JInternalFrame f,Boolean value){
  if (value != null) {
    f.putClientProperty(HAS_BEEN_ICONIFIED_PROPERTY,value);
  }
}

Fixed version (ground truth):
/** 
 * Sets that the component has been iconized and the bounds of the <code>desktopIcon</code> are valid.
 * @param f     the {@code JInternalFrame} of interest
 * @param value a {@code Boolean} signifying if component has been iconized
 */
protected void setWasIcon(JInternalFrame f,Boolean value){
  if (value != null) {
    f.putClientProperty(HAS_BEEN_ICONIFIED_PROPERTY,value);
  }
}
Program: 35927
Project: 35927
Buggy source:
/** 
 * Convenience method to remove the desktopIcon of <b>f</b> is necessary. 
 */
protected void removeIconFor(JInternalFrame f){
  JInternalFrame.JDesktopIcon di=f.getDesktopIcon();
  Container c=di.getParent();
  if (c != null) {
    c.remove(di);
    c.repaint(di.getX(),di.getY(),di.getWidth(),di.getHeight());
  }
}

Fixed version (ground truth):
/** 
 * Convenience method to remove the desktopIcon of <b>f</b> is necessary.
 * @param f the {@code JInternalFrame} for which to remove the{@code desktopIcon}
 */
protected void removeIconFor(JInternalFrame f){
  JInternalFrame.JDesktopIcon di=f.getDesktopIcon();
  Container c=di.getParent();
  if (c != null) {
    c.remove(di);
    c.repaint(di.getX(),di.getY(),di.getWidth(),di.getHeight());
  }
}
Program: 35929
Project: 35929
Buggy source:
/** 
 * Returns an array of all the objects currently registered as <code><em>Foo</em>Listener</code>s upon this model. <code><em>Foo</em>Listener</code>s are registered using the <code>add<em>Foo</em>Listener</code> method. <p> You can specify the <code>listenerType</code> argument with a class literal, such as <code><em>Foo</em>Listener.class</code>. For example, you can query a <code>DefaultListSelectionModel</code> instance <code>m</code> for its list selection listeners with the following code: <pre>ListSelectionListener[] lsls = (ListSelectionListener[])(m.getListeners(ListSelectionListener.class));</pre> If no such listeners exist, this method returns an empty array.
 * @param listenerType  the type of listeners requested;this parameter should specify an interface that descends from <code>java.util.EventListener</code>
 * @return an array of all objects registered as<code><em>Foo</em>Listener</code>s on this model, or an empty array if no such listeners have been added
 * @exception ClassCastException if <code>listenerType</code> doesn'tspecify a class or interface that implements <code>java.util.EventListener</code>
 * @see #getListSelectionListeners
 * @since 1.3
 */
public <T extends EventListener>T[] getListeners(Class<T> listenerType){
  return listenerList.getListeners(listenerType);
}

Fixed version (ground truth):
/** 
 * Returns an array of all the objects currently registered as <code><em>Foo</em>Listener</code>s upon this model. <code><em>Foo</em>Listener</code>s are registered using the <code>add<em>Foo</em>Listener</code> method. <p> You can specify the <code>listenerType</code> argument with a class literal, such as <code><em>Foo</em>Listener.class</code>. For example, you can query a <code>DefaultListSelectionModel</code> instance <code>m</code> for its list selection listeners with the following code: <pre>ListSelectionListener[] lsls = (ListSelectionListener[])(m.getListeners(ListSelectionListener.class));</pre> If no such listeners exist, this method returns an empty array.
 * @param < T > the type of {@code EventListener} class being requested
 * @param listenerType  the type of listeners requested;this parameter should specify an interface that descends from <code>java.util.EventListener</code>
 * @return an array of all objects registered as<code><em>Foo</em>Listener</code>s on this model, or an empty array if no such listeners have been added
 * @exception ClassCastException if <code>listenerType</code> doesn'tspecify a class or interface that implements <code>java.util.EventListener</code>
 * @see #getListSelectionListeners
 * @since 1.3
 */
public <T extends EventListener>T[] getListeners(Class<T> listenerType){
  return listenerList.getListeners(listenerType);
}
Program: 35930
Project: 35930
Buggy source:
/** 
 * Sets the value of the leadAnchorNotificationEnabled flag.
 * @see #isLeadAnchorNotificationEnabled()
 */
public void setLeadAnchorNotificationEnabled(boolean flag){
  leadAnchorNotificationEnabled=flag;
}

Fixed version (ground truth):
/** 
 * Sets the value of the leadAnchorNotificationEnabled flag.
 * @param flag boolean value for {@code leadAnchorNotificationEnabled}
 * @see #isLeadAnchorNotificationEnabled()
 */
public void setLeadAnchorNotificationEnabled(boolean flag){
  leadAnchorNotificationEnabled=flag;
}
Program: 35931
Project: 35931
Buggy source:
/** 
 * Returns whether or not to convert the value to a string before doing comparisons when sorting.  If true <code>ModelWrapper.getStringValueAt</code> will be used, otherwise <code>ModelWrapper.getValueAt</code> will be used.  It is up to subclasses, such as <code>TableRowSorter</code>, to honor this value in their <code>ModelWrapper</code> implementation.
 * @param column the index of the column to test, in terms of theunderlying model
 * @throws IndexOutOfBoundsException if <code>column</code> is not valid
 */
protected boolean useToString(int column){
  return (getComparator(column) == null);
}

Fixed version (ground truth):
/** 
 * Returns whether or not to convert the value to a string before doing comparisons when sorting.  If true <code>ModelWrapper.getStringValueAt</code> will be used, otherwise <code>ModelWrapper.getValueAt</code> will be used.  It is up to subclasses, such as <code>TableRowSorter</code>, to honor this value in their <code>ModelWrapper</code> implementation.
 * @param column the index of the column to test, in terms of theunderlying model
 * @return true if values are to be converted to strings before doingcomparisons when sorting
 * @throws IndexOutOfBoundsException if <code>column</code> is not valid
 */
protected boolean useToString(int column){
  return (getComparator(column) == null);
}
Program: 35932
Project: 35932
Buggy source:
/** 
 * Gets this <code>InputMap</code>'s parent.
 * @return map  the <code>InputMap</code> that is the parent of this one,or null if this <code>InputMap</code> has no parent
 */
public InputMap getParent(){
  return parent;
}

Fixed version (ground truth):
/** 
 * Gets this   {@code InputMap}'s parent.
 * @return map the {@code InputMap} that is the parent of this one,or null if this  {@code InputMap} has no parent
 */
public InputMap getParent(){
  return parent;
}
Program: 35933
Project: 35933
Buggy source:
/** 
 * Returns the number of <code>KeyStroke</code> bindings.
 */
public int size(){
  if (arrayTable == null) {
    return 0;
  }
  return arrayTable.size();
}

Fixed version (ground truth):
/** 
 * Returns the number of   {@code KeyStroke} bindings.
 * @return the number of {@code KeyStroke} bindings
 */
public int size(){
  if (arrayTable == null) {
    return 0;
  }
  return arrayTable.size();
}