nus-yam/ex-repair huggingface dataset:
Program: 78559
Project: 78559
Buggy source:
/** 
 * Utility routine to check if the InetAddress in a wildcard address.
 * @return a {@code boolean} indicating if the Inetaddress isa wildcard address.
 * @since 1.4
 */
@Override public boolean isAnyLocalAddress(){
  return holder6.isAnyLocalAddress();
}

Fixed version (ground truth):
/** 
 * Utility routine to check if the InetAddress is a wildcard address.
 * @return a {@code boolean} indicating if the Inetaddress isa wildcard address.
 * @since 1.4
 */
@Override public boolean isAnyLocalAddress(){
  return holder6.isAnyLocalAddress();
}
Program: 78560
Project: 78560
Buggy source:
/** 
 * Utility routine to check if the InetAddress in a wildcard address.
 * @return a {@code boolean} indicating if the Inetaddress isa wildcard address.
 * @since 1.4
 */
public boolean isAnyLocalAddress(){
  return false;
}

Fixed version (ground truth):
/** 
 * Utility routine to check if the InetAddress is a wildcard address.
 * @return a {@code boolean} indicating if the Inetaddress isa wildcard address.
 * @since 1.4
 */
public boolean isAnyLocalAddress(){
  return false;
}
Program: 78562
Project: 78562
Buggy source:
/** 
 * Returns an output stream for this socket. <p> If this socket has an associated channel then the resulting output stream delegates all of its operations to the channel.  If the channel is in non-blocking mode then the output stream's   {@code write}operations will throw an   {@link java.nio.channels.IllegalBlockingModeException}. <p> Closing the returned   {@link java.io.OutputStream OutputStream}will close the associated socket.
 * @return     an output stream for writing bytes to this socket.
 * @exception IOException  if an I/O error occurs when creating theoutput stream or if the socket is not connected.
 * @revised 1.4
 * @spec JSR-51
 */
public OutputStream getOutputStream() throws IOException {
  if (isClosed())   throw new SocketException("String_Node_Str");
  if (!isConnected())   throw new SocketException("String_Node_Str");
  if (isOutputShutdown())   throw new SocketException("String_Node_Str");
  final Socket s=this;
  OutputStream os=null;
  try {
    os=AccessController.doPrivileged(new PrivilegedExceptionAction<>(){
      public OutputStream run() throws IOException {
        return impl.getOutputStream();
      }
    }
);
  }
 catch (  java.security.PrivilegedActionException e) {
    throw (IOException)e.getException();
  }
  return os;
}

Fixed version (ground truth):
/** 
 * Returns an output stream for this socket. <p> If this socket has an associated channel then the resulting output stream delegates all of its operations to the channel.  If the channel is in non-blocking mode then the output stream's   {@code write}operations will throw an   {@link java.nio.channels.IllegalBlockingModeException}. <p> Closing the returned   {@link java.io.OutputStream OutputStream}will close the associated socket.
 * @return     an output stream for writing bytes to this socket.
 * @exception IOException  if an I/O error occurs when creating theoutput stream or if the socket is not connected.
 * @revised 1.4
 * @spec JSR-51
 */
public OutputStream getOutputStream() throws IOException {
  if (isClosed())   throw new SocketException("String_Node_Str");
  if (!isConnected())   throw new SocketException("String_Node_Str");
  if (isOutputShutdown())   throw new SocketException("String_Node_Str");
  OutputStream os=null;
  try {
    os=AccessController.doPrivileged(new PrivilegedExceptionAction<>(){
      public OutputStream run() throws IOException {
        return impl.getOutputStream();
      }
    }
);
  }
 catch (  java.security.PrivilegedActionException e) {
    throw (IOException)e.getException();
  }
  return os;
}
Program: 78563
Project: 78563
Buggy source:
/** 
 * extract the root name from a versioned entry name given inode for META-INF/versions/9/foo/bar.class and prefix META-INF/versions/9/ returns foo/bar.class
 */
private byte[] getRootName(IndexNode prefix,IndexNode inode){
  int offset=prefix.name.length;
  byte[] fullName=inode.name;
  return Arrays.copyOfRange(fullName,offset,fullName.length);
}

Fixed version (ground truth):
/** 
 * extract the root name from a versioned entry name given inode for META-INF/versions/9/foo/bar.class and prefix META-INF/versions/9/ returns foo/bar.class
 */
