nus-yam/ex-repair huggingface dataset:
Program: 43623
Project: 43623
Buggy source:
/** 
 * Flatten a Bundle into the parcel at the current dataPosition(), growing dataCapacity() if needed.
 */
public final void writeBundle(Bundle val){
  if (val == null) {
    writeInt(-1);
    return;
  }
  if (val.mParcelledData != null) {
    int length=val.mParcelledData.dataSize();
    appendFrom(val.mParcelledData,0,length);
  }
 else {
    writeInt(-1);
    int oldPos=dataPosition();
    writeInt(0x4C444E42);
    writeMapInternal(val.mMap);
    int newPos=dataPosition();
    setDataPosition(oldPos - 4);
    int length=newPos - oldPos;
    writeInt(length);
    setDataPosition(newPos);
  }
}

Fixed version (ground truth):
/** 
 * Flatten a Bundle into the parcel at the current dataPosition(), growing dataCapacity() if needed.
 */
public final void writeBundle(Bundle val){
  if (val == null) {
    writeInt(-1);
    return;
  }
  val.writeToParcel(this,0);
}
Program: 43624
Project: 43624
Buggy source:
/** 
 * Read and return a new Bundle object from the parcel at the current dataPosition(), using the given class loader to initialize the class loader of the Bundle for later retrieval of Parcelable objects. Returns null if the previously written Bundle object was null.
 */
public final Bundle readBundle(ClassLoader loader){
  int offset=dataPosition();
  int length=readInt();
  if (length < 0) {
    return null;
  }
  int magic=readInt();
  if (magic != 0x4C444E42) {
    String st=Log.getStackTraceString(new RuntimeException());
    Log.e("String_Node_Str","String_Node_Str");
    Log.e("String_Node_Str","String_Node_Str" + st);
  }
  setDataPosition(offset + length + 4);
  Parcel p=new Parcel(0);
  p.setDataPosition(0);
  p.appendFrom(this,offset,length + 4);
  p.setDataPosition(0);
  final Bundle bundle=new Bundle(p);
  if (loader != null) {
    bundle.setClassLoader(loader);
  }
  return bundle;
}

Fixed version (ground truth):
/** 
 * Read and return a new Bundle object from the parcel at the current dataPosition(), using the given class loader to initialize the class loader of the Bundle for later retrieval of Parcelable objects. Returns null if the previously written Bundle object was null.
 */
public final Bundle readBundle(ClassLoader loader){
  int length=readInt();
  if (length < 0) {
    return null;
  }
  final Bundle bundle=new Bundle(this,length);
  if (loader != null) {
    bundle.setClassLoader(loader);
  }
  return bundle;
}
Program: 43625
Project: 43625
Buggy source:
/** 
 * Flatten a Map into the parcel at the current dataPosition(), growing dataCapacity() if needed.  The Map keys must be String objects.
 */
private void writeMapInternal(Map<String,Object> val){
  if (val == null) {
    writeInt(-1);
    return;
  }
  Set<Map.Entry<String,Object>> entries=val.entrySet();
  writeInt(entries.size());
  for (  Map.Entry<String,Object> e : entries) {
    writeValue(e.getKey());
    writeValue(e.getValue());
  }
}

Fixed version (ground truth):
/** 
 * Flatten a Map into the parcel at the current dataPosition(), growing dataCapacity() if needed.  The Map keys must be String objects.
 */
void writeMapInternal(Map<String,Object> val){
  if (val == null) {
    writeInt(-1);
    return;
  }
  Set<Map.Entry<String,Object>> entries=val.entrySet();
  writeInt(entries.size());
  for (  Map.Entry<String,Object> e : entries) {
    writeValue(e.getKey());
    writeValue(e.getValue());
  }
}
Program: 43626
Project: 43626
Buggy source:
void replaceTextfieldText(int oldStart,int oldEnd,String replace,int newStart,int newEnd){
  HashMap arg=new HashMap();
  arg.put("String_Node_Str",new WebViewCore.FocusData(mFocusData));
  arg.put("String_Node_Str",replace);
  arg.put("String_Node_Str",new Integer(newStart));
  arg.put("String_Node_Str",new Integer(newEnd));
  mTextGeneration++;
  mWebViewCore.sendMessage(EventHub.REPLACE_TEXT,oldStart,oldEnd,arg);
}

Fixed version (ground truth):
void replaceTextfieldText(int oldStart,int oldEnd,String replace,int newStart,int newEnd){
  HashMap arg=new HashMap();
  arg.put("String_Node_Str",new WebViewCore.FocusData(mFocusData));
  arg.put("String_Node_Str",replace);
  arg.put("String_Node_Str",Integer.valueOf(newStart));
  arg.put("String_Node_Str",Integer.valueOf(newEnd));
  mTextGeneration++;
  mWebViewCore.sendMessage(EventHub.REPLACE_TEXT,oldStart,oldEnd,arg);
}
Program: 43629
Project: 43629
Buggy source:
/** 
 * goes to the home screen
 * @return whether it did anything
 */
boolean goHome(){
  if (false) {
    mContext.startActivity(mHomeIntent);
  }
 else {
    try {
      int result=ActivityManagerNative.getDefault().startActivity(null,mHomeIntent,mHomeIntent.resolveTypeIfNeeded(mContext.getContentResolver()),null,0,null,null,0,true,false);
      if (result == IActivityManager.START_RETURN_INTENT_TO_CALLER) {
        return false;
      }
    }
 catch (    RemoteException ex) {
    }
  }
  sendCloseSystemWindows();
  return true;
}

Fixed version (ground truth):
/** 
 * goes to the home screen
 * @return whether it did anything
 */
boolean goHome(){
  if (false) {
    try {
      ActivityManagerNative.getDefault().stopAppSwitches();
    }
 catch (    RemoteException e) {
    }
    mContext.startActivity(mHomeIntent);
  }
 else {
    try {
      ActivityManagerNative.getDefault().stopAppSwitches();
      int result=ActivityManagerNative.getDefault().startActivity(null,mHomeIntent,mHomeIntent.resolveTypeIfNeeded(mContext.getContentResolver()),null,0,null,null,0,true,false);
      if (result == IActivityManager.START_RETURN_INTENT_TO_CALLER) {
        return false;
      }
    }
 catch (    RemoteException ex) {
    }
  }
  sendCloseSystemWindows();
  return true;
}
Program: 43630
Project: 43630
Buggy source:
/** 
 * A home key -> launch home action was detected.  Take the appropriate action given the situation with the keyguard.
 */
