nus-yam/ex-repair huggingface dataset:
Program: 72019
Project: 72019
Buggy source:
/** 
 * Put the given key-value association into this preference node.  It is guaranteed that <tt>key</tt> and <tt>value</tt> are non-null and of legal length.  Also, it is guaranteed that this node has not been removed.  (The implementor needn't check for any of these things.) <p>This method is invoked with the lock on this node held.
 */
protected abstract void putSpi(String key,String value);

Fixed version (ground truth):
/** 
 * Put the given key-value association into this preference node.  It is guaranteed that <tt>key</tt> and <tt>value</tt> are non-null and of legal length.  Also, it is guaranteed that this node has not been removed.  (The implementor needn't check for any of these things.) <p>This method is invoked with the lock on this node held.
 * @param key the key
 * @param value the value
 */
protected abstract void putSpi(String key,String value);
Program: 72020
Project: 72020
Buggy source:
/** 
 * Remove the association (if any) for the specified key at this preference node.  It is guaranteed that <tt>key</tt> is non-null. Also, it is guaranteed that this node has not been removed. (The implementor needn't check for either of these things.) <p>This method is invoked with the lock on this node held.
 */
protected abstract void removeSpi(String key);

Fixed version (ground truth):
/** 
 * Remove the association (if any) for the specified key at this preference node.  It is guaranteed that <tt>key</tt> is non-null. Also, it is guaranteed that this node has not been removed. (The implementor needn't check for either of these things.) <p>This method is invoked with the lock on this node held.
 * @param key the key
 */
protected abstract void removeSpi(String key);
Program: 72021
Project: 72021
Buggy source:
/** 
 * Return the value associated with the specified key at this preference node, or <tt>null</tt> if there is no association for this key, or the association cannot be determined at this time.  It is guaranteed that <tt>key</tt> is non-null.  Also, it is guaranteed that this node has not been removed.  (The implementor needn't check for either of these things.) <p> Generally speaking, this method should not throw an exception under any circumstances.  If, however, if it does throw an exception, the exception will be intercepted and treated as a <tt>null</tt> return value. <p>This method is invoked with the lock on this node held.
 * @return the value associated with the specified key at this preferencenode, or <tt>null</tt> if there is no association for this key, or the association cannot be determined at this time.
 */
protected abstract String getSpi(String key);

Fixed version (ground truth):
/** 
 * Return the value associated with the specified key at this preference node, or <tt>null</tt> if there is no association for this key, or the association cannot be determined at this time.  It is guaranteed that <tt>key</tt> is non-null.  Also, it is guaranteed that this node has not been removed.  (The implementor needn't check for either of these things.) <p> Generally speaking, this method should not throw an exception under any circumstances.  If, however, if it does throw an exception, the exception will be intercepted and treated as a <tt>null</tt> return value. <p>This method is invoked with the lock on this node held.
 * @param key the key
 * @return the value associated with the specified key at this preferencenode, or <tt>null</tt> if there is no association for this key, or the association cannot be determined at this time.
 */
protected abstract String getSpi(String key);
Program: 72022
Project: 72022
Buggy source:
/** 
 * Returns the user root preference node corresponding to the calling user.  In a server, the returned value will typically depend on some implicit client-context.
 */
Preferences userRoot();

Fixed version (ground truth):
/** 
 * Returns the user root preference node corresponding to the calling user.  In a server, the returned value will typically depend on some implicit client-context.
 * @return the user root preference node corresponding to the callinguser
 */
Preferences userRoot();
Program: 72023
Project: 72023
Buggy source:
/** 
 * Returns the system root preference node.  (Multiple calls on this method will return the same object reference.)
 */
Preferences systemRoot();

Fixed version (ground truth):
/** 
 * Returns the system root preference node.  (Multiple calls on this method will return the same object reference.)
 * @return the system root preference node
 */
Preferences systemRoot();
Program: 72024
Project: 72024
Buggy source:
/** 
 * Returns a hash code for a   {@code boolean} value; compatible with{@code Boolean.hashCode()}.
 * @since 1.8
 * @return a hash code value for a {@code boolean} value.
 */
public static int hashCode(boolean value){
  return value ? 1231 : 1237;
}

Fixed version (ground truth):
/** 
 * Returns a hash code for a   {@code boolean} value; compatible with{@code Boolean.hashCode()}.
 * @param value the value to hash
 * @return a hash code value for a {@code boolean} value.
 * @since 1.8
 */
public static int hashCode(boolean value){
  return value ? 1231 : 1237;
}
Program: 72025
Project: 72025
Buggy source:
/** 
 * Returns a hash code for a   {@code byte} value; compatible with{@code Byte.hashCode()}.
 * @since 1.8
 * @return a hash code value for a {@code byte} value.
 */
public static int hashCode(byte value){
  return (int)value;
}

Fixed version (ground truth):
/** 
 * Returns a hash code for a   {@code byte} value; compatible with{@code Byte.hashCode()}.
 * @param value the value to hash
 * @return a hash code value for a {@code byte} value.
 * @since 1.8
 */
public static int hashCode(byte value){
  return (int)value;
}
Program: 72026
Project: 72026
Buggy source:
/** 
 * Casts this   {@code Class} object to represent a subclass of the classrepresented by the specified class object.  Checks that the cast is valid, and throws a  {@code ClassCastException} if it is not.  Ifthis method succeeds, it always returns a reference to this class object. <p>This method is useful when a client needs to "narrow" the type of a  {@code Class} object to pass it to an API that restricts the{@code Class} objects that it is willing to accept.  A cast wouldgenerate a compile-time warning, as the correctness of the cast could not be checked at runtime (because generic types are implemented by erasure).
 * @return this {@code Class} object, cast to represent a subclass ofthe specified class object.
 * @throws ClassCastException if this {@code Class} object does notrepresent a subclass of the specified class (here "subclass" includes the class itself).
 * @since 1.5
 */
@SuppressWarnings("String_Node_Str") public <U>Class<? extends U> asSubclass(Class<U> clazz){
  if (clazz.isAssignableFrom(this))   return (Class<? extends U>)this;
 else   throw new ClassCastException(this.toString());
}

