nus-yam/ex-repair huggingface dataset:
Program: 77555
Project: 77555
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: 77556
Project: 77556
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: 77557
Project: 77557
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: 77558
Project: 77558
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: 77559
Project: 77559
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: 77560
Project: 77560
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: 77561
Project: 77561
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: 77562
Project: 77562
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: 77563
Project: 77563
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: 77564
Project: 77564
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: 77565
Project: 77565
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: 77566
Project: 77566
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: 77567
Project: 77567
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: 77568
Project: 77568
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: 77569
Project: 77569
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: 77570
Project: 77570
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: 77571
Project: 77571
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: 77572
Project: 77572
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: 77573
Project: 77573
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: 77574
Project: 77574
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: 77575
Project: 77575
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: 77576
Project: 77576
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: 77577
Project: 77577
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: 77578
Project: 77578
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: 77579
Project: 77579
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: 77580
Project: 77580
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: 77581
Project: 77581
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: 77583
Project: 77583
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: 77584
Project: 77584
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: 77585
Project: 77585
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);
}
Program: 77586
Project: 77586
Buggy source:
/** 
 * Returns a BigDecimal whose numerical value is equal to (  {@code this} * 10<sup>n</sup>).  The scale ofthe result is  {@code (this.scale() - n)}.
 * @throws ArithmeticException if the scale would beoutside the range of a 32-bit integer.
 * @since 1.5
 */
public BigDecimal scaleByPowerOfTen(int n){
  return new BigDecimal(intVal,intCompact,checkScale((long)scale - n),precision);
}

Fixed version (ground truth):
/** 
 * Returns a BigDecimal whose numerical value is equal to (  {@code this} * 10<sup>n</sup>).  The scale ofthe result is  {@code (this.scale() - n)}.
 * @param n the exponent power of ten to scale by
 * @return a BigDecimal whose numerical value is equal to( {@code this} * 10<sup>n</sup>)
 * @throws ArithmeticException if the scale would beoutside the range of a 32-bit integer.
 * @since 1.5
 */
public BigDecimal scaleByPowerOfTen(int n){
  return new BigDecimal(intVal,intCompact,checkScale((long)scale - n),precision);
}
Program: 77587
Project: 77587
Buggy source:
/** 
 * Return the kind of this tag. similar or synonymous tags.  For most tags, <code>kind()&nbsp;==&nbsp;name()</code>; the following table lists those cases where there is more than one tag of a given kind: <p> <table border="1" cellpadding="4" cellspacing="0"> <tr><th><tt> kind()  </tt></th>  <th><tt> name()      </tt></th></tr> <tr><td><tt> @throws </tt></td>  <td><tt> @throws     </tt></td></tr> <tr><td><tt> @throws </tt></td>  <td><tt> @exception  </tt></td></tr> <tr><td><tt> @see    </tt></td>  <td><tt> @see        </tt></td></tr> <tr><td><tt> @see    </tt></td>  <td><tt> @link       </tt></td></tr> <tr><td><tt> @see    </tt></td>  <td><tt> @linkplain  </tt></td></tr> <tr><td><tt> @serial </tt></td>  <td><tt> @serial     </tt></td></tr> <tr><td><tt> @serial </tt></td>  <td><tt> @serialData </tt></td></tr> </table>
 */
String kind();

Fixed version (ground truth):
/** 
 * Return the kind of this tag. For most tags, <code>kind()&nbsp;==&nbsp;name()</code>; the following table lists those cases where there is more than one tag of a given kind: <p> <table border="1" cellpadding="4" cellspacing="0" summary="related tags"> <tr><th>  {@code kind()  }</th>  <th>  {@code name()      }</th></tr> <tr><td>  {@code @throws }</td>  <td>  {@code @throws     }</td></tr> <tr><td>  {@code @throws }</td>  <td>  {@code @exception  }</td></tr> <tr><td>  {@code @see    }</td>  <td>  {@code @see        }</td></tr> <tr><td>  {@code @see    }</td>  <td>  {@code @link       }</td></tr> <tr><td>  {@code @see    }</td>  <td>  {@code @linkplain  }</td></tr> <tr><td>  {@code @serial }</td>  <td>  {@code @serial     }</td></tr> <tr><td>  {@code @serial }</td>  <td>  {@code @serialData }</td></tr> </table>
 * @return the kind of this tag.
 */
String kind();
Program: 77588
Project: 77588
Buggy source:
/** 
 * Return the name of this tag.  The name is the string starting with "@" that is used in a doc comment, such as <code>@return</code>.  For inline tags, such as <code>{&#064;link}</code>, the curly brackets are not part of the name, so in this example the name would be simply <code>@link</code>.
 */
String name();

Fixed version (ground truth):
/** 
 * Return the name of this tag.  The name is the string starting with "@" that is used in a doc comment, such as <code>@return</code>.  For inline tags, such as <code>{&#064;link}</code>, the curly brackets are not part of the name, so in this example the name would be simply <code>@link</code>.
 * @return the name of this tag
 */
String name();
Program: 77589
Project: 77589
Buggy source:
/** 
 * Return the containing   {@link Doc} of this Tag element.
 */
Doc holder();

Fixed version (ground truth):
/** 
 * Return the containing   {@link Doc} of this Tag element.
 * @return the containing {@link Doc} of this Tag element
 */
Doc holder();
Program: 77590
Project: 77590
Buggy source:
/** 
 * Return the text of this tag, that is, portion beyond tag name.
 */
String text();

Fixed version (ground truth):
/** 
 * Return the text of this tag, that is, the portion beyond tag name.
 * @return the text of this tag
 */
String text();
Program: 77591
Project: 77591
Buggy source:
BasicLookupHelper(Name name,Type site,List<Type> argtypes,List<Type> typeargtypes){
  super(name,site,argtypes,typeargtypes,MethodResolutionPhase.VARARITY);
}

Fixed version (ground truth):
BasicLookupHelper(Name name,Type site,List<Type> argtypes,List<Type> typeargtypes,MethodResolutionPhase maxPhase){
  super(name,site,argtypes,typeargtypes,maxPhase);
}