nus-yam/ex-repair huggingface dataset:
Program: 71858
Project: 71858
Buggy source:
/** 
 * Creates and returns an updater for objects with the given field. The Class arguments are needed to check that reflective types and generic types match.
 * @param tclass the class of the objects holding the field
 * @param vclass the class of the field
 * @param fieldName the name of the field to be updated
 * @return the updater
 * @throws ClassCastException if the field is of the wrong type
 * @throws IllegalArgumentException if the field is not volatile
 * @throws RuntimeException with a nested reflection-basedexception if the class does not hold field or is the wrong type, or the field is inaccessible to the caller according to Java language access control
 */
@CallerSensitive public static <U,W>AtomicReferenceFieldUpdater<U,W> newUpdater(Class<U> tclass,Class<W> vclass,String fieldName){
  return new AtomicReferenceFieldUpdaterImpl<U,W>(tclass,vclass,fieldName,Reflection.getCallerClass());
}

Fixed version (ground truth):
/** 
 * Creates and returns an updater for objects with the given field. The Class arguments are needed to check that reflective types and generic types match.
 * @param tclass the class of the objects holding the field
 * @param vclass the class of the field
 * @param fieldName the name of the field to be updated
 * @param < U > the type of instances of tclass
 * @param < W > the type of instances of vclass
 * @return the updater
 * @throws ClassCastException if the field is of the wrong type
 * @throws IllegalArgumentException if the field is not volatile
 * @throws RuntimeException with a nested reflection-basedexception if the class does not hold field or is the wrong type, or the field is inaccessible to the caller according to Java language access control
 */
@CallerSensitive public static <U,W>AtomicReferenceFieldUpdater<U,W> newUpdater(Class<U> tclass,Class<W> vclass,String fieldName){
  return new AtomicReferenceFieldUpdaterImpl<U,W>(tclass,vclass,fieldName,Reflection.getCallerClass());
}
Program: 71859
Project: 71859
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: 71861
Project: 71861
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: 71862
Project: 71862
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: 71863
Project: 71863
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: 71864
Project: 71864
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: 71865
Project: 71865
Buggy source:
/** 
 * Returns a   {@code LockInfo} object represented by thegiven  {@code CompositeData}. The given   {@code CompositeData} must contain the following attributes:<blockquote> <table border> <tr> <th align=left>Attribute Name</th> <th align=left>Type</th> </tr> <tr> <td>className</td> <td><tt>java.lang.String</tt></td> </tr> <tr> <td>identityHashCode</td> <td><tt>java.lang.Integer</tt></td> </tr> </table> </blockquote>
 * @param cd {@code CompositeData} representing a {@code LockInfo}
 * @throws IllegalArgumentException if {@code cd} does notrepresent a  {@code LockInfo} with the attributes describedabove.
 * @return a {@code LockInfo} object representedby  {@code cd} if {@code cd} is not {@code null};  {@code null} otherwise.
 * @since 1.8
 */
public static LockInfo from(CompositeData cd){
  if (cd == null) {
    return null;
  }
  if (cd instanceof LockInfoCompositeData) {
    return ((LockInfoCompositeData)cd).getLockInfo();
  }
 else {
    return LockInfoCompositeData.toLockInfo(cd);
  }
}

Fixed version (ground truth):
/** 
 * Returns a   {@code LockInfo} object represented by thegiven  {@code CompositeData}. The given   {@code CompositeData} 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>className</td> <td><tt>java.lang.String</tt></td> </tr> <tr> <td>identityHashCode</td> <td><tt>java.lang.Integer</tt></td> </tr> </table> </blockquote>
 * @param cd {@code CompositeData} representing a {@code LockInfo}
 * @throws IllegalArgumentException if {@code cd} does notrepresent a  {@code LockInfo} with the attributes describedabove.
 * @return a {@code LockInfo} object representedby  {@code cd} if {@code cd} is not {@code null};  {@code null} otherwise.
 * @since 1.8
 */
public static LockInfo from(CompositeData cd){
  if (cd == null) {
    return null;
  }
  if (cd instanceof LockInfoCompositeData) {
    return ((LockInfoCompositeData)cd).getLockInfo();
  }
 else {
    return LockInfoCompositeData.toLockInfo(cd);
  }
}
Program: 71866
Project: 71866
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: 71869
Project: 71869
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: 71870
Project: 71870
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: 71872
Project: 71872
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: 71873
Project: 71873
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: 71875
Project: 71875
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: 71876
Project: 71876
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: 71877
Project: 71877
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: 71878
Project: 71878
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: 71879
Project: 71879
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: 71880
Project: 71880
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: 71881
Project: 71881
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: 71882
Project: 71882
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: 71883
Project: 71883
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: 71884
Project: 71884
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: 71885
Project: 71885
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: 71886
Project: 71886
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: 71887
Project: 71887
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: 71888
Project: 71888
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: 71889
Project: 71889
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: 71890
Project: 71890
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: 71891
Project: 71891
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: 71893
Project: 71893
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);
}
Program: 71894
Project: 71894
Buggy source:
/** 
 * Find 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  A {@link java.net.URL <tt>URL</tt>} object for reading theresource, or <tt>null</tt> if the resource could not be found
 * @since  1.1
 */
