nus-yam/ex-repair huggingface dataset:
Program: 77391
Project: 77391
Buggy source:
/** 
 * Returns the list of the platform MXBean proxies for forwarding the method calls of the   {@code mxbeanInterface}through the given   {@code MBeanServerConnection}. The returned list may contain zero, one, or more instances. The number of instances in the returned list is defined in the specification of the given management interface. The order is undefined and there is no guarantee that the list returned is in the same order as previous invocations.
 * @param connection the {@code MBeanServerConnection} to forward to.
 * @param mxbeanInterface a management interface for a platformMXBean
 * @return the list of platform MXBean proxies forforwarding the method calls of the  {@code mxbeanInterface}through the given   {@code MBeanServerConnection}.
 * @throws IllegalArgumentException if {@code mxbeanInterface}is not a platform management interface.
 * @throws java.io.IOException if a communication problemoccurred when accessing the  {@code MBeanServerConnection}.
 * @see #newPlatformMXBeanProxy
 * @since 1.7
 */
public static <T extends PlatformManagedObject>List<T> getPlatformMXBeans(MBeanServerConnection connection,Class<T> mxbeanInterface) throws java.io.IOException {
  PlatformComponent pc=PlatformComponent.getPlatformComponent(mxbeanInterface);
  if (pc == null) {
    throw new IllegalArgumentException(mxbeanInterface.getName() + "String_Node_Str");
  }
  return Collections.unmodifiableList(pc.getMXBeans(connection,mxbeanInterface));
}

Fixed version (ground truth):
/** 
 * Returns the list of the platform MXBean proxies for forwarding the method calls of the   {@code mxbeanInterface}through the given   {@code MBeanServerConnection}. The returned list may contain zero, one, or more instances. The number of instances in the returned list is defined in the specification of the given management interface. The order is undefined and there is no guarantee that the list returned is in the same order as previous invocations.
 * @param connection the {@code MBeanServerConnection} to forward to.
 * @param mxbeanInterface a management interface for a platformMXBean
 * @param < T > an {@code mxbeanInterface} type parameter
 * @return the list of platform MXBean proxies forforwarding the method calls of the  {@code mxbeanInterface}through the given   {@code MBeanServerConnection}.
 * @throws IllegalArgumentException if {@code mxbeanInterface}is not a platform management interface.
 * @throws java.io.IOException if a communication problemoccurred when accessing the  {@code MBeanServerConnection}.
 * @see #newPlatformMXBeanProxy
 * @since 1.7
 */
public static <T extends PlatformManagedObject>List<T> getPlatformMXBeans(MBeanServerConnection connection,Class<T> mxbeanInterface) throws java.io.IOException {
  PlatformComponent pc=PlatformComponent.getPlatformComponent(mxbeanInterface);
  if (pc == null) {
    throw new IllegalArgumentException(mxbeanInterface.getName() + "String_Node_Str");
  }
  return Collections.unmodifiableList(pc.getMXBeans(connection,mxbeanInterface));
}
Program: 77394
Project: 77394
Buggy source:
/** 
 * Returns a <tt>MemoryNotificationInfo</tt> object represented by the given <tt>CompositeData</tt>. The given <tt>CompositeData</tt> must contain the following attributes: <blockquote> <table border> <tr> <th align=left>Attribute Name</th> <th align=left>Type</th> </tr> <tr> <td>poolName</td> <td><tt>java.lang.String</tt></td> </tr> <tr> <td>usage</td> <td><tt>javax.management.openmbean.CompositeData</tt></td> </tr> <tr> <td>count</td> <td><tt>java.lang.Long</tt></td> </tr> </table> </blockquote>
 * @param cd <tt>CompositeData</tt> representing a<tt>MemoryNotificationInfo</tt>
 * @throws IllegalArgumentException if <tt>cd</tt> does notrepresent a <tt>MemoryNotificationInfo</tt> object.
 * @return a <tt>MemoryNotificationInfo</tt> object representedby <tt>cd</tt> if <tt>cd</tt> is not <tt>null</tt>; <tt>null</tt> otherwise.
 */
public static MemoryNotificationInfo from(CompositeData cd){
  if (cd == null) {
    return null;
  }
  if (cd instanceof MemoryNotifInfoCompositeData) {
    return ((MemoryNotifInfoCompositeData)cd).getMemoryNotifInfo();
  }
 else {
    return new MemoryNotificationInfo(cd);
  }
}

Fixed version (ground truth):
/** 
 * Returns a <tt>MemoryNotificationInfo</tt> object represented by the given <tt>CompositeData</tt>. The given <tt>CompositeData</tt> must contain the following attributes: <blockquote> <table border summary="The attributes and the types the given CompositeData contains"> <tr> <th align=left>Attribute Name</th> <th align=left>Type</th> </tr> <tr> <td>poolName</td> <td><tt>java.lang.String</tt></td> </tr> <tr> <td>usage</td> <td><tt>javax.management.openmbean.CompositeData</tt></td> </tr> <tr> <td>count</td> <td><tt>java.lang.Long</tt></td> </tr> </table> </blockquote>
 * @param cd <tt>CompositeData</tt> representing a<tt>MemoryNotificationInfo</tt>
 * @throws IllegalArgumentException if <tt>cd</tt> does notrepresent a <tt>MemoryNotificationInfo</tt> object.
 * @return a <tt>MemoryNotificationInfo</tt> object representedby <tt>cd</tt> if <tt>cd</tt> is not <tt>null</tt>; <tt>null</tt> otherwise.
 */