Fixed version (ground truth):
/** 
 * Casts this   {@code Class} object to represent a subclass of the classrepresented by the specified class object.  Checks that the cast is valid, and throws a  {@code ClassCastException} if it is not.  Ifthis method succeeds, it always returns a reference to this class object. <p>This method is useful when a client needs to "narrow" the type of a  {@code Class} object to pass it to an API that restricts the{@code Class} objects that it is willing to accept.  A cast wouldgenerate a compile-time warning, as the correctness of the cast could not be checked at runtime (because generic types are implemented by erasure).
 * @param < U > the type to cast this class object to
 * @param clazz the class of the type to cast this class object to
 * @return this {@code Class} object, cast to represent a subclass ofthe specified class object.
 * @throws ClassCastException if this {@code Class} object does notrepresent a subclass of the specified class (here "subclass" includes the class itself).
 * @since 1.5
 */
@SuppressWarnings("String_Node_Str") public <U>Class<? extends U> asSubclass(Class<U> clazz){
  if (clazz.isAssignableFrom(this))   return (Class<? extends U>)this;
 else   throw new ClassCastException(this.toString());
}
Program: 72027
Project: 72027
Buggy source:
/** 
 * Returns an array of AnnotatedType objects that represent the use of types to specify superinterfaces of the entity represented by this Class. (The <em>use</em> of type Foo to specify a superinterface in '... implements Foo' is distinct from the <em>declaration</em> of type Foo.) If this Class represents a class, the return value is an array containing objects representing the uses of interface types to specify interfaces implemented by the class. The order of the objects in the array corresponds to the order of the interface types used in the 'implements' clause of the declaration of this Class. If this Class represents an interface, the return value is an array containing objects representing the uses of interface types to specify interfaces directly extended by the interface. The order of the objects in the array corresponds to the order of the interface types used in the 'extends' clause of the declaration of this Class. If this Class represents a class or interface whose declaration does not explicitly indicate any annotated superinterfaces, the return value is an array of length 0. If this Class represents either the Object class, an array type, a primitive type, or void, the return value is an array of length 0.
 * @since 1.8
 */
public AnnotatedType[] getAnnotatedInterfaces(){
  return TypeAnnotationParser.buildAnnotatedInterfaces(getRawTypeAnnotations(),getConstantPool(),this);
}

Fixed version (ground truth):
/** 
 * Returns an array of AnnotatedType objects that represent the use of types to specify superinterfaces of the entity represented by this Class. (The <em>use</em> of type Foo to specify a superinterface in '... implements Foo' is distinct from the <em>declaration</em> of type Foo.) If this Class represents a class, the return value is an array containing objects representing the uses of interface types to specify interfaces implemented by the class. The order of the objects in the array corresponds to the order of the interface types used in the 'implements' clause of the declaration of this Class. If this Class represents an interface, the return value is an array containing objects representing the uses of interface types to specify interfaces directly extended by the interface. The order of the objects in the array corresponds to the order of the interface types used in the 'extends' clause of the declaration of this Class. If this Class represents a class or interface whose declaration does not explicitly indicate any annotated superinterfaces, the return value is an array of length 0. If this Class represents either the Object class, an array type, a primitive type, or void, the return value is an array of length 0.
 * @return an array representing the superinterfaces
 * @since 1.8
 */
public AnnotatedType[] getAnnotatedInterfaces(){
  return TypeAnnotationParser.buildAnnotatedInterfaces(getRawTypeAnnotations(),getConstantPool(),this);
}
Program: 72028
Project: 72028
Buggy source:
/** 
 * Returns an AnnotatedType object that represents the use of a type to specify the superclass of the entity represented by this Class. (The <em>use</em> of type Foo to specify the superclass in '... extends Foo' is distinct from the <em>declaration</em> of type Foo.) If this Class represents a class type whose declaration does not explicitly indicate an annotated superclass, the return value is null. If this Class represents either the Object class, an interface type, an array type, a primitive type, or void, the return value is null.
 * @since 1.8
 */
public AnnotatedType getAnnotatedSuperclass(){
  return TypeAnnotationParser.buildAnnotatedSuperclass(getRawTypeAnnotations(),getConstantPool(),this);
}

Fixed version (ground truth):
/** 
 * Returns an AnnotatedType object that represents the use of a type to specify the superclass of the entity represented by this Class. (The <em>use</em> of type Foo to specify the superclass in '... extends Foo' is distinct from the <em>declaration</em> of type Foo.) If this Class represents a class type whose declaration does not explicitly indicate an annotated superclass, the return value is null. If this Class represents either the Object class, an interface type, an array type, a primitive type, or void, the return value is null.
 * @return an object representing the superclass
 * @since 1.8
 */
public AnnotatedType getAnnotatedSuperclass(){
  return TypeAnnotationParser.buildAnnotatedSuperclass(getRawTypeAnnotations(),getConstantPool(),this);
}
Program: 72029
Project: 72029
Buggy source:
/** 
 * Returns a hash code for a   {@code double} value; compatible with{@code Double.hashCode()}.
 * @since 1.8
 * @return a hash code value for a {@code double} value.
 */
public static int hashCode(double value){
  long bits=doubleToLongBits(value);
  return (int)(bits ^ (bits >>> 32));
}

Fixed version (ground truth):
/** 
 * Returns a hash code for a   {@code double} value; compatible with{@code Double.hashCode()}.
 * @param value the value to hash
 * @return a hash code value for a {@code double} value.
 * @since 1.8
 */
public static int hashCode(double value){
  long bits=doubleToLongBits(value);
  return (int)(bits ^ (bits >>> 32));
}
Program: 72030
Project: 72030
Buggy source:
/** 
 * Returns a hash code for a   {@code float} value; compatible with{@code Float.hashCode()}.
 * @since 1.8
 * @return a hash code value for a {@code float} value.
 */
public static int hashCode(float value){
  return floatToIntBits(value);
}

