nus-yam/ex-repair huggingface dataset:
Program: 198264
Project: 198264
Buggy source:
private int totalBytes(AdvertiseData data){
  if (data == null) {
    return 0;
  }
  int size=FLAGS_FIELD_BYTES;
  if (data.getServiceUuids() != null) {
    int num16BitUuids=0;
    int num32BitUuids=0;
    int num128BitUuids=0;
    for (    ParcelUuid uuid : data.getServiceUuids()) {
      if (BluetoothUuid.is16BitUuid(uuid)) {
        ++num16BitUuids;
      }
 else       if (BluetoothUuid.is32BitUuid(uuid)) {
        ++num32BitUuids;
      }
 else {
        ++num128BitUuids;
      }
    }
    if (num16BitUuids != 0) {
      size+=OVERHEAD_BYTES_PER_FIELD + num16BitUuids * BluetoothUuid.UUID_BYTES_16_BIT;
    }
    if (num32BitUuids != 0) {
      size+=OVERHEAD_BYTES_PER_FIELD + num32BitUuids * BluetoothUuid.UUID_BYTES_32_BIT;
    }
    if (num128BitUuids != 0) {
      size+=OVERHEAD_BYTES_PER_FIELD + num128BitUuids * BluetoothUuid.UUID_BYTES_128_BIT;
    }
  }
  for (  ParcelUuid uuid : data.getServiceData().keySet()) {
    size+=OVERHEAD_BYTES_PER_FIELD + SERVICE_DATA_UUID_LENGTH + byteLength(data.getServiceData().get(uuid));
  }
  for (int i=0; i < data.getManufacturerSpecificData().size(); ++i) {
    size+=OVERHEAD_BYTES_PER_FIELD + MANUFACTURER_SPECIFIC_DATA_LENGTH + byteLength(data.getManufacturerSpecificData().valueAt(i));
  }
  if (data.getIncludeTxPowerLevel()) {
    size+=OVERHEAD_BYTES_PER_FIELD + 1;
  }
  if (data.getIncludeDeviceName() && mBluetoothAdapter.getName() != null) {
    size+=OVERHEAD_BYTES_PER_FIELD + mBluetoothAdapter.getName().length();
  }
  return size;
}

Fixed version (ground truth):
private int totalBytes(AdvertiseData data){
  if (data == null)   return 0;
  int size=FLAGS_FIELD_BYTES;
  if (data.getServiceUuids() != null) {
    int num16BitUuids=0;
    int num32BitUuids=0;
    int num128BitUuids=0;
    for (    ParcelUuid uuid : data.getServiceUuids()) {
      if (BluetoothUuid.is16BitUuid(uuid)) {
        ++num16BitUuids;
      }
 else       if (BluetoothUuid.is32BitUuid(uuid)) {
        ++num32BitUuids;
      }
 else {
        ++num128BitUuids;
      }
    }
    if (num16BitUuids != 0) {
      size+=OVERHEAD_BYTES_PER_FIELD + num16BitUuids * BluetoothUuid.UUID_BYTES_16_BIT;
    }
    if (num32BitUuids != 0) {
      size+=OVERHEAD_BYTES_PER_FIELD + num32BitUuids * BluetoothUuid.UUID_BYTES_32_BIT;
    }
    if (num128BitUuids != 0) {
      size+=OVERHEAD_BYTES_PER_FIELD + num128BitUuids * BluetoothUuid.UUID_BYTES_128_BIT;
    }
  }
  for (  ParcelUuid uuid : data.getServiceData().keySet()) {
    size+=OVERHEAD_BYTES_PER_FIELD + SERVICE_DATA_UUID_LENGTH + byteLength(data.getServiceData().get(uuid));
  }
  for (int i=0; i < data.getManufacturerSpecificData().size(); ++i) {
    size+=OVERHEAD_BYTES_PER_FIELD + MANUFACTURER_SPECIFIC_DATA_LENGTH + byteLength(data.getManufacturerSpecificData().valueAt(i));
  }
  if (data.getIncludeTxPowerLevel()) {
    size+=OVERHEAD_BYTES_PER_FIELD + 1;
  }
  if (data.getIncludeDeviceName() && mBluetoothAdapter.getName() != null) {
    size+=OVERHEAD_BYTES_PER_FIELD + mBluetoothAdapter.getName().length();
  }
  return size;
}
Program: 198268
Project: 198268
Buggy source:
/** 
 * Set a   {@link android.widget.Toolbar Toolbar} to act as the {@link ActionBar} for thisActivity window. <p>When set to a non-null value the  {@link #getActionBar()} method will returnan  {@link ActionBar} object that can be used to control the given toolbar as if it werea traditional window decor action bar. The toolbar's menu will be populated with the Activity's options menu and the navigation button will be wired through the standard {@link android.R.id#home home} menu select action.</p><p>In order to use a Toolbar within the Activity's window content the application must not request the window feature  {@link Window#FEATURE_ACTION_BAR FEATURE_ACTION_BAR}.</p>
 * @param toolbar Toolbar to set as the Activity's action bar
 */
public void setActionBar(@Nullable Toolbar toolbar){
  if (getActionBar() instanceof WindowDecorActionBar) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  }
  mActionBar=new ToolbarActionBar(toolbar,getTitle(),this);
  mActionBar.invalidateOptionsMenu();
}

Fixed version (ground truth):
/** 
 * Set a   {@link android.widget.Toolbar Toolbar} to act as the {@link ActionBar} for thisActivity window. <p>When set to a non-null value the  {@link #getActionBar()} method will returnan  {@link ActionBar} object that can be used to control the given toolbar as if it werea traditional window decor action bar. The toolbar's menu will be populated with the Activity's options menu and the navigation button will be wired through the standard {@link android.R.id#home home} menu select action.</p><p>In order to use a Toolbar within the Activity's window content the application must not request the window feature  {@link Window#FEATURE_ACTION_BAR FEATURE_ACTION_BAR}.</p>
 * @param toolbar Toolbar to set as the Activity's action bar
 */