public static MemoryNotificationInfo from(CompositeData cd){
  if (cd == null) {
    return null;
  }
  if (cd instanceof MemoryNotifInfoCompositeData) {
    return ((MemoryNotifInfoCompositeData)cd).getMemoryNotifInfo();
  }
 else {
    return new MemoryNotificationInfo(cd);
  }
}
Program: 77395
Project: 77395
Buggy source:
/** 
 * Returns a <tt>MemoryUsage</tt> object represented by the given <tt>CompositeData</tt>. The given <tt>CompositeData</tt> must contain the following attributes: <p> <blockquote> <table border> <tr> <th align=left>Attribute Name</th> <th align=left>Type</th> </tr> <tr> <td>init</td> <td><tt>java.lang.Long</tt></td> </tr> <tr> <td>used</td> <td><tt>java.lang.Long</tt></td> </tr> <tr> <td>committed</td> <td><tt>java.lang.Long</tt></td> </tr> <tr> <td>max</td> <td><tt>java.lang.Long</tt></td> </tr> </table> </blockquote>
 * @param cd <tt>CompositeData</tt> representing a <tt>MemoryUsage</tt>
 * @throws IllegalArgumentException if <tt>cd</tt> does notrepresent a <tt>MemoryUsage</tt> with the attributes described above.
 * @return a <tt>MemoryUsage</tt> object represented by <tt>cd</tt>if <tt>cd</tt> is not <tt>null</tt>; <tt>null</tt> otherwise.
 */
public static MemoryUsage from(CompositeData cd){
  if (cd == null) {
    return null;
  }
  if (cd instanceof MemoryUsageCompositeData) {
    return ((MemoryUsageCompositeData)cd).getMemoryUsage();
  }
 else {
    return new MemoryUsage(cd);
  }
}

Fixed version (ground truth):
/** 
 * Returns a <tt>MemoryUsage</tt> object represented by the given <tt>CompositeData</tt>. The given <tt>CompositeData</tt> must contain the following attributes: <p> <blockquote> <table border summary="The attributes and the types the given CompositeData contains"> <tr> <th align=left>Attribute Name</th> <th align=left>Type</th> </tr> <tr> <td>init</td> <td><tt>java.lang.Long</tt></td> </tr> <tr> <td>used</td> <td><tt>java.lang.Long</tt></td> </tr> <tr> <td>committed</td> <td><tt>java.lang.Long</tt></td> </tr> <tr> <td>max</td> <td><tt>java.lang.Long</tt></td> </tr> </table> </blockquote>
 * @param cd <tt>CompositeData</tt> representing a <tt>MemoryUsage</tt>
 * @throws IllegalArgumentException if <tt>cd</tt> does notrepresent a <tt>MemoryUsage</tt> with the attributes described above.
 * @return a <tt>MemoryUsage</tt> object represented by <tt>cd</tt>if <tt>cd</tt> is not <tt>null</tt>; <tt>null</tt> otherwise.
 */
public static MemoryUsage from(CompositeData cd){
  if (cd == null) {
    return null;
  }
  if (cd instanceof MemoryUsageCompositeData) {
    return ((MemoryUsageCompositeData)cd).getMemoryUsage();
  }
 else {
    return new MemoryUsage(cd);
  }
}
Program: 77397
Project: 77397
Buggy source:
/** 
 * Returns the input arguments passed to the Java virtual machine which does not include the arguments to the <tt>main</tt> method. This method returns an empty list if there is no input argument to the Java virtual machine. <p> Some Java virtual machine implementations may take input arguments from multiple different sources: for examples, arguments passed from the application that launches the Java virtual machine such as the 'java' command, environment variables, configuration files, etc. <p> Typically, not all command-line options to the 'java' command are passed to the Java virtual machine. Thus, the returned input arguments may not include all command-line options. <p> <b>MBeanServer access</b>:<br> The mapped type of <tt>List<String></tt> is <tt>String[]</tt>.
 * @return a list of <tt>String</tt> objects; each elementis an argument passed to the Java virtual machine.
 * @throws java.lang.SecurityException if a security manager exists and the caller does not have ManagementPermission("monitor").
 */
public java.util.List<String> getInputArguments();

Fixed version (ground truth):
/** 
 * Returns the input arguments passed to the Java virtual machine which does not include the arguments to the <tt>main</tt> method. This method returns an empty list if there is no input argument to the Java virtual machine. <p> Some Java virtual machine implementations may take input arguments from multiple different sources: for examples, arguments passed from the application that launches the Java virtual machine such as the 'java' command, environment variables, configuration files, etc. <p> Typically, not all command-line options to the 'java' command are passed to the Java virtual machine. Thus, the returned input arguments may not include all command-line options. <p> <b>MBeanServer access</b>:<br> The mapped type of   {@code List<String>} is <tt>String[]</tt>.
 * @return a list of <tt>String</tt> objects; each elementis an argument passed to the Java virtual machine.
 * @throws java.lang.SecurityException if a security manager exists and the caller does not have ManagementPermission("monitor").
 */
public java.util.List<String> getInputArguments();
Program: 77398
Project: 77398
Buggy source:
/** 
 * Returns a map of names and values of all system properties. This method calls   {@link System#getProperties} to get allsystem properties.  Properties whose name or value is not a <tt>String</tt> are omitted. <p> <b>MBeanServer access</b>:<br> The mapped type of  {@code Map<String,String>} is{@link javax.management.openmbean.TabularData TabularData}with two items in each row as follows: <blockquote> <table border> <tr> <th>Item Name</th> <th>Item Type</th> </tr> <tr> <td><tt>key</tt></td> <td><tt>String</tt></td> </tr> <tr> <td><tt>value</tt></td> <td><tt>String</tt></td> </tr> </table> </blockquote>
 * @return a map of names and values of all system properties.
 * @throws java.lang.SecurityException if a security manager exists and its <code>checkPropertiesAccess</code> method doesn't allow access to the system properties.
 */
public java.util.Map<String,String> getSystemProperties();

Fixed version (ground truth):
/** 
 * Returns a map of names and values of all system properties. This method calls   {@link System#getProperties} to get allsystem properties.  Properties whose name or value is not a <tt>String</tt> are omitted. <p> <b>MBeanServer access</b>:<br> The mapped type of  {@code Map<String,String>} is{@link javax.management.openmbean.TabularData TabularData}with two items in each row as follows: <blockquote> <table border summary="Name and Type for each item"> <tr> <th>Item Name</th> <th>Item Type</th> </tr> <tr> <td><tt>key</tt></td> <td><tt>String</tt></td> </tr> <tr> <td><tt>value</tt></td> <td><tt>String</tt></td> </tr> </table> </blockquote>
 * @return a map of names and values of all system properties.
 * @throws java.lang.SecurityException if a security manager exists and its <code>checkPropertiesAccess</code> method doesn't allow access to the system properties.
 */