Fixed version (ground truth):
/** 
 * Returns a hash code for a   {@code float} value; compatible with{@code Float.hashCode()}.
 * @param value the value to hash
 * @return a hash code value for a {@code float} value.
 * @since 1.8
 */
public static int hashCode(float value){
  return floatToIntBits(value);
}
Program: 72031
Project: 72031
Buggy source:
/** 
 * Returns the value obtained by rotating the two's complement binary representation of the specified   {@code int} value left by thespecified number of bits.  (Bits shifted out of the left hand, or high-order, side reenter on the right, or low-order.) <p>Note that left rotation with a negative distance is equivalent to right rotation:  {@code rotateLeft(val, -distance) == rotateRight(val,distance)}.  Note also that rotation by any multiple of 32 is a no-op, so all but the last five bits of the rotation distance can be ignored, even if the distance is negative:   {@code rotateLeft(val,distance) == rotateLeft(val, distance & 0x1F)}.
 * @return the value obtained by rotating the two's complement binaryrepresentation of the specified  {@code int} value left by thespecified number of bits.
 * @since 1.5
 */
public static int rotateLeft(int i,int distance){
  return (i << distance) | (i >>> -distance);
}

Fixed version (ground truth):
/** 
 * Returns the value obtained by rotating the two's complement binary representation of the specified   {@code int} value left by thespecified number of bits.  (Bits shifted out of the left hand, or high-order, side reenter on the right, or low-order.) <p>Note that left rotation with a negative distance is equivalent to right rotation:  {@code rotateLeft(val, -distance) == rotateRight(val,distance)}.  Note also that rotation by any multiple of 32 is a no-op, so all but the last five bits of the rotation distance can be ignored, even if the distance is negative:   {@code rotateLeft(val,distance) == rotateLeft(val, distance & 0x1F)}.
 * @param i the value whose bits are to be rotated left
 * @param distance the number of bit positions to rotate left
 * @return the value obtained by rotating the two's complement binaryrepresentation of the specified  {@code int} value left by thespecified number of bits.
 * @since 1.5
 */
public static int rotateLeft(int i,int distance){
  return (i << distance) | (i >>> -distance);
}
Program: 72032
Project: 72032
Buggy source:
/** 
 * Returns a hash code for a   {@code int} value; compatible with{@code Integer.hashCode()}.
 * @since 1.8
 * @return a hash code value for a {@code int} value.
 */
public static int hashCode(int value){
  return value;
}

Fixed version (ground truth):
/** 
 * Returns a hash code for a   {@code int} value; compatible with{@code Integer.hashCode()}.
 * @param value the value to hash
 * @since 1.8
 * @return a hash code value for a {@code int} value.
 */
public static int hashCode(int value){
  return value;
}
Program: 72033
Project: 72033
Buggy source:
/** 
 * Returns an   {@code int} value with at most a single one-bit, in theposition of the lowest-order ("rightmost") one-bit in the specified {@code int} value.  Returns zero if the specified value has noone-bits in its two's complement binary representation, that is, if it is equal to zero.
 * @return an {@code int} value with a single one-bit, in the positionof the lowest-order one-bit in the specified value, or zero if the specified value is itself equal to zero.
 * @since 1.5
 */
public static int lowestOneBit(int i){
  return i & -i;
}

Fixed version (ground truth):
/** 
 * Returns an   {@code int} value with at most a single one-bit, in theposition of the lowest-order ("rightmost") one-bit in the specified {@code int} value.  Returns zero if the specified value has noone-bits in its two's complement binary representation, that is, if it is equal to zero.
 * @param i the value whose lowest one bit is to be computed
 * @return an {@code int} value with a single one-bit, in the positionof the lowest-order one-bit in the specified value, or zero if the specified value is itself equal to zero.
 * @since 1.5
 */
public static int lowestOneBit(int i){
  return i & -i;
}
Program: 72034
Project: 72034
Buggy source:
/** 
 * Returns the signum function of the specified   {@code int} value.  (Thereturn value is -1 if the specified value is negative; 0 if the specified value is zero; and 1 if the specified value is positive.)
 * @return the signum function of the specified {@code int} value.
 * @since 1.5
 */
public static int signum(int i){
  return (i >> 31) | (-i >>> 31);
}

Fixed version (ground truth):
/** 
 * Returns the signum function of the specified   {@code int} value.  (Thereturn value is -1 if the specified value is negative; 0 if the specified value is zero; and 1 if the specified value is positive.)
 * @param i the value whose signum is to be computed
 * @return the signum function of the specified {@code int} value.
 * @since 1.5
 */
public static int signum(int i){
  return (i >> 31) | (-i >>> 31);
}
Program: 72035
Project: 72035
Buggy source:
/** 
 * Returns the value obtained by rotating the two's complement binary representation of the specified   {@code int} value right by thespecified number of bits.  (Bits shifted out of the right hand, or low-order, side reenter on the left, or high-order.) <p>Note that right rotation with a negative distance is equivalent to left rotation:  {@code rotateRight(val, -distance) == rotateLeft(val,distance)}.  Note also that rotation by any multiple of 32 is a no-op, so all but the last five bits of the rotation distance can be ignored, even if the distance is negative:   {@code rotateRight(val,distance) == rotateRight(val, distance & 0x1F)}.
 * @return the value obtained by rotating the two's complement binaryrepresentation of the specified  {@code int} value right by thespecified number of bits.
 * @since 1.5
 */
public static int rotateRight(int i,int distance){
  return (i >>> distance) | (i << -distance);
}

Fixed version (ground truth):
/** 
 * Returns the value obtained by rotating the two's complement binary representation of the specified   {@code int} value right by thespecified number of bits.  (Bits shifted out of the right hand, or low-order, side reenter on the left, or high-order.) <p>Note that right rotation with a negative distance is equivalent to left rotation:  {@code rotateRight(val, -distance) == rotateLeft(val,distance)}.  Note also that rotation by any multiple of 32 is a no-op, so all but the last five bits of the rotation distance can be ignored, even if the distance is negative:   {@code rotateRight(val,distance) == rotateRight(val, distance & 0x1F)}.
 * @param i the value whose bits are to be rotated right
 * @param distance the number of bit positions to rotate right
 * @return the value obtained by rotating the two's complement binaryrepresentation of the specified  {@code int} value right by thespecified number of bits.
 * @since 1.5
 */