public void setActionBar(@Nullable Toolbar toolbar){
  if (getActionBar() instanceof WindowDecorActionBar) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  }
  ToolbarActionBar tbab=new ToolbarActionBar(toolbar,getTitle(),this);
  mActionBar=tbab;
  mWindow.setCallback(tbab.getWrappedWindowCallback());
  mActionBar.invalidateOptionsMenu();
}
Program: 198269
Project: 198269
Buggy source:
public ToolbarActionBar(Toolbar toolbar,CharSequence title,Window.Callback windowCallback){
  mToolbar=toolbar;
  mDecorToolbar=new ToolbarWidgetWrapper(toolbar,false);
  mWindowCallback=windowCallback;
  mDecorToolbar.setWindowCallback(mWindowCallback);
  toolbar.setOnMenuItemClickListener(mMenuClicker);
  mDecorToolbar.setWindowTitle(title);
}

Fixed version (ground truth):
public ToolbarActionBar(Toolbar toolbar,CharSequence title,Window.Callback windowCallback){
  mToolbar=toolbar;
  mDecorToolbar=new ToolbarWidgetWrapper(toolbar,false);
  mWindowCallback=new ToolbarCallbackWrapper(windowCallback);
  mDecorToolbar.setWindowCallback(mWindowCallback);
  toolbar.setOnMenuItemClickListener(mMenuClicker);
  mDecorToolbar.setWindowTitle(title);
}
Program: 198270
Project: 198270
Buggy source:
/** 
 * Set a   {@link android.widget.Toolbar Toolbar} to act as the {@link ActionBar} for thisActivity window. <p>When set to a non-null value the  {@link #getActionBar()} method will returnan  {@link ActionBar} object that can be used to control the given toolbar as if it werea traditional window decor action bar. The toolbar's menu will be populated with the Activity's options menu and the navigation button will be wired through the standard {@link android.R.id#home home} menu select action.</p><p>In order to use a Toolbar within the Activity's window content the application must not request the window feature  {@link Window#FEATURE_ACTION_BAR FEATURE_ACTION_BAR}.</p>
 * @param toolbar Toolbar to set as the Activity's action bar
 */
public void setActionBar(@Nullable Toolbar toolbar){
  if (getActionBar() instanceof WindowDecorActionBar) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  }
  mActionBar=new ToolbarActionBar(toolbar,getTitle(),this);
  mActionBar.invalidateOptionsMenu();
}

Fixed version (ground truth):
/** 
 * Set a   {@link android.widget.Toolbar Toolbar} to act as the {@link ActionBar} for thisActivity window. <p>When set to a non-null value the  {@link #getActionBar()} method will returnan  {@link ActionBar} object that can be used to control the given toolbar as if it werea traditional window decor action bar. The toolbar's menu will be populated with the Activity's options menu and the navigation button will be wired through the standard {@link android.R.id#home home} menu select action.</p><p>In order to use a Toolbar within the Activity's window content the application must not request the window feature  {@link Window#FEATURE_ACTION_BAR FEATURE_ACTION_BAR}.</p>
 * @param toolbar Toolbar to set as the Activity's action bar
 */
public void setActionBar(@Nullable Toolbar toolbar){
  if (getActionBar() instanceof WindowDecorActionBar) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  }
  ToolbarActionBar tbab=new ToolbarActionBar(toolbar,getTitle(),this);
  mActionBar=tbab;
  mWindow.setCallback(tbab.getWrappedWindowCallback());
  mActionBar.invalidateOptionsMenu();
}
Program: 198271
Project: 198271
Buggy source:
public ToolbarActionBar(Toolbar toolbar,CharSequence title,Window.Callback windowCallback){
  mToolbar=toolbar;
  mDecorToolbar=new ToolbarWidgetWrapper(toolbar,false);
  mWindowCallback=windowCallback;
  mDecorToolbar.setWindowCallback(mWindowCallback);
  toolbar.setOnMenuItemClickListener(mMenuClicker);
  mDecorToolbar.setWindowTitle(title);
}

Fixed version (ground truth):
public ToolbarActionBar(Toolbar toolbar,CharSequence title,Window.Callback windowCallback){
  mToolbar=toolbar;
  mDecorToolbar=new ToolbarWidgetWrapper(toolbar,false);
  mWindowCallback=new ToolbarCallbackWrapper(windowCallback);
  mDecorToolbar.setWindowCallback(mWindowCallback);
  toolbar.setOnMenuItemClickListener(mMenuClicker);
  mDecorToolbar.setWindowTitle(title);
}
Program: 198272
Project: 198272
Buggy source:
/** 
 * Set a   {@link android.widget.Toolbar Toolbar} to act as the {@link ActionBar} for thisActivity window. <p>When set to a non-null value the  {@link #getActionBar()} method will returnan  {@link ActionBar} object that can be used to control the given toolbar as if it werea traditional window decor action bar. The toolbar's menu will be populated with the Activity's options menu and the navigation button will be wired through the standard {@link android.R.id#home home} menu select action.</p><p>In order to use a Toolbar within the Activity's window content the application must not request the window feature  {@link Window#FEATURE_ACTION_BAR FEATURE_ACTION_BAR}.</p>
 * @param toolbar Toolbar to set as the Activity's action bar
 */
public void setActionBar(@Nullable Toolbar toolbar){
  if (getActionBar() instanceof WindowDecorActionBar) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  }
  mActionBar=new ToolbarActionBar(toolbar,getTitle(),this);
  mActionBar.invalidateOptionsMenu();
}

Fixed version (ground truth):
/** 
 * Set a   {@link android.widget.Toolbar Toolbar} to act as the {@link ActionBar} for thisActivity window. <p>When set to a non-null value the  {@link #getActionBar()} method will returnan  {@link ActionBar} object that can be used to control the given toolbar as if it werea traditional window decor action bar. The toolbar's menu will be populated with the Activity's options menu and the navigation button will be wired through the standard {@link android.R.id#home home} menu select action.</p><p>In order to use a Toolbar within the Activity's window content the application must not request the window feature  {@link Window#FEATURE_ACTION_BAR FEATURE_ACTION_BAR}.</p>
 * @param toolbar Toolbar to set as the Activity's action bar
 */
public void setActionBar(@Nullable Toolbar toolbar){
  if (getActionBar() instanceof WindowDecorActionBar) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  }
  ToolbarActionBar tbab=new ToolbarActionBar(toolbar,getTitle(),this);
  mActionBar=tbab;
  mWindow.setCallback(tbab.getWrappedWindowCallback());
  mActionBar.invalidateOptionsMenu();
}
Program: 198273
Project: 198273
Buggy source:
public ToolbarActionBar(Toolbar toolbar,CharSequence title,Window.Callback windowCallback){
  mToolbar=toolbar;
  mDecorToolbar=new ToolbarWidgetWrapper(toolbar,false);
  mWindowCallback=windowCallback;
  mDecorToolbar.setWindowCallback(mWindowCallback);
  toolbar.setOnMenuItemClickListener(mMenuClicker);
  mDecorToolbar.setWindowTitle(title);
}