public java.util.Map<String,String> getSystemProperties();
Program: 77400
Project: 77400
Buggy source:
/** 
 * Returns the unique   {@link java.nio.channels.FileChannel FileChannel}object associated with this file input stream. <p> The initial   {@link java.nio.channels.FileChannel#position() </code>position<code>} of the returned channel will be equal to thenumber of bytes read from the file so far.  Reading bytes from this stream will increment the channel's position.  Changing the channel's position, either explicitly or by reading, will change this stream's file position.
 * @return  the file channel associated with this file input stream
 * @since 1.4
 * @spec JSR-51
 */
public FileChannel getChannel(){
synchronized (this) {
    if (channel == null) {
      channel=FileChannelImpl.open(fd,true,false,this);
    }
    return channel;
  }
}

Fixed version (ground truth):
/** 
 * Returns the unique   {@link java.nio.channels.FileChannel FileChannel}object associated with this file input stream. <p> The initial   {@link java.nio.channels.FileChannel#position() position} of the returned channel will be equal to thenumber of bytes read from the file so far.  Reading bytes from this stream will increment the channel's position.  Changing the channel's position, either explicitly or by reading, will change this stream's file position.
 * @return  the file channel associated with this file input stream
 * @since 1.4
 * @spec JSR-51
 */
public FileChannel getChannel(){
synchronized (this) {
    if (channel == null) {
      channel=FileChannelImpl.open(fd,true,false,this);
    }
    return channel;
  }
}
Program: 77401
Project: 77401
Buggy source:
/** 
 * Returns the unique   {@link java.nio.channels.FileChannel FileChannel}object associated with this file output stream. </p> <p> The initial   {@link java.nio.channels.FileChannel#position() </code>position<code>} of the returned channel will be equal to thenumber of bytes written to the file so far unless this stream is in append mode, in which case it will be equal to the size of the file. Writing bytes to this stream will increment the channel's position accordingly.  Changing the channel's position, either explicitly or by writing, will change this stream's file position.
 * @return  the file channel associated with this file output stream
 * @since 1.4
 * @spec JSR-51
 */
public FileChannel getChannel(){
synchronized (this) {
    if (channel == null) {
      channel=FileChannelImpl.open(fd,false,true,append,this);
    }
    return channel;
  }
}

Fixed version (ground truth):
/** 
 * Returns the unique   {@link java.nio.channels.FileChannel FileChannel}object associated with this file output stream. <p> The initial   {@link java.nio.channels.FileChannel#position() position} of the returned channel will be equal to thenumber of bytes written to the file so far unless this stream is in append mode, in which case it will be equal to the size of the file. Writing bytes to this stream will increment the channel's position accordingly.  Changing the channel's position, either explicitly or by writing, will change this stream's file position.
 * @return  the file channel associated with this file output stream
 * @since 1.4
 * @spec JSR-51
 */
public FileChannel getChannel(){
synchronized (this) {
    if (channel == null) {
      channel=FileChannelImpl.open(fd,false,true,append,this);
    }
    return channel;
  }
}
Program: 77402
Project: 77402
Buggy source:
/** 
 * Creates an InputStreamReader that uses the given charset decoder.  </p>
 * @param in       An InputStream
 * @param dec      A charset decoder
 * @since 1.4
 * @spec JSR-51
 */
public InputStreamReader(InputStream in,CharsetDecoder dec){
  super(in);
  if (dec == null)   throw new NullPointerException("String_Node_Str");
  sd=StreamDecoder.forInputStreamReader(in,this,dec);
}

Fixed version (ground truth):
/** 
 * Creates an InputStreamReader that uses the given charset decoder.
 * @param in       An InputStream
 * @param dec      A charset decoder
 * @since 1.4
 * @spec JSR-51
 */
public InputStreamReader(InputStream in,CharsetDecoder dec){
  super(in);
  if (dec == null)   throw new NullPointerException("String_Node_Str");
  sd=StreamDecoder.forInputStreamReader(in,this,dec);
}
Program: 77403
Project: 77403
Buggy source:
/** 
 * Creates an OutputStreamWriter that uses the given charset encoder.  </p>
 * @param out An OutputStream
 * @param enc A charset encoder
 * @since 1.4
 * @spec JSR-51
 */
public OutputStreamWriter(OutputStream out,CharsetEncoder enc){
  super(out);
  if (enc == null)   throw new NullPointerException("String_Node_Str");
  se=StreamEncoder.forOutputStreamWriter(out,this,enc);
}

Fixed version (ground truth):
/** 
 * Creates an OutputStreamWriter that uses the given charset encoder.
 * @param out An OutputStream
 * @param enc A charset encoder
 * @since 1.4
 * @spec JSR-51
 */
public OutputStreamWriter(OutputStream out,CharsetEncoder enc){
  super(out);
  if (enc == null)   throw new NullPointerException("String_Node_Str");
  se=StreamEncoder.forOutputStreamWriter(out,this,enc);
}
Program: 77404
Project: 77404
Buggy source:
/** 
 * Receives data into an array of bytes.  This method will block until some input is available.
 * @param b the buffer into which the data is received
 * @param off the start offset of the data
 * @param len the maximum number of bytes received
 * @exception IOException If the pipe is <a href=#BROKEN> broken</a>,{@link #connect(java.io.PipedOutputStream) unconnected}, closed,or if an I/O error occurs.
 */