public static int rotateRight(int i,int distance){
  return (i >>> distance) | (i << -distance);
}
Program: 72036
Project: 72036
Buggy source:
/** 
 * Returns the value obtained by reversing the order of the bits in the two's complement binary representation of the specified   {@code int}value.
 * @return the value obtained by reversing order of the bits in thespecified  {@code int} value.
 * @since 1.5
 */
public static int reverse(int i){
  i=(i & 0x55555555) << 1 | (i >>> 1) & 0x55555555;
  i=(i & 0x33333333) << 2 | (i >>> 2) & 0x33333333;
  i=(i & 0x0f0f0f0f) << 4 | (i >>> 4) & 0x0f0f0f0f;
  i=(i << 24) | ((i & 0xff00) << 8) | ((i >>> 8) & 0xff00)| (i >>> 24);
  return i;
}

Fixed version (ground truth):
/** 
 * Returns the value obtained by reversing the order of the bits in the two's complement binary representation of the specified   {@code int}value.
 * @param i the value to be reversed
 * @return the value obtained by reversing order of the bits in thespecified  {@code int} value.
 * @since 1.5
 */
public static int reverse(int i){
  i=(i & 0x55555555) << 1 | (i >>> 1) & 0x55555555;
  i=(i & 0x33333333) << 2 | (i >>> 2) & 0x33333333;
  i=(i & 0x0f0f0f0f) << 4 | (i >>> 4) & 0x0f0f0f0f;
  i=(i << 24) | ((i & 0xff00) << 8) | ((i >>> 8) & 0xff00)| (i >>> 24);
  return i;
}
Program: 72037
Project: 72037
Buggy source:
/** 
 * Returns the number of zero bits preceding the highest-order ("leftmost") one-bit in the two's complement binary representation of the specified   {@code int} value.  Returns 32 if thespecified value has no one-bits in its two's complement representation, in other words if it is equal to zero. <p>Note that this method is closely related to the logarithm base 2. For all positive  {@code int} values x:<ul> <li>floor(log<sub>2</sub>(x)) =  {@code 31 - numberOfLeadingZeros(x)}<li>ceil(log<sub>2</sub>(x)) =   {@code 32 - numberOfLeadingZeros(x - 1)}</ul>
 * @return the number of zero bits preceding the highest-order("leftmost") one-bit in the two's complement binary representation of the specified  {@code int} value, or 32 if the valueis equal to zero.
 * @since 1.5
 */
public static int numberOfLeadingZeros(int i){
  if (i == 0)   return 32;
  int n=1;
  if (i >>> 16 == 0) {
    n+=16;
    i<<=16;
  }
  if (i >>> 24 == 0) {
    n+=8;
    i<<=8;
  }
  if (i >>> 28 == 0) {
    n+=4;
    i<<=4;
  }
  if (i >>> 30 == 0) {
    n+=2;
    i<<=2;
  }
  n-=i >>> 31;
  return n;
}

Fixed version (ground truth):
/** 
 * Returns the number of zero bits preceding the highest-order ("leftmost") one-bit in the two's complement binary representation of the specified   {@code int} value.  Returns 32 if thespecified value has no one-bits in its two's complement representation, in other words if it is equal to zero. <p>Note that this method is closely related to the logarithm base 2. For all positive  {@code int} values x:<ul> <li>floor(log<sub>2</sub>(x)) =  {@code 31 - numberOfLeadingZeros(x)}<li>ceil(log<sub>2</sub>(x)) =   {@code 32 - numberOfLeadingZeros(x - 1)}</ul>
 * @param i the value whose number of leading zeros is to be computed
 * @return the number of zero bits preceding the highest-order("leftmost") one-bit in the two's complement binary representation of the specified  {@code int} value, or 32 if the valueis equal to zero.
 * @since 1.5
 */
public static int numberOfLeadingZeros(int i){
  if (i == 0)   return 32;
  int n=1;
  if (i >>> 16 == 0) {
    n+=16;
    i<<=16;
  }
  if (i >>> 24 == 0) {
    n+=8;
    i<<=8;
  }
  if (i >>> 28 == 0) {
    n+=4;
    i<<=4;
  }
  if (i >>> 30 == 0) {
    n+=2;
    i<<=2;
  }
  n-=i >>> 31;
  return n;
}
Program: 72038
Project: 72038
Buggy source:
/** 
 * Returns the number of one-bits in the two's complement binary representation of the specified   {@code int} value.  This function issometimes referred to as the <i>population count</i>.
 * @return the number of one-bits in the two's complement binaryrepresentation of the specified  {@code int} value.
 * @since 1.5
 */
public static int bitCount(int i){
  i=i - ((i >>> 1) & 0x55555555);
  i=(i & 0x33333333) + ((i >>> 2) & 0x33333333);
  i=(i + (i >>> 4)) & 0x0f0f0f0f;
  i=i + (i >>> 8);
  i=i + (i >>> 16);
  return i & 0x3f;
}

Fixed version (ground truth):
/** 
 * Returns the number of one-bits in the two's complement binary representation of the specified   {@code int} value.  This function issometimes referred to as the <i>population count</i>.
 * @param i the value whose bits are to be counted
 * @return the number of one-bits in the two's complement binaryrepresentation of the specified  {@code int} value.
 * @since 1.5
 */
public static int bitCount(int i){
  i=i - ((i >>> 1) & 0x55555555);
  i=(i & 0x33333333) + ((i >>> 2) & 0x33333333);
  i=(i + (i >>> 4)) & 0x0f0f0f0f;
  i=i + (i >>> 8);
  i=i + (i >>> 16);
  return i & 0x3f;
}
Program: 72039
Project: 72039
Buggy source:
/** 
 * Returns an   {@code int} value with at most a single one-bit, in theposition of the highest-order ("leftmost") one-bit in the specified {@code int} value.  Returns zero if the specified value has noone-bits in its two's complement binary representation, that is, if it is equal to zero.
 * @return an {@code int} value with a single one-bit, in the positionof the highest-order one-bit in the specified value, or zero if the specified value is itself equal to zero.
 * @since 1.5
 */