Fixed version (ground truth):
public ToolbarActionBar(Toolbar toolbar,CharSequence title,Window.Callback windowCallback){
  mToolbar=toolbar;
  mDecorToolbar=new ToolbarWidgetWrapper(toolbar,false);
  mWindowCallback=new ToolbarCallbackWrapper(windowCallback);
  mDecorToolbar.setWindowCallback(mWindowCallback);
  toolbar.setOnMenuItemClickListener(mMenuClicker);
  mDecorToolbar.setWindowTitle(title);
}
Program: 198274
Project: 198274
Buggy source:
public boolean setDeviceType(int deviceType){
  if (deviceType >= WFD_SOURCE && deviceType <= SOURCE_OR_PRIMARY_SINK) {
    mDeviceInfo|=deviceType;
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean setDeviceType(int deviceType){
  if (deviceType >= WFD_SOURCE && deviceType <= SOURCE_OR_PRIMARY_SINK) {
    mDeviceInfo&=~DEVICE_TYPE;
    mDeviceInfo|=deviceType;
    return true;
  }
  return false;
}
Program: 198275
Project: 198275
Buggy source:
/** 
 * Set a   {@link android.widget.Toolbar Toolbar} to act as the {@link ActionBar} for thisActivity window. <p>When set to a non-null value the  {@link #getActionBar()} method will returnan  {@link ActionBar} object that can be used to control the given toolbar as if it werea traditional window decor action bar. The toolbar's menu will be populated with the Activity's options menu and the navigation button will be wired through the standard {@link android.R.id#home home} menu select action.</p><p>In order to use a Toolbar within the Activity's window content the application must not request the window feature  {@link Window#FEATURE_ACTION_BAR FEATURE_ACTION_BAR}.</p>
 * @param toolbar Toolbar to set as the Activity's action bar
 */
public void setActionBar(@Nullable Toolbar toolbar){
  if (getActionBar() instanceof WindowDecorActionBar) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  }
  mActionBar=new ToolbarActionBar(toolbar,getTitle(),this);
  mActionBar.invalidateOptionsMenu();
}

Fixed version (ground truth):
/** 
 * Set a   {@link android.widget.Toolbar Toolbar} to act as the {@link ActionBar} for thisActivity window. <p>When set to a non-null value the  {@link #getActionBar()} method will returnan  {@link ActionBar} object that can be used to control the given toolbar as if it werea traditional window decor action bar. The toolbar's menu will be populated with the Activity's options menu and the navigation button will be wired through the standard {@link android.R.id#home home} menu select action.</p><p>In order to use a Toolbar within the Activity's window content the application must not request the window feature  {@link Window#FEATURE_ACTION_BAR FEATURE_ACTION_BAR}.</p>
 * @param toolbar Toolbar to set as the Activity's action bar
 */
public void setActionBar(@Nullable Toolbar toolbar){
  if (getActionBar() instanceof WindowDecorActionBar) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  }
  ToolbarActionBar tbab=new ToolbarActionBar(toolbar,getTitle(),this);
  mActionBar=tbab;
  mWindow.setCallback(tbab.getWrappedWindowCallback());
  mActionBar.invalidateOptionsMenu();
}
Program: 198276
Project: 198276
Buggy source:
public ToolbarActionBar(Toolbar toolbar,CharSequence title,Window.Callback windowCallback){
  mToolbar=toolbar;
  mDecorToolbar=new ToolbarWidgetWrapper(toolbar,false);
  mWindowCallback=windowCallback;
  mDecorToolbar.setWindowCallback(mWindowCallback);
  toolbar.setOnMenuItemClickListener(mMenuClicker);
  mDecorToolbar.setWindowTitle(title);
}

Fixed version (ground truth):
public ToolbarActionBar(Toolbar toolbar,CharSequence title,Window.Callback windowCallback){
  mToolbar=toolbar;
  mDecorToolbar=new ToolbarWidgetWrapper(toolbar,false);
  mWindowCallback=new ToolbarCallbackWrapper(windowCallback);
  mDecorToolbar.setWindowCallback(mWindowCallback);
  toolbar.setOnMenuItemClickListener(mMenuClicker);
  mDecorToolbar.setWindowTitle(title);
}
Program: 198278
Project: 198278
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  Intent intent=getIntent();
  Parcelable targetParcelable=intent.getParcelableExtra(Intent.EXTRA_INTENT);
  if (!(targetParcelable instanceof Intent)) {
    Log.w("String_Node_Str","String_Node_Str" + targetParcelable);
    finish();
    super.onCreate(null);
    return;
  }
  Intent target=(Intent)targetParcelable;
  if (target != null) {
    modifyTargetIntent(target);
  }
  mReplacementExtras=intent.getBundleExtra(Intent.EXTRA_REPLACEMENT_EXTRAS);
  CharSequence title=intent.getCharSequenceExtra(Intent.EXTRA_TITLE);
  int defaultTitleRes=0;
  if (title == null) {
    defaultTitleRes=com.android.internal.R.string.chooseActivity;
  }
  Parcelable[] pa=intent.getParcelableArrayExtra(Intent.EXTRA_INITIAL_INTENTS);
  Intent[] initialIntents=null;
  if (pa != null) {
    initialIntents=new Intent[pa.length];
    for (int i=0; i < pa.length; i++) {
      if (!(pa[i] instanceof Intent)) {
        Log.w("String_Node_Str","String_Node_Str" + i + "String_Node_Str"+ pa[i]);
        finish();
        super.onCreate(null);
        return;
      }
      final Intent in=(Intent)pa[i];
      modifyTargetIntent(in);
      initialIntents[i]=in;
    }
  }
  super.onCreate(savedInstanceState,target,title,defaultTitleRes,initialIntents,null,false);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  Intent intent=getIntent();
  Parcelable targetParcelable=intent.getParcelableExtra(Intent.EXTRA_INTENT);
  if (!(targetParcelable instanceof Intent)) {
    Log.w("String_Node_Str","String_Node_Str" + targetParcelable);
    finish();
    super.onCreate(null);
    return;
  }
  Intent target=(Intent)targetParcelable;
  if (target != null) {
    modifyTargetIntent(target);
  }
  mReplacementExtras=intent.getBundleExtra(Intent.EXTRA_REPLACEMENT_EXTRAS);
  CharSequence title=intent.getCharSequenceExtra(Intent.EXTRA_TITLE);
  int defaultTitleRes=0;
  if (title == null) {
    defaultTitleRes=com.android.internal.R.string.chooseActivity;
  }
  Parcelable[] pa=intent.getParcelableArrayExtra(Intent.EXTRA_INITIAL_INTENTS);
  Intent[] initialIntents=null;
  if (pa != null) {
    initialIntents=new Intent[pa.length];
    for (int i=0; i < pa.length; i++) {
      if (!(pa[i] instanceof Intent)) {
        Log.w("String_Node_Str","String_Node_Str" + i + "String_Node_Str"+ pa[i]);
        finish();
        super.onCreate(null);
        return;
      }
      final Intent in=(Intent)pa[i];
      modifyTargetIntent(in);
      initialIntents[i]=in;
    }
  }
  setSafeForwardingMode(true);
  super.onCreate(savedInstanceState,target,title,defaultTitleRes,initialIntents,null,false);
}
Program: 198280
Project: 198280
Buggy source:
void showAppDetails(ResolveInfo ri){
  Intent in=new Intent().setAction("String_Node_Str").setData(Uri.fromParts("String_Node_Str",ri.activityInfo.packageName,null)).addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
  startActivity(in);
}