synchronized void receive(byte b[],int off,int len) throws IOException {
  checkStateForReceive();
  writeSide=Thread.currentThread();
  int bytesToTransfer=len;
  while (bytesToTransfer > 0) {
    if (in == out)     awaitSpace();
    int nextTransferAmount=0;
    if (out < in) {
      nextTransferAmount=buffer.length - in;
    }
 else     if (in < out) {
      if (in == -1) {
        in=out=0;
        nextTransferAmount=buffer.length - in;
      }
 else {
        nextTransferAmount=out - in;
      }
    }
    if (nextTransferAmount > bytesToTransfer)     nextTransferAmount=bytesToTransfer;
    assert(nextTransferAmount > 0);
    System.arraycopy(b,off,buffer,in,nextTransferAmount);
    bytesToTransfer-=nextTransferAmount;
    off+=nextTransferAmount;
    in+=nextTransferAmount;
    if (in >= buffer.length) {
      in=0;
    }
  }
}

Fixed version (ground truth):
/** 
 * Receives data into an array of bytes.  This method will block until some input is available.
 * @param b the buffer into which the data is received
 * @param off the start offset of the data
 * @param len the maximum number of bytes received
 * @exception IOException If the pipe is <a href="#BROKEN"> broken</a>,{@link #connect(java.io.PipedOutputStream) unconnected}, closed,or if an I/O error occurs.
 */
synchronized void receive(byte b[],int off,int len) throws IOException {
  checkStateForReceive();
  writeSide=Thread.currentThread();
  int bytesToTransfer=len;
  while (bytesToTransfer > 0) {
    if (in == out)     awaitSpace();
    int nextTransferAmount=0;
    if (out < in) {
      nextTransferAmount=buffer.length - in;
    }
 else     if (in < out) {
      if (in == -1) {
        in=out=0;
        nextTransferAmount=buffer.length - in;
      }
 else {
        nextTransferAmount=out - in;
      }
    }
    if (nextTransferAmount > bytesToTransfer)     nextTransferAmount=bytesToTransfer;
    assert(nextTransferAmount > 0);
    System.arraycopy(b,off,buffer,in,nextTransferAmount);
    bytesToTransfer-=nextTransferAmount;
    off+=nextTransferAmount;
    in+=nextTransferAmount;
    if (in >= buffer.length) {
      in=0;
    }
  }
}
Program: 77406
Project: 77406
Buggy source:
/** 
 * Returns the number of bytes that can be read from this input stream without blocking.
 * @return the number of bytes that can be read from this input streamwithout blocking, or  {@code 0} if this input stream has beenclosed by invoking its  {@link #close()} method, or if the pipeis  {@link #connect(java.io.PipedOutputStream) unconnected}, or <a href=#BROKEN> <code>broken</code></a>.
 * @exception IOException  if an I/O error occurs.
 * @since   JDK1.0.2
 */
public synchronized int available() throws IOException {
  if (in < 0)   return 0;
 else   if (in == out)   return buffer.length;
 else   if (in > out)   return in - out;
 else   return in + buffer.length - out;
}

Fixed version (ground truth):
/** 
 * Returns the number of bytes that can be read from this input stream without blocking.
 * @return the number of bytes that can be read from this input streamwithout blocking, or  {@code 0} if this input stream has beenclosed by invoking its  {@link #close()} method, or if the pipeis  {@link #connect(java.io.PipedOutputStream) unconnected}, or <a href="#BROKEN"> <code>broken</code></a>.
 * @exception IOException  if an I/O error occurs.
 * @since   JDK1.0.2
 */
public synchronized int available() throws IOException {
  if (in < 0)   return 0;
 else   if (in == out)   return buffer.length;
 else   if (in > out)   return in - out;
 else   return in + buffer.length - out;
}
Program: 77407
Project: 77407
Buggy source:
/** 
 * Returns the opaque file descriptor object associated with this stream. </p>
 * @return     the file descriptor object associated with this stream.
 * @exception IOException  if an I/O error occurs.
 * @see java.io.FileDescriptor
 */
public final FileDescriptor getFD() throws IOException {
  if (fd != null) {
    return fd;
  }
  throw new IOException();
}

Fixed version (ground truth):
/** 
 * Returns the opaque file descriptor object associated with this stream.
 * @return     the file descriptor object associated with this stream.
 * @exception IOException  if an I/O error occurs.
 * @see java.io.FileDescriptor
 */
public final FileDescriptor getFD() throws IOException {
  if (fd != null) {
    return fd;
  }
  throw new IOException();
}
Program: 77409
Project: 77409
Buggy source:
/** 
 * Retrieve cookies associated with given URI, or whose domain matches the given URI. Only cookies that have not expired are returned. This is called for every outgoing HTTP request.
 * @return          an immutable list of HttpCookie,return empty list if no cookies match the given URI
 * @throws NullPointerException if <tt>uri</tt> is <tt>null</tt>
 * @see #add
 */
public List<HttpCookie> get(URI uri);

Fixed version (ground truth):
/** 
 * Retrieve cookies associated with given URI, or whose domain matches the given URI. Only cookies that have not expired are returned. This is called for every outgoing HTTP request.
 * @return          an immutable list of HttpCookie,return empty list if no cookies match the given URI
 * @param uri       the uri associated with the cookies to be returned
 * @throws NullPointerException if <tt>uri</tt> is <tt>null</tt>
 * @see #add
 */
public List<HttpCookie> get(URI uri);
Program: 77411
Project: 77411
Buggy source:
/** 
 * Creates a HttpURLPermission with the given url string and unrestricted methods and request headers by invoking the two argument constructor as follows: HttpURLPermission(url, "*:*")
 * @throws IllegalArgumentException if url does not result in a valid {@link URI}
 */