private byte[] getRootName(IndexNode prefix,IndexNode inode){
  int offset=prefix.name.length - 1;
  byte[] fullName=inode.name;
  return Arrays.copyOfRange(fullName,offset,fullName.length);
}
Program: 78564
Project: 78564
Buggy source:
public int method(){
  return e.method;
}

Fixed version (ground truth):
public int method();
Program: 78565
Project: 78565
Buggy source:
public long compressedSize(){
  return e.csize;
}

Fixed version (ground truth):
public long compressedSize();
Program: 78566
Project: 78566
Buggy source:
public long crc(){
  return e.crc;
}

Fixed version (ground truth):
public long crc();
Program: 78567
Project: 78567
Buggy source:
public byte[] extra(){
  if (e.extra != null)   return Arrays.copyOf(e.extra,e.extra.length);
  return null;
}

Fixed version (ground truth):
public byte[] extra();
Program: 78568
Project: 78568
Buggy source:
public byte[] comment(){
  if (e.comment != null)   return Arrays.copyOf(e.comment,e.comment.length);
  return null;
}

Fixed version (ground truth):
public byte[] comment();
Program: 78569
Project: 78569
Buggy source:
public String toString(){
  StringBuilder sb=new StringBuilder(1024);
  Formatter fm=new Formatter(sb);
  if (creationTime() != null)   fm.format("String_Node_Str",creationTime().toMillis());
 else   fm.format("String_Node_Str");
  if (lastAccessTime() != null)   fm.format("String_Node_Str",lastAccessTime().toMillis());
 else   fm.format("String_Node_Str");
  fm.format("String_Node_Str",lastModifiedTime().toMillis());
  fm.format("String_Node_Str",isRegularFile());
  fm.format("String_Node_Str",isDirectory());
  fm.format("String_Node_Str",isSymbolicLink());
  fm.format("String_Node_Str",isOther());
  fm.format("String_Node_Str",fileKey());
  fm.format("String_Node_Str",size());
  fm.format("String_Node_Str",compressedSize());
  fm.format("String_Node_Str",crc());
  fm.format("String_Node_Str",method());
  fm.close();
  return sb.toString();
}

Fixed version (ground truth):
public String toString();
Program: 78570
Project: 78570
Buggy source:
@Override <V extends Number,A>Future<V> implRead(boolean isScatteringRead,ByteBuffer dst,ByteBuffer[] dsts,long timeout,TimeUnit unit,A attachment,CompletionHandler<V,? super A> handler){
  PendingFuture<V,A> result=new PendingFuture<V,A>(this,handler,attachment);
  ByteBuffer[] bufs;
  if (isScatteringRead) {
    bufs=dsts;
  }
 else {
    bufs=new ByteBuffer[1];
    bufs[0]=dst;
  }
  final ReadTask<V,A> readTask=new ReadTask<V,A>(bufs,isScatteringRead,result);
  result.setContext(readTask);
  if (timeout > 0L) {
    Future<?> timeoutTask=iocp.schedule(new Runnable(){
      public void run(){
        readTask.timeout();
      }
    }
,timeout,unit);
    result.setTimeoutTask(timeoutTask);
  }
  if (Iocp.supportsThreadAgnosticIo()) {
    readTask.run();
  }
 else {
    Invoker.invokeOnThreadInThreadPool(this,readTask);
  }
  return result;
}

Fixed version (ground truth):
@Override <V extends Number,A>Future<V> implRead(boolean isScatteringRead,ByteBuffer dst,ByteBuffer[] dsts,long timeout,TimeUnit unit,A attachment,CompletionHandler<V,? super A> handler){
  PendingFuture<V,A> result=new PendingFuture<V,A>(this,handler,attachment);
  ByteBuffer[] bufs;
  if (isScatteringRead) {
    bufs=dsts;
  }
 else {
    bufs=new ByteBuffer[1];
    bufs[0]=dst;
  }
  final ReadTask<V,A> readTask=new ReadTask<V,A>(bufs,isScatteringRead,result);
  result.setContext(readTask);
  if (timeout > 0L) {
    Future<?> timeoutTask=iocp.schedule(new Runnable(){
      public void run(){
        readTask.timeout();
      }
    }
,timeout,unit);
    result.setTimeoutTask(timeoutTask);
  }
  readTask.run();
  return result;
}
Program: 78571
Project: 78571
Buggy source:
@Override <V extends Number,A>Future<V> implWrite(boolean gatheringWrite,ByteBuffer src,ByteBuffer[] srcs,long timeout,TimeUnit unit,A attachment,CompletionHandler<V,? super A> handler){
  PendingFuture<V,A> result=new PendingFuture<V,A>(this,handler,attachment);
  ByteBuffer[] bufs;
  if (gatheringWrite) {
    bufs=srcs;
  }
 else {
    bufs=new ByteBuffer[1];
    bufs[0]=src;
  }
  final WriteTask<V,A> writeTask=new WriteTask<V,A>(bufs,gatheringWrite,result);
  result.setContext(writeTask);
  if (timeout > 0L) {
    Future<?> timeoutTask=iocp.schedule(new Runnable(){
      public void run(){
        writeTask.timeout();
      }
    }
,timeout,unit);
    result.setTimeoutTask(timeoutTask);
  }
  if (Iocp.supportsThreadAgnosticIo()) {
    writeTask.run();
  }
 else {
    Invoker.invokeOnThreadInThreadPool(this,writeTask);
  }
  return result;
}