Fixed version (ground truth):
void showAppDetails(ResolveInfo ri){
  Intent in=new Intent().setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS).setData(Uri.fromParts("String_Node_Str",ri.activityInfo.packageName,null)).addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
  startActivity(in);
}
Program: 198282
Project: 198282
Buggy source:
public boolean setDeviceType(int deviceType){
  if (deviceType >= WFD_SOURCE && deviceType <= SOURCE_OR_PRIMARY_SINK) {
    mDeviceInfo|=deviceType;
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean setDeviceType(int deviceType){
  if (deviceType >= WFD_SOURCE && deviceType <= SOURCE_OR_PRIMARY_SINK) {
    mDeviceInfo&=~DEVICE_TYPE;
    mDeviceInfo|=deviceType;
    return true;
  }
  return false;
}
Program: 198283
Project: 198283
Buggy source:
/** 
 * Set a   {@link android.widget.Toolbar Toolbar} to act as the {@link ActionBar} for thisActivity window. <p>When set to a non-null value the  {@link #getActionBar()} method will returnan  {@link ActionBar} object that can be used to control the given toolbar as if it werea traditional window decor action bar. The toolbar's menu will be populated with the Activity's options menu and the navigation button will be wired through the standard {@link android.R.id#home home} menu select action.</p><p>In order to use a Toolbar within the Activity's window content the application must not request the window feature  {@link Window#FEATURE_ACTION_BAR FEATURE_ACTION_BAR}.</p>
 * @param toolbar Toolbar to set as the Activity's action bar
 */
public void setActionBar(@Nullable Toolbar toolbar){
  if (getActionBar() instanceof WindowDecorActionBar) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  }
  mActionBar=new ToolbarActionBar(toolbar,getTitle(),this);
  mActionBar.invalidateOptionsMenu();
}

Fixed version (ground truth):
/** 
 * Set a   {@link android.widget.Toolbar Toolbar} to act as the {@link ActionBar} for thisActivity window. <p>When set to a non-null value the  {@link #getActionBar()} method will returnan  {@link ActionBar} object that can be used to control the given toolbar as if it werea traditional window decor action bar. The toolbar's menu will be populated with the Activity's options menu and the navigation button will be wired through the standard {@link android.R.id#home home} menu select action.</p><p>In order to use a Toolbar within the Activity's window content the application must not request the window feature  {@link Window#FEATURE_ACTION_BAR FEATURE_ACTION_BAR}.</p>
 * @param toolbar Toolbar to set as the Activity's action bar
 */
public void setActionBar(@Nullable Toolbar toolbar){
  if (getActionBar() instanceof WindowDecorActionBar) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  }
  ToolbarActionBar tbab=new ToolbarActionBar(toolbar,getTitle(),this);
  mActionBar=tbab;
  mWindow.setCallback(tbab.getWrappedWindowCallback());
  mActionBar.invalidateOptionsMenu();
}
Program: 198284
Project: 198284
Buggy source:
public ToolbarActionBar(Toolbar toolbar,CharSequence title,Window.Callback windowCallback){
  mToolbar=toolbar;
  mDecorToolbar=new ToolbarWidgetWrapper(toolbar,false);
  mWindowCallback=windowCallback;
  mDecorToolbar.setWindowCallback(mWindowCallback);
  toolbar.setOnMenuItemClickListener(mMenuClicker);
  mDecorToolbar.setWindowTitle(title);
}

Fixed version (ground truth):
public ToolbarActionBar(Toolbar toolbar,CharSequence title,Window.Callback windowCallback){
  mToolbar=toolbar;
  mDecorToolbar=new ToolbarWidgetWrapper(toolbar,false);
  mWindowCallback=new ToolbarCallbackWrapper(windowCallback);
  mDecorToolbar.setWindowCallback(mWindowCallback);
  toolbar.setOnMenuItemClickListener(mMenuClicker);
  mDecorToolbar.setWindowTitle(title);
}
Program: 198285
Project: 198285
Buggy source:
/** 
 * Is the given data authority included in the filter?  Note that if the filter does not include any authorities, false will <em>always</em> be returned.
 * @param data The data whose authority is being looked for.
 * @return Returns true if the data string matches an authority listed in thefilter.
 */
public final boolean hasDataAuthority(Uri data){
  return matchDataAuthority(data) >= 0;
}

Fixed version (ground truth):
/** 
 * @hide 
 */
public final boolean hasDataAuthority(AuthorityEntry auth){
  if (mDataAuthorities == null) {
    return false;
  }
  final int numDataAuthorities=mDataAuthorities.size();
  for (int i=0; i < numDataAuthorities; i++) {
    if (mDataAuthorities.get(i).match(auth)) {
      return true;
    }
  }
  return false;
}
Program: 198286
Project: 198286
Buggy source:
/** 
 * Is the given data scheme specific part included in the filter?  Note that if the filter does not include any scheme specific parts, false will <em>always</em> be returned.
 * @param data The scheme specific part that is being looked for.
 * @return Returns true if the data string matches a scheme specific part listed in thefilter.
 */