public static URL getSystemResource(String name){
  ClassLoader system=getSystemClassLoader();
  if (system == null) {
    return getBootstrapResource(name);
  }
  return system.getResource(name);
}

Fixed version (ground truth):
/** 
 * Find 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  A {@link java.net.URL <tt>URL</tt>} object for reading theresource, or <tt>null</tt> if the resource could not be found
 * @since  1.1
 */
public static URL getSystemResource(String name){
  ClassLoader system=getSystemClassLoader();
  if (system == null) {
    return getBootstrapResource(name);
  }
  return system.getResource(name);
}
Program: 71895
Project: 71895
Buggy source:
/** 
 * Sets the signers of a class.  This should be invoked after defining a class.  </p>
 * @param c The <tt>Class</tt> object
 * @param signers The signers for the class
 * @since  1.1
 */
protected final void setSigners(Class<?> c,Object[] signers){
  c.setSigners(signers);
}

Fixed version (ground truth):
/** 
 * Sets the signers of a class.  This should be invoked after defining a class.
 * @param c The <tt>Class</tt> object
 * @param signers The signers for the class
 * @since  1.1
 */
protected final void setSigners(Class<?> c,Object[] signers){
  c.setSigners(signers);
}
Program: 71896
Project: 71896
Buggy source:
/** 
 * Returns all of the <tt>Packages</tt> defined by this class loader and its ancestors.  </p>
 * @return  The array of <tt>Package</tt> objects defined by this<tt>ClassLoader</tt>
 * @since  1.2
 */
protected Package[] getPackages(){
  Map<String,Package> map;
synchronized (packages) {
    map=new HashMap<>(packages);
  }
  Package[] pkgs;
  if (parent != null) {
    pkgs=parent.getPackages();
  }
 else {
    pkgs=Package.getSystemPackages();
  }
  if (pkgs != null) {
    for (int i=0; i < pkgs.length; i++) {
      String pkgName=pkgs[i].getName();
      if (map.get(pkgName) == null) {
        map.put(pkgName,pkgs[i]);
      }
    }
  }
  return map.values().toArray(new Package[map.size()]);
}

Fixed version (ground truth):
/** 
 * Returns all of the <tt>Packages</tt> defined by this class loader and its ancestors.
 * @return  The array of <tt>Package</tt> objects defined by this<tt>ClassLoader</tt>
 * @since  1.2
 */
protected Package[] getPackages(){
  Map<String,Package> map;
synchronized (packages) {
    map=new HashMap<>(packages);
  }
  Package[] pkgs;
  if (parent != null) {
    pkgs=parent.getPackages();
  }
 else {
    pkgs=Package.getSystemPackages();
  }
  if (pkgs != null) {
    for (int i=0; i < pkgs.length; i++) {
      String pkgName=pkgs[i].getName();
      if (map.get(pkgName) == null) {
        map.put(pkgName,pkgs[i]);
      }
    }
  }
  return map.values().toArray(new Package[map.size()]);
}
Program: 71897
Project: 71897
Buggy source:
/** 
 * Returns the lock object for class loading operations. For backward compatibility, the default implementation of this method behaves as follows. If this ClassLoader object is registered as parallel capable, the method returns a dedicated object associated with the specified class name. Otherwise, the method returns this ClassLoader object. </p>
 * @param className The name of the to-be-loaded class
 * @return the lock for class loading operations
 * @throws NullPointerException If registered as parallel capable and <tt>className</tt> is null
 * @see #loadClass(String,boolean)
 * @since  1.7
 */
protected Object getClassLoadingLock(String className){
  Object lock=this;
  if (parallelLockMap != null) {
    Object newLock=new Object();
    lock=parallelLockMap.putIfAbsent(className,newLock);
    if (lock == null) {
      lock=newLock;
    }
  }
  return lock;
}

Fixed version (ground truth):
/** 
 * Returns the lock object for class loading operations. For backward compatibility, the default implementation of this method behaves as follows. If this ClassLoader object is registered as parallel capable, the method returns a dedicated object associated with the specified class name. Otherwise, the method returns this ClassLoader object.
 * @param className The name of the to-be-loaded class
 * @return the lock for class loading operations
 * @throws NullPointerException If registered as parallel capable and <tt>className</tt> is null
 * @see #loadClass(String,boolean)
 * @since  1.7
 */
protected Object getClassLoadingLock(String className){
  Object lock=this;
  if (parallelLockMap != null) {
    Object newLock=new Object();
    lock=parallelLockMap.putIfAbsent(className,newLock);
    if (lock == null) {
      lock=newLock;
    }
  }
  return lock;
}