void launchHomeFromHotKey(){
  if (mKeyguardMediator.isShowing()) {
  }
 else   if (mKeyguardMediator.isInputRestricted()) {
    mKeyguardMediator.verifyUnlock(new OnKeyguardExitResult(){
      public void onKeyguardExitResult(      boolean success){
        if (success) {
          mContext.startActivity(mHomeIntent);
          sendCloseSystemWindows();
        }
      }
    }
);
  }
 else {
    mContext.startActivity(mHomeIntent);
    sendCloseSystemWindows();
  }
}

Fixed version (ground truth):
/** 
 * A home key -> launch home action was detected.  Take the appropriate action given the situation with the keyguard.
 */
void launchHomeFromHotKey(){
  if (mKeyguardMediator.isShowing()) {
  }
 else   if (mKeyguardMediator.isInputRestricted()) {
    mKeyguardMediator.verifyUnlock(new OnKeyguardExitResult(){
      public void onKeyguardExitResult(      boolean success){
        if (success) {
          try {
            ActivityManagerNative.getDefault().stopAppSwitches();
          }
 catch (          RemoteException e) {
          }
          mContext.startActivity(mHomeIntent);
          sendCloseSystemWindows();
        }
      }
    }
);
  }
 else {
    try {
      ActivityManagerNative.getDefault().stopAppSwitches();
    }
 catch (    RemoteException e) {
    }
    mContext.startActivity(mHomeIntent);
    sendCloseSystemWindows();
  }
}
Program: 43631
Project: 43631
Buggy source:
public void onKeyguardExitResult(boolean success){
  if (success) {
    mContext.startActivity(mHomeIntent);
    sendCloseSystemWindows();
  }
}

Fixed version (ground truth):
public void onKeyguardExitResult(boolean success){
  if (success) {
    try {
      ActivityManagerNative.getDefault().stopAppSwitches();
    }
 catch (    RemoteException e) {
    }
    mContext.startActivity(mHomeIntent);
    sendCloseSystemWindows();
  }
}
Program: 43632
Project: 43632
Buggy source:
protected void onHandleIntent(Intent intent){
  if (REMOTE_INTENT_ACTION.equals(intent.getAction())) {
    boolean fromTrustedServer=intent.getBooleanExtra("String_Node_Str",false);
    if (fromTrustedServer) {
      String accountName=intent.getStringExtra("String_Node_Str");
      String token=intent.getStringExtra("String_Node_Str");
      if (TextUtils.isEmpty(accountName) || TextUtils.isEmpty(token)) {
        if (Config.LOGD) {
          Log.d(TAG,"String_Node_Str");
        }
        return;
      }
      if (Config.LOGD) {
        Log.d(TAG,"String_Node_Str" + accountName + "String_Node_Str"+ token);
      }
      handleTickle(this,accountName,token);
    }
 else {
      if (Log.isLoggable(TAG,Log.VERBOSE)) {
        Log.v(TAG,"String_Node_Str");
      }
    }
  }
 else   if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
    if (Config.LOGD) {
      Log.d(TAG,"String_Node_Str");
    }
    long refreshTime=getSharedPreferences(sSubscribedFeedsPrefs,Context.MODE_WORLD_READABLE).getLong(sRefreshTime,0);
    scheduleRefresh(this,refreshTime);
  }
 else   if (SUBSCRIBED_FEEDS_REFRESH_ACTION.equals(intent.getAction())) {
    if (Config.LOGD) {
      Log.d(TAG,"String_Node_Str");
    }
    handleRefreshAlarm(this);
  }
}