Fixed version (ground truth):
@Override <V extends Number,A>Future<V> implWrite(boolean gatheringWrite,ByteBuffer src,ByteBuffer[] srcs,long timeout,TimeUnit unit,A attachment,CompletionHandler<V,? super A> handler){
  PendingFuture<V,A> result=new PendingFuture<V,A>(this,handler,attachment);
  ByteBuffer[] bufs;
  if (gatheringWrite) {
    bufs=srcs;
  }
 else {
    bufs=new ByteBuffer[1];
    bufs[0]=src;
  }
  final WriteTask<V,A> writeTask=new WriteTask<V,A>(bufs,gatheringWrite,result);
  result.setContext(writeTask);
  if (timeout > 0L) {
    Future<?> timeoutTask=iocp.schedule(new Runnable(){
      public void run(){
        writeTask.timeout();
      }
    }
,timeout,unit);
    result.setTimeoutTask(timeoutTask);
  }
  writeTask.run();
  return result;
}
Program: 78572
Project: 78572
Buggy source:
/** 
 * Constructs an instance with the given file descriptor.
 */
PlainSocketImpl(FileDescriptor fd){
  if (useDualStackImpl) {
    impl=new DualStackPlainSocketImpl(fd,exclusiveBind);
  }
 else {
    impl=new TwoStacksPlainSocketImpl(fd,exclusiveBind);
  }
}

Fixed version (ground truth):
/** 
 * Constructs an instance with the given file descriptor.
 */
PlainSocketImpl(FileDescriptor fd){
  if (!preferIPv4Stack) {
    impl=new DualStackPlainSocketImpl(fd,exclusiveBind);
  }
 else {
    impl=new TwoStacksPlainSocketImpl(fd,exclusiveBind);
  }
}
Program: 78573
Project: 78573
Buggy source:
@Override public Type add(final MethodVisitor method,final int programPoint){
  if (programPoint == INVALID_PROGRAM_POINT) {
    method.visitInsn(IADD);
  }
 else {
    method.visitInvokeDynamicInsn("String_Node_Str","String_Node_Str",MATHBOOTSTRAP,programPoint);
  }
  return INT;
}

Fixed version (ground truth):
@Override public Type add(final MethodVisitor method,final int programPoint){
  return Type.INT.add(method,programPoint);
}
Program: 78574
Project: 78574
Buggy source:
@Override public Type add(final MethodVisitor method,final int programPoint){
  if (programPoint == INVALID_PROGRAM_POINT) {
    method.visitInsn(IADD);
  }
 else {
    method.visitInvokeDynamicInsn("String_Node_Str","String_Node_Str",MATHBOOTSTRAP,programPoint);
  }
  return INT;
}

Fixed version (ground truth):
@Override public Type add(final MethodVisitor method,final int programPoint){
  if (programPoint == INVALID_PROGRAM_POINT) {
    method.visitInsn(IADD);
  }
 else {
    ldc(method,programPoint);
    JSType.ADD_EXACT.invoke(method);
  }
  return INT;
}
Program: 78575
Project: 78575
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: 78576
Project: 78576
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: 78577
Project: 78577
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: 78578
Project: 78578
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: 78579
Project: 78579
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: 78580
Project: 78580
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: 78581
Project: 78581
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: 78582
Project: 78582
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: 78583
Project: 78583
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: 78584
Project: 78584
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: 78585
Project: 78585
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: 78586
Project: 78586
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: 78587
Project: 78587
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: 78588
Project: 78588
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: 78589
Project: 78589
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: 78590
Project: 78590
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: 78591
Project: 78591
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: 78592
Project: 78592
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: 78594
Project: 78594
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: 78595
Project: 78595
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: 78596
Project: 78596
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: 78597
Project: 78597
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: 78598
Project: 78598
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: 78599
Project: 78599
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: 78600
Project: 78600
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: 78601
Project: 78601
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: 78602
Project: 78602
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: 78603
Project: 78603
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: 78604
Project: 78604
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: 78605
Project: 78605
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: 78606
Project: 78606
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: 78607
Project: 78607
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: 78608
Project: 78608
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: 78609
Project: 78609
Buggy source:
/** 
 * Returns the ancestor that the event actually occurred on.
 */