public static int highestOneBit(int i){
  i|=(i >> 1);
  i|=(i >> 2);
  i|=(i >> 4);
  i|=(i >> 8);
  i|=(i >> 16);
  return i - (i >>> 1);
}

Fixed version (ground truth):
/** 
 * Returns an   {@code int} value with at most a single one-bit, in theposition of the highest-order ("leftmost") one-bit in the specified {@code int} value.  Returns zero if the specified value has noone-bits in its two's complement binary representation, that is, if it is equal to zero.
 * @param i the value whose highest one bit is to be computed
 * @return an {@code int} value with a single one-bit, in the positionof the highest-order one-bit in the specified value, or zero if the specified value is itself equal to zero.
 * @since 1.5
 */
public static int highestOneBit(int i){
  i|=(i >> 1);
  i|=(i >> 2);
  i|=(i >> 4);
  i|=(i >> 8);
  i|=(i >> 16);
  return i - (i >>> 1);
}
Program: 72040
Project: 72040
Buggy source:
/** 
 * Returns the number of zero bits following the lowest-order ("rightmost") one-bit in the two's complement binary representation of the specified  {@code int} value.  Returns 32 if the specified value has noone-bits in its two's complement representation, in other words if it is equal to zero.
 * @return the number of zero bits following the lowest-order ("rightmost")one-bit in the two's complement binary representation of the specified  {@code int} value, or 32 if the value is equalto zero.
 * @since 1.5
 */
public static int numberOfTrailingZeros(int i){
  int y;
  if (i == 0)   return 32;
  int n=31;
  y=i << 16;
  if (y != 0) {
    n=n - 16;
    i=y;
  }
  y=i << 8;
  if (y != 0) {
    n=n - 8;
    i=y;
  }
  y=i << 4;
  if (y != 0) {
    n=n - 4;
    i=y;
  }
  y=i << 2;
  if (y != 0) {
    n=n - 2;
    i=y;
  }
  return n - ((i << 1) >>> 31);
}

Fixed version (ground truth):
/** 
 * Returns the number of zero bits following the lowest-order ("rightmost") one-bit in the two's complement binary representation of the specified  {@code int} value.  Returns 32 if the specified value has noone-bits in its two's complement representation, in other words if it is equal to zero.
 * @param i the value whose number of trailing zeros is to be computed
 * @return the number of zero bits following the lowest-order ("rightmost")one-bit in the two's complement binary representation of the specified  {@code int} value, or 32 if the value is equalto zero.
 * @since 1.5
 */
public static int numberOfTrailingZeros(int i){
  int y;
  if (i == 0)   return 32;
  int n=31;
  y=i << 16;
  if (y != 0) {
    n=n - 16;
    i=y;
  }
  y=i << 8;
  if (y != 0) {
    n=n - 8;
    i=y;
  }
  y=i << 4;
  if (y != 0) {
    n=n - 4;
    i=y;
  }
  y=i << 2;
  if (y != 0) {
    n=n - 2;
    i=y;
  }
  return n - ((i << 1) >>> 31);
}
Program: 72041
Project: 72041
Buggy source:
/** 
 * Returns the value obtained by reversing the order of the bytes in the two's complement representation of the specified   {@code int} value.
 * @return the value obtained by reversing the bytes in the specified{@code int} value.
 * @since 1.5
 */
public static int reverseBytes(int i){
  return ((i >>> 24)) | ((i >> 8) & 0xFF00) | ((i << 8) & 0xFF0000)| ((i << 24));
}

Fixed version (ground truth):
/** 
 * Returns the value obtained by reversing the order of the bytes in the two's complement representation of the specified   {@code int} value.
 * @param i the value whose bytes are to be reversed
 * @return the value obtained by reversing the bytes in the specified{@code int} value.
 * @since 1.5
 */
public static int reverseBytes(int i){
  return ((i >>> 24)) | ((i >> 8) & 0xFF00) | ((i << 8) & 0xFF0000)| ((i << 24));
}
Program: 72042
Project: 72042
Buggy source:
/** 
 * Returns the value obtained by rotating the two's complement binary representation of the specified   {@code long} value left by thespecified number of bits.  (Bits shifted out of the left hand, or high-order, side reenter on the right, or low-order.) <p>Note that left rotation with a negative distance is equivalent to right rotation:  {@code rotateLeft(val, -distance) == rotateRight(val,distance)}.  Note also that rotation by any multiple of 64 is a no-op, so all but the last six bits of the rotation distance can be ignored, even if the distance is negative:   {@code rotateLeft(val,distance) == rotateLeft(val, distance & 0x3F)}.
 * @return the value obtained by rotating the two's complement binaryrepresentation of the specified  {@code long} value left by thespecified number of bits.
 * @since 1.5
 */
public static long rotateLeft(long i,int distance){
  return (i << distance) | (i >>> -distance);
}

Fixed version (ground truth):
/** 
 * Returns the value obtained by rotating the two's complement binary representation of the specified   {@code long} value left by thespecified number of bits.  (Bits shifted out of the left hand, or high-order, side reenter on the right, or low-order.) <p>Note that left rotation with a negative distance is equivalent to right rotation:  {@code rotateLeft(val, -distance) == rotateRight(val,distance)}.  Note also that rotation by any multiple of 64 is a no-op, so all but the last six bits of the rotation distance can be ignored, even if the distance is negative:   {@code rotateLeft(val,distance) == rotateLeft(val, distance & 0x3F)}.
 * @param i the value whose bits are to be rotated left
 * @param distance the number of bit positions to rotate left
 * @return the value obtained by rotating the two's complement binaryrepresentation of the specified  {@code long} value left by thespecified number of bits.
 * @since 1.5
 */
public static long rotateLeft(long i,int distance){
  return (i << distance) | (i >>> -distance);
}
Program: 72043
Project: 72043
Buggy source:
/** 
 * Returns a hash code for a   {@code long} value; compatible with{@code Long.hashCode()}.
 * @since 1.8
 * @return a hash code value for a {@code long} value.
 */
