nus-yam/ex-repair huggingface dataset:
Program: 198798
Project: 198798
Buggy source:
/** 
 * Retrieve the ColorStateList for the attribute at <var>index</var>. The value may be either a single solid color or a reference to a color or complex   {@link android.content.res.ColorStateList} description.
 * @param index Index of attribute to retrieve.
 * @return ColorStateList for the attribute, or null if not defined.
 */
public ColorStateList getColorStateList(int index){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  final TypedValue value=mValue;
  if (getValueAt(index * AssetManager.STYLE_NUM_ENTRIES,value)) {
    return mResources.loadColorStateList(value,value.resourceId);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Retrieve the ColorStateList for the attribute at <var>index</var>. The value may be either a single solid color or a reference to a color or complex   {@link android.content.res.ColorStateList} description.
 * @param index Index of attribute to retrieve.
 * @return ColorStateList for the attribute, or null if not defined.
 */
public ColorStateList getColorStateList(int index){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  final TypedValue value=mValue;
  if (getValueAt(index * AssetManager.STYLE_NUM_ENTRIES,value)) {
    if (value.type == TypedValue.TYPE_ATTRIBUTE) {
      throw new RuntimeException("String_Node_Str" + index);
    }
    return mResources.loadColorStateList(value,value.resourceId);
  }
  return null;
}
Program: 198799
Project: 198799
Buggy source:
/** 
 * Retrieve a fractional unit attribute at <var>index</var>.
 * @param index Index of attribute to retrieve.
 * @param base The base value of this fraction.  In other words, astandard fraction is multiplied by this value.
 * @param pbase The parent base value of this fraction.  In otherwords, a parent fraction (nn%p) is multiplied by this value.
 * @param defValue Value to return if the attribute is not defined ornot a resource.
 * @return Attribute fractional value multiplied by the appropriatebase value, or defValue if not defined.
 */
public float getFraction(int index,int base,int pbase,float defValue){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  index*=AssetManager.STYLE_NUM_ENTRIES;
  final int[] data=mData;
  final int type=data[index + AssetManager.STYLE_TYPE];
  if (type == TypedValue.TYPE_NULL) {
    return defValue;
  }
 else   if (type == TypedValue.TYPE_FRACTION) {
    return TypedValue.complexToFraction(data[index + AssetManager.STYLE_DATA],base,pbase);
  }
  throw new UnsupportedOperationException("String_Node_Str" + Integer.toHexString(type));
}

Fixed version (ground truth):
/** 
 * Retrieve a fractional unit attribute at <var>index</var>.
 * @param index Index of attribute to retrieve.
 * @param base The base value of this fraction.  In other words, astandard fraction is multiplied by this value.
 * @param pbase The parent base value of this fraction.  In otherwords, a parent fraction (nn%p) is multiplied by this value.
 * @param defValue Value to return if the attribute is not defined ornot a resource.
 * @return Attribute fractional value multiplied by the appropriatebase value, or defValue if not defined.
 */
public float getFraction(int index,int base,int pbase,float defValue){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  index*=AssetManager.STYLE_NUM_ENTRIES;
  final int[] data=mData;
  final int type=data[index + AssetManager.STYLE_TYPE];
  if (type == TypedValue.TYPE_NULL) {
    return defValue;
  }
 else   if (type == TypedValue.TYPE_FRACTION) {
    return TypedValue.complexToFraction(data[index + AssetManager.STYLE_DATA],base,pbase);
  }
 else   if (type == TypedValue.TYPE_ATTRIBUTE) {
    throw new RuntimeException("String_Node_Str" + index);
  }
  throw new UnsupportedOperationException("String_Node_Str" + Integer.toHexString(type));
}
Program: 198800
Project: 198800
Buggy source:
/** 
 * Retrieve the Drawable for the attribute at <var>index</var>.  This gets the resource ID of the selected attribute, and uses  {@link Resources#getDrawable Resources.getDrawable} of the owningResources object to retrieve its Drawable.
 * @param index Index of attribute to retrieve.
 * @return Drawable for the attribute, or null if not defined.
 */
public Drawable getDrawable(int index){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  final TypedValue value=mValue;
  if (getValueAt(index * AssetManager.STYLE_NUM_ENTRIES,value)) {
    if (false) {
      System.out.println("String_Node_Str");
      System.out.println("String_Node_Str" + value.type + "String_Node_Str"+ value.string+ "String_Node_Str"+ Integer.toHexString(value.data)+ "String_Node_Str"+ value.assetCookie);
      System.out.println("String_Node_Str");
    }
    return mResources.loadDrawable(value,value.resourceId,mTheme);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Retrieve the Drawable for the attribute at <var>index</var>.
 * @param index Index of attribute to retrieve.
 * @return Drawable for the attribute, or null if not defined.
 */
public Drawable getDrawable(int index){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  final TypedValue value=mValue;
  if (getValueAt(index * AssetManager.STYLE_NUM_ENTRIES,value)) {
    if (value.type == TypedValue.TYPE_ATTRIBUTE) {
      throw new RuntimeException("String_Node_Str" + index);
    }
    return mResources.loadDrawable(value,value.resourceId,mTheme);
  }
  return null;
}
Program: 198801
Project: 198801
Buggy source:
/** 
 * Retrieve a dimensional unit attribute at <var>index</var> for use as an offset in raw pixels.  This is the same as  {@link #getDimension}, except the returned value is converted to integer pixels for you.  An offset conversion involves simply truncating the base value to an integer.
 * @param index Index of attribute to retrieve.
 * @param defValue Value to return if the attribute is not defined ornot a resource.
 * @return Attribute dimension value multiplied by the appropriatemetric and truncated to integer pixels, or defValue if not defined.
 * @see #getDimension
 * @see #getDimensionPixelSize
 */
public int getDimensionPixelOffset(int index,int defValue){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  index*=AssetManager.STYLE_NUM_ENTRIES;
  final int[] data=mData;
  final int type=data[index + AssetManager.STYLE_TYPE];
  if (type == TypedValue.TYPE_NULL) {
    return defValue;
  }
 else   if (type == TypedValue.TYPE_DIMENSION) {
    return TypedValue.complexToDimensionPixelOffset(data[index + AssetManager.STYLE_DATA],mMetrics);
  }
  throw new UnsupportedOperationException("String_Node_Str" + Integer.toHexString(type));
}

Fixed version (ground truth):
/** 
 * Retrieve a dimensional unit attribute at <var>index</var> for use as an offset in raw pixels.  This is the same as  {@link #getDimension}, except the returned value is converted to integer pixels for you.  An offset conversion involves simply truncating the base value to an integer.
 * @param index Index of attribute to retrieve.
 * @param defValue Value to return if the attribute is not defined ornot a resource.
 * @return Attribute dimension value multiplied by the appropriatemetric and truncated to integer pixels, or defValue if not defined.
 * @see #getDimension
 * @see #getDimensionPixelSize
 */
public int getDimensionPixelOffset(int index,int defValue){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  index*=AssetManager.STYLE_NUM_ENTRIES;
  final int[] data=mData;
  final int type=data[index + AssetManager.STYLE_TYPE];
  if (type == TypedValue.TYPE_NULL) {
    return defValue;
  }
 else   if (type == TypedValue.TYPE_DIMENSION) {
    return TypedValue.complexToDimensionPixelOffset(data[index + AssetManager.STYLE_DATA],mMetrics);
  }
 else   if (type == TypedValue.TYPE_ATTRIBUTE) {
    throw new RuntimeException("String_Node_Str" + index);
  }
  throw new UnsupportedOperationException("String_Node_Str" + Integer.toHexString(type));
}
Program: 198802
Project: 198802
Buggy source:
/** 
 * Retrieve the integer value for the attribute at <var>index</var>.
 * @param index Index of attribute to retrieve.
 * @param defValue Value to return if the attribute is not defined ornot a resource.
 * @return Attribute integer value, or defValue if not defined.
 */
public int getInteger(int index,int defValue){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  index*=AssetManager.STYLE_NUM_ENTRIES;
  final int[] data=mData;
  final int type=data[index + AssetManager.STYLE_TYPE];
  if (type == TypedValue.TYPE_NULL) {
    return defValue;
  }
 else   if (type >= TypedValue.TYPE_FIRST_INT && type <= TypedValue.TYPE_LAST_INT) {
    return data[index + AssetManager.STYLE_DATA];
  }
  throw new UnsupportedOperationException("String_Node_Str" + Integer.toHexString(type));
}

Fixed version (ground truth):
/** 
 * Retrieve the integer value for the attribute at <var>index</var>.
 * @param index Index of attribute to retrieve.
 * @param defValue Value to return if the attribute is not defined ornot a resource.
 * @return Attribute integer value, or defValue if not defined.
 */
public int getInteger(int index,int defValue){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  index*=AssetManager.STYLE_NUM_ENTRIES;
  final int[] data=mData;
  final int type=data[index + AssetManager.STYLE_TYPE];
  if (type == TypedValue.TYPE_NULL) {
    return defValue;
  }
 else   if (type >= TypedValue.TYPE_FIRST_INT && type <= TypedValue.TYPE_LAST_INT) {
    return data[index + AssetManager.STYLE_DATA];
  }
 else   if (type == TypedValue.TYPE_ATTRIBUTE) {
    throw new RuntimeException("String_Node_Str" + index);
  }
  throw new UnsupportedOperationException("String_Node_Str" + Integer.toHexString(type));
}
Program: 198803
Project: 198803
Buggy source:
/** 
 * Retrieve a dimensional unit attribute at <var>index</var>.  Unit conversions are based on the current   {@link DisplayMetrics}associated with the resources this   {@link TypedArray} objectcame from.
 * @param index Index of attribute to retrieve.
 * @param defValue Value to return if the attribute is not defined ornot a resource.
 * @return Attribute dimension value multiplied by the appropriatemetric, or defValue if not defined.
 * @see #getDimensionPixelOffset
 * @see #getDimensionPixelSize
 */
public float getDimension(int index,float defValue){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  index*=AssetManager.STYLE_NUM_ENTRIES;
  final int[] data=mData;
  final int type=data[index + AssetManager.STYLE_TYPE];
  if (type == TypedValue.TYPE_NULL) {
    return defValue;
  }
 else   if (type == TypedValue.TYPE_DIMENSION) {
    return TypedValue.complexToDimension(data[index + AssetManager.STYLE_DATA],mMetrics);
  }
  throw new UnsupportedOperationException("String_Node_Str" + Integer.toHexString(type));
}

Fixed version (ground truth):
/** 
 * Retrieve a dimensional unit attribute at <var>index</var>.  Unit conversions are based on the current   {@link DisplayMetrics}associated with the resources this   {@link TypedArray} objectcame from.
 * @param index Index of attribute to retrieve.
 * @param defValue Value to return if the attribute is not defined ornot a resource.
 * @return Attribute dimension value multiplied by the appropriatemetric, or defValue if not defined.
 * @see #getDimensionPixelOffset
 * @see #getDimensionPixelSize
 */
public float getDimension(int index,float defValue){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  index*=AssetManager.STYLE_NUM_ENTRIES;
  final int[] data=mData;
  final int type=data[index + AssetManager.STYLE_TYPE];
  if (type == TypedValue.TYPE_NULL) {
    return defValue;
  }
 else   if (type == TypedValue.TYPE_DIMENSION) {
    return TypedValue.complexToDimension(data[index + AssetManager.STYLE_DATA],mMetrics);
  }
 else   if (type == TypedValue.TYPE_ATTRIBUTE) {
    throw new RuntimeException("String_Node_Str" + index);
  }
  throw new UnsupportedOperationException("String_Node_Str" + Integer.toHexString(type));
}
Program: 198804
Project: 198804
Buggy source:
/** 
 * Retrieve the CharSequence[] for the attribute at <var>index</var>. This gets the resource ID of the selected attribute, and uses  {@link Resources#getTextArray Resources.getTextArray} of the owningResources object to retrieve its String[].
 * @param index Index of attribute to retrieve.
 * @return CharSequence[] for the attribute, or null if not defined.
 */
public CharSequence[] getTextArray(int index){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  final TypedValue value=mValue;
  if (getValueAt(index * AssetManager.STYLE_NUM_ENTRIES,value)) {
    if (false) {
      System.out.println("String_Node_Str");
      System.out.println("String_Node_Str" + value.type + "String_Node_Str"+ value.string+ "String_Node_Str"+ Integer.toHexString(value.data)+ "String_Node_Str"+ value.assetCookie);
      System.out.println("String_Node_Str");
    }
    return mResources.getTextArray(value.resourceId);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Retrieve the CharSequence[] for the attribute at <var>index</var>. This gets the resource ID of the selected attribute, and uses  {@link Resources#getTextArray Resources.getTextArray} of the owningResources object to retrieve its String[].
 * @param index Index of attribute to retrieve.
 * @return CharSequence[] for the attribute, or null if not defined.
 */
public CharSequence[] getTextArray(int index){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  final TypedValue value=mValue;
  if (getValueAt(index * AssetManager.STYLE_NUM_ENTRIES,value)) {
    return mResources.getTextArray(value.resourceId);
  }
  return null;
}
Program: 198805
Project: 198805
Buggy source:
/** 
 * Retrieve a dimensional unit attribute at <var>index</var> for use as a size in raw pixels.  This is the same as  {@link #getDimension}, except the returned value is converted to integer pixels for use as a size.  A size conversion involves rounding the base value, and ensuring that a non-zero base value is at least one pixel in size.
 * @param index Index of attribute to retrieve.
 * @param defValue Value to return if the attribute is not defined ornot a resource.
 * @return Attribute dimension value multiplied by the appropriatemetric and truncated to integer pixels, or defValue if not defined.
 * @see #getDimension
 * @see #getDimensionPixelOffset
 */
public int getDimensionPixelSize(int index,int defValue){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  index*=AssetManager.STYLE_NUM_ENTRIES;
  final int[] data=mData;
  final int type=data[index + AssetManager.STYLE_TYPE];
  if (type == TypedValue.TYPE_NULL) {
    return defValue;
  }
 else   if (type == TypedValue.TYPE_DIMENSION) {
    return TypedValue.complexToDimensionPixelSize(data[index + AssetManager.STYLE_DATA],mMetrics);
  }
  throw new UnsupportedOperationException("String_Node_Str" + Integer.toHexString(type));
}

Fixed version (ground truth):
/** 
 * Retrieve a dimensional unit attribute at <var>index</var> for use as a size in raw pixels.  This is the same as  {@link #getDimension}, except the returned value is converted to integer pixels for use as a size.  A size conversion involves rounding the base value, and ensuring that a non-zero base value is at least one pixel in size.
 * @param index Index of attribute to retrieve.
 * @param defValue Value to return if the attribute is not defined ornot a resource.
 * @return Attribute dimension value multiplied by the appropriatemetric and truncated to integer pixels, or defValue if not defined.
 * @see #getDimension
 * @see #getDimensionPixelOffset
 */
public int getDimensionPixelSize(int index,int defValue){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  index*=AssetManager.STYLE_NUM_ENTRIES;
  final int[] data=mData;
  final int type=data[index + AssetManager.STYLE_TYPE];
  if (type == TypedValue.TYPE_NULL) {
    return defValue;
  }
 else   if (type == TypedValue.TYPE_DIMENSION) {
    return TypedValue.complexToDimensionPixelSize(data[index + AssetManager.STYLE_DATA],mMetrics);
  }
 else   if (type == TypedValue.TYPE_ATTRIBUTE) {
    throw new RuntimeException("String_Node_Str" + index);
  }
  throw new UnsupportedOperationException("String_Node_Str" + Integer.toHexString(type));
}
Program: 198806
Project: 198806
Buggy source:
/** 
 * Retrieve the color value for the attribute at <var>index</var>.  If the attribute references a color resource holding a complex  {@link android.content.res.ColorStateList}, then the default color from the set is returned.
 * @param index Index of attribute to retrieve.
 * @param defValue Value to return if the attribute is not defined ornot a resource.
 * @return Attribute color value, or defValue if not defined.
 */
public int getColor(int index,int defValue){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  index*=AssetManager.STYLE_NUM_ENTRIES;
  final int[] data=mData;
  final int type=data[index + AssetManager.STYLE_TYPE];
  if (type == TypedValue.TYPE_NULL) {
    return defValue;
  }
 else   if (type >= TypedValue.TYPE_FIRST_INT && type <= TypedValue.TYPE_LAST_INT) {
    return data[index + AssetManager.STYLE_DATA];
  }
 else   if (type == TypedValue.TYPE_STRING) {
    final TypedValue value=mValue;
    if (getValueAt(index,value)) {
      ColorStateList csl=mResources.loadColorStateList(value,value.resourceId);
      return csl.getDefaultColor();
    }
    return defValue;
  }
  throw new UnsupportedOperationException("String_Node_Str" + Integer.toHexString(type));
}

Fixed version (ground truth):
/** 
 * Retrieve the color value for the attribute at <var>index</var>.  If the attribute references a color resource holding a complex  {@link android.content.res.ColorStateList}, then the default color from the set is returned.
 * @param index Index of attribute to retrieve.
 * @param defValue Value to return if the attribute is not defined ornot a resource.
 * @return Attribute color value, or defValue if not defined.
 */
public int getColor(int index,int defValue){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  index*=AssetManager.STYLE_NUM_ENTRIES;
  final int[] data=mData;
  final int type=data[index + AssetManager.STYLE_TYPE];
  if (type == TypedValue.TYPE_NULL) {
    return defValue;
  }
 else   if (type >= TypedValue.TYPE_FIRST_INT && type <= TypedValue.TYPE_LAST_INT) {
    return data[index + AssetManager.STYLE_DATA];
  }
 else   if (type == TypedValue.TYPE_STRING) {
    final TypedValue value=mValue;
    if (getValueAt(index,value)) {
      ColorStateList csl=mResources.loadColorStateList(value,value.resourceId);
      return csl.getDefaultColor();
    }
    return defValue;
  }
 else   if (type == TypedValue.TYPE_ATTRIBUTE) {
    throw new RuntimeException("String_Node_Str" + index);
  }
  throw new UnsupportedOperationException("String_Node_Str" + Integer.toHexString(type));
}
Program: 198807
Project: 198807
Buggy source:
/** 
 * Retrieve the ColorStateList for the attribute at <var>index</var>. The value may be either a single solid color or a reference to a color or complex   {@link android.content.res.ColorStateList} description.
 * @param index Index of attribute to retrieve.
 * @return ColorStateList for the attribute, or null if not defined.
 */
public ColorStateList getColorStateList(int index){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  final TypedValue value=mValue;
  if (getValueAt(index * AssetManager.STYLE_NUM_ENTRIES,value)) {
    return mResources.loadColorStateList(value,value.resourceId);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Retrieve the ColorStateList for the attribute at <var>index</var>. The value may be either a single solid color or a reference to a color or complex   {@link android.content.res.ColorStateList} description.
 * @param index Index of attribute to retrieve.
 * @return ColorStateList for the attribute, or null if not defined.
 */
public ColorStateList getColorStateList(int index){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  final TypedValue value=mValue;
  if (getValueAt(index * AssetManager.STYLE_NUM_ENTRIES,value)) {
    if (value.type == TypedValue.TYPE_ATTRIBUTE) {
      throw new RuntimeException("String_Node_Str" + index);
    }
    return mResources.loadColorStateList(value,value.resourceId);
  }
  return null;
}
Program: 198808
Project: 198808
Buggy source:
/** 
 * Retrieve a fractional unit attribute at <var>index</var>.
 * @param index Index of attribute to retrieve.
 * @param base The base value of this fraction.  In other words, astandard fraction is multiplied by this value.
 * @param pbase The parent base value of this fraction.  In otherwords, a parent fraction (nn%p) is multiplied by this value.
 * @param defValue Value to return if the attribute is not defined ornot a resource.
 * @return Attribute fractional value multiplied by the appropriatebase value, or defValue if not defined.
 */
public float getFraction(int index,int base,int pbase,float defValue){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  index*=AssetManager.STYLE_NUM_ENTRIES;
  final int[] data=mData;
  final int type=data[index + AssetManager.STYLE_TYPE];
  if (type == TypedValue.TYPE_NULL) {
    return defValue;
  }
 else   if (type == TypedValue.TYPE_FRACTION) {
    return TypedValue.complexToFraction(data[index + AssetManager.STYLE_DATA],base,pbase);
  }
  throw new UnsupportedOperationException("String_Node_Str" + Integer.toHexString(type));
}

Fixed version (ground truth):
/** 
 * Retrieve a fractional unit attribute at <var>index</var>.
 * @param index Index of attribute to retrieve.
 * @param base The base value of this fraction.  In other words, astandard fraction is multiplied by this value.
 * @param pbase The parent base value of this fraction.  In otherwords, a parent fraction (nn%p) is multiplied by this value.
 * @param defValue Value to return if the attribute is not defined ornot a resource.
 * @return Attribute fractional value multiplied by the appropriatebase value, or defValue if not defined.
 */
public float getFraction(int index,int base,int pbase,float defValue){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  index*=AssetManager.STYLE_NUM_ENTRIES;
  final int[] data=mData;
  final int type=data[index + AssetManager.STYLE_TYPE];
  if (type == TypedValue.TYPE_NULL) {
    return defValue;
  }
 else   if (type == TypedValue.TYPE_FRACTION) {
    return TypedValue.complexToFraction(data[index + AssetManager.STYLE_DATA],base,pbase);
  }
 else   if (type == TypedValue.TYPE_ATTRIBUTE) {
    throw new RuntimeException("String_Node_Str" + index);
  }
  throw new UnsupportedOperationException("String_Node_Str" + Integer.toHexString(type));
}
Program: 198809
Project: 198809
Buggy source:
@Override public WindowInsets dispatchApplyWindowInsets(WindowInsets insets){
  if (mOutsetBottom != null) {
    final DisplayMetrics metrics=getContext().getResources().getDisplayMetrics();
    int bottom=(int)mOutsetBottom.getDimension(metrics);
    WindowInsets newInsets=insets.replaceSystemWindowInsets(insets.getSystemWindowInsetLeft(),insets.getSystemWindowInsetTop(),insets.getSystemWindowInsetRight(),insets.getSystemWindowInsetBottom() + bottom);
    return super.dispatchApplyWindowInsets(newInsets);
  }
 else {
    return super.dispatchApplyWindowInsets(insets);
  }
}

Fixed version (ground truth):
@Override public WindowInsets dispatchApplyWindowInsets(WindowInsets insets){
  if (mOutsetBottom != null) {
    final DisplayMetrics metrics=getContext().getResources().getDisplayMetrics();
    int bottom=(int)mOutsetBottom.getDimension(metrics);
    WindowInsets newInsets=insets.replaceSystemWindowInsets(insets.getSystemWindowInsetLeft(),insets.getSystemWindowInsetTop(),insets.getSystemWindowInsetRight(),bottom);
    return super.dispatchApplyWindowInsets(newInsets);
  }
 else {
    return super.dispatchApplyWindowInsets(insets);
  }
}
Program: 198810
Project: 198810
Buggy source:
@Override protected void handleSecondaryClick(){
  if (!mState.value) {
    mController.setBluetoothEnabled(true);
  }
  showDetail(true);
}

Fixed version (ground truth):
@Override protected void handleSecondaryClick(){
  showDetail(true);
}
Program: 198811
Project: 198811
Buggy source:
public int getCurrentHour(){
  int hours=mSelectionDegrees[mIsOnInnerCircle ? HOURS_INNER : HOURS] / DEGREES_FOR_ONE_HOUR;
  if (mIs24HourMode) {
    if (mIsOnInnerCircle) {
      hours=hours % 12;
    }
 else {
      if (hours != 0) {
        hours+=12;
      }
    }
  }
 else {
    hours=hours % 12;
    if (hours == 0) {
      if (mAmOrPm == PM) {
        hours=12;
      }
    }
 else {
      if (mAmOrPm == PM) {
        hours+=12;
      }
    }
  }
  return hours;
}

Fixed version (ground truth):
public int getCurrentHour(){
  int hours=mSelectionDegrees[mIsOnInnerCircle ? HOURS_INNER : HOURS] / DEGREES_FOR_ONE_HOUR;
  if (mIs24HourMode) {
    if (mIsOnInnerCircle) {
      hours=hours % 12;
      if (hours == 0) {
        hours=12;
      }
    }
 else {
      if (hours != 0) {
        hours+=12;
      }
    }
  }
 else {
    hours=hours % 12;
    if (hours == 0) {
      if (mAmOrPm == PM) {
        hours=12;
      }
    }
 else {
      if (mAmOrPm == PM) {
        hours+=12;
      }
    }
  }
  return hours;
}
Program: 198812
Project: 198812
Buggy source:
/** 
 * Set report delay timestamp for Bluetooth LE scan.
 * @param reportDelayMillis Set to 0 to be notified of results immediately.Values &gt; 0 causes the scan results to be queued up and delivered after the requested delay or when the internal buffers fill up.
 * @throws IllegalArgumentException If {@code reportDelaySeconds} &lt; 0.
 */
public Builder setReportDelayMillis(long reportDelayMillis){
  if (reportDelayMillis < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  mReportDelayMillis=reportDelayMillis;
  return this;
}

Fixed version (ground truth):
/** 
 * Set report delay timestamp for Bluetooth LE scan.
 * @param reportDelayMillis Set to 0 to be notified of results immediately. Values &gt; 0causes the scan results to be queued up and delivered after the requested delay or when the internal buffers fill up.
 * @throws IllegalArgumentException If {@code reportDelayMillis} &lt; 0.
 */
public Builder setReportDelayMillis(long reportDelayMillis){
  if (reportDelayMillis < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  mReportDelayMillis=reportDelayMillis;
  return this;
}
Program: 198813
Project: 198813
Buggy source:
/** 
 * Set callback type for Bluetooth LE scan.
 * @param callbackType The callback type flags for the scan.
 * @throws IllegalArgumentException If the {@code callbackType} is invalid.
 */
public Builder setCallbackType(int callbackType){
  if (callbackType < CALLBACK_TYPE_ALL_MATCHES || callbackType > (CALLBACK_TYPE_FIRST_MATCH | CALLBACK_TYPE_MATCH_LOST) || (callbackType & CALLBACK_TYPE_ALL_MATCHES) != CALLBACK_TYPE_ALL_MATCHES) {
    throw new IllegalArgumentException("String_Node_Str" + callbackType);
  }
  mCallbackType=callbackType;
  return this;
}

Fixed version (ground truth):
/** 
 * Set callback type for Bluetooth LE scan.
 * @param callbackType The callback type flags for the scan.
 * @throws IllegalArgumentException If the {@code callbackType} is invalid.
 */
public Builder setCallbackType(int callbackType){
  if (!isValidCallbackType(callbackType)) {
    throw new IllegalArgumentException("String_Node_Str" + callbackType);
  }
  mCallbackType=callbackType;
  return this;
}
Program: 198814
Project: 198814
Buggy source:
public int getCurrentHour(){
  int hours=mSelectionDegrees[mIsOnInnerCircle ? HOURS_INNER : HOURS] / DEGREES_FOR_ONE_HOUR;
  if (mIs24HourMode) {
    if (mIsOnInnerCircle) {
      hours=hours % 12;
    }
 else {
      if (hours != 0) {
        hours+=12;
      }
    }
  }
 else {
    hours=hours % 12;
    if (hours == 0) {
      if (mAmOrPm == PM) {
        hours=12;
      }
    }
 else {
      if (mAmOrPm == PM) {
        hours+=12;
      }
    }
  }
  return hours;
}

Fixed version (ground truth):
public int getCurrentHour(){
  int hours=mSelectionDegrees[mIsOnInnerCircle ? HOURS_INNER : HOURS] / DEGREES_FOR_ONE_HOUR;
  if (mIs24HourMode) {
    if (mIsOnInnerCircle) {
      hours=hours % 12;
      if (hours == 0) {
        hours=12;
      }
    }
 else {
      if (hours != 0) {
        hours+=12;
      }
    }
  }
 else {
    hours=hours % 12;
    if (hours == 0) {
      if (mAmOrPm == PM) {
        hours=12;
      }
    }
 else {
      if (mAmOrPm == PM) {
        hours+=12;
      }
    }
  }
  return hours;
}
Program: 198815
Project: 198815
Buggy source:
/** 
 * Gets the unsigned horizontal extent of the specified line, including leading margin indent and trailing whitespace.
 */
public float getLineWidth(int line){
  float margin=getParagraphLeadingMargin(line);
  float signedExtent=getLineExtent(line,true);
  return margin + signedExtent >= 0 ? signedExtent : -signedExtent;
}

Fixed version (ground truth):
/** 
 * Gets the unsigned horizontal extent of the specified line, including leading margin indent and trailing whitespace.
 */
public float getLineWidth(int line){
  float margin=getParagraphLeadingMargin(line);
  float signedExtent=getLineExtent(line,true);
  return margin + (signedExtent >= 0 ? signedExtent : -signedExtent);
}
Program: 198816
Project: 198816
Buggy source:
static float measurePara(TextPaint paint,CharSequence text,int start,int end){
  MeasuredText mt=MeasuredText.obtain();
  TextLine tl=TextLine.obtain();
  try {
    mt.setPara(text,start,end,TextDirectionHeuristics.LTR);
    Directions directions;
    int dir;
    if (mt.mEasy) {
      directions=DIRS_ALL_LEFT_TO_RIGHT;
      dir=Layout.DIR_LEFT_TO_RIGHT;
    }
 else {
      directions=AndroidBidi.directions(mt.mDir,mt.mLevels,0,mt.mChars,0,mt.mLen);
      dir=mt.mDir;
    }
    char[] chars=mt.mChars;
    int len=mt.mLen;
    boolean hasTabs=false;
    TabStops tabStops=null;
    for (int i=0; i < len; ++i) {
      if (chars[i] == '\t') {
        hasTabs=true;
        if (text instanceof Spanned) {
          Spanned spanned=(Spanned)text;
          int spanEnd=spanned.nextSpanTransition(start,end,TabStopSpan.class);
          TabStopSpan[] spans=getParagraphSpans(spanned,start,spanEnd,TabStopSpan.class);
          if (spans.length > 0) {
            tabStops=new TabStops(TAB_INCREMENT,spans);
          }
        }
        break;
      }
    }
    tl.set(paint,text,start,end,dir,directions,hasTabs,tabStops);
    return tl.metrics(null);
  }
  finally {
    TextLine.recycle(tl);
    MeasuredText.recycle(mt);
  }
}

Fixed version (ground truth):
static float measurePara(TextPaint paint,CharSequence text,int start,int end){
  MeasuredText mt=MeasuredText.obtain();
  TextLine tl=TextLine.obtain();
  try {
    mt.setPara(text,start,end,TextDirectionHeuristics.LTR);
    Directions directions;
    int dir;
    if (mt.mEasy) {
      directions=DIRS_ALL_LEFT_TO_RIGHT;
      dir=Layout.DIR_LEFT_TO_RIGHT;
    }
 else {
      directions=AndroidBidi.directions(mt.mDir,mt.mLevels,0,mt.mChars,0,mt.mLen);
      dir=mt.mDir;
    }
    char[] chars=mt.mChars;
    int len=mt.mLen;
    boolean hasTabs=false;
    TabStops tabStops=null;
    int margin=0;
    if (text instanceof Spanned) {
      Spanned spanned=(Spanned)text;
      LeadingMarginSpan[] spans=getParagraphSpans(spanned,start,end,LeadingMarginSpan.class);
      for (      LeadingMarginSpan lms : spans) {
        margin+=lms.getLeadingMargin(true);
      }
    }
    for (int i=0; i < len; ++i) {
      if (chars[i] == '\t') {
        hasTabs=true;
        if (text instanceof Spanned) {
          Spanned spanned=(Spanned)text;
          int spanEnd=spanned.nextSpanTransition(start,end,TabStopSpan.class);
          TabStopSpan[] spans=getParagraphSpans(spanned,start,spanEnd,TabStopSpan.class);
          if (spans.length > 0) {
            tabStops=new TabStops(TAB_INCREMENT,spans);
          }
        }
        break;
      }
    }
    tl.set(paint,text,start,end,dir,directions,hasTabs,tabStops);
    return margin + tl.metrics(null);
  }
  finally {
    TextLine.recycle(tl);
    MeasuredText.recycle(mt);
  }
}
Program: 198817
Project: 198817
Buggy source:
/** 
 * Gets the unsigned horizontal extent of the specified line, including leading margin indent, but excluding trailing whitespace.
 */
public float getLineMax(int line){
  float margin=getParagraphLeadingMargin(line);
  float signedExtent=getLineExtent(line,false);
  return margin + signedExtent >= 0 ? signedExtent : -signedExtent;
}

Fixed version (ground truth):
/** 
 * Gets the unsigned horizontal extent of the specified line, including leading margin indent, but excluding trailing whitespace.
 */
public float getLineMax(int line){
  float margin=getParagraphLeadingMargin(line);
  float signedExtent=getLineExtent(line,false);
  return margin + (signedExtent >= 0 ? signedExtent : -signedExtent);
}
Program: 198818
Project: 198818
Buggy source:
public int getCurrentHour(){
  int hours=mSelectionDegrees[mIsOnInnerCircle ? HOURS_INNER : HOURS] / DEGREES_FOR_ONE_HOUR;
  if (mIs24HourMode) {
    if (mIsOnInnerCircle) {
      hours=hours % 12;
    }
 else {
      if (hours != 0) {
        hours+=12;
      }
    }
  }
 else {
    hours=hours % 12;
    if (hours == 0) {
      if (mAmOrPm == PM) {
        hours=12;
      }
    }
 else {
      if (mAmOrPm == PM) {
        hours+=12;
      }
    }
  }
  return hours;
}

Fixed version (ground truth):
public int getCurrentHour(){
  int hours=mSelectionDegrees[mIsOnInnerCircle ? HOURS_INNER : HOURS] / DEGREES_FOR_ONE_HOUR;
  if (mIs24HourMode) {
    if (mIsOnInnerCircle) {
      hours=hours % 12;
      if (hours == 0) {
        hours=12;
      }
    }
 else {
      if (hours != 0) {
        hours+=12;
      }
    }
  }
 else {
    hours=hours % 12;
    if (hours == 0) {
      if (mAmOrPm == PM) {
        hours=12;
      }
    }
 else {
      if (mAmOrPm == PM) {
        hours+=12;
      }
    }
  }
  return hours;
}
Program: 198819
Project: 198819
Buggy source:
/** 
 * Set report delay timestamp for Bluetooth LE scan.
 * @param reportDelayMillis Set to 0 to be notified of results immediately.Values &gt; 0 causes the scan results to be queued up and delivered after the requested delay or when the internal buffers fill up.
 * @throws IllegalArgumentException If {@code reportDelaySeconds} &lt; 0.
 */
public Builder setReportDelayMillis(long reportDelayMillis){
  if (reportDelayMillis < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  mReportDelayMillis=reportDelayMillis;
  return this;
}

Fixed version (ground truth):
/** 
 * Set report delay timestamp for Bluetooth LE scan.
 * @param reportDelayMillis Set to 0 to be notified of results immediately. Values &gt; 0causes the scan results to be queued up and delivered after the requested delay or when the internal buffers fill up.
 * @throws IllegalArgumentException If {@code reportDelayMillis} &lt; 0.
 */
public Builder setReportDelayMillis(long reportDelayMillis){
  if (reportDelayMillis < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  mReportDelayMillis=reportDelayMillis;
  return this;
}
Program: 198820
Project: 198820
Buggy source:
/** 
 * Set callback type for Bluetooth LE scan.
 * @param callbackType The callback type flags for the scan.
 * @throws IllegalArgumentException If the {@code callbackType} is invalid.
 */
public Builder setCallbackType(int callbackType){
  if (callbackType < CALLBACK_TYPE_ALL_MATCHES || callbackType > (CALLBACK_TYPE_FIRST_MATCH | CALLBACK_TYPE_MATCH_LOST) || (callbackType & CALLBACK_TYPE_ALL_MATCHES) != CALLBACK_TYPE_ALL_MATCHES) {
    throw new IllegalArgumentException("String_Node_Str" + callbackType);
  }
  mCallbackType=callbackType;
  return this;
}

Fixed version (ground truth):
/** 
 * Set callback type for Bluetooth LE scan.
 * @param callbackType The callback type flags for the scan.
 * @throws IllegalArgumentException If the {@code callbackType} is invalid.
 */
public Builder setCallbackType(int callbackType){
  if (!isValidCallbackType(callbackType)) {
    throw new IllegalArgumentException("String_Node_Str" + callbackType);
  }
  mCallbackType=callbackType;
  return this;
}
Program: 198821
Project: 198821
Buggy source:
public int getCurrentHour(){
  int hours=mSelectionDegrees[mIsOnInnerCircle ? HOURS_INNER : HOURS] / DEGREES_FOR_ONE_HOUR;
  if (mIs24HourMode) {
    if (mIsOnInnerCircle) {
      hours=hours % 12;
    }
 else {
      if (hours != 0) {
        hours+=12;
      }
    }
  }
 else {
    hours=hours % 12;
    if (hours == 0) {
      if (mAmOrPm == PM) {
        hours=12;
      }
    }
 else {
      if (mAmOrPm == PM) {
        hours+=12;
      }
    }
  }
  return hours;
}

Fixed version (ground truth):
public int getCurrentHour(){
  int hours=mSelectionDegrees[mIsOnInnerCircle ? HOURS_INNER : HOURS] / DEGREES_FOR_ONE_HOUR;
  if (mIs24HourMode) {
    if (mIsOnInnerCircle) {
      hours=hours % 12;
      if (hours == 0) {
        hours=12;
      }
    }
 else {
      if (hours != 0) {
        hours+=12;
      }
    }
  }
 else {
    hours=hours % 12;
    if (hours == 0) {
      if (mAmOrPm == PM) {
        hours=12;
      }
    }
 else {
      if (mAmOrPm == PM) {
        hours+=12;
      }
    }
  }
  return hours;
}
Program: 198822
Project: 198822
Buggy source:
/** 
 * Gets the unsigned horizontal extent of the specified line, including leading margin indent and trailing whitespace.
 */
public float getLineWidth(int line){
  float margin=getParagraphLeadingMargin(line);
  float signedExtent=getLineExtent(line,true);
  return margin + signedExtent >= 0 ? signedExtent : -signedExtent;
}

Fixed version (ground truth):
/** 
 * Gets the unsigned horizontal extent of the specified line, including leading margin indent and trailing whitespace.
 */
public float getLineWidth(int line){
  float margin=getParagraphLeadingMargin(line);
  float signedExtent=getLineExtent(line,true);
  return margin + (signedExtent >= 0 ? signedExtent : -signedExtent);
}
Program: 198823
Project: 198823
Buggy source:
static float measurePara(TextPaint paint,CharSequence text,int start,int end){
  MeasuredText mt=MeasuredText.obtain();
  TextLine tl=TextLine.obtain();
  try {
    mt.setPara(text,start,end,TextDirectionHeuristics.LTR);
    Directions directions;
    int dir;
    if (mt.mEasy) {
      directions=DIRS_ALL_LEFT_TO_RIGHT;
      dir=Layout.DIR_LEFT_TO_RIGHT;
    }
 else {
      directions=AndroidBidi.directions(mt.mDir,mt.mLevels,0,mt.mChars,0,mt.mLen);
      dir=mt.mDir;
    }
    char[] chars=mt.mChars;
    int len=mt.mLen;
    boolean hasTabs=false;
    TabStops tabStops=null;
    for (int i=0; i < len; ++i) {
      if (chars[i] == '\t') {
        hasTabs=true;
        if (text instanceof Spanned) {
          Spanned spanned=(Spanned)text;
          int spanEnd=spanned.nextSpanTransition(start,end,TabStopSpan.class);
          TabStopSpan[] spans=getParagraphSpans(spanned,start,spanEnd,TabStopSpan.class);
          if (spans.length > 0) {
            tabStops=new TabStops(TAB_INCREMENT,spans);
          }
        }
        break;
      }
    }
    tl.set(paint,text,start,end,dir,directions,hasTabs,tabStops);
    return tl.metrics(null);
  }
  finally {
    TextLine.recycle(tl);
    MeasuredText.recycle(mt);
  }
}

Fixed version (ground truth):
static float measurePara(TextPaint paint,CharSequence text,int start,int end){
  MeasuredText mt=MeasuredText.obtain();
  TextLine tl=TextLine.obtain();
  try {
    mt.setPara(text,start,end,TextDirectionHeuristics.LTR);
    Directions directions;
    int dir;
    if (mt.mEasy) {
      directions=DIRS_ALL_LEFT_TO_RIGHT;
      dir=Layout.DIR_LEFT_TO_RIGHT;
    }
 else {
      directions=AndroidBidi.directions(mt.mDir,mt.mLevels,0,mt.mChars,0,mt.mLen);
      dir=mt.mDir;
    }
    char[] chars=mt.mChars;
    int len=mt.mLen;
    boolean hasTabs=false;
    TabStops tabStops=null;
    int margin=0;
    if (text instanceof Spanned) {
      Spanned spanned=(Spanned)text;
      LeadingMarginSpan[] spans=getParagraphSpans(spanned,start,end,LeadingMarginSpan.class);
      for (      LeadingMarginSpan lms : spans) {
        margin+=lms.getLeadingMargin(true);
      }
    }
    for (int i=0; i < len; ++i) {
      if (chars[i] == '\t') {
        hasTabs=true;
        if (text instanceof Spanned) {
          Spanned spanned=(Spanned)text;
          int spanEnd=spanned.nextSpanTransition(start,end,TabStopSpan.class);
          TabStopSpan[] spans=getParagraphSpans(spanned,start,spanEnd,TabStopSpan.class);
          if (spans.length > 0) {
            tabStops=new TabStops(TAB_INCREMENT,spans);
          }
        }
        break;
      }
    }
    tl.set(paint,text,start,end,dir,directions,hasTabs,tabStops);
    return margin + tl.metrics(null);
  }
  finally {
    TextLine.recycle(tl);
    MeasuredText.recycle(mt);
  }
}
Program: 198824
Project: 198824
Buggy source:
/** 
 * Gets the unsigned horizontal extent of the specified line, including leading margin indent, but excluding trailing whitespace.
 */
public float getLineMax(int line){
  float margin=getParagraphLeadingMargin(line);
  float signedExtent=getLineExtent(line,false);
  return margin + signedExtent >= 0 ? signedExtent : -signedExtent;
}

Fixed version (ground truth):
/** 
 * Gets the unsigned horizontal extent of the specified line, including leading margin indent, but excluding trailing whitespace.
 */
public float getLineMax(int line){
  float margin=getParagraphLeadingMargin(line);
  float signedExtent=getLineExtent(line,false);
  return margin + (signedExtent >= 0 ? signedExtent : -signedExtent);
}
Program: 198825
Project: 198825
Buggy source:
/** 
 * Set report delay timestamp for Bluetooth LE scan.
 * @param reportDelayMillis Set to 0 to be notified of results immediately.Values &gt; 0 causes the scan results to be queued up and delivered after the requested delay or when the internal buffers fill up.
 * @throws IllegalArgumentException If {@code reportDelaySeconds} &lt; 0.
 */
public Builder setReportDelayMillis(long reportDelayMillis){
  if (reportDelayMillis < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  mReportDelayMillis=reportDelayMillis;
  return this;
}

Fixed version (ground truth):
/** 
 * Set report delay timestamp for Bluetooth LE scan.
 * @param reportDelayMillis Set to 0 to be notified of results immediately. Values &gt; 0causes the scan results to be queued up and delivered after the requested delay or when the internal buffers fill up.
 * @throws IllegalArgumentException If {@code reportDelayMillis} &lt; 0.
 */
public Builder setReportDelayMillis(long reportDelayMillis){
  if (reportDelayMillis < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  mReportDelayMillis=reportDelayMillis;
  return this;
}
Program: 198826
Project: 198826
Buggy source:
/** 
 * Set callback type for Bluetooth LE scan.
 * @param callbackType The callback type flags for the scan.
 * @throws IllegalArgumentException If the {@code callbackType} is invalid.
 */
public Builder setCallbackType(int callbackType){
  if (callbackType < CALLBACK_TYPE_ALL_MATCHES || callbackType > (CALLBACK_TYPE_FIRST_MATCH | CALLBACK_TYPE_MATCH_LOST) || (callbackType & CALLBACK_TYPE_ALL_MATCHES) != CALLBACK_TYPE_ALL_MATCHES) {
    throw new IllegalArgumentException("String_Node_Str" + callbackType);
  }
  mCallbackType=callbackType;
  return this;
}

Fixed version (ground truth):
/** 
 * Set callback type for Bluetooth LE scan.
 * @param callbackType The callback type flags for the scan.
 * @throws IllegalArgumentException If the {@code callbackType} is invalid.
 */
public Builder setCallbackType(int callbackType){
  if (!isValidCallbackType(callbackType)) {
    throw new IllegalArgumentException("String_Node_Str" + callbackType);
  }
  mCallbackType=callbackType;
  return this;
}
Program: 198827
Project: 198827
Buggy source:
/** 
 * Set report delay timestamp for Bluetooth LE scan.
 * @param reportDelayMillis Set to 0 to be notified of results immediately.Values &gt; 0 causes the scan results to be queued up and delivered after the requested delay or when the internal buffers fill up.
 * @throws IllegalArgumentException If {@code reportDelaySeconds} &lt; 0.
 */
public Builder setReportDelayMillis(long reportDelayMillis){
  if (reportDelayMillis < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  mReportDelayMillis=reportDelayMillis;
  return this;
}

Fixed version (ground truth):
/** 
 * Set report delay timestamp for Bluetooth LE scan.
 * @param reportDelayMillis Set to 0 to be notified of results immediately. Values &gt; 0causes the scan results to be queued up and delivered after the requested delay or when the internal buffers fill up.
 * @throws IllegalArgumentException If {@code reportDelayMillis} &lt; 0.
 */
public Builder setReportDelayMillis(long reportDelayMillis){
  if (reportDelayMillis < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  mReportDelayMillis=reportDelayMillis;
  return this;
}
Program: 198828
Project: 198828
Buggy source:
/** 
 * Set callback type for Bluetooth LE scan.
 * @param callbackType The callback type flags for the scan.
 * @throws IllegalArgumentException If the {@code callbackType} is invalid.
 */
public Builder setCallbackType(int callbackType){
  if (callbackType < CALLBACK_TYPE_ALL_MATCHES || callbackType > (CALLBACK_TYPE_FIRST_MATCH | CALLBACK_TYPE_MATCH_LOST) || (callbackType & CALLBACK_TYPE_ALL_MATCHES) != CALLBACK_TYPE_ALL_MATCHES) {
    throw new IllegalArgumentException("String_Node_Str" + callbackType);
  }
  mCallbackType=callbackType;
  return this;
}

Fixed version (ground truth):
/** 
 * Set callback type for Bluetooth LE scan.
 * @param callbackType The callback type flags for the scan.
 * @throws IllegalArgumentException If the {@code callbackType} is invalid.
 */
public Builder setCallbackType(int callbackType){
  if (!isValidCallbackType(callbackType)) {
    throw new IllegalArgumentException("String_Node_Str" + callbackType);
  }
  mCallbackType=callbackType;
  return this;
}
Program: 198829
Project: 198829
Buggy source:
public synchronized void init(){
  mPtr=nativeOpen();
}

Fixed version (ground truth):
public void init(){
synchronized (mLock) {
    mPtr=nativeOpen();
  }
}
Program: 198830
Project: 198830
Buggy source:
public synchronized int removeStream(int deviceId,TvStreamConfig streamConfig){
  if (mPtr == 0) {
    return ERROR_NO_INIT;
  }
  if (mStreamConfigGeneration != streamConfig.getGeneration()) {
    return ERROR_STALE_CONFIG;
  }
  if (nativeRemoveStream(mPtr,deviceId,streamConfig.getStreamId()) == 0) {
    return SUCCESS;
  }
 else {
    return ERROR_UNKNOWN;
  }
}

Fixed version (ground truth):
public int removeStream(int deviceId,TvStreamConfig streamConfig){
synchronized (mLock) {
    if (mPtr == 0) {
      return ERROR_NO_INIT;
    }
    int generation=mStreamConfigGenerations.get(deviceId,0);
    if (generation != streamConfig.getGeneration()) {
      return ERROR_STALE_CONFIG;
    }
    if (nativeRemoveStream(mPtr,deviceId,streamConfig.getStreamId()) == 0) {
      return SUCCESS;
    }
 else {
      return ERROR_UNKNOWN;
    }
  }
}