Fixed version (ground truth):
protected void onHandleIntent(Intent intent){
  if (REMOTE_INTENT_ACTION.equals(intent.getAction())) {
    boolean fromTrustedServer=intent.getBooleanExtra("String_Node_Str",false);
    if (fromTrustedServer) {
      String accountName=intent.getStringExtra("String_Node_Str");
      String token=intent.getStringExtra(Intent.EXTRA_REMOTE_INTENT_TOKEN);
      if (TextUtils.isEmpty(accountName) || TextUtils.isEmpty(token)) {
        if (Config.LOGD) {
          Log.d(TAG,"String_Node_Str");
        }
        return;
      }
      if (Config.LOGD) {
        Log.d(TAG,"String_Node_Str" + accountName + "String_Node_Str"+ token);
      }
      handleTickle(this,accountName,token);
    }
 else {
      if (Log.isLoggable(TAG,Log.VERBOSE)) {
        Log.v(TAG,"String_Node_Str");
      }
    }
  }
 else   if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
    if (Config.LOGD) {
      Log.d(TAG,"String_Node_Str");
    }
    long refreshTime=getSharedPreferences(sSubscribedFeedsPrefs,Context.MODE_WORLD_READABLE).getLong(sRefreshTime,0);
    scheduleRefresh(this,refreshTime);
  }
 else   if (SUBSCRIBED_FEEDS_REFRESH_ACTION.equals(intent.getAction())) {
    if (Config.LOGD) {
      Log.d(TAG,"String_Node_Str");
    }
    handleRefreshAlarm(this);
  }
}
Program: 43633
Project: 43633
Buggy source:
private void runStart(){
  Intent intent=makeIntent();
  if (intent != null) {
    System.out.println("String_Node_Str" + intent);
    try {
      intent.addFlags(intent.FLAG_ACTIVITY_NEW_TASK);
      int res=mAm.startActivity(null,intent,intent.getType(),null,0,null,null,0,false,mDebugOption);
switch (res) {
case IActivityManager.START_SUCCESS:
        break;
case IActivityManager.START_CLASS_NOT_FOUND:
      System.err.println("String_Node_Str");
    System.err.println("String_Node_Str" + intent.getComponent().toShortString() + "String_Node_Str");
  break;
case IActivityManager.START_DELIVERED_TO_TOP:
System.err.println("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
break;
case IActivityManager.START_FORWARD_AND_REQUEST_CONFLICT:
System.err.println("String_Node_Str" + "String_Node_Str");
break;
case IActivityManager.START_INTENT_NOT_RESOLVED:
System.err.println("String_Node_Str" + "String_Node_Str" + intent.toString());
break;
case IActivityManager.START_RETURN_INTENT_TO_CALLER:
System.err.println("String_Node_Str" + "String_Node_Str");
break;
case IActivityManager.START_TASK_TO_FRONT:
System.err.println("String_Node_Str" + "String_Node_Str");
break;
default :
System.err.println("String_Node_Str" + "String_Node_Str" + res);
break;
}
}
 catch (RemoteException e) {
System.err.println("String_Node_Str");
System.err.println("String_Node_Str" + "String_Node_Str");
}
}
}

Fixed version (ground truth):
private void runStart(){
  Intent intent=makeIntent();
  if (intent != null) {
    System.out.println("String_Node_Str" + intent);
    try {
      intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
      int res=mAm.startActivity(null,intent,intent.getType(),null,0,null,null,0,false,mDebugOption);
switch (res) {
case IActivityManager.START_SUCCESS:
        break;
case IActivityManager.START_SWITCHES_CANCELED:
      System.err.println("String_Node_Str" + "String_Node_Str");
    break;
case IActivityManager.START_DELIVERED_TO_TOP:
  System.err.println("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
break;
case IActivityManager.START_RETURN_INTENT_TO_CALLER:
System.err.println("String_Node_Str" + "String_Node_Str");
break;
case IActivityManager.START_TASK_TO_FRONT:
System.err.println("String_Node_Str" + "String_Node_Str");
break;
case IActivityManager.START_INTENT_NOT_RESOLVED:
System.err.println("String_Node_Str" + "String_Node_Str" + intent.toString());
break;
case IActivityManager.START_CLASS_NOT_FOUND:
System.err.println("String_Node_Str");
System.err.println("String_Node_Str" + intent.getComponent().toShortString() + "String_Node_Str");
break;
case IActivityManager.START_FORWARD_AND_REQUEST_CONFLICT:
System.err.println("String_Node_Str" + "String_Node_Str");
break;
case IActivityManager.START_PERMISSION_DENIED:
System.err.println("String_Node_Str" + "String_Node_Str");
break;
default :
System.err.println("String_Node_Str" + "String_Node_Str" + res);
break;
}
}
 catch (RemoteException e) {
System.err.println("String_Node_Str");
System.err.println("String_Node_Str" + "String_Node_Str");
}
}
}
Program: 43635
Project: 43635
Buggy source:
private void runStart(){
  Intent intent=makeIntent();
  if (intent != null) {
    System.out.println("String_Node_Str" + intent);
    try {
      intent.addFlags(intent.FLAG_ACTIVITY_NEW_TASK);
      int res=mAm.startActivity(null,intent,intent.getType(),null,0,null,null,0,false,mDebugOption);
switch (res) {
case IActivityManager.START_SUCCESS:
        break;
case IActivityManager.START_CLASS_NOT_FOUND:
      System.err.println("String_Node_Str");
    System.err.println("String_Node_Str" + intent.getComponent().toShortString() + "String_Node_Str");
  break;
case IActivityManager.START_DELIVERED_TO_TOP:
System.err.println("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
break;
case IActivityManager.START_FORWARD_AND_REQUEST_CONFLICT:
System.err.println("String_Node_Str" + "String_Node_Str");
break;
case IActivityManager.START_INTENT_NOT_RESOLVED:
System.err.println("String_Node_Str" + "String_Node_Str" + intent.toString());
break;
case IActivityManager.START_RETURN_INTENT_TO_CALLER:
System.err.println("String_Node_Str" + "String_Node_Str");
break;
case IActivityManager.START_TASK_TO_FRONT:
System.err.println("String_Node_Str" + "String_Node_Str");
break;
default :
System.err.println("String_Node_Str" + "String_Node_Str" + res);
break;
}
}
 catch (RemoteException e) {
System.err.println("String_Node_Str");
System.err.println("String_Node_Str" + "String_Node_Str");
}
}
}

Fixed version (ground truth):
private void runStart(){
  Intent intent=makeIntent();
  if (intent != null) {
    System.out.println("String_Node_Str" + intent);
    try {
      intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
      int res=mAm.startActivity(null,intent,intent.getType(),null,0,null,null,0,false,mDebugOption);
switch (res) {
case IActivityManager.START_SUCCESS:
        break;
case IActivityManager.START_SWITCHES_CANCELED:
      System.err.println("String_Node_Str" + "String_Node_Str");
    break;
case IActivityManager.START_DELIVERED_TO_TOP:
  System.err.println("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
break;
case IActivityManager.START_RETURN_INTENT_TO_CALLER:
System.err.println("String_Node_Str" + "String_Node_Str");
break;
case IActivityManager.START_TASK_TO_FRONT:
System.err.println("String_Node_Str" + "String_Node_Str");
break;
case IActivityManager.START_INTENT_NOT_RESOLVED:
System.err.println("String_Node_Str" + "String_Node_Str" + intent.toString());
break;
case IActivityManager.START_CLASS_NOT_FOUND:
System.err.println("String_Node_Str");
System.err.println("String_Node_Str" + intent.getComponent().toShortString() + "String_Node_Str");
break;
case IActivityManager.START_FORWARD_AND_REQUEST_CONFLICT:
System.err.println("String_Node_Str" + "String_Node_Str");
break;
case IActivityManager.START_PERMISSION_DENIED:
System.err.println("String_Node_Str" + "String_Node_Str");
break;
default :
System.err.println("String_Node_Str" + "String_Node_Str" + res);
break;
}
}
 catch (RemoteException e) {
System.err.println("String_Node_Str");
System.err.println("String_Node_Str" + "String_Node_Str");
}
}
}
Program: 43637
Project: 43637
Buggy source:
/** 
 * goes to the home screen
 * @return whether it did anything
 */
boolean goHome(){
  if (false) {
    mContext.startActivity(mHomeIntent);
  }
 else {
    try {
      int result=ActivityManagerNative.getDefault().startActivity(null,mHomeIntent,mHomeIntent.resolveTypeIfNeeded(mContext.getContentResolver()),null,0,null,null,0,true,false);
      if (result == IActivityManager.START_RETURN_INTENT_TO_CALLER) {
        return false;
      }
    }
 catch (    RemoteException ex) {
    }
  }
  sendCloseSystemWindows();
  return true;
}

Fixed version (ground truth):
/** 
 * goes to the home screen
 * @return whether it did anything
 */
boolean goHome(){
  if (false) {
    try {
      ActivityManagerNative.getDefault().stopAppSwitches();
    }
 catch (    RemoteException e) {
    }
    mContext.startActivity(mHomeIntent);
  }
 else {
    try {
      ActivityManagerNative.getDefault().stopAppSwitches();
      int result=ActivityManagerNative.getDefault().startActivity(null,mHomeIntent,mHomeIntent.resolveTypeIfNeeded(mContext.getContentResolver()),null,0,null,null,0,true,false);
      if (result == IActivityManager.START_RETURN_INTENT_TO_CALLER) {
        return false;
      }
    }
 catch (    RemoteException ex) {
    }
  }
  sendCloseSystemWindows();
  return true;
}
Program: 43638
Project: 43638
Buggy source:
/** 
 * A home key -> launch home action was detected.  Take the appropriate action given the situation with the keyguard.
 */
void launchHomeFromHotKey(){
  if (mKeyguardMediator.isShowing()) {
  }
 else   if (mKeyguardMediator.isInputRestricted()) {
    mKeyguardMediator.verifyUnlock(new OnKeyguardExitResult(){
      public void onKeyguardExitResult(      boolean success){
        if (success) {
          mContext.startActivity(mHomeIntent);
          sendCloseSystemWindows();
        }
      }
    }
);
  }
 else {
    mContext.startActivity(mHomeIntent);
    sendCloseSystemWindows();
  }
}

Fixed version (ground truth):
/** 
 * A home key -> launch home action was detected.  Take the appropriate action given the situation with the keyguard.
 */
void launchHomeFromHotKey(){
  if (mKeyguardMediator.isShowing()) {
  }
 else   if (mKeyguardMediator.isInputRestricted()) {
    mKeyguardMediator.verifyUnlock(new OnKeyguardExitResult(){
      public void onKeyguardExitResult(      boolean success){
        if (success) {
          try {
            ActivityManagerNative.getDefault().stopAppSwitches();
          }
 catch (          RemoteException e) {
          }
          mContext.startActivity(mHomeIntent);
          sendCloseSystemWindows();
        }
      }
    }
);
  }
 else {
    try {
      ActivityManagerNative.getDefault().stopAppSwitches();
    }
 catch (    RemoteException e) {
    }
    mContext.startActivity(mHomeIntent);
    sendCloseSystemWindows();
  }
}
Program: 43639
Project: 43639
Buggy source:
public void onKeyguardExitResult(boolean success){
  if (success) {
    mContext.startActivity(mHomeIntent);
    sendCloseSystemWindows();
  }
}

Fixed version (ground truth):
public void onKeyguardExitResult(boolean success){
  if (success) {
    try {
      ActivityManagerNative.getDefault().stopAppSwitches();
    }
 catch (    RemoteException e) {
    }
    mContext.startActivity(mHomeIntent);
    sendCloseSystemWindows();
  }
}
Program: 43640
Project: 43640
Buggy source:
/** 
 * <p> Call mDb.endTransaction(). If successful is true, try to call mDb.setTransactionSuccessful() before calling mDb.endTransaction(). This method MUST be used with   {@link #beginBatch()}. </p>
 * @hide This method must be used with {@link #beginTransaction}
 */
public final void endBatch(boolean successful){
  try {
    if (successful) {
      mDb.setTransactionSuccessful();
    }
  }
  finally {
    mApplyingBatch.set(false);
    getDatabase().endTransaction();
    for (    Uri url : mPendingBatchNotifications.get()) {
      getContext().getContentResolver().notifyChange(url,null,changeRequiresLocalSync(url));
    }
    mDb.endTransaction();
  }
}

Fixed version (ground truth):
/** 
 * <p> Finish batch transaction. If "successful" is true, try to call mDb.setTransactionSuccessful() before calling mDb.endTransaction(). This method MUST be used with   {@link #beginBatch()}. </p>
 * @hide This method must be used with {@link #beginTransaction}
 */
public final void endBatch(boolean successful){
  try {
    if (successful) {
      mDb.setTransactionSuccessful();
    }
  }
  finally {
    mApplyingBatch.set(false);
    getDatabase().endTransaction();
    for (    Uri url : mPendingBatchNotifications.get()) {
      getContext().getContentResolver().notifyChange(url,null,changeRequiresLocalSync(url));
    }
  }
}
Program: 43641
Project: 43641
Buggy source:
/** 
 * <p> Call mOpenHelper.getWritableDatabase() and mDb.beginTransaction().  {@link #endTransaction} MUST be called after calling this method.Those methods should be used like this: </p> <pre class="prettyprint"> boolean successful = false; if (!beginTransaction()) { return; } try { // Do something related to mDb successful = true; return ret; } finally { endTransaction(successful); } </pre>
 * @hide This method should be used only when {@link #applyBatch} is not enough and must beused with  {@link #endTransaction}. e.g. If returned value has to be used during one transaction, this method might be useful.
 */
public final void beginBatch(){
  if (mApplyingBatch.get() == null) {
    mApplyingBatch.set(false);
    mPendingBatchNotifications.set(new HashSet<Uri>());
  }
  if (applyingBatch()) {
    throw new IllegalStateException("String_Node_Str");
  }
  SQLiteDatabase db=getDatabase();
  db.beginTransaction();
  boolean successful=false;
  try {
    mApplyingBatch.set(true);
    successful=true;
  }
  finally {
    if (!successful) {
      db.endTransaction();
    }
  }
}

Fixed version (ground truth):
/** 
 * <p> Start batch transaction.   {@link #endTransaction} MUST be called after calling this method. Those methods should be used like this: </p> <pre class="prettyprint"> boolean successful = false; beginBatch() try { // Do something related to mDb successful = true; return ret; } finally { endBatch(successful); } </pre>
 * @hide This method should be used only when {@link #applyBatch} is not enough and must beused with  {@link #endBatch}. e.g. If returned value has to be used during one transaction, this method might be useful.
 */
public final void beginBatch(){
  if (mApplyingBatch.get() == null) {
    mApplyingBatch.set(false);
    mPendingBatchNotifications.set(new HashSet<Uri>());
  }
  if (applyingBatch()) {
    throw new IllegalStateException("String_Node_Str");
  }
  SQLiteDatabase db=getDatabase();
  db.beginTransaction();
  boolean successful=false;
  try {
    mApplyingBatch.set(true);
    successful=true;
  }
  finally {
    if (!successful) {
      db.endTransaction();
    }
  }
}
Program: 43642
Project: 43642
Buggy source:
static void addFileType(String extension,int fileType,String mimeType){
  sFileTypeMap.put(extension,new MediaFileType(fileType,mimeType));
  sMimeTypeMap.put(mimeType,new Integer(fileType));
}

Fixed version (ground truth):
static void addFileType(String extension,int fileType,String mimeType){
  sFileTypeMap.put(extension,new MediaFileType(fileType,mimeType));
  sMimeTypeMap.put(mimeType,Integer.valueOf(fileType));
}
Program: 43646
Project: 43646
Buggy source:
void setLayoutParams(WindowManager.LayoutParams attrs,boolean newView){
synchronized (this) {
    int oldSoftInputMode=mWindowAttributes.softInputMode;
    mWindowAttributes.copyFrom(attrs);
    mWindowAttributes.scale(mAppScale);
    if (newView) {
      mSoftInputMode=attrs.softInputMode;
      requestLayout();
    }
    if ((attrs.softInputMode & WindowManager.LayoutParams.SOFT_INPUT_MASK_ADJUST) == WindowManager.LayoutParams.SOFT_INPUT_ADJUST_UNSPECIFIED) {
      mWindowAttributes.softInputMode=(mWindowAttributes.softInputMode & ~WindowManager.LayoutParams.SOFT_INPUT_MASK_ADJUST) | (oldSoftInputMode & WindowManager.LayoutParams.SOFT_INPUT_MASK_ADJUST);
    }
    mWindowAttributesChanged=true;
    scheduleTraversals();
  }
}

Fixed version (ground truth):
void setLayoutParams(WindowManager.LayoutParams attrs,boolean newView){
synchronized (this) {
    int oldSoftInputMode=mWindowAttributes.softInputMode;
    mWindowAttributes.copyFrom(attrs);
    if (newView) {
      mSoftInputMode=attrs.softInputMode;
      requestLayout();
    }
    if ((attrs.softInputMode & WindowManager.LayoutParams.SOFT_INPUT_MASK_ADJUST) == WindowManager.LayoutParams.SOFT_INPUT_ADJUST_UNSPECIFIED) {
      mWindowAttributes.softInputMode=(mWindowAttributes.softInputMode & ~WindowManager.LayoutParams.SOFT_INPUT_MASK_ADJUST) | (oldSoftInputMode & WindowManager.LayoutParams.SOFT_INPUT_MASK_ADJUST);
    }
    mWindowAttributesChanged=true;
    scheduleTraversals();
  }
}
Program: 43647
Project: 43647
Buggy source:
private int relayoutWindow(WindowManager.LayoutParams params,int viewVisibility,boolean insetsPending) throws RemoteException {
  int relayoutResult=sWindowSession.relayout(mWindow,params,(int)(mView.mMeasuredWidth * mAppScale),(int)(mView.mMeasuredHeight * mAppScale),viewVisibility,insetsPending,mWinFrame,mPendingContentInsets,mPendingVisibleInsets,mSurface);
  mPendingContentInsets.scale(mAppScaleInverted);
  mPendingVisibleInsets.scale(mAppScaleInverted);
  mWinFrame.scale(mAppScaleInverted);
  return relayoutResult;
}

Fixed version (ground truth):
private int relayoutWindow(WindowManager.LayoutParams params,int viewVisibility,boolean insetsPending) throws RemoteException {
  boolean restore=false;
  if (params != null && mAppScale != 1.0f) {
    restore=true;
    params.scale(mAppScale,mWindowLayoutParamsBackup);
  }
  int relayoutResult=sWindowSession.relayout(mWindow,params,(int)(mView.mMeasuredWidth * mAppScale),(int)(mView.mMeasuredHeight * mAppScale),viewVisibility,insetsPending,mWinFrame,mPendingContentInsets,mPendingVisibleInsets,mSurface);
  if (restore) {
    params.restore(mWindowLayoutParamsBackup);
  }
  mPendingContentInsets.scale(mAppScaleInverted);
  mPendingVisibleInsets.scale(mAppScaleInverted);
  mWinFrame.scale(mAppScaleInverted);
  return relayoutResult;
}
Program: 43649
Project: 43649
Buggy source:
void scale(float scale){
  if (scale != 1.0f) {
    x*=scale;
    y*=scale;
    if (width > 0) {
      width*=scale;
    }
    if (height > 0) {
      height*=scale;
    }
  }
}

Fixed version (ground truth):
/** 
 * Scale the layout params' coordinates and size. Returns the original info as a backup so that the caller can restore the layout params;
 */
void scale(float scale,int[] backup){
  if (scale != 1.0f) {
    backup[0]=x;
    backup[1]=y;
    x*=scale;
    y*=scale;
    if (width > 0) {
      backup[2]=width;
      width*=scale;
    }
    if (height > 0) {
      backup[3]=height;
      height*=scale;
    }
  }
}
Program: 43651
Project: 43651
Buggy source:
public void setSyncProviderAutomatically(String account,String providerName,boolean sync){
synchronized (mAuthorities) {
    if (account != null) {
      AuthorityInfo authority=getAuthorityLocked(account,providerName,"String_Node_Str");
      if (authority != null) {
        authority.enabled=sync;
      }
    }
 else {
      int i=mAuthorities.size();
      while (i > 0) {
        i--;
        AuthorityInfo authority=mAuthorities.get(i);
        if (authority.account.equals(account) && authority.authority.equals(providerName)) {
          authority.enabled=sync;
        }
      }
    }
    writeAccountInfoLocked();
  }
  reportChange(CHANGE_SETTINGS);
}

Fixed version (ground truth):
public void setSyncProviderAutomatically(String account,String providerName,boolean sync){
synchronized (mAuthorities) {
    if (account != null) {
      AuthorityInfo authority=getAuthorityLocked(account,providerName,"String_Node_Str");
      if (authority != null) {
        authority.enabled=sync;
      }
    }
 else {
      int i=mAuthorities.size();
      while (i > 0) {
        i--;
        AuthorityInfo authority=mAuthorities.get(i);
        if (authority.authority.equals(providerName)) {
          authority.enabled=sync;
        }
      }
    }
    writeAccountInfoLocked();
  }
  reportChange(CHANGE_SETTINGS);
}
Program: 43652
Project: 43652
Buggy source:
private final List generateApplicationProvidersLocked(ProcessRecord app){
  List providers=null;
  try {
    providers=ActivityThread.getPackageManager().queryContentProviders(app.processName,app.info.uid,PackageManager.GET_SHARED_LIBRARY_FILES | PackageManager.GET_URI_PERMISSION_PATTERNS);
  }
 catch (  RemoteException ex) {
  }
  if (providers != null) {
    final int N=providers.size();
    for (int i=0; i < N; i++) {
      ProviderInfo cpi=(ProviderInfo)providers.get(i);
      ContentProviderRecord cpr=(ContentProviderRecord)mProvidersByClass.get(cpi.name);
      if (cpr == null) {
        cpr=new ContentProviderRecord(cpi,app.info);
        mProvidersByClass.put(cpi.name,cpr);
      }
      app.pubProviders.put(cpi.name,cpr);
      app.addPackage(cpi.applicationInfo.packageName);
    }
  }
  return providers;
}

Fixed version (ground truth):
private final List generateApplicationProvidersLocked(ProcessRecord app){
  List providers=null;
  try {
    providers=ActivityThread.getPackageManager().queryContentProviders(app.processName,app.info.uid,STOCK_PM_FLAGS | PackageManager.GET_URI_PERMISSION_PATTERNS);
  }
 catch (  RemoteException ex) {
  }
  if (providers != null) {
    final int N=providers.size();
    for (int i=0; i < N; i++) {
      ProviderInfo cpi=(ProviderInfo)providers.get(i);
      ContentProviderRecord cpr=(ContentProviderRecord)mProvidersByClass.get(cpi.name);
      if (cpr == null) {
        cpr=new ContentProviderRecord(cpi,app.info);
        mProvidersByClass.put(cpi.name,cpr);
      }
      app.pubProviders.put(cpi.name,cpr);
      app.addPackage(cpi.applicationInfo.packageName);
    }
  }
  return providers;
}
Program: 43656
Project: 43656
Buggy source:
void finishInstrumentationLocked(ProcessRecord app,int resultCode,Bundle results){
  if (app.instrumentationWatcher != null) {
    try {
      app.instrumentationWatcher.instrumentationFinished(app.instrumentationClass,resultCode,results);
    }
 catch (    RemoteException e) {
    }
  }
  app.instrumentationWatcher=null;
  app.instrumentationClass=null;
  app.instrumentationProfileFile=null;
  app.instrumentationArguments=null;
  uninstallPackageLocked(app.processName,-1,false);
}

Fixed version (ground truth):
void finishInstrumentationLocked(ProcessRecord app,int resultCode,Bundle results){
  if (app.instrumentationWatcher != null) {
    try {
      app.instrumentationWatcher.instrumentationFinished(app.instrumentationClass,resultCode,results);
    }
 catch (    RemoteException e) {
    }
  }
  app.instrumentationWatcher=null;
  app.instrumentationClass=null;
  app.instrumentationInfo=null;
  app.instrumentationProfileFile=null;
  app.instrumentationArguments=null;
  uninstallPackageLocked(app.processName,-1,false);
}
Program: 43657
Project: 43657
Buggy source:
final int startActivityInPackage(int uid,Intent intent,String resolvedType,IBinder resultTo,String resultWho,int requestCode,boolean onlyIfNeeded){
  final boolean componentSpecified=intent.getComponent() != null;
  intent=new Intent(intent);
  ActivityInfo aInfo;
  try {
    ResolveInfo rInfo=ActivityThread.getPackageManager().resolveIntent(intent,resolvedType,PackageManager.MATCH_DEFAULT_ONLY | PackageManager.GET_SHARED_LIBRARY_FILES);
    aInfo=rInfo != null ? rInfo.activityInfo : null;
  }
 catch (  RemoteException e) {
    aInfo=null;
  }
  if (aInfo != null) {
    intent.setComponent(new ComponentName(aInfo.applicationInfo.packageName,aInfo.name));
  }
synchronized (this) {
    return startActivityLocked(null,intent,resolvedType,null,0,aInfo,resultTo,resultWho,requestCode,-1,uid,onlyIfNeeded,componentSpecified);
  }
}

Fixed version (ground truth):
final int startActivityInPackage(int uid,Intent intent,String resolvedType,IBinder resultTo,String resultWho,int requestCode,boolean onlyIfNeeded){
  final boolean componentSpecified=intent.getComponent() != null;
  intent=new Intent(intent);
  ActivityInfo aInfo;
  try {
    ResolveInfo rInfo=ActivityThread.getPackageManager().resolveIntent(intent,resolvedType,PackageManager.MATCH_DEFAULT_ONLY | STOCK_PM_FLAGS);
    aInfo=rInfo != null ? rInfo.activityInfo : null;
  }
 catch (  RemoteException e) {
    aInfo=null;
  }
  if (aInfo != null) {
    intent.setComponent(new ComponentName(aInfo.applicationInfo.packageName,aInfo.name));
  }
synchronized (this) {
    return startActivityLocked(null,intent,resolvedType,null,0,aInfo,resultTo,resultWho,requestCode,-1,uid,onlyIfNeeded,componentSpecified);
  }
}
Program: 43658
Project: 43658
Buggy source:
public static void setSystemProcess(){
  try {
    ActivityManagerService m=mSelf;
    ServiceManager.addService("String_Node_Str",m);
    ServiceManager.addService("String_Node_Str",new MemBinder(m));
    if (MONITOR_CPU_USAGE) {
      ServiceManager.addService("String_Node_Str",new CpuBinder(m));
    }
    ServiceManager.addService("String_Node_Str",new BroadcastsBinder(m));
    ServiceManager.addService("String_Node_Str",new ServicesBinder(m));
    ServiceManager.addService("String_Node_Str",new SendersBinder(m));
    ServiceManager.addService("String_Node_Str",new ProvidersBinder(m));
    ServiceManager.addService("String_Node_Str",new PermissionController(m));
    ApplicationInfo info=mSelf.mContext.getPackageManager().getApplicationInfo("String_Node_Str",PackageManager.GET_SHARED_LIBRARY_FILES);
synchronized (mSelf) {
      ProcessRecord app=mSelf.newProcessRecordLocked(mSystemThread.getApplicationThread(),info,info.processName);
      app.persistent=true;
      app.pid=Process.myPid();
      app.maxAdj=SYSTEM_ADJ;
      mSelf.mProcessNames.put(app.processName,app.info.uid,app);
synchronized (mSelf.mPidsSelfLocked) {
        mSelf.mPidsSelfLocked.put(app.pid,app);
      }
      mSelf.updateLRUListLocked(app,true);
    }
  }
 catch (  PackageManager.NameNotFoundException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public static void setSystemProcess(){
  try {
    ActivityManagerService m=mSelf;
    ServiceManager.addService("String_Node_Str",m);
    ServiceManager.addService("String_Node_Str",new MemBinder(m));
    if (MONITOR_CPU_USAGE) {
      ServiceManager.addService("String_Node_Str",new CpuBinder(m));
    }
    ServiceManager.addService("String_Node_Str",new BroadcastsBinder(m));
    ServiceManager.addService("String_Node_Str",new ServicesBinder(m));
    ServiceManager.addService("String_Node_Str",new SendersBinder(m));
    ServiceManager.addService("String_Node_Str",new ProvidersBinder(m));
    ServiceManager.addService("String_Node_Str",new PermissionController(m));
    ApplicationInfo info=mSelf.mContext.getPackageManager().getApplicationInfo("String_Node_Str",STOCK_PM_FLAGS);
synchronized (mSelf) {
      ProcessRecord app=mSelf.newProcessRecordLocked(mSystemThread.getApplicationThread(),info,info.processName);
      app.persistent=true;
      app.pid=Process.myPid();
      app.maxAdj=SYSTEM_ADJ;
      mSelf.mProcessNames.put(app.processName,app.info.uid,app);
synchronized (mSelf.mPidsSelfLocked) {
        mSelf.mPidsSelfLocked.put(app.pid,app);
      }
      mSelf.updateLRUListLocked(app,true);
    }
  }
 catch (  PackageManager.NameNotFoundException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}
Program: 43659
Project: 43659
Buggy source:
public final int startActivity(IApplicationThread caller,Intent intent,String resolvedType,Uri[] grantedUriPermissions,int grantedMode,IBinder resultTo,String resultWho,int requestCode,boolean onlyIfNeeded,boolean debug){
  if (intent != null && intent.hasFileDescriptors()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final boolean componentSpecified=intent.getComponent() != null;
  intent=new Intent(intent);
  ActivityInfo aInfo;
  try {
    ResolveInfo rInfo=ActivityThread.getPackageManager().resolveIntent(intent,resolvedType,PackageManager.MATCH_DEFAULT_ONLY | PackageManager.GET_SHARED_LIBRARY_FILES);
    aInfo=rInfo != null ? rInfo.activityInfo : null;
  }
 catch (  RemoteException e) {
    aInfo=null;
  }
  if (aInfo != null) {
    intent.setComponent(new ComponentName(aInfo.applicationInfo.packageName,aInfo.name));
    if (debug) {
      if (!aInfo.processName.equals("String_Node_Str")) {
        setDebugApp(aInfo.processName,true,false);
      }
    }
  }
synchronized (this) {
    final long origId=Binder.clearCallingIdentity();
    int res=startActivityLocked(caller,intent,resolvedType,grantedUriPermissions,grantedMode,aInfo,resultTo,resultWho,requestCode,-1,-1,onlyIfNeeded,componentSpecified);
    Binder.restoreCallingIdentity(origId);
    return res;
  }
}

Fixed version (ground truth):
public final int startActivity(IApplicationThread caller,Intent intent,String resolvedType,Uri[] grantedUriPermissions,int grantedMode,IBinder resultTo,String resultWho,int requestCode,boolean onlyIfNeeded,boolean debug){
  if (intent != null && intent.hasFileDescriptors()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final boolean componentSpecified=intent.getComponent() != null;
  intent=new Intent(intent);
  ActivityInfo aInfo;
  try {
    ResolveInfo rInfo=ActivityThread.getPackageManager().resolveIntent(intent,resolvedType,PackageManager.MATCH_DEFAULT_ONLY | STOCK_PM_FLAGS);
    aInfo=rInfo != null ? rInfo.activityInfo : null;
  }
 catch (  RemoteException e) {
    aInfo=null;
  }
  if (aInfo != null) {
    intent.setComponent(new ComponentName(aInfo.applicationInfo.packageName,aInfo.name));
    if (debug) {
      if (!aInfo.processName.equals("String_Node_Str")) {
        setDebugApp(aInfo.processName,true,false);
      }
    }
  }
synchronized (this) {
    final long origId=Binder.clearCallingIdentity();
    int res=startActivityLocked(caller,intent,resolvedType,grantedUriPermissions,grantedMode,aInfo,resultTo,resultWho,requestCode,-1,-1,onlyIfNeeded,componentSpecified);
    Binder.restoreCallingIdentity(origId);
    return res;
  }
}
Program: 43666
Project: 43666
Buggy source:
private final List generateApplicationProvidersLocked(ProcessRecord app){
  List providers=null;
  try {
    providers=ActivityThread.getPackageManager().queryContentProviders(app.processName,app.info.uid,PackageManager.GET_SHARED_LIBRARY_FILES | PackageManager.GET_URI_PERMISSION_PATTERNS);
  }
 catch (  RemoteException ex) {
  }
  if (providers != null) {
    final int N=providers.size();
    for (int i=0; i < N; i++) {
      ProviderInfo cpi=(ProviderInfo)providers.get(i);
      ContentProviderRecord cpr=(ContentProviderRecord)mProvidersByClass.get(cpi.name);
      if (cpr == null) {
        cpr=new ContentProviderRecord(cpi,app.info);
        mProvidersByClass.put(cpi.name,cpr);
      }
      app.pubProviders.put(cpi.name,cpr);
      app.addPackage(cpi.applicationInfo.packageName);
    }
  }
  return providers;
}

Fixed version (ground truth):
private final List generateApplicationProvidersLocked(ProcessRecord app){
  List providers=null;
  try {
    providers=ActivityThread.getPackageManager().queryContentProviders(app.processName,app.info.uid,STOCK_PM_FLAGS | PackageManager.GET_URI_PERMISSION_PATTERNS);
  }
 catch (  RemoteException ex) {
  }
  if (providers != null) {
    final int N=providers.size();
    for (int i=0; i < N; i++) {
      ProviderInfo cpi=(ProviderInfo)providers.get(i);
      ContentProviderRecord cpr=(ContentProviderRecord)mProvidersByClass.get(cpi.name);
      if (cpr == null) {
        cpr=new ContentProviderRecord(cpi,app.info);
        mProvidersByClass.put(cpi.name,cpr);
      }
      app.pubProviders.put(cpi.name,cpr);
      app.addPackage(cpi.applicationInfo.packageName);
    }
  }
  return providers;
}
Program: 43670
Project: 43670
Buggy source:
void finishInstrumentationLocked(ProcessRecord app,int resultCode,Bundle results){
  if (app.instrumentationWatcher != null) {
    try {
      app.instrumentationWatcher.instrumentationFinished(app.instrumentationClass,resultCode,results);
    }
 catch (    RemoteException e) {
    }
  }
  app.instrumentationWatcher=null;
  app.instrumentationClass=null;
  app.instrumentationProfileFile=null;
  app.instrumentationArguments=null;
  uninstallPackageLocked(app.processName,-1,false);
}

Fixed version (ground truth):
void finishInstrumentationLocked(ProcessRecord app,int resultCode,Bundle results){
  if (app.instrumentationWatcher != null) {
    try {
      app.instrumentationWatcher.instrumentationFinished(app.instrumentationClass,resultCode,results);
    }
 catch (    RemoteException e) {
    }
  }
  app.instrumentationWatcher=null;
  app.instrumentationClass=null;
  app.instrumentationInfo=null;
  app.instrumentationProfileFile=null;
  app.instrumentationArguments=null;
  uninstallPackageLocked(app.processName,-1,false);
}
Program: 43671
Project: 43671
Buggy source:
final int startActivityInPackage(int uid,Intent intent,String resolvedType,IBinder resultTo,String resultWho,int requestCode,boolean onlyIfNeeded){
  final boolean componentSpecified=intent.getComponent() != null;
  intent=new Intent(intent);
  ActivityInfo aInfo;
  try {
    ResolveInfo rInfo=ActivityThread.getPackageManager().resolveIntent(intent,resolvedType,PackageManager.MATCH_DEFAULT_ONLY | PackageManager.GET_SHARED_LIBRARY_FILES);
    aInfo=rInfo != null ? rInfo.activityInfo : null;
  }
 catch (  RemoteException e) {
    aInfo=null;
  }
  if (aInfo != null) {
    intent.setComponent(new ComponentName(aInfo.applicationInfo.packageName,aInfo.name));
  }
synchronized (this) {
    return startActivityLocked(null,intent,resolvedType,null,0,aInfo,resultTo,resultWho,requestCode,-1,uid,onlyIfNeeded,componentSpecified);
  }
}

Fixed version (ground truth):
final int startActivityInPackage(int uid,Intent intent,String resolvedType,IBinder resultTo,String resultWho,int requestCode,boolean onlyIfNeeded){
  final boolean componentSpecified=intent.getComponent() != null;
  intent=new Intent(intent);
  ActivityInfo aInfo;
  try {
    ResolveInfo rInfo=ActivityThread.getPackageManager().resolveIntent(intent,resolvedType,PackageManager.MATCH_DEFAULT_ONLY | STOCK_PM_FLAGS);
    aInfo=rInfo != null ? rInfo.activityInfo : null;
  }
 catch (  RemoteException e) {
    aInfo=null;
  }
  if (aInfo != null) {
    intent.setComponent(new ComponentName(aInfo.applicationInfo.packageName,aInfo.name));
  }
synchronized (this) {
    return startActivityLocked(null,intent,resolvedType,null,0,aInfo,resultTo,resultWho,requestCode,-1,uid,onlyIfNeeded,componentSpecified);
  }
}
Program: 43672
Project: 43672
Buggy source:
public static void setSystemProcess(){
  try {
    ActivityManagerService m=mSelf;
    ServiceManager.addService("String_Node_Str",m);
    ServiceManager.addService("String_Node_Str",new MemBinder(m));
    if (MONITOR_CPU_USAGE) {
      ServiceManager.addService("String_Node_Str",new CpuBinder(m));
    }
    ServiceManager.addService("String_Node_Str",new BroadcastsBinder(m));
    ServiceManager.addService("String_Node_Str",new ServicesBinder(m));
    ServiceManager.addService("String_Node_Str",new SendersBinder(m));
    ServiceManager.addService("String_Node_Str",new ProvidersBinder(m));
    ServiceManager.addService("String_Node_Str",new PermissionController(m));
    ApplicationInfo info=mSelf.mContext.getPackageManager().getApplicationInfo("String_Node_Str",PackageManager.GET_SHARED_LIBRARY_FILES);
synchronized (mSelf) {
      ProcessRecord app=mSelf.newProcessRecordLocked(mSystemThread.getApplicationThread(),info,info.processName);
      app.persistent=true;
      app.pid=Process.myPid();
      app.maxAdj=SYSTEM_ADJ;
      mSelf.mProcessNames.put(app.processName,app.info.uid,app);
synchronized (mSelf.mPidsSelfLocked) {
        mSelf.mPidsSelfLocked.put(app.pid,app);
      }
      mSelf.updateLRUListLocked(app,true);
    }
  }
 catch (  PackageManager.NameNotFoundException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public static void setSystemProcess(){
  try {
    ActivityManagerService m=mSelf;
    ServiceManager.addService("String_Node_Str",m);
    ServiceManager.addService("String_Node_Str",new MemBinder(m));
    if (MONITOR_CPU_USAGE) {
      ServiceManager.addService("String_Node_Str",new CpuBinder(m));
    }
    ServiceManager.addService("String_Node_Str",new BroadcastsBinder(m));
    ServiceManager.addService("String_Node_Str",new ServicesBinder(m));
    ServiceManager.addService("String_Node_Str",new SendersBinder(m));
    ServiceManager.addService("String_Node_Str",new ProvidersBinder(m));
    ServiceManager.addService("String_Node_Str",new PermissionController(m));
    ApplicationInfo info=mSelf.mContext.getPackageManager().getApplicationInfo("String_Node_Str",STOCK_PM_FLAGS);
synchronized (mSelf) {
      ProcessRecord app=mSelf.newProcessRecordLocked(mSystemThread.getApplicationThread(),info,info.processName);
      app.persistent=true;
      app.pid=Process.myPid();
      app.maxAdj=SYSTEM_ADJ;
      mSelf.mProcessNames.put(app.processName,app.info.uid,app);
synchronized (mSelf.mPidsSelfLocked) {
        mSelf.mPidsSelfLocked.put(app.pid,app);
      }
      mSelf.updateLRUListLocked(app,true);
    }
  }
 catch (  PackageManager.NameNotFoundException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}
Program: 43673
Project: 43673
Buggy source:
public final int startActivity(IApplicationThread caller,Intent intent,String resolvedType,Uri[] grantedUriPermissions,int grantedMode,IBinder resultTo,String resultWho,int requestCode,boolean onlyIfNeeded,boolean debug){
  if (intent != null && intent.hasFileDescriptors()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final boolean componentSpecified=intent.getComponent() != null;
  intent=new Intent(intent);
  ActivityInfo aInfo;
  try {
    ResolveInfo rInfo=ActivityThread.getPackageManager().resolveIntent(intent,resolvedType,PackageManager.MATCH_DEFAULT_ONLY | PackageManager.GET_SHARED_LIBRARY_FILES);
    aInfo=rInfo != null ? rInfo.activityInfo : null;
  }
 catch (  RemoteException e) {
    aInfo=null;
  }
  if (aInfo != null) {
    intent.setComponent(new ComponentName(aInfo.applicationInfo.packageName,aInfo.name));
    if (debug) {
      if (!aInfo.processName.equals("String_Node_Str")) {
        setDebugApp(aInfo.processName,true,false);
      }
    }
  }
synchronized (this) {
    final long origId=Binder.clearCallingIdentity();
    int res=startActivityLocked(caller,intent,resolvedType,grantedUriPermissions,grantedMode,aInfo,resultTo,resultWho,requestCode,-1,-1,onlyIfNeeded,componentSpecified);
    Binder.restoreCallingIdentity(origId);
    return res;
  }
}

Fixed version (ground truth):
public final int startActivity(IApplicationThread caller,Intent intent,String resolvedType,Uri[] grantedUriPermissions,int grantedMode,IBinder resultTo,String resultWho,int requestCode,boolean onlyIfNeeded,boolean debug){
  if (intent != null && intent.hasFileDescriptors()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final boolean componentSpecified=intent.getComponent() != null;
  intent=new Intent(intent);
  ActivityInfo aInfo;
  try {
    ResolveInfo rInfo=ActivityThread.getPackageManager().resolveIntent(intent,resolvedType,PackageManager.MATCH_DEFAULT_ONLY | STOCK_PM_FLAGS);
    aInfo=rInfo != null ? rInfo.activityInfo : null;
  }
 catch (  RemoteException e) {
    aInfo=null;
  }
  if (aInfo != null) {
    intent.setComponent(new ComponentName(aInfo.applicationInfo.packageName,aInfo.name));
    if (debug) {
      if (!aInfo.processName.equals("String_Node_Str")) {
        setDebugApp(aInfo.processName,true,false);
      }
    }
  }
synchronized (this) {
    final long origId=Binder.clearCallingIdentity();
    int res=startActivityLocked(caller,intent,resolvedType,grantedUriPermissions,grantedMode,aInfo,resultTo,resultWho,requestCode,-1,-1,onlyIfNeeded,componentSpecified);
    Binder.restoreCallingIdentity(origId);
    return res;
  }
}