public Container getAncestor(){
  return ancestor;
}

Fixed version (ground truth):
/** 
 * Returns the ancestor that the event actually occurred on.
 * @return the {@code Container} object specifying the ancestor component
 */
public Container getAncestor(){
  return ancestor;
}
Program: 78610
Project: 78610
Buggy source:
/** 
 * Returns the parent of the ancestor the event actually occurred on. This is most interesting in an ANCESTOR_REMOVED event, as the ancestor may no longer be in the component hierarchy.
 */
public Container getAncestorParent(){
  return ancestorParent;
}

Fixed version (ground truth):
/** 
 * Returns the parent of the ancestor the event actually occurred on. This is most interesting in an ANCESTOR_REMOVED event, as the ancestor may no longer be in the component hierarchy.
 * @return the {@code Container} object specifying the ancestor's parent
 */
public Container getAncestorParent(){
  return ancestorParent;
}
Program: 78611
Project: 78611
Buggy source:
/** 
 * Returns the component that the listener was added to.
 */
public JComponent getComponent(){
  return (JComponent)getSource();
}

Fixed version (ground truth):
/** 
 * Returns the component that the listener was added to.
 * @return the {@code JComponent} on which the event occurred
 */
public JComponent getComponent(){
  return (JComponent)getSource();
}
Program: 78612
Project: 78612
Buggy source:
/** 
 * Called when the source or one of its ancestors is made visible either by setVisible(true) being called or by its being added to the component hierarchy.  The method is only called if the source has actually become visible.  For this to be true all its parents must be visible and it must be in a hierarchy rooted at a Window
 */
public void ancestorAdded(AncestorEvent event);

Fixed version (ground truth):
/** 
 * Called when the source or one of its ancestors is made visible either by setVisible(true) being called or by its being added to the component hierarchy.  The method is only called if the source has actually become visible.  For this to be true all its parents must be visible and it must be in a hierarchy rooted at a Window
 * @param event an {@code AncestorEvent} signifying a change in anancestor-component's display-status
 */
public void ancestorAdded(AncestorEvent event);
Program: 78613
Project: 78613
Buggy source:
/** 
 * Called when either the source or one of its ancestors is moved.
 */
public void ancestorMoved(AncestorEvent event);

Fixed version (ground truth):
/** 
 * Called when either the source or one of its ancestors is moved.
 * @param event an {@code AncestorEvent} signifying a change in anancestor-component's display-status
 */
public void ancestorMoved(AncestorEvent event);
Program: 78614
Project: 78614
Buggy source:
/** 
 * Called when the source or one of its ancestors is made invisible either by setVisible(false) being called or by its being remove from the component hierarchy.  The method is only called if the source has actually become invisible.  For this to be true at least one of its parents must by invisible or it is not in a hierarchy rooted at a Window
 */
public void ancestorRemoved(AncestorEvent event);

Fixed version (ground truth):
/** 
 * Called when the source or one of its ancestors is made invisible either by setVisible(false) being called or by its being remove from the component hierarchy.  The method is only called if the source has actually become invisible.  For this to be true at least one of its parents must by invisible or it is not in a hierarchy rooted at a Window
 * @param event an {@code AncestorEvent} signifying a change in anancestor-component's display-status
 */
public void ancestorRemoved(AncestorEvent event);
Program: 78615
Project: 78615
Buggy source:
/** 
 * This tells the listeners the editor has ended editing 
 */
public void editingStopped(ChangeEvent e);

Fixed version (ground truth):
/** 
 * This tells the listeners the editor has ended editing
 * @param e the {@code ChangeEvent} containing the source of the event
 */
public void editingStopped(ChangeEvent e);
Program: 78616
Project: 78616
Buggy source:
/** 
 * This tells the listeners the editor has canceled editing 
 */
public void editingCanceled(ChangeEvent e);

Fixed version (ground truth):
/** 
 * This tells the listeners the editor has canceled editing
 * @param e the {@code ChangeEvent} containing the source of the event
 */
public void editingCanceled(ChangeEvent e);