public static int hashCode(long value){
  return (int)(value ^ (value >>> 32));
}

Fixed version (ground truth):
/** 
 * Returns a hash code for a   {@code long} value; compatible with{@code Long.hashCode()}.
 * @param value the value to hash
 * @return a hash code value for a {@code long} value.
 * @since 1.8
 */
public static int hashCode(long value){
  return (int)(value ^ (value >>> 32));
}
Program: 72044
Project: 72044
Buggy source:
/** 
 * Returns a   {@code long} value with at most a single one-bit, in theposition of the lowest-order ("rightmost") one-bit in the specified {@code long} value.  Returns zero if the specified value has noone-bits in its two's complement binary representation, that is, if it is equal to zero.
 * @return a {@code long} value with a single one-bit, in the positionof the lowest-order one-bit in the specified value, or zero if the specified value is itself equal to zero.
 * @since 1.5
 */
public static long lowestOneBit(long i){
  return i & -i;
}

Fixed version (ground truth):
/** 
 * Returns a   {@code long} value with at most a single one-bit, in theposition of the lowest-order ("rightmost") one-bit in the specified {@code long} value.  Returns zero if the specified value has noone-bits in its two's complement binary representation, that is, if it is equal to zero.
 * @param i the value whose lowest one bit is to be computed
 * @return a {@code long} value with a single one-bit, in the positionof the lowest-order one-bit in the specified value, or zero if the specified value is itself equal to zero.
 * @since 1.5
 */
public static long lowestOneBit(long i){
  return i & -i;
}
Program: 72045
Project: 72045
Buggy source:
/** 
 * Returns the signum function of the specified   {@code long} value.  (Thereturn value is -1 if the specified value is negative; 0 if the specified value is zero; and 1 if the specified value is positive.)
 * @return the signum function of the specified {@code long} value.
 * @since 1.5
 */
public static int signum(long i){
  return (int)((i >> 63) | (-i >>> 63));
}

Fixed version (ground truth):
/** 
 * Returns the signum function of the specified   {@code long} value.  (Thereturn value is -1 if the specified value is negative; 0 if the specified value is zero; and 1 if the specified value is positive.)
 * @param i the value whose signum is to be computed
 * @return the signum function of the specified {@code long} value.
 * @since 1.5
 */
public static int signum(long i){
  return (int)((i >> 63) | (-i >>> 63));
}
Program: 72046
Project: 72046
Buggy source:
/** 
 * Returns the value obtained by rotating the two's complement binary representation of the specified   {@code long} value right by thespecified number of bits.  (Bits shifted out of the right hand, or low-order, side reenter on the left, or high-order.) <p>Note that right rotation with a negative distance is equivalent to left rotation:  {@code rotateRight(val, -distance) == rotateLeft(val,distance)}.  Note also that rotation by any multiple of 64 is a no-op, so all but the last six bits of the rotation distance can be ignored, even if the distance is negative:   {@code rotateRight(val,distance) == rotateRight(val, distance & 0x3F)}.
 * @return the value obtained by rotating the two's complement binaryrepresentation of the specified  {@code long} value right by thespecified number of bits.
 * @since 1.5
 */
public static long rotateRight(long i,int distance){
  return (i >>> distance) | (i << -distance);
}

Fixed version (ground truth):
/** 
 * Returns the value obtained by rotating the two's complement binary representation of the specified   {@code long} value right by thespecified number of bits.  (Bits shifted out of the right hand, or low-order, side reenter on the left, or high-order.) <p>Note that right rotation with a negative distance is equivalent to left rotation:  {@code rotateRight(val, -distance) == rotateLeft(val,distance)}.  Note also that rotation by any multiple of 64 is a no-op, so all but the last six bits of the rotation distance can be ignored, even if the distance is negative:   {@code rotateRight(val,distance) == rotateRight(val, distance & 0x3F)}.
 * @param i the value whose bits are to be rotated right
 * @param distance the number of bit positions to rotate right
 * @return the value obtained by rotating the two's complement binaryrepresentation of the specified  {@code long} value right by thespecified number of bits.
 * @since 1.5
 */
public static long rotateRight(long i,int distance){
  return (i >>> distance) | (i << -distance);
}
Program: 72047
Project: 72047
Buggy source:
/** 
 * Returns the value obtained by reversing the order of the bits in the two's complement binary representation of the specified   {@code long}value.
 * @return the value obtained by reversing order of the bits in thespecified  {@code long} value.
 * @since 1.5
 */
public static long reverse(long i){
  i=(i & 0x5555555555555555L) << 1 | (i >>> 1) & 0x5555555555555555L;
  i=(i & 0x3333333333333333L) << 2 | (i >>> 2) & 0x3333333333333333L;
  i=(i & 0x0f0f0f0f0f0f0f0fL) << 4 | (i >>> 4) & 0x0f0f0f0f0f0f0f0fL;
  i=(i & 0x00ff00ff00ff00ffL) << 8 | (i >>> 8) & 0x00ff00ff00ff00ffL;
  i=(i << 48) | ((i & 0xffff0000L) << 16) | ((i >>> 16) & 0xffff0000L)| (i >>> 48);
  return i;
}

Fixed version (ground truth):
/** 
 * Returns the value obtained by reversing the order of the bits in the two's complement binary representation of the specified   {@code long}value.
 * @param i the value to be reversed
 * @return the value obtained by reversing order of the bits in thespecified  {@code long} value.
 * @since 1.5
 */