public final boolean hasDataSchemeSpecificPart(String data){
  if (mDataSchemeSpecificParts == null) {
    return false;
  }
  final int numDataSchemeSpecificParts=mDataSchemeSpecificParts.size();
  for (int i=0; i < numDataSchemeSpecificParts; i++) {
    final PatternMatcher pe=mDataSchemeSpecificParts.get(i);
    if (pe.match(data)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @hide 
 */
public final boolean hasDataSchemeSpecificPart(PatternMatcher ssp){
  if (mDataSchemeSpecificParts == null) {
    return false;
  }
  final int numDataSchemeSpecificParts=mDataSchemeSpecificParts.size();
  for (int i=0; i < numDataSchemeSpecificParts; i++) {
    final PatternMatcher pe=mDataSchemeSpecificParts.get(i);
    if (pe.getType() == ssp.getType() && pe.getPath().equals(ssp.getPath())) {
      return true;
    }
  }
  return false;
}
Program: 198287
Project: 198287
Buggy source:
/** 
 * Is the given data path included in the filter?  Note that if the filter does not include any paths, false will <em>always</em> be returned.
 * @param data The data path to look for.  This is without the schemeprefix.
 * @return True if the data string matches a path listed in thefilter.
 */
public final boolean hasDataPath(String data){
  if (mDataPaths == null) {
    return false;
  }
  final int numDataPaths=mDataPaths.size();
  for (int i=0; i < numDataPaths; i++) {
    final PatternMatcher pe=mDataPaths.get(i);
    if (pe.match(data)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @hide 
 */
public final boolean hasDataPath(PatternMatcher path){
  if (mDataPaths == null) {
    return false;
  }
  final int numDataPaths=mDataPaths.size();
  for (int i=0; i < numDataPaths; i++) {
    final PatternMatcher pe=mDataPaths.get(i);
    if (pe.getType() == path.getType() && pe.getPath().equals(path.getPath())) {
      return true;
    }
  }
  return false;
}
Program: 198288
Project: 198288
Buggy source:
private void addPreferredActivityInternal(IntentFilter filter,int match,ComponentName[] set,ComponentName activity,boolean always,int userId){
  int callingUid=Binder.getCallingUid();
  enforceCrossUserPermission(callingUid,userId,true,"String_Node_Str");
  if (filter.countActions() == 0) {
    Slog.w(TAG,"String_Node_Str");
    return;
  }
synchronized (mPackages) {
    if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.SET_PREFERRED_APPLICATIONS) != PackageManager.PERMISSION_GRANTED) {
      if (getUidTargetSdkVersionLockedLPr(callingUid) < Build.VERSION_CODES.FROYO) {
        Slog.w(TAG,"String_Node_Str" + callingUid);
        return;
      }
      mContext.enforceCallingOrSelfPermission(android.Manifest.permission.SET_PREFERRED_APPLICATIONS,null);
    }
    Slog.i(TAG,"String_Node_Str" + activity + "String_Node_Str"+ userId+ "String_Node_Str");
    filter.dump(new LogPrinter(Log.INFO,TAG),"String_Node_Str");
    mSettings.editPreferredActivitiesLPw(userId).addFilter(new PreferredActivity(filter,match,set,activity,always));
    mSettings.writePackageRestrictionsLPr(userId);
  }
}

Fixed version (ground truth):
private void addPreferredActivityInternal(IntentFilter filter,int match,ComponentName[] set,ComponentName activity,boolean always,int userId,String opname){
  int callingUid=Binder.getCallingUid();
  enforceCrossUserPermission(callingUid,userId,true,"String_Node_Str");
  if (filter.countActions() == 0) {
    Slog.w(TAG,"String_Node_Str");
    return;
  }
synchronized (mPackages) {
    if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.SET_PREFERRED_APPLICATIONS) != PackageManager.PERMISSION_GRANTED) {
      if (getUidTargetSdkVersionLockedLPr(callingUid) < Build.VERSION_CODES.FROYO) {
        Slog.w(TAG,"String_Node_Str" + callingUid);
        return;
      }
      mContext.enforceCallingOrSelfPermission(android.Manifest.permission.SET_PREFERRED_APPLICATIONS,null);
    }
    PreferredIntentResolver pir=mSettings.editPreferredActivitiesLPw(userId);
    Slog.i(TAG,opname + "String_Node_Str" + activity.flattenToShortString()+ "String_Node_Str"+ userId+ "String_Node_Str");
    filter.dump(new LogPrinter(Log.INFO,TAG),"String_Node_Str");
    pir.addFilter(new PreferredActivity(filter,match,set,activity,always));
    mSettings.writePackageRestrictionsLPr(userId);
  }
}
Program: 198289
Project: 198289
Buggy source:
@Override public void setLastChosenActivity(Intent intent,String resolvedType,int flags,IntentFilter filter,int match,ComponentName activity){
  final int userId=UserHandle.getCallingUserId();
  if (DEBUG_PREFERRED) {
    Log.v(TAG,"String_Node_Str" + intent + "String_Node_Str"+ resolvedType+ "String_Node_Str"+ flags+ "String_Node_Str"+ filter+ "String_Node_Str"+ match+ "String_Node_Str"+ activity);
    filter.dump(new PrintStreamPrinter(System.out),"String_Node_Str");
  }
  intent.setComponent(null);
  List<ResolveInfo> query=queryIntentActivities(intent,resolvedType,flags,userId);
  findPreferredActivity(intent,resolvedType,flags,query,0,false,true,false,userId);
  addPreferredActivityInternal(filter,match,null,activity,false,userId);
}

Fixed version (ground truth):
@Override public void setLastChosenActivity(Intent intent,String resolvedType,int flags,IntentFilter filter,int match,ComponentName activity){
  final int userId=UserHandle.getCallingUserId();
  if (DEBUG_PREFERRED) {
    Log.v(TAG,"String_Node_Str" + intent + "String_Node_Str"+ resolvedType+ "String_Node_Str"+ flags+ "String_Node_Str"+ filter+ "String_Node_Str"+ match+ "String_Node_Str"+ activity);
    filter.dump(new PrintStreamPrinter(System.out),"String_Node_Str");
  }
  intent.setComponent(null);
  List<ResolveInfo> query=queryIntentActivities(intent,resolvedType,flags,userId);
  findPreferredActivity(intent,resolvedType,flags,query,0,false,true,false,userId);
  addPreferredActivityInternal(filter,match,null,activity,false,userId,"String_Node_Str");
}
Program: 198290
Project: 198290
Buggy source:
@Override public void addPreferredActivity(IntentFilter filter,int match,ComponentName[] set,ComponentName activity,int userId){
  addPreferredActivityInternal(filter,match,set,activity,true,userId);
}

Fixed version (ground truth):
@Override public void addPreferredActivity(IntentFilter filter,int match,ComponentName[] set,ComponentName activity,int userId){
  addPreferredActivityInternal(filter,match,set,activity,true,userId,"String_Node_Str");
}
Program: 198293
Project: 198293
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  Intent intent=getIntent();
  Parcelable targetParcelable=intent.getParcelableExtra(Intent.EXTRA_INTENT);
  if (!(targetParcelable instanceof Intent)) {
    Log.w("String_Node_Str","String_Node_Str" + targetParcelable);
    finish();
    super.onCreate(null);
    return;
  }
  Intent target=(Intent)targetParcelable;
  if (target != null) {
    modifyTargetIntent(target);
  }
  mReplacementExtras=intent.getBundleExtra(Intent.EXTRA_REPLACEMENT_EXTRAS);
  CharSequence title=intent.getCharSequenceExtra(Intent.EXTRA_TITLE);
  int defaultTitleRes=0;
  if (title == null) {
    defaultTitleRes=com.android.internal.R.string.chooseActivity;
  }
  Parcelable[] pa=intent.getParcelableArrayExtra(Intent.EXTRA_INITIAL_INTENTS);
  Intent[] initialIntents=null;
  if (pa != null) {
    initialIntents=new Intent[pa.length];
    for (int i=0; i < pa.length; i++) {
      if (!(pa[i] instanceof Intent)) {
        Log.w("String_Node_Str","String_Node_Str" + i + "String_Node_Str"+ pa[i]);
        finish();
        super.onCreate(null);
        return;
      }
      final Intent in=(Intent)pa[i];
      modifyTargetIntent(in);
      initialIntents[i]=in;
    }
  }
  super.onCreate(savedInstanceState,target,title,defaultTitleRes,initialIntents,null,false);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  Intent intent=getIntent();
  Parcelable targetParcelable=intent.getParcelableExtra(Intent.EXTRA_INTENT);
  if (!(targetParcelable instanceof Intent)) {
    Log.w("String_Node_Str","String_Node_Str" + targetParcelable);
    finish();
    super.onCreate(null);
    return;
  }
  Intent target=(Intent)targetParcelable;
  if (target != null) {
    modifyTargetIntent(target);
  }
  mReplacementExtras=intent.getBundleExtra(Intent.EXTRA_REPLACEMENT_EXTRAS);
  CharSequence title=intent.getCharSequenceExtra(Intent.EXTRA_TITLE);
  int defaultTitleRes=0;
  if (title == null) {
    defaultTitleRes=com.android.internal.R.string.chooseActivity;
  }
  Parcelable[] pa=intent.getParcelableArrayExtra(Intent.EXTRA_INITIAL_INTENTS);
  Intent[] initialIntents=null;
  if (pa != null) {
    initialIntents=new Intent[pa.length];
    for (int i=0; i < pa.length; i++) {
      if (!(pa[i] instanceof Intent)) {
        Log.w("String_Node_Str","String_Node_Str" + i + "String_Node_Str"+ pa[i]);
        finish();
        super.onCreate(null);
        return;
      }
      final Intent in=(Intent)pa[i];
      modifyTargetIntent(in);
      initialIntents[i]=in;
    }
  }
  setSafeForwardingMode(true);
  super.onCreate(savedInstanceState,target,title,defaultTitleRes,initialIntents,null,false);
}
Program: 198295
Project: 198295
Buggy source:
void showAppDetails(ResolveInfo ri){
  Intent in=new Intent().setAction("String_Node_Str").setData(Uri.fromParts("String_Node_Str",ri.activityInfo.packageName,null)).addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
  startActivity(in);
}

Fixed version (ground truth):
void showAppDetails(ResolveInfo ri){
  Intent in=new Intent().setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS).setData(Uri.fromParts("String_Node_Str",ri.activityInfo.packageName,null)).addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
  startActivity(in);
}
Program: 198297
Project: 198297
Buggy source:
/** 
 * Is the given data authority included in the filter?  Note that if the filter does not include any authorities, false will <em>always</em> be returned.
 * @param data The data whose authority is being looked for.
 * @return Returns true if the data string matches an authority listed in thefilter.
 */