public HttpURLPermission(String url){
  this(url,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Creates a HttpURLPermission with the given url string and unrestricted methods and request headers by invoking the two argument constructor as follows: HttpURLPermission(url, "*:*")
 * @param url the url string
 * @throws IllegalArgumentException if url does not result in a valid {@link URI}
 */
public HttpURLPermission(String url){
  this(url,"String_Node_Str");
}
Program: 77412
Project: 77412
Buggy source:
/** 
 * Returns the name of the protocol family.
 */
String name();

Fixed version (ground truth):
/** 
 * Returns the name of the protocol family.
 * @return the name of the protocol family
 */
String name();
Program: 77413
Project: 77413
Buggy source:
/** 
 * Returns the name of the socket option.
 */
String name();

Fixed version (ground truth):
/** 
 * Returns the name of the socket option.
 * @return the name of the socket option
 */
String name();
Program: 77414
Project: 77414
Buggy source:
/** 
 * Returns the type of the socket option value.
 */
Class<T> type();

Fixed version (ground truth):
/** 
 * Returns the type of the socket option value.
 * @return the type of the socket option value
 */
Class<T> type();
Program: 77415
Project: 77415
Buggy source:
/** 
 * Returns the length of this character sequence.  The length is the number of 16-bit <code>char</code>s in the sequence.</p>
 * @return  the number of <code>char</code>s in this sequence
 */
int length();

Fixed version (ground truth):
/** 
 * Returns the length of this character sequence.  The length is the number of 16-bit <code>char</code>s in the sequence.
 * @return  the number of <code>char</code>s in this sequence
 */
int length();
Program: 77416
Project: 77416
Buggy source:
/** 
 * Returns a string containing the characters in this sequence in the same order as this sequence.  The length of the string will be the length of this sequence. </p>
 * @return  a string consisting of exactly this sequence of characters
 */
public String toString();

Fixed version (ground truth):
/** 
 * Returns a string containing the characters in this sequence in the same order as this sequence.  The length of the string will be the length of this sequence.
 * @return  a string consisting of exactly this sequence of characters
 */
public String toString();
Program: 77417
Project: 77417
Buggy source:
/** 
 * Returns a new <code>CharSequence</code> that is a subsequence of this sequence. The subsequence starts with the <code>char</code> value at the specified index and ends with the <code>char</code> value at index <tt>end - 1</tt>.  The length (in <code>char</code>s) of the returned sequence is <tt>end - start</tt>, so if <tt>start == end</tt> then an empty sequence is returned. </p>
 * @param start   the start index, inclusive
 * @param end     the end index, exclusive
 * @return  the specified subsequence
 * @throws IndexOutOfBoundsException if <tt>start</tt> or <tt>end</tt> are negative, if <tt>end</tt> is greater than <tt>length()</tt>, or if <tt>start</tt> is greater than <tt>end</tt>
 */
CharSequence subSequence(int start,int end);

Fixed version (ground truth):
/** 
 * Returns a new <code>CharSequence</code> that is a subsequence of this sequence. The subsequence starts with the <code>char</code> value at the specified index and ends with the <code>char</code> value at index <tt>end - 1</tt>.  The length (in <code>char</code>s) of the returned sequence is <tt>end - start</tt>, so if <tt>start == end</tt> then an empty sequence is returned.
 * @param start   the start index, inclusive
 * @param end     the end index, exclusive
 * @return  the specified subsequence
 * @throws IndexOutOfBoundsException if <tt>start</tt> or <tt>end</tt> are negative, if <tt>end</tt> is greater than <tt>length()</tt>, or if <tt>start</tt> is greater than <tt>end</tt>
 */
CharSequence subSequence(int start,int end);
Program: 77418
Project: 77418
Buggy source:
/** 
 * Returns the <code>char</code> value at the specified index.  An index ranges from zero to <tt>length() - 1</tt>.  The first <code>char</code> value of the sequence is at index zero, the next at index one, and so on, as for array indexing. </p> <p>If the <code>char</code> value specified by the index is a <a href="  {@docRoot}/java/lang/Character.html#unicode">surrogate</a>, the surrogate value is returned.
 * @param index   the index of the <code>char</code> value to be returned
 * @return  the specified <code>char</code> value
 * @throws IndexOutOfBoundsException if the <tt>index</tt> argument is negative or not less than <tt>length()</tt>
 */
char charAt(int index);

Fixed version (ground truth):
/** 
 * Returns the <code>char</code> value at the specified index.  An index ranges from zero to <tt>length() - 1</tt>.  The first <code>char</code> value of the sequence is at index zero, the next at index one, and so on, as for array indexing. <p>If the <code>char</code> value specified by the index is a <a href="  {@docRoot}/java/lang/Character.html#unicode">surrogate</a>, the surrogate value is returned.
 * @param index   the index of the <code>char</code> value to be returned
 * @return  the specified <code>char</code> value
 * @throws IndexOutOfBoundsException if the <tt>index</tt> argument is negative or not less than <tt>length()</tt>
 */
char charAt(int index);
Program: 77419
Project: 77419
Buggy source:
/** 
 * Determines if the specified character is ISO-LATIN-1 white space. This method returns   {@code true} for the following fivecharacters only: <table> <tr><td> {@code '\t'}</td>            <td>  {@code U+0009}</td> <td>  {@code HORIZONTAL TABULATION}</td></tr> <tr><td>  {@code '\n'}</td>            <td>  {@code U+000A}</td> <td>  {@code NEW LINE}</td></tr> <tr><td>  {@code '\f'}</td>            <td>  {@code U+000C}</td> <td>  {@code FORM FEED}</td></tr> <tr><td>  {@code '\r'}</td>            <td>  {@code U+000D}</td> <td>  {@code CARRIAGE RETURN}</td></tr> <tr><td>  {@code '&nbsp;'}</td>  <td>  {@code U+0020}</td> <td>  {@code SPACE}</td></tr> </table>
 * @param ch   the character to be tested.
 * @return     {@code true} if the character is ISO-LATIN-1 whitespace;  {@code false} otherwise.
 * @see Character#isSpaceChar(char)
 * @see Character#isWhitespace(char)
 * @deprecated Replaced by isWhitespace(char).
 */
@Deprecated public static boolean isSpace(char ch){
  return (ch <= 0x0020) && (((((1L << 0x0009) | (1L << 0x000A) | (1L << 0x000C)| (1L << 0x000D)| (1L << 0x0020)) >> ch) & 1L) != 0);
}

Fixed version (ground truth):
/** 
 * Determines if the specified character is ISO-LATIN-1 white space. This method returns   {@code true} for the following fivecharacters only: <table summary="truechars"> <tr><td> {@code '\t'}</td>            <td>  {@code U+0009}</td> <td>  {@code HORIZONTAL TABULATION}</td></tr> <tr><td>  {@code '\n'}</td>            <td>  {@code U+000A}</td> <td>  {@code NEW LINE}</td></tr> <tr><td>  {@code '\f'}</td>            <td>  {@code U+000C}</td> <td>  {@code FORM FEED}</td></tr> <tr><td>  {@code '\r'}</td>            <td>  {@code U+000D}</td> <td>  {@code CARRIAGE RETURN}</td></tr> <tr><td>  {@code '&nbsp;'}</td>  <td>  {@code U+0020}</td> <td>  {@code SPACE}</td></tr> </table>
 * @param ch   the character to be tested.
 * @return     {@code true} if the character is ISO-LATIN-1 whitespace;  {@code false} otherwise.
 * @see Character#isSpaceChar(char)
 * @see Character#isWhitespace(char)
 * @deprecated Replaced by isWhitespace(char).
 */
@Deprecated public static boolean isSpace(char ch){
  return (ch <= 0x0020) && (((((1L << 0x0009) | (1L << 0x000A) | (1L << 0x000C)| (1L << 0x000D)| (1L << 0x0020)) >> ch) & 1L) != 0);
}
Program: 77420
Project: 77420
Buggy source:
/** 
 * Returns the value obtained by reversing the order of the bytes in the specified <tt>char</tt> value.
 * @return the value obtained by reversing (or, equivalently, swapping)the bytes in the specified <tt>char</tt> value.
 * @since 1.5
 */
public static char reverseBytes(char ch){
  return (char)(((ch & 0xFF00) >> 8) | (ch << 8));
}

Fixed version (ground truth):
/** 
 * Returns the value obtained by reversing the order of the bytes in the specified <tt>char</tt> value.
 * @param ch The {@code char} of which to reverse the byte order.
 * @return the value obtained by reversing (or, equivalently, swapping)the bytes in the specified <tt>char</tt> value.
 * @since 1.5
 */
public static char reverseBytes(char ch){
  return (char)(((ch & 0xFF00) >> 8) | (ch << 8));
}
Program: 77421
Project: 77421
Buggy source:
/** 
 * Returns a hash code for a   {@code char} value; compatible with{@code Character.hashCode()}.
 * @since 1.8
 * @return a hash code value for a {@code char} value.
 */
public static int hashCode(char value){
  return (int)value;
}

Fixed version (ground truth):
/** 
 * Returns a hash code for a   {@code char} value; compatible with{@code Character.hashCode()}.
 * @since 1.8
 * @param value The {@code char} for which to return a hash code.
 * @return a hash code value for a {@code char} value.
 */
public static int hashCode(char value){
  return (int)value;
}
Program: 77422
Project: 77422
Buggy source:
/** 
 * Finds the resource with the given name. Class loader implementations should override this method to specify where to find resources.  </p>
 * @param name The resource name
 * @return  A <tt>URL</tt> object for reading the resource, or<tt>null</tt> if the resource could not be found
 * @since  1.2
 */
protected URL findResource(String name){
  return null;
}

Fixed version (ground truth):
/** 
 * Finds the resource with the given name. Class loader implementations should override this method to specify where to find resources.
 * @param name The resource name
 * @return  A <tt>URL</tt> object for reading the resource, or<tt>null</tt> if the resource could not be found
 * @since  1.2
 */
protected URL findResource(String name){
  return null;
}
Program: 77423
Project: 77423
Buggy source:
/** 
 * Sets the default assertion status for this class loader to <tt>false</tt> and discards any package defaults or class assertion status settings associated with the class loader.  This method is provided so that class loaders can be made to ignore any command line or persistent assertion status settings and "start with a clean slate." </p>
 * @since  1.4
 */
public void clearAssertionStatus(){
synchronized (assertionLock) {
    classAssertionStatus=new HashMap<>();
    packageAssertionStatus=new HashMap<>();
    defaultAssertionStatus=false;
  }
}

Fixed version (ground truth):
/** 
 * Sets the default assertion status for this class loader to <tt>false</tt> and discards any package defaults or class assertion status settings associated with the class loader.  This method is provided so that class loaders can be made to ignore any command line or persistent assertion status settings and "start with a clean slate."
 * @since  1.4
 */
public void clearAssertionStatus(){
synchronized (assertionLock) {
    classAssertionStatus=new HashMap<>();
    packageAssertionStatus=new HashMap<>();
    defaultAssertionStatus=false;
  }
}
Program: 77424
Project: 77424
Buggy source:
/** 
 * Registers the caller as parallel capable.</p> The registration succeeds if and only if all of the following conditions are met: <br> 1. no instance of the caller has been created</p> 2. all of the super classes (except class Object) of the caller are registered as parallel capable</p> Note that once a class loader is registered as parallel capable, there is no way to change it back. </p>
 * @return  true if the caller is successfully registered asparallel capable and false if otherwise.
 * @since   1.7
 */
@CallerSensitive protected static boolean registerAsParallelCapable(){
  Class<? extends ClassLoader> callerClass=Reflection.getCallerClass().asSubclass(ClassLoader.class);
  return ParallelLoaders.register(callerClass);
}

Fixed version (ground truth):
/** 
 * Registers the caller as parallel capable. The registration succeeds if and only if all of the following conditions are met: <ol> <li> no instance of the caller has been created</li> <li> all of the super classes (except class Object) of the caller are registered as parallel capable</li> </ol> <p>Note that once a class loader is registered as parallel capable, there is no way to change it back.</p>
 * @return  true if the caller is successfully registered asparallel capable and false if otherwise.
 * @since   1.7
 */
@CallerSensitive protected static boolean registerAsParallelCapable(){
  Class<? extends ClassLoader> callerClass=Reflection.getCallerClass().asSubclass(ClassLoader.class);
  return ParallelLoaders.register(callerClass);
}
Program: 77425
Project: 77425
Buggy source:
/** 
 * Returns a <tt>Package</tt> that has been defined by this class loader or any of its ancestors.  </p>
 * @param name The package name
 * @return  The <tt>Package</tt> corresponding to the given name, or<tt>null</tt> if not found
 * @since  1.2
 */
protected Package getPackage(String name){
  Package pkg;
synchronized (packages) {
    pkg=packages.get(name);
  }
  if (pkg == null) {
    if (parent != null) {
      pkg=parent.getPackage(name);
    }
 else {
      pkg=Package.getSystemPackage(name);
    }
    if (pkg != null) {
synchronized (packages) {
        Package pkg2=packages.get(name);
        if (pkg2 == null) {
          packages.put(name,pkg);
        }
 else {
          pkg=pkg2;
        }
      }
    }
  }
  return pkg;
}

Fixed version (ground truth):
/** 
 * Returns a <tt>Package</tt> that has been defined by this class loader or any of its ancestors.
 * @param name The package name
 * @return  The <tt>Package</tt> corresponding to the given name, or<tt>null</tt> if not found
 * @since  1.2
 */
protected Package getPackage(String name){
  Package pkg;
synchronized (packages) {
    pkg=packages.get(name);
  }
  if (pkg == null) {
    if (parent != null) {
      pkg=parent.getPackage(name);
    }
 else {
      pkg=Package.getSystemPackage(name);
    }
    if (pkg != null) {
synchronized (packages) {
        Package pkg2=packages.get(name);
        if (pkg2 == null) {
          packages.put(name,pkg);
        }
 else {
          pkg=pkg2;
        }
      }
    }
  }
  return pkg;
}
Program: 77426
Project: 77426
Buggy source:
/** 
 * Returns an enumeration of   {@link java.net.URL <tt>URL</tt>} objectsrepresenting all the resources with the given name. Class loader implementations should override this method to specify where to load resources from.  </p>
 * @param name The resource name
 * @return  An enumeration of {@link java.net.URL <tt>URL</tt>} objects forthe resources
 * @throws IOException If I/O errors occur
 * @since  1.2
 */
protected Enumeration<URL> findResources(String name) throws IOException {
  return java.util.Collections.emptyEnumeration();
}

Fixed version (ground truth):
/** 
 * Returns an enumeration of   {@link java.net.URL <tt>URL</tt>} objectsrepresenting all the resources with the given name. Class loader implementations should override this method to specify where to load resources from.
 * @param name The resource name
 * @return  An enumeration of {@link java.net.URL <tt>URL</tt>} objects forthe resources
 * @throws IOException If I/O errors occur
 * @since  1.2
 */
protected Enumeration<URL> findResources(String name) throws IOException {
  return java.util.Collections.emptyEnumeration();
}
Program: 77427
Project: 77427
Buggy source:
/** 
 * Finds the class with the specified <a href="#name">binary name</a>. This method should be overridden by class loader implementations that follow the delegation model for loading classes, and will be invoked by the   {@link #loadClass <tt>loadClass</tt>} method after checking theparent class loader for the requested class.  The default implementation throws a <tt>ClassNotFoundException</tt>.  </p>
 * @param name The <a href="#name">binary name</a> of the class
 * @return  The resulting <tt>Class</tt> object
 * @throws ClassNotFoundException If the class could not be found
 * @since  1.2
 */
protected Class<?> findClass(String name) throws ClassNotFoundException {
  throw new ClassNotFoundException(name);
}

Fixed version (ground truth):
/** 
 * Finds the class with the specified <a href="#name">binary name</a>. This method should be overridden by class loader implementations that follow the delegation model for loading classes, and will be invoked by the   {@link #loadClass <tt>loadClass</tt>} method after checking theparent class loader for the requested class.  The default implementation throws a <tt>ClassNotFoundException</tt>.
 * @param name The <a href="#name">binary name</a> of the class
 * @return  The resulting <tt>Class</tt> object
 * @throws ClassNotFoundException If the class could not be found
 * @since  1.2
 */
protected Class<?> findClass(String name) throws ClassNotFoundException {
  throw new ClassNotFoundException(name);
}
Program: 77428
Project: 77428
Buggy source:
/** 
 * Open for reading, a resource of the specified name from the search path used to load classes.  This method locates the resource through the system class loader (see   {@link #getSystemClassLoader()}).  </p>
 * @param name The resource name
 * @return  An input stream for reading the resource, or <tt>null</tt>if the resource could not be found
 * @since  1.1
 */
public static InputStream getSystemResourceAsStream(String name){
  URL url=getSystemResource(name);
  try {
    return url != null ? url.openStream() : null;
  }
 catch (  IOException e) {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Open for reading, a resource of the specified name from the search path used to load classes.  This method locates the resource through the system class loader (see   {@link #getSystemClassLoader()}).
 * @param name The resource name
 * @return  An input stream for reading the resource, or <tt>null</tt>if the resource could not be found
 * @since  1.1
 */
public static InputStream getSystemResourceAsStream(String name){
  URL url=getSystemResource(name);
  try {
    return url != null ? url.openStream() : null;
  }
 catch (  IOException e) {
    return null;
  }
}
Program: 77429
Project: 77429
Buggy source:
/** 
 * Links the specified class.  This (misleadingly named) method may be used by a class loader to link a class.  If the class <tt>c</tt> has already been linked, then this method simply returns. Otherwise, the class is linked as described in the "Execution" chapter of <cite>The Java&trade; Language Specification</cite>. </p>
 * @param c The class to link
 * @throws NullPointerException If <tt>c</tt> is <tt>null</tt>.
 * @see #defineClass(String,byte[],int,int)
 */
protected final void resolveClass(Class<?> c){
  resolveClass0(c);
}

Fixed version (ground truth):
/** 
 * Links the specified class.  This (misleadingly named) method may be used by a class loader to link a class.  If the class <tt>c</tt> has already been linked, then this method simply returns. Otherwise, the class is linked as described in the "Execution" chapter of <cite>The Java&trade; Language Specification</cite>.
 * @param c The class to link
 * @throws NullPointerException If <tt>c</tt> is <tt>null</tt>.
 * @see #defineClass(String,byte[],int,int)
 */
protected final void resolveClass(Class<?> c){
  resolveClass0(c);
}
Program: 77430
Project: 77430
Buggy source:
/** 
 * Sets the default assertion status for this class loader.  This setting determines whether classes loaded by this class loader and initialized in the future will have assertions enabled or disabled by default. This setting may be overridden on a per-package or per-class basis by invoking   {@link #setPackageAssertionStatus(String,boolean)} or {@link #setClassAssertionStatus(String,boolean)}.  </p>
 * @param enabled <tt>true</tt> if classes loaded by this class loader will henceforth have assertions enabled by default, <tt>false</tt> if they will have assertions disabled by default.
 * @since  1.4
 */
public void setDefaultAssertionStatus(boolean enabled){
synchronized (assertionLock) {
    if (classAssertionStatus == null)     initializeJavaAssertionMaps();
    defaultAssertionStatus=enabled;
  }
}

Fixed version (ground truth):
/** 
 * Sets the default assertion status for this class loader.  This setting determines whether classes loaded by this class loader and initialized in the future will have assertions enabled or disabled by default. This setting may be overridden on a per-package or per-class basis by invoking   {@link #setPackageAssertionStatus(String,boolean)} or {@link #setClassAssertionStatus(String,boolean)}.
 * @param enabled <tt>true</tt> if classes loaded by this class loader will henceforth have assertions enabled by default, <tt>false</tt> if they will have assertions disabled by default.
 * @since  1.4
 */
public void setDefaultAssertionStatus(boolean enabled){
synchronized (assertionLock) {
    if (classAssertionStatus == null)     initializeJavaAssertionMaps();
    defaultAssertionStatus=enabled;
  }
}
Program: 77431
Project: 77431
Buggy source:
/** 
 * Defines a package by name in this <tt>ClassLoader</tt>.  This allows class loaders to define the packages for their classes. Packages must be created before the class is defined, and package names must be unique within a class loader and cannot be redefined or changed once created.  </p>
 * @param name The package name
 * @param specTitle The specification title
 * @param specVersion The specification version
 * @param specVendor The specification vendor
 * @param implTitle The implementation title
 * @param implVersion The implementation version
 * @param implVendor The implementation vendor
 * @param sealBase If not <tt>null</tt>, then this package is sealed with respect to the given code source  {@link java.net.URL <tt>URL</tt>}  object.  Otherwise, the package is not sealed.
 * @return  The newly defined <tt>Package</tt> object
 * @throws IllegalArgumentException If package name duplicates an existing package either in this class loader or one of its ancestors
 * @since  1.2
 */
protected Package definePackage(String name,String specTitle,String specVersion,String specVendor,String implTitle,String implVersion,String implVendor,URL sealBase) throws IllegalArgumentException {
synchronized (packages) {
    Package pkg=getPackage(name);
    if (pkg != null) {
      throw new IllegalArgumentException(name);
    }
    pkg=new Package(name,specTitle,specVersion,specVendor,implTitle,implVersion,implVendor,sealBase,this);
    packages.put(name,pkg);
    return pkg;
  }
}

Fixed version (ground truth):
/** 
 * Defines a package by name in this <tt>ClassLoader</tt>.  This allows class loaders to define the packages for their classes. Packages must be created before the class is defined, and package names must be unique within a class loader and cannot be redefined or changed once created.
 * @param name The package name
 * @param specTitle The specification title
 * @param specVersion The specification version
 * @param specVendor The specification vendor
 * @param implTitle The implementation title
 * @param implVersion The implementation version
 * @param implVendor The implementation vendor
 * @param sealBase If not <tt>null</tt>, then this package is sealed with respect to the given code source  {@link java.net.URL <tt>URL</tt>}  object.  Otherwise, the package is not sealed.
 * @return  The newly defined <tt>Package</tt> object
 * @throws IllegalArgumentException If package name duplicates an existing package either in this class loader or one of its ancestors
 * @since  1.2
 */
protected Package definePackage(String name,String specTitle,String specVersion,String specVendor,String implTitle,String implVersion,String implVendor,URL sealBase) throws IllegalArgumentException {
synchronized (packages) {
    Package pkg=getPackage(name);
    if (pkg != null) {
      throw new IllegalArgumentException(name);
    }
    pkg=new Package(name,specTitle,specVersion,specVendor,implTitle,implVersion,implVendor,sealBase,this);
    packages.put(name,pkg);
    return pkg;
  }
}
Program: 77433
Project: 77433
Buggy source:
/** 
 * Returns the class with the given <a href="#name">binary name</a> if this loader has been recorded by the Java virtual machine as an initiating loader of a class with that <a href="#name">binary name</a>.  Otherwise <tt>null</tt> is returned.  </p>
 * @param name The <a href="#name">binary name</a> of the class
 * @return  The <tt>Class</tt> object, or <tt>null</tt> if the class hasnot been loaded
 * @since  1.1
 */
protected final Class<?> findLoadedClass(String name){
  if (!checkName(name))   return null;
  return findLoadedClass0(name);
}

Fixed version (ground truth):
/** 
 * Returns the class with the given <a href="#name">binary name</a> if this loader has been recorded by the Java virtual machine as an initiating loader of a class with that <a href="#name">binary name</a>.  Otherwise <tt>null</tt> is returned.
 * @param name The <a href="#name">binary name</a> of the class
 * @return  The <tt>Class</tt> object, or <tt>null</tt> if the class hasnot been loaded
 * @since  1.1
 */
protected final Class<?> findLoadedClass(String name){
  if (!checkName(name))   return null;
  return findLoadedClass0(name);
}