public static long reverse(long i){
  i=(i & 0x5555555555555555L) << 1 | (i >>> 1) & 0x5555555555555555L;
  i=(i & 0x3333333333333333L) << 2 | (i >>> 2) & 0x3333333333333333L;
  i=(i & 0x0f0f0f0f0f0f0f0fL) << 4 | (i >>> 4) & 0x0f0f0f0f0f0f0f0fL;
  i=(i & 0x00ff00ff00ff00ffL) << 8 | (i >>> 8) & 0x00ff00ff00ff00ffL;
  i=(i << 48) | ((i & 0xffff0000L) << 16) | ((i >>> 16) & 0xffff0000L)| (i >>> 48);
  return i;
}
Program: 72048
Project: 72048
Buggy source:
/** 
 * Returns the number of zero bits preceding the highest-order ("leftmost") one-bit in the two's complement binary representation of the specified   {@code long} value.  Returns 64 if thespecified value has no one-bits in its two's complement representation, in other words if it is equal to zero. <p>Note that this method is closely related to the logarithm base 2. For all positive  {@code long} values x:<ul> <li>floor(log<sub>2</sub>(x)) =  {@code 63 - numberOfLeadingZeros(x)}<li>ceil(log<sub>2</sub>(x)) =   {@code 64 - numberOfLeadingZeros(x - 1)}</ul>
 * @return the number of zero bits preceding the highest-order("leftmost") one-bit in the two's complement binary representation of the specified  {@code long} value, or 64 if the valueis equal to zero.
 * @since 1.5
 */
public static int numberOfLeadingZeros(long i){
  if (i == 0)   return 64;
  int n=1;
  int x=(int)(i >>> 32);
  if (x == 0) {
    n+=32;
    x=(int)i;
  }
  if (x >>> 16 == 0) {
    n+=16;
    x<<=16;
  }
  if (x >>> 24 == 0) {
    n+=8;
    x<<=8;
  }
  if (x >>> 28 == 0) {
    n+=4;
    x<<=4;
  }
  if (x >>> 30 == 0) {
    n+=2;
    x<<=2;
  }
  n-=x >>> 31;
  return n;
}

Fixed version (ground truth):
/** 
 * Returns the number of zero bits preceding the highest-order ("leftmost") one-bit in the two's complement binary representation of the specified   {@code long} value.  Returns 64 if thespecified value has no one-bits in its two's complement representation, in other words if it is equal to zero. <p>Note that this method is closely related to the logarithm base 2. For all positive  {@code long} values x:<ul> <li>floor(log<sub>2</sub>(x)) =  {@code 63 - numberOfLeadingZeros(x)}<li>ceil(log<sub>2</sub>(x)) =   {@code 64 - numberOfLeadingZeros(x - 1)}</ul>
 * @param i the value whose number of leading zeros is to be computed
 * @return the number of zero bits preceding the highest-order("leftmost") one-bit in the two's complement binary representation of the specified  {@code long} value, or 64 if the valueis equal to zero.
 * @since 1.5
 */
public static int numberOfLeadingZeros(long i){
  if (i == 0)   return 64;
  int n=1;
  int x=(int)(i >>> 32);
  if (x == 0) {
    n+=32;
    x=(int)i;
  }
  if (x >>> 16 == 0) {
    n+=16;
    x<<=16;
  }
  if (x >>> 24 == 0) {
    n+=8;
    x<<=8;
  }
  if (x >>> 28 == 0) {
    n+=4;
    x<<=4;
  }
  if (x >>> 30 == 0) {
    n+=2;
    x<<=2;
  }
  n-=x >>> 31;
  return n;
}
Program: 72049
Project: 72049
Buggy source:
/** 
 * Returns the number of one-bits in the two's complement binary representation of the specified   {@code long} value.  This function issometimes referred to as the <i>population count</i>.
 * @return the number of one-bits in the two's complement binaryrepresentation of the specified  {@code long} value.
 * @since 1.5
 */
public static int bitCount(long i){
  i=i - ((i >>> 1) & 0x5555555555555555L);
  i=(i & 0x3333333333333333L) + ((i >>> 2) & 0x3333333333333333L);
  i=(i + (i >>> 4)) & 0x0f0f0f0f0f0f0f0fL;
  i=i + (i >>> 8);
  i=i + (i >>> 16);
  i=i + (i >>> 32);
  return (int)i & 0x7f;
}

Fixed version (ground truth):
/** 
 * Returns the number of one-bits in the two's complement binary representation of the specified   {@code long} value.  This function issometimes referred to as the <i>population count</i>.
 * @param i the value whose bits are to be counted
 * @return the number of one-bits in the two's complement binaryrepresentation of the specified  {@code long} value.
 * @since 1.5
 */
public static int bitCount(long i){
  i=i - ((i >>> 1) & 0x5555555555555555L);
  i=(i & 0x3333333333333333L) + ((i >>> 2) & 0x3333333333333333L);
  i=(i + (i >>> 4)) & 0x0f0f0f0f0f0f0f0fL;
  i=i + (i >>> 8);
  i=i + (i >>> 16);
  i=i + (i >>> 32);
  return (int)i & 0x7f;
}
Program: 72050
Project: 72050
Buggy source:
/** 
 * Returns a   {@code long} value with at most a single one-bit, in theposition of the highest-order ("leftmost") one-bit in the specified {@code long} value.  Returns zero if the specified value has noone-bits in its two's complement binary representation, that is, if it is equal to zero.
 * @return a {@code long} value with a single one-bit, in the positionof the highest-order one-bit in the specified value, or zero if the specified value is itself equal to zero.
 * @since 1.5
 */
public static long highestOneBit(long i){
  i|=(i >> 1);
  i|=(i >> 2);
  i|=(i >> 4);
  i|=(i >> 8);
  i|=(i >> 16);
  i|=(i >> 32);
  return i - (i >>> 1);
}

Fixed version (ground truth):
/** 
 * Returns a   {@code long} value with at most a single one-bit, in theposition of the highest-order ("leftmost") one-bit in the specified {@code long} value.  Returns zero if the specified value has noone-bits in its two's complement binary representation, that is, if it is equal to zero.
 * @param i the value whose highest one bit is to be computed
 * @return a {@code long} value with a single one-bit, in the positionof the highest-order one-bit in the specified value, or zero if the specified value is itself equal to zero.
 * @since 1.5
 */