public final boolean hasDataAuthority(Uri data){
  return matchDataAuthority(data) >= 0;
}

Fixed version (ground truth):
/** 
 * @hide 
 */
public final boolean hasDataAuthority(AuthorityEntry auth){
  if (mDataAuthorities == null) {
    return false;
  }
  final int numDataAuthorities=mDataAuthorities.size();
  for (int i=0; i < numDataAuthorities; i++) {
    if (mDataAuthorities.get(i).match(auth)) {
      return true;
    }
  }
  return false;
}
Program: 198298
Project: 198298
Buggy source:
/** 
 * Is the given data scheme specific part included in the filter?  Note that if the filter does not include any scheme specific parts, false will <em>always</em> be returned.
 * @param data The scheme specific part that is being looked for.
 * @return Returns true if the data string matches a scheme specific part listed in thefilter.
 */
public final boolean hasDataSchemeSpecificPart(String data){
  if (mDataSchemeSpecificParts == null) {
    return false;
  }
  final int numDataSchemeSpecificParts=mDataSchemeSpecificParts.size();
  for (int i=0; i < numDataSchemeSpecificParts; i++) {
    final PatternMatcher pe=mDataSchemeSpecificParts.get(i);
    if (pe.match(data)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @hide 
 */
public final boolean hasDataSchemeSpecificPart(PatternMatcher ssp){
  if (mDataSchemeSpecificParts == null) {
    return false;
  }
  final int numDataSchemeSpecificParts=mDataSchemeSpecificParts.size();
  for (int i=0; i < numDataSchemeSpecificParts; i++) {
    final PatternMatcher pe=mDataSchemeSpecificParts.get(i);
    if (pe.getType() == ssp.getType() && pe.getPath().equals(ssp.getPath())) {
      return true;
    }
  }
  return false;
}
Program: 198299
Project: 198299
Buggy source:
/** 
 * Is the given data path included in the filter?  Note that if the filter does not include any paths, false will <em>always</em> be returned.
 * @param data The data path to look for.  This is without the schemeprefix.
 * @return True if the data string matches a path listed in thefilter.
 */
public final boolean hasDataPath(String data){
  if (mDataPaths == null) {
    return false;
  }
  final int numDataPaths=mDataPaths.size();
  for (int i=0; i < numDataPaths; i++) {
    final PatternMatcher pe=mDataPaths.get(i);
    if (pe.match(data)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @hide 
 */
public final boolean hasDataPath(PatternMatcher path){
  if (mDataPaths == null) {
    return false;
  }
  final int numDataPaths=mDataPaths.size();
  for (int i=0; i < numDataPaths; i++) {
    final PatternMatcher pe=mDataPaths.get(i);
    if (pe.getType() == path.getType() && pe.getPath().equals(path.getPath())) {
      return true;
    }
  }
  return false;
}
Program: 198300
Project: 198300
Buggy source:
private void addPreferredActivityInternal(IntentFilter filter,int match,ComponentName[] set,ComponentName activity,boolean always,int userId){
  int callingUid=Binder.getCallingUid();
  enforceCrossUserPermission(callingUid,userId,true,"String_Node_Str");
  if (filter.countActions() == 0) {
    Slog.w(TAG,"String_Node_Str");
    return;
  }
synchronized (mPackages) {
    if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.SET_PREFERRED_APPLICATIONS) != PackageManager.PERMISSION_GRANTED) {
      if (getUidTargetSdkVersionLockedLPr(callingUid) < Build.VERSION_CODES.FROYO) {
        Slog.w(TAG,"String_Node_Str" + callingUid);
        return;
      }
      mContext.enforceCallingOrSelfPermission(android.Manifest.permission.SET_PREFERRED_APPLICATIONS,null);
    }
    Slog.i(TAG,"String_Node_Str" + activity + "String_Node_Str"+ userId+ "String_Node_Str");
    filter.dump(new LogPrinter(Log.INFO,TAG),"String_Node_Str");
    mSettings.editPreferredActivitiesLPw(userId).addFilter(new PreferredActivity(filter,match,set,activity,always));
    mSettings.writePackageRestrictionsLPr(userId);
  }
}

Fixed version (ground truth):
private void addPreferredActivityInternal(IntentFilter filter,int match,ComponentName[] set,ComponentName activity,boolean always,int userId,String opname){
  int callingUid=Binder.getCallingUid();
  enforceCrossUserPermission(callingUid,userId,true,"String_Node_Str");
  if (filter.countActions() == 0) {
    Slog.w(TAG,"String_Node_Str");
    return;
  }
synchronized (mPackages) {
    if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.SET_PREFERRED_APPLICATIONS) != PackageManager.PERMISSION_GRANTED) {
      if (getUidTargetSdkVersionLockedLPr(callingUid) < Build.VERSION_CODES.FROYO) {
        Slog.w(TAG,"String_Node_Str" + callingUid);
        return;
      }
      mContext.enforceCallingOrSelfPermission(android.Manifest.permission.SET_PREFERRED_APPLICATIONS,null);
    }
    PreferredIntentResolver pir=mSettings.editPreferredActivitiesLPw(userId);
    Slog.i(TAG,opname + "String_Node_Str" + activity.flattenToShortString()+ "String_Node_Str"+ userId+ "String_Node_Str");
    filter.dump(new LogPrinter(Log.INFO,TAG),"String_Node_Str");
    pir.addFilter(new PreferredActivity(filter,match,set,activity,always));
    mSettings.writePackageRestrictionsLPr(userId);
  }
}
Program: 198301
Project: 198301
Buggy source:
@Override public void setLastChosenActivity(Intent intent,String resolvedType,int flags,IntentFilter filter,int match,ComponentName activity){
  final int userId=UserHandle.getCallingUserId();
  if (DEBUG_PREFERRED) {
    Log.v(TAG,"String_Node_Str" + intent + "String_Node_Str"+ resolvedType+ "String_Node_Str"+ flags+ "String_Node_Str"+ filter+ "String_Node_Str"+ match+ "String_Node_Str"+ activity);
    filter.dump(new PrintStreamPrinter(System.out),"String_Node_Str");
  }
  intent.setComponent(null);
  List<ResolveInfo> query=queryIntentActivities(intent,resolvedType,flags,userId);
  findPreferredActivity(intent,resolvedType,flags,query,0,false,true,false,userId);
  addPreferredActivityInternal(filter,match,null,activity,false,userId);
}

Fixed version (ground truth):
@Override public void setLastChosenActivity(Intent intent,String resolvedType,int flags,IntentFilter filter,int match,ComponentName activity){
  final int userId=UserHandle.getCallingUserId();
  if (DEBUG_PREFERRED) {
    Log.v(TAG,"String_Node_Str" + intent + "String_Node_Str"+ resolvedType+ "String_Node_Str"+ flags+ "String_Node_Str"+ filter+ "String_Node_Str"+ match+ "String_Node_Str"+ activity);
    filter.dump(new PrintStreamPrinter(System.out),"String_Node_Str");
  }
  intent.setComponent(null);
  List<ResolveInfo> query=queryIntentActivities(intent,resolvedType,flags,userId);
  findPreferredActivity(intent,resolvedType,flags,query,0,false,true,false,userId);
  addPreferredActivityInternal(filter,match,null,activity,false,userId,"String_Node_Str");
}
Program: 198302
Project: 198302
Buggy source:
@Override public void addPreferredActivity(IntentFilter filter,int match,ComponentName[] set,ComponentName activity,int userId){
  addPreferredActivityInternal(filter,match,set,activity,true,userId);
}

Fixed version (ground truth):
@Override public void addPreferredActivity(IntentFilter filter,int match,ComponentName[] set,ComponentName activity,int userId){
  addPreferredActivityInternal(filter,match,set,activity,true,userId,"String_Node_Str");
}
Program: 198304
Project: 198304
Buggy source:
/** 
 * Reads the network specific MTU size from reources. and set it on it's iface.
 */
private void updateMtu(LinkProperties newLp,LinkProperties oldLp){
  final String iface=newLp.getInterfaceName();
  final int mtu=newLp.getMtu();
  if (oldLp != null && newLp.isIdenticalMtu(oldLp)) {
    if (VDBG)     log("String_Node_Str");
    return;
  }
  if (LinkProperties.isValidMtu(mtu,newLp.hasGlobalIPv6Address())) {
    loge("String_Node_Str" + mtu + "String_Node_Str"+ iface);
    return;
  }
  if (TextUtils.isEmpty(iface)) {
    loge("String_Node_Str");
    return;
  }
  try {
    if (VDBG)     log("String_Node_Str" + iface + "String_Node_Str"+ mtu);
    mNetd.setMtu(iface,mtu);
  }
 catch (  Exception e) {
    Slog.e(TAG,"String_Node_Str" + e);
  }
}

Fixed version (ground truth):
/** 
 * Reads the network specific MTU size from reources. and set it on it's iface.
 */
private void updateMtu(LinkProperties newLp,LinkProperties oldLp){
  final String iface=newLp.getInterfaceName();
  final int mtu=newLp.getMtu();
  if (oldLp != null && newLp.isIdenticalMtu(oldLp)) {
    if (VDBG)     log("String_Node_Str");
    return;
  }
  if (LinkProperties.isValidMtu(mtu,newLp.hasGlobalIPv6Address()) == false) {
    loge("String_Node_Str" + mtu + "String_Node_Str"+ iface);
    return;
  }
  if (TextUtils.isEmpty(iface)) {
    loge("String_Node_Str");
    return;
  }
  try {
    if (VDBG)     log("String_Node_Str" + iface + "String_Node_Str"+ mtu);
    mNetd.setMtu(iface,mtu);
  }
 catch (  Exception e) {
    Slog.e(TAG,"String_Node_Str" + e);
  }
}
Program: 198305
Project: 198305
Buggy source:
/** 
 * Reads the network specific MTU size from reources. and set it on it's iface.
 */
private void updateMtu(LinkProperties newLp,LinkProperties oldLp){
  final String iface=newLp.getInterfaceName();
  final int mtu=newLp.getMtu();
  if (oldLp != null && newLp.isIdenticalMtu(oldLp)) {
    if (VDBG)     log("String_Node_Str");
    return;
  }
  if (LinkProperties.isValidMtu(mtu,newLp.hasGlobalIPv6Address())) {
    loge("String_Node_Str" + mtu + "String_Node_Str"+ iface);
    return;
  }
  if (TextUtils.isEmpty(iface)) {
    loge("String_Node_Str");
    return;
  }
  try {
    if (VDBG)     log("String_Node_Str" + iface + "String_Node_Str"+ mtu);
    mNetd.setMtu(iface,mtu);
  }
 catch (  Exception e) {
    Slog.e(TAG,"String_Node_Str" + e);
  }
}

Fixed version (ground truth):
/** 
 * Reads the network specific MTU size from reources. and set it on it's iface.
 */
private void updateMtu(LinkProperties newLp,LinkProperties oldLp){
  final String iface=newLp.getInterfaceName();
  final int mtu=newLp.getMtu();
  if (oldLp != null && newLp.isIdenticalMtu(oldLp)) {
    if (VDBG)     log("String_Node_Str");
    return;
  }
  if (LinkProperties.isValidMtu(mtu,newLp.hasGlobalIPv6Address()) == false) {
    loge("String_Node_Str" + mtu + "String_Node_Str"+ iface);
    return;
  }
  if (TextUtils.isEmpty(iface)) {
    loge("String_Node_Str");
    return;
  }
  try {
    if (VDBG)     log("String_Node_Str" + iface + "String_Node_Str"+ mtu);
    mNetd.setMtu(iface,mtu);
  }
 catch (  Exception e) {
    Slog.e(TAG,"String_Node_Str" + e);
  }
}
Program: 198306
Project: 198306
Buggy source:
/** 
 * Reads the network specific MTU size from reources. and set it on it's iface.
 */
private void updateMtu(LinkProperties newLp,LinkProperties oldLp){
  final String iface=newLp.getInterfaceName();
  final int mtu=newLp.getMtu();
  if (oldLp != null && newLp.isIdenticalMtu(oldLp)) {
    if (VDBG)     log("String_Node_Str");
    return;
  }
  if (LinkProperties.isValidMtu(mtu,newLp.hasGlobalIPv6Address())) {
    loge("String_Node_Str" + mtu + "String_Node_Str"+ iface);
    return;
  }
  if (TextUtils.isEmpty(iface)) {
    loge("String_Node_Str");
    return;
  }
  try {
    if (VDBG)     log("String_Node_Str" + iface + "String_Node_Str"+ mtu);
    mNetd.setMtu(iface,mtu);
  }
 catch (  Exception e) {
    Slog.e(TAG,"String_Node_Str" + e);
  }
}

Fixed version (ground truth):
/** 
 * Reads the network specific MTU size from reources. and set it on it's iface.
 */
private void updateMtu(LinkProperties newLp,LinkProperties oldLp){
  final String iface=newLp.getInterfaceName();
  final int mtu=newLp.getMtu();
  if (oldLp != null && newLp.isIdenticalMtu(oldLp)) {
    if (VDBG)     log("String_Node_Str");
    return;
  }
  if (LinkProperties.isValidMtu(mtu,newLp.hasGlobalIPv6Address()) == false) {
    loge("String_Node_Str" + mtu + "String_Node_Str"+ iface);
    return;
  }
  if (TextUtils.isEmpty(iface)) {
    loge("String_Node_Str");
    return;
  }
  try {
    if (VDBG)     log("String_Node_Str" + iface + "String_Node_Str"+ mtu);
    mNetd.setMtu(iface,mtu);
  }
 catch (  Exception e) {
    Slog.e(TAG,"String_Node_Str" + e);
  }
}
Program: 198309
Project: 198309
Buggy source:
public boolean setDeviceType(int deviceType){
  if (deviceType >= WFD_SOURCE && deviceType <= SOURCE_OR_PRIMARY_SINK) {
    mDeviceInfo|=deviceType;
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean setDeviceType(int deviceType){
  if (deviceType >= WFD_SOURCE && deviceType <= SOURCE_OR_PRIMARY_SINK) {
    mDeviceInfo&=~DEVICE_TYPE;
    mDeviceInfo|=deviceType;
    return true;
  }
  return false;
}
Program: 198310
Project: 198310
Buggy source:
public boolean setDeviceType(int deviceType){
  if (deviceType >= WFD_SOURCE && deviceType <= SOURCE_OR_PRIMARY_SINK) {
    mDeviceInfo|=deviceType;
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean setDeviceType(int deviceType){
  if (deviceType >= WFD_SOURCE && deviceType <= SOURCE_OR_PRIMARY_SINK) {
    mDeviceInfo&=~DEVICE_TYPE;
    mDeviceInfo|=deviceType;
    return true;
  }
  return false;
}