public static long highestOneBit(long i){
  i|=(i >> 1);
  i|=(i >> 2);
  i|=(i >> 4);
  i|=(i >> 8);
  i|=(i >> 16);
  i|=(i >> 32);
  return i - (i >>> 1);
}
Program: 72051
Project: 72051
Buggy source:
/** 
 * Returns the number of zero bits following the lowest-order ("rightmost") one-bit in the two's complement binary representation of the specified  {@code long} value.  Returns 64 if the specified value has noone-bits in its two's complement representation, in other words if it is equal to zero.
 * @return the number of zero bits following the lowest-order ("rightmost")one-bit in the two's complement binary representation of the specified  {@code long} value, or 64 if the value is equalto zero.
 * @since 1.5
 */
public static int numberOfTrailingZeros(long i){
  int x, y;
  if (i == 0)   return 64;
  int n=63;
  y=(int)i;
  if (y != 0) {
    n=n - 32;
    x=y;
  }
 else   x=(int)(i >>> 32);
  y=x << 16;
  if (y != 0) {
    n=n - 16;
    x=y;
  }
  y=x << 8;
  if (y != 0) {
    n=n - 8;
    x=y;
  }
  y=x << 4;
  if (y != 0) {
    n=n - 4;
    x=y;
  }
  y=x << 2;
  if (y != 0) {
    n=n - 2;
    x=y;
  }
  return n - ((x << 1) >>> 31);
}

Fixed version (ground truth):
/** 
 * Returns the number of zero bits following the lowest-order ("rightmost") one-bit in the two's complement binary representation of the specified  {@code long} value.  Returns 64 if the specified value has noone-bits in its two's complement representation, in other words if it is equal to zero.
 * @param i the value whose number of trailing zeros is to be computed
 * @return the number of zero bits following the lowest-order ("rightmost")one-bit in the two's complement binary representation of the specified  {@code long} value, or 64 if the value is equalto zero.
 * @since 1.5
 */
public static int numberOfTrailingZeros(long i){
  int x, y;
  if (i == 0)   return 64;
  int n=63;
  y=(int)i;
  if (y != 0) {
    n=n - 32;
    x=y;
  }
 else   x=(int)(i >>> 32);
  y=x << 16;
  if (y != 0) {
    n=n - 16;
    x=y;
  }
  y=x << 8;
  if (y != 0) {
    n=n - 8;
    x=y;
  }
  y=x << 4;
  if (y != 0) {
    n=n - 4;
    x=y;
  }
  y=x << 2;
  if (y != 0) {
    n=n - 2;
    x=y;
  }
  return n - ((x << 1) >>> 31);
}
Program: 72052
Project: 72052
Buggy source:
/** 
 * Returns the value obtained by reversing the order of the bytes in the two's complement representation of the specified   {@code long} value.
 * @return the value obtained by reversing the bytes in the specified{@code long} value.
 * @since 1.5
 */
public static long reverseBytes(long i){
  i=(i & 0x00ff00ff00ff00ffL) << 8 | (i >>> 8) & 0x00ff00ff00ff00ffL;
  return (i << 48) | ((i & 0xffff0000L) << 16) | ((i >>> 16) & 0xffff0000L)| (i >>> 48);
}

Fixed version (ground truth):
/** 
 * Returns the value obtained by reversing the order of the bytes in the two's complement representation of the specified   {@code long} value.
 * @param i the value whose bytes are to be reversed
 * @return the value obtained by reversing the bytes in the specified{@code long} value.
 * @since 1.5
 */
public static long reverseBytes(long i){
  i=(i & 0x00ff00ff00ff00ffL) << 8 | (i >>> 8) & 0x00ff00ff00ff00ffL;
  return (i << 48) | ((i & 0xffff0000L) << 16) | ((i >>> 16) & 0xffff0000L)| (i >>> 48);
}
Program: 72054
Project: 72054
Buggy source:
/** 
 * Returns a hash code for a   {@code short} value; compatible with{@code Short.hashCode()}.
 * @since 1.8
 * @return a hash code value for a {@code short} value.
 */
public static int hashCode(short value){
  return (int)value;
}

Fixed version (ground truth):
/** 
 * Returns a hash code for a   {@code short} value; compatible with{@code Short.hashCode()}.
 * @param value the value to hash
 * @return a hash code value for a {@code short} value.
 * @since 1.8
 */
public static int hashCode(short value){
  return (int)value;
}
Program: 72055
Project: 72055
Buggy source:
/** 
 * Returns the value obtained by reversing the order of the bytes in the two's complement representation of the specified   {@code short} value.
 * @return the value obtained by reversing (or, equivalently, swapping)the bytes in the specified  {@code short} value.
 * @since 1.5
 */
public static short reverseBytes(short i){
  return (short)(((i & 0xFF00) >> 8) | (i << 8));
}

Fixed version (ground truth):
/** 
 * Returns the value obtained by reversing the order of the bytes in the two's complement representation of the specified   {@code short} value.
 * @param i the value whose bytes are to be reversed
 * @return the value obtained by reversing (or, equivalently, swapping)the bytes in the specified  {@code short} value.
 * @since 1.5
 */
public static short reverseBytes(short i){
  return (short)(((i & 0xFF00) >> 8) | (i << 8));
}
Program: 72056
Project: 72056
Buggy source:
/** 
 * Returns the unbiased exponent used in the representation of a  {@code double}.  Special cases: <ul> <li>If the argument is NaN or infinite, then the result is  {@link Double#MAX_EXPONENT} + 1.<li>If the argument is zero or subnormal, then the result is {@link Double#MIN_EXPONENT} -1.</ul>
 * @param d a {@code double} value
 * @since 1.6
 */
public static int getExponent(double d){
  return Math.getExponent(d);
}

Fixed version (ground truth):
/** 
 * Returns the unbiased exponent used in the representation of a  {@code double}.  Special cases: <ul> <li>If the argument is NaN or infinite, then the result is  {@link Double#MAX_EXPONENT} + 1.<li>If the argument is zero or subnormal, then the result is {@link Double#MIN_EXPONENT} -1.</ul>
 * @param d a {@code double} value
 * @return the unbiased exponent of the argument
 * @since 1.6
 */
public static int getExponent(double d){
  return Math.getExponent(d);
}