nus-yam/ex-repair huggingface dataset:
Program: 22290
Project: 22290
Buggy source:
public void cancel(IRecognitionListener listener){
  if (DBG)   Log.d(TAG,"String_Node_Str" + listener.asBinder());
  if (checkPermissions(listener)) {
    mHandler.sendMessage(Message.obtain(mHandler,MSG_CANCEL,listener));
  }
}

Fixed version (ground truth):
public void cancel(IRecognitionListener listener){
  if (DBG)   Log.d(TAG,"String_Node_Str" + listener.asBinder());
  if (mInternalService != null && mInternalService.checkPermissions(listener)) {
    mInternalService.mHandler.sendMessage(Message.obtain(mInternalService.mHandler,MSG_CANCEL,listener));
  }
}
Program: 22291
Project: 22291
Buggy source:
public void startListening(Intent recognizerIntent,IRecognitionListener listener){
  if (DBG)   Log.d(TAG,"String_Node_Str" + listener.asBinder());
  if (checkPermissions(listener)) {
    mHandler.sendMessage(Message.obtain(mHandler,MSG_START_LISTENING,new StartListeningArgs(recognizerIntent,listener)));
  }
}

Fixed version (ground truth):
public void startListening(Intent recognizerIntent,IRecognitionListener listener){
  if (DBG)   Log.d(TAG,"String_Node_Str" + listener.asBinder());
  if (mInternalService != null && mInternalService.checkPermissions(listener)) {
    mInternalService.mHandler.sendMessage(Message.obtain(mInternalService.mHandler,MSG_START_LISTENING,mInternalService.new StartListeningArgs(recognizerIntent,listener)));
  }
}
Program: 22292
Project: 22292
Buggy source:
public void stopListening(IRecognitionListener listener){
  if (DBG)   Log.d(TAG,"String_Node_Str" + listener.asBinder());
  if (checkPermissions(listener)) {
    mHandler.sendMessage(Message.obtain(mHandler,MSG_STOP_LISTENING,listener));
  }
}

Fixed version (ground truth):
public void stopListening(IRecognitionListener listener){
  if (DBG)   Log.d(TAG,"String_Node_Str" + listener.asBinder());
  if (mInternalService != null && mInternalService.checkPermissions(listener)) {
    mInternalService.mHandler.sendMessage(Message.obtain(mInternalService.mHandler,MSG_STOP_LISTENING,listener));
  }
}
Program: 22293
Project: 22293
Buggy source:
/** 
 * Destroys the   {@code SpeechRecognizer} object.
 */
public void destroy(){
  if (mConnection != null) {
    mContext.unbindService(mConnection);
  }
  mPendingTasks.clear();
  mService=null;
  mConnection=null;
}

Fixed version (ground truth):
/** 
 * Destroys the   {@code SpeechRecognizer} object.
 */
public void destroy(){
  if (mConnection != null) {
    mContext.unbindService(mConnection);
  }
  mPendingTasks.clear();
  mService=null;
  mConnection=null;
  mListener.mInternalListener=null;
}
Program: 22294
Project: 22294
Buggy source:
public void cancel(IRecognitionListener listener){
  if (DBG)   Log.d(TAG,"String_Node_Str" + listener.asBinder());
  if (checkPermissions(listener)) {
    mHandler.sendMessage(Message.obtain(mHandler,MSG_CANCEL,listener));
  }
}

Fixed version (ground truth):
public void cancel(IRecognitionListener listener){
  if (DBG)   Log.d(TAG,"String_Node_Str" + listener.asBinder());
  if (mInternalService != null && mInternalService.checkPermissions(listener)) {
    mInternalService.mHandler.sendMessage(Message.obtain(mInternalService.mHandler,MSG_CANCEL,listener));
  }
}
Program: 22295
Project: 22295
Buggy source:
public void startListening(Intent recognizerIntent,IRecognitionListener listener){
  if (DBG)   Log.d(TAG,"String_Node_Str" + listener.asBinder());
  if (checkPermissions(listener)) {
    mHandler.sendMessage(Message.obtain(mHandler,MSG_START_LISTENING,new StartListeningArgs(recognizerIntent,listener)));
  }
}

Fixed version (ground truth):
public void startListening(Intent recognizerIntent,IRecognitionListener listener){
  if (DBG)   Log.d(TAG,"String_Node_Str" + listener.asBinder());
  if (mInternalService != null && mInternalService.checkPermissions(listener)) {
    mInternalService.mHandler.sendMessage(Message.obtain(mInternalService.mHandler,MSG_START_LISTENING,mInternalService.new StartListeningArgs(recognizerIntent,listener)));
  }
}
Program: 22296
Project: 22296
Buggy source:
public void stopListening(IRecognitionListener listener){
  if (DBG)   Log.d(TAG,"String_Node_Str" + listener.asBinder());
  if (checkPermissions(listener)) {
    mHandler.sendMessage(Message.obtain(mHandler,MSG_STOP_LISTENING,listener));
  }
}

Fixed version (ground truth):
public void stopListening(IRecognitionListener listener){
  if (DBG)   Log.d(TAG,"String_Node_Str" + listener.asBinder());
  if (mInternalService != null && mInternalService.checkPermissions(listener)) {
    mInternalService.mHandler.sendMessage(Message.obtain(mInternalService.mHandler,MSG_STOP_LISTENING,listener));
  }
}
Program: 22297
Project: 22297
Buggy source:
/** 
 * Destroys the   {@code SpeechRecognizer} object.
 */
public void destroy(){
  if (mConnection != null) {
    mContext.unbindService(mConnection);
  }
  mPendingTasks.clear();
  mService=null;
  mConnection=null;
}

Fixed version (ground truth):
/** 
 * Destroys the   {@code SpeechRecognizer} object.
 */
public void destroy(){
  if (mConnection != null) {
    mContext.unbindService(mConnection);
  }
  mPendingTasks.clear();
  mService=null;
  mConnection=null;
  mListener.mInternalListener=null;
}
Program: 22298
Project: 22298
Buggy source:
public void cancel(IRecognitionListener listener){
  if (DBG)   Log.d(TAG,"String_Node_Str" + listener.asBinder());
  if (checkPermissions(listener)) {
    mHandler.sendMessage(Message.obtain(mHandler,MSG_CANCEL,listener));
  }
}

Fixed version (ground truth):
public void cancel(IRecognitionListener listener){
  if (DBG)   Log.d(TAG,"String_Node_Str" + listener.asBinder());
  if (mInternalService != null && mInternalService.checkPermissions(listener)) {
    mInternalService.mHandler.sendMessage(Message.obtain(mInternalService.mHandler,MSG_CANCEL,listener));
  }
}
Program: 22299
Project: 22299
Buggy source:
public void startListening(Intent recognizerIntent,IRecognitionListener listener){
  if (DBG)   Log.d(TAG,"String_Node_Str" + listener.asBinder());
  if (checkPermissions(listener)) {
    mHandler.sendMessage(Message.obtain(mHandler,MSG_START_LISTENING,new StartListeningArgs(recognizerIntent,listener)));
  }
}

Fixed version (ground truth):
public void startListening(Intent recognizerIntent,IRecognitionListener listener){
  if (DBG)   Log.d(TAG,"String_Node_Str" + listener.asBinder());
  if (mInternalService != null && mInternalService.checkPermissions(listener)) {
    mInternalService.mHandler.sendMessage(Message.obtain(mInternalService.mHandler,MSG_START_LISTENING,mInternalService.new StartListeningArgs(recognizerIntent,listener)));
  }
}
Program: 22300
Project: 22300
Buggy source:
public void stopListening(IRecognitionListener listener){
  if (DBG)   Log.d(TAG,"String_Node_Str" + listener.asBinder());
  if (checkPermissions(listener)) {
    mHandler.sendMessage(Message.obtain(mHandler,MSG_STOP_LISTENING,listener));
  }
}

Fixed version (ground truth):
public void stopListening(IRecognitionListener listener){
  if (DBG)   Log.d(TAG,"String_Node_Str" + listener.asBinder());
  if (mInternalService != null && mInternalService.checkPermissions(listener)) {
    mInternalService.mHandler.sendMessage(Message.obtain(mInternalService.mHandler,MSG_STOP_LISTENING,listener));
  }
}
Program: 22301
Project: 22301
Buggy source:
/** 
 * Destroys the   {@code SpeechRecognizer} object.
 */
public void destroy(){
  if (mConnection != null) {
    mContext.unbindService(mConnection);
  }
  mPendingTasks.clear();
  mService=null;
  mConnection=null;
}

Fixed version (ground truth):
/** 
 * Destroys the   {@code SpeechRecognizer} object.
 */
public void destroy(){
  if (mConnection != null) {
    mContext.unbindService(mConnection);
  }
  mPendingTasks.clear();
  mService=null;
  mConnection=null;
  mListener.mInternalListener=null;
}
Program: 22302
Project: 22302
Buggy source:
private final boolean updateOomAdjLocked(){
  boolean didOomAdj=true;
  final HistoryRecord TOP_ACT=resumedAppLocked();
  final ProcessRecord TOP_APP=TOP_ACT != null ? TOP_ACT.app : null;
  if (false) {
    RuntimeException e=new RuntimeException();
    e.fillInStackTrace();
    Slog.i(TAG,"String_Node_Str" + TOP_ACT,e);
  }
  mAdjSeq++;
  int numSlots=HIDDEN_APP_MAX_ADJ - HIDDEN_APP_MIN_ADJ + 1;
  int factor=(mLruProcesses.size() - 4) / numSlots;
  if (factor < 1)   factor=1;
  int step=0;
  int numHidden=0;
  int i=mLruProcesses.size();
  int curHiddenAdj=HIDDEN_APP_MIN_ADJ;
  while (i > 0) {
    i--;
    ProcessRecord app=mLruProcesses.get(i);
    if (updateOomAdjLocked(app,curHiddenAdj,TOP_APP)) {
      if (curHiddenAdj < EMPTY_APP_ADJ && app.curAdj == curHiddenAdj) {
        step++;
        if (step >= factor) {
          step=0;
          curHiddenAdj++;
        }
      }
      if (app.curAdj >= HIDDEN_APP_MIN_ADJ) {
        numHidden++;
        if (numHidden > MAX_HIDDEN_APPS) {
          Slog.i(TAG,"String_Node_Str" + app.processName + "String_Node_Str"+ app.pid+ "String_Node_Str"+ numHidden+ "String_Node_Str"+ MAX_HIDDEN_APPS);
          EventLog.writeEvent(EventLogTags.AM_KILL,app.pid,app.processName,app.setAdj,"String_Node_Str");
          Process.killProcess(app.pid);
        }
      }
    }
 else {
      didOomAdj=false;
    }
  }
  return ENFORCE_PROCESS_LIMIT || mProcessLimit > 0 ? false : didOomAdj;
}

Fixed version (ground truth):
private final boolean updateOomAdjLocked(){
  boolean didOomAdj=true;
  final HistoryRecord TOP_ACT=resumedAppLocked();
  final ProcessRecord TOP_APP=TOP_ACT != null ? TOP_ACT.app : null;
  if (false) {
    RuntimeException e=new RuntimeException();
    e.fillInStackTrace();
    Slog.i(TAG,"String_Node_Str" + TOP_ACT,e);
  }
  mAdjSeq++;
  int numSlots=HIDDEN_APP_MAX_ADJ - HIDDEN_APP_MIN_ADJ + 1;
  int factor=(mLruProcesses.size() - 4) / numSlots;
  if (factor < 1)   factor=1;
  int step=0;
  int numHidden=0;
  int i=mLruProcesses.size();
  int curHiddenAdj=HIDDEN_APP_MIN_ADJ;
  while (i > 0) {
    i--;
    ProcessRecord app=mLruProcesses.get(i);
    if (updateOomAdjLocked(app,curHiddenAdj,TOP_APP)) {
      if (curHiddenAdj < EMPTY_APP_ADJ && app.curAdj == curHiddenAdj) {
        step++;
        if (step >= factor) {
          step=0;
          curHiddenAdj++;
        }
      }
      if (app.curAdj >= HIDDEN_APP_MIN_ADJ) {
        if (!app.killedBackground) {
          numHidden++;
          if (numHidden > MAX_HIDDEN_APPS) {
            Slog.i(TAG,"String_Node_Str" + app.processName + "String_Node_Str"+ app.pid+ "String_Node_Str"+ numHidden+ "String_Node_Str"+ MAX_HIDDEN_APPS);
            EventLog.writeEvent(EventLogTags.AM_KILL,app.pid,app.processName,app.setAdj,"String_Node_Str");
            app.killedBackground=true;
            Process.killProcess(app.pid);
          }
        }
      }
    }
 else {
      didOomAdj=false;
    }
  }
  return ENFORCE_PROCESS_LIMIT || mProcessLimit > 0 ? false : didOomAdj;
}
Program: 22304
Project: 22304
Buggy source:
private void cancelA2dpDeviceTimeout(String address){
  mAudioHandler.removeMessages(MSG_BTA2DP_DOCK_TIMEOUT);
}

Fixed version (ground truth):
private void cancelA2dpDeviceTimeout(){
  mAudioHandler.removeMessages(MSG_BTA2DP_DOCK_TIMEOUT);
}
Program: 22305
Project: 22305
Buggy source:
private void cancelA2dpDeviceTimeout(String address){
  mAudioHandler.removeMessages(MSG_BTA2DP_DOCK_TIMEOUT);
}

Fixed version (ground truth):
private void cancelA2dpDeviceTimeout(){
  mAudioHandler.removeMessages(MSG_BTA2DP_DOCK_TIMEOUT);
}
Program: 22306
Project: 22306
Buggy source:
private void cancelA2dpDeviceTimeout(String address){
  mAudioHandler.removeMessages(MSG_BTA2DP_DOCK_TIMEOUT);
}

Fixed version (ground truth):
private void cancelA2dpDeviceTimeout(){
  mAudioHandler.removeMessages(MSG_BTA2DP_DOCK_TIMEOUT);
}
Program: 22307
Project: 22307
Buggy source:
private void cancelA2dpDeviceTimeout(String address){
  mAudioHandler.removeMessages(MSG_BTA2DP_DOCK_TIMEOUT);
}

Fixed version (ground truth):
private void cancelA2dpDeviceTimeout(){
  mAudioHandler.removeMessages(MSG_BTA2DP_DOCK_TIMEOUT);
}
Program: 22308
Project: 22308
Buggy source:
void killAppAtUsersRequest(ProcessRecord app,Dialog fromDialog){
synchronized (this) {
    app.crashing=false;
    app.crashingReport=null;
    app.notResponding=false;
    app.notRespondingReport=null;
    if (app.anrDialog == fromDialog) {
      app.anrDialog=null;
    }
    if (app.waitDialog == fromDialog) {
      app.waitDialog=null;
    }
    if (app.pid > 0 && app.pid != MY_PID) {
      handleAppCrashLocked(app);
      Slog.i(ActivityManagerService.TAG,"String_Node_Str" + app.processName + "String_Node_Str"+ app.pid+ "String_Node_Str");
      Process.killProcess(app.pid);
    }
  }
}

Fixed version (ground truth):
void killAppAtUsersRequest(ProcessRecord app,Dialog fromDialog){
synchronized (this) {
    app.crashing=false;
    app.crashingReport=null;
    app.notResponding=false;
    app.notRespondingReport=null;
    if (app.anrDialog == fromDialog) {
      app.anrDialog=null;
    }
    if (app.waitDialog == fromDialog) {
      app.waitDialog=null;
    }
    if (app.pid > 0 && app.pid != MY_PID) {
      handleAppCrashLocked(app);
      Slog.i(ActivityManagerService.TAG,"String_Node_Str" + app.processName + "String_Node_Str"+ app.pid+ "String_Node_Str");
      EventLog.writeEvent(EventLogTags.AM_KILL,app.pid,app.processName,app.setAdj,"String_Node_Str");
      Process.killProcess(app.pid);
    }
  }
}
Program: 22309
Project: 22309
Buggy source:
private final boolean updateOomAdjLocked(){
  boolean didOomAdj=true;
  final HistoryRecord TOP_ACT=resumedAppLocked();
  final ProcessRecord TOP_APP=TOP_ACT != null ? TOP_ACT.app : null;
  if (false) {
    RuntimeException e=new RuntimeException();
    e.fillInStackTrace();
    Slog.i(TAG,"String_Node_Str" + TOP_ACT,e);
  }
  mAdjSeq++;
  int numSlots=HIDDEN_APP_MAX_ADJ - HIDDEN_APP_MIN_ADJ + 1;
  int factor=(mLruProcesses.size() - 4) / numSlots;
  if (factor < 1)   factor=1;
  int step=0;
  int i=mLruProcesses.size();
  int curHiddenAdj=HIDDEN_APP_MIN_ADJ;
  while (i > 0) {
    i--;
    ProcessRecord app=mLruProcesses.get(i);
    if (updateOomAdjLocked(app,curHiddenAdj,TOP_APP)) {
      if (curHiddenAdj < EMPTY_APP_ADJ && app.curAdj == curHiddenAdj) {
        step++;
        if (step >= factor) {
          step=0;
          curHiddenAdj++;
        }
      }
    }
 else {
      didOomAdj=false;
    }
  }
  return ENFORCE_PROCESS_LIMIT || mProcessLimit > 0 ? false : didOomAdj;
}

Fixed version (ground truth):
private final boolean updateOomAdjLocked(){
  boolean didOomAdj=true;
  final HistoryRecord TOP_ACT=resumedAppLocked();
  final ProcessRecord TOP_APP=TOP_ACT != null ? TOP_ACT.app : null;
  if (false) {
    RuntimeException e=new RuntimeException();
    e.fillInStackTrace();
    Slog.i(TAG,"String_Node_Str" + TOP_ACT,e);
  }
  mAdjSeq++;
  int numSlots=HIDDEN_APP_MAX_ADJ - HIDDEN_APP_MIN_ADJ + 1;
  int factor=(mLruProcesses.size() - 4) / numSlots;
  if (factor < 1)   factor=1;
  int step=0;
  int numHidden=0;
  int i=mLruProcesses.size();
  int curHiddenAdj=HIDDEN_APP_MIN_ADJ;
  while (i > 0) {
    i--;
    ProcessRecord app=mLruProcesses.get(i);
    if (updateOomAdjLocked(app,curHiddenAdj,TOP_APP)) {
      if (curHiddenAdj < EMPTY_APP_ADJ && app.curAdj == curHiddenAdj) {
        step++;
        if (step >= factor) {
          step=0;
          curHiddenAdj++;
        }
      }
      if (app.curAdj >= HIDDEN_APP_MIN_ADJ) {
        numHidden++;
        if (numHidden > MAX_HIDDEN_APPS) {
          Slog.i(TAG,"String_Node_Str" + app.processName + "String_Node_Str"+ app.pid+ "String_Node_Str"+ numHidden+ "String_Node_Str"+ MAX_HIDDEN_APPS);
          EventLog.writeEvent(EventLogTags.AM_KILL,app.pid,app.processName,app.setAdj,"String_Node_Str");
          Process.killProcess(app.pid);
        }
      }
    }
 else {
      didOomAdj=false;
    }
  }
  return ENFORCE_PROCESS_LIMIT || mProcessLimit > 0 ? false : didOomAdj;
}
Program: 22310
Project: 22310
Buggy source:
public boolean killPids(int[] pids,String pReason){
  if (Binder.getCallingUid() != Process.SYSTEM_UID) {
    throw new SecurityException("String_Node_Str");
  }
  String reason=(pReason == null) ? "String_Node_Str" : pReason;
  boolean killed=false;
synchronized (mPidsSelfLocked) {
    int[] types=new int[pids.length];
    int worstType=0;
    for (int i=0; i < pids.length; i++) {
      ProcessRecord proc=mPidsSelfLocked.get(pids[i]);
      if (proc != null) {
        int type=proc.setAdj;
        types[i]=type;
        if (type > worstType) {
          worstType=type;
        }
      }
    }
    if (worstType < EMPTY_APP_ADJ && worstType > HIDDEN_APP_MIN_ADJ) {
      worstType=HIDDEN_APP_MIN_ADJ;
    }
    Slog.w(TAG,"String_Node_Str" + reason + "String_Node_Str"+ worstType);
    for (int i=0; i < pids.length; i++) {
      ProcessRecord proc=mPidsSelfLocked.get(pids[i]);
      if (proc == null) {
        continue;
      }
      int adj=proc.setAdj;
      if (adj >= worstType) {
        Slog.w(TAG,"String_Node_Str" + reason + "String_Node_Str"+ proc+ "String_Node_Str"+ adj+ "String_Node_Str");
        EventLog.writeEvent(EventLogTags.AM_KILL,proc.pid,proc.processName,adj,reason);
        killed=true;
        Process.killProcess(pids[i]);
      }
    }
  }
  return killed;
}

Fixed version (ground truth):
public boolean killPids(int[] pids,String pReason){
  if (Binder.getCallingUid() != Process.SYSTEM_UID) {
    throw new SecurityException("String_Node_Str");
  }
  String reason=(pReason == null) ? "String_Node_Str" : pReason;
  boolean killed=false;
synchronized (mPidsSelfLocked) {
    int[] types=new int[pids.length];
    int worstType=0;
    for (int i=0; i < pids.length; i++) {
      ProcessRecord proc=mPidsSelfLocked.get(pids[i]);
      if (proc != null) {
        int type=proc.setAdj;
        types[i]=type;
        if (type > worstType) {
          worstType=type;
        }
      }
    }
    if (worstType < EMPTY_APP_ADJ && worstType > HIDDEN_APP_MIN_ADJ) {
      worstType=HIDDEN_APP_MIN_ADJ;
    }
    Slog.w(TAG,"String_Node_Str" + reason + "String_Node_Str"+ worstType);
    for (int i=0; i < pids.length; i++) {
      ProcessRecord proc=mPidsSelfLocked.get(pids[i]);
      if (proc == null) {
        continue;
      }
      int adj=proc.setAdj;
      if (adj >= worstType) {
        Slog.w(TAG,"String_Node_Str" + proc + "String_Node_Str"+ adj+ "String_Node_Str"+ reason);
        EventLog.writeEvent(EventLogTags.AM_KILL,proc.pid,proc.processName,adj,reason);
        killed=true;
        Process.killProcess(pids[i]);
      }
    }
  }
  return killed;
}
Program: 22311
Project: 22311
Buggy source:
private final void removeDyingProviderLocked(ProcessRecord proc,ContentProviderRecord cpr){
synchronized (cpr) {
    cpr.launchingApp=null;
    cpr.notifyAll();
  }
  mProvidersByClass.remove(cpr.info.name);
  String names[]=cpr.info.authority.split("String_Node_Str");
  for (int j=0; j < names.length; j++) {
    mProvidersByName.remove(names[j]);
  }
  Iterator<ProcessRecord> cit=cpr.clients.iterator();
  while (cit.hasNext()) {
    ProcessRecord capp=cit.next();
    if (!capp.persistent && capp.thread != null && capp.pid != 0 && capp.pid != MY_PID) {
      Slog.i(TAG,"String_Node_Str" + capp.processName + "String_Node_Str"+ capp.pid+ "String_Node_Str"+ cpr.info.name+ "String_Node_Str"+ proc.processName);
      Process.killProcess(capp.pid);
    }
  }
  mLaunchingProviders.remove(cpr);
}

Fixed version (ground truth):
private final void removeDyingProviderLocked(ProcessRecord proc,ContentProviderRecord cpr){
synchronized (cpr) {
    cpr.launchingApp=null;
    cpr.notifyAll();
  }
  mProvidersByClass.remove(cpr.info.name);
  String names[]=cpr.info.authority.split("String_Node_Str");
  for (int j=0; j < names.length; j++) {
    mProvidersByName.remove(names[j]);
  }
  Iterator<ProcessRecord> cit=cpr.clients.iterator();
  while (cit.hasNext()) {
    ProcessRecord capp=cit.next();
    if (!capp.persistent && capp.thread != null && capp.pid != 0 && capp.pid != MY_PID) {
      Slog.i(TAG,"String_Node_Str" + capp.processName + "String_Node_Str"+ capp.pid+ "String_Node_Str"+ cpr.info.name+ "String_Node_Str"+ proc.processName);
      EventLog.writeEvent(EventLogTags.AM_KILL,capp.pid,capp.processName,capp.setAdj,"String_Node_Str" + proc.processName);
      Process.killProcess(capp.pid);
    }
  }
  mLaunchingProviders.remove(cpr);
}
Program: 22312
Project: 22312
Buggy source:
public void setServiceForeground(ComponentName className,IBinder token,int id,Notification notification,boolean removeNotification){
  final long origId=Binder.clearCallingIdentity();
  try {
synchronized (this) {
      ServiceRecord r=findServiceLocked(className,token);
      if (r != null) {
        if (id != 0) {
          if (notification == null) {
            throw new IllegalArgumentException("String_Node_Str");
          }
          if (r.foregroundId != id) {
            r.cancelNotification();
            r.foregroundId=id;
          }
          notification.flags|=Notification.FLAG_FOREGROUND_SERVICE;
          r.foregroundNoti=notification;
          r.isForeground=true;
          r.postNotification();
          if (r.app != null) {
            updateServiceForegroundLocked(r.app,true);
          }
        }
 else {
          if (r.isForeground) {
            r.isForeground=false;
            if (r.app != null) {
              updateServiceForegroundLocked(r.app,true);
            }
          }
          if (removeNotification) {
            r.cancelNotification();
            r.foregroundId=0;
            r.foregroundNoti=null;
          }
        }
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(origId);
  }
}

Fixed version (ground truth):
public void setServiceForeground(ComponentName className,IBinder token,int id,Notification notification,boolean removeNotification){
  final long origId=Binder.clearCallingIdentity();
  try {
synchronized (this) {
      ServiceRecord r=findServiceLocked(className,token);
      if (r != null) {
        if (id != 0) {
          if (notification == null) {
            throw new IllegalArgumentException("String_Node_Str");
          }
          if (r.foregroundId != id) {
            r.cancelNotification();
            r.foregroundId=id;
          }
          notification.flags|=Notification.FLAG_FOREGROUND_SERVICE;
          r.foregroundNoti=notification;
          r.isForeground=true;
          r.postNotification();
          if (r.app != null) {
            updateServiceForegroundLocked(r.app,true);
          }
        }
 else {
          if (r.isForeground) {
            r.isForeground=false;
            if (r.app != null) {
              updateLruProcessLocked(r.app,false,true);
              updateServiceForegroundLocked(r.app,true);
            }
          }
          if (removeNotification) {
            r.cancelNotification();
            r.foregroundId=0;
            r.foregroundNoti=null;
          }
        }
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(origId);
  }
}
Program: 22313
Project: 22313
Buggy source:
void killAppAtUsersRequest(ProcessRecord app,Dialog fromDialog){
synchronized (this) {
    app.crashing=false;
    app.crashingReport=null;
    app.notResponding=false;
    app.notRespondingReport=null;
    if (app.anrDialog == fromDialog) {
      app.anrDialog=null;
    }
    if (app.waitDialog == fromDialog) {
      app.waitDialog=null;
    }
    if (app.pid > 0 && app.pid != MY_PID) {
      handleAppCrashLocked(app);
      Slog.i(ActivityManagerService.TAG,"String_Node_Str" + app.processName + "String_Node_Str"+ app.pid+ "String_Node_Str");
      Process.killProcess(app.pid);
    }
  }
}

Fixed version (ground truth):
void killAppAtUsersRequest(ProcessRecord app,Dialog fromDialog){
synchronized (this) {
    app.crashing=false;
    app.crashingReport=null;
    app.notResponding=false;
    app.notRespondingReport=null;
    if (app.anrDialog == fromDialog) {
      app.anrDialog=null;
    }
    if (app.waitDialog == fromDialog) {
      app.waitDialog=null;
    }
    if (app.pid > 0 && app.pid != MY_PID) {
      handleAppCrashLocked(app);
      Slog.i(ActivityManagerService.TAG,"String_Node_Str" + app.processName + "String_Node_Str"+ app.pid+ "String_Node_Str");
      EventLog.writeEvent(EventLogTags.AM_KILL,app.pid,app.processName,app.setAdj,"String_Node_Str");
      Process.killProcess(app.pid);
    }
  }
}
Program: 22314
Project: 22314
Buggy source:
private final boolean updateOomAdjLocked(){
  boolean didOomAdj=true;
  final HistoryRecord TOP_ACT=resumedAppLocked();
  final ProcessRecord TOP_APP=TOP_ACT != null ? TOP_ACT.app : null;
  if (false) {
    RuntimeException e=new RuntimeException();
    e.fillInStackTrace();
    Slog.i(TAG,"String_Node_Str" + TOP_ACT,e);
  }
  mAdjSeq++;
  int numSlots=HIDDEN_APP_MAX_ADJ - HIDDEN_APP_MIN_ADJ + 1;
  int factor=(mLruProcesses.size() - 4) / numSlots;
  if (factor < 1)   factor=1;
  int step=0;
  int i=mLruProcesses.size();
  int curHiddenAdj=HIDDEN_APP_MIN_ADJ;
  while (i > 0) {
    i--;
    ProcessRecord app=mLruProcesses.get(i);
    if (updateOomAdjLocked(app,curHiddenAdj,TOP_APP)) {
      if (curHiddenAdj < EMPTY_APP_ADJ && app.curAdj == curHiddenAdj) {
        step++;
        if (step >= factor) {
          step=0;
          curHiddenAdj++;
        }
      }
    }
 else {
      didOomAdj=false;
    }
  }
  return ENFORCE_PROCESS_LIMIT || mProcessLimit > 0 ? false : didOomAdj;
}

Fixed version (ground truth):
private final boolean updateOomAdjLocked(){
  boolean didOomAdj=true;
  final HistoryRecord TOP_ACT=resumedAppLocked();
  final ProcessRecord TOP_APP=TOP_ACT != null ? TOP_ACT.app : null;
  if (false) {
    RuntimeException e=new RuntimeException();
    e.fillInStackTrace();
    Slog.i(TAG,"String_Node_Str" + TOP_ACT,e);
  }
  mAdjSeq++;
  int numSlots=HIDDEN_APP_MAX_ADJ - HIDDEN_APP_MIN_ADJ + 1;
  int factor=(mLruProcesses.size() - 4) / numSlots;
  if (factor < 1)   factor=1;
  int step=0;
  int numHidden=0;
  int i=mLruProcesses.size();
  int curHiddenAdj=HIDDEN_APP_MIN_ADJ;
  while (i > 0) {
    i--;
    ProcessRecord app=mLruProcesses.get(i);
    if (updateOomAdjLocked(app,curHiddenAdj,TOP_APP)) {
      if (curHiddenAdj < EMPTY_APP_ADJ && app.curAdj == curHiddenAdj) {
        step++;
        if (step >= factor) {
          step=0;
          curHiddenAdj++;
        }
      }
      if (app.curAdj >= HIDDEN_APP_MIN_ADJ) {
        numHidden++;
        if (numHidden > MAX_HIDDEN_APPS) {
          Slog.i(TAG,"String_Node_Str" + app.processName + "String_Node_Str"+ app.pid+ "String_Node_Str"+ numHidden+ "String_Node_Str"+ MAX_HIDDEN_APPS);
          EventLog.writeEvent(EventLogTags.AM_KILL,app.pid,app.processName,app.setAdj,"String_Node_Str");
          Process.killProcess(app.pid);
        }
      }
    }
 else {
      didOomAdj=false;
    }
  }
  return ENFORCE_PROCESS_LIMIT || mProcessLimit > 0 ? false : didOomAdj;
}
Program: 22315
Project: 22315
Buggy source:
public boolean killPids(int[] pids,String pReason){
  if (Binder.getCallingUid() != Process.SYSTEM_UID) {
    throw new SecurityException("String_Node_Str");
  }
  String reason=(pReason == null) ? "String_Node_Str" : pReason;
  boolean killed=false;
synchronized (mPidsSelfLocked) {
    int[] types=new int[pids.length];
    int worstType=0;
    for (int i=0; i < pids.length; i++) {
      ProcessRecord proc=mPidsSelfLocked.get(pids[i]);
      if (proc != null) {
        int type=proc.setAdj;
        types[i]=type;
        if (type > worstType) {
          worstType=type;
        }
      }
    }
    if (worstType < EMPTY_APP_ADJ && worstType > HIDDEN_APP_MIN_ADJ) {
      worstType=HIDDEN_APP_MIN_ADJ;
    }
    Slog.w(TAG,"String_Node_Str" + reason + "String_Node_Str"+ worstType);
    for (int i=0; i < pids.length; i++) {
      ProcessRecord proc=mPidsSelfLocked.get(pids[i]);
      if (proc == null) {
        continue;
      }
      int adj=proc.setAdj;
      if (adj >= worstType) {
        Slog.w(TAG,"String_Node_Str" + reason + "String_Node_Str"+ proc+ "String_Node_Str"+ adj+ "String_Node_Str");
        EventLog.writeEvent(EventLogTags.AM_KILL,proc.pid,proc.processName,adj,reason);
        killed=true;
        Process.killProcess(pids[i]);
      }
    }
  }
  return killed;
}

Fixed version (ground truth):
public boolean killPids(int[] pids,String pReason){
  if (Binder.getCallingUid() != Process.SYSTEM_UID) {
    throw new SecurityException("String_Node_Str");
  }
  String reason=(pReason == null) ? "String_Node_Str" : pReason;
  boolean killed=false;
synchronized (mPidsSelfLocked) {
    int[] types=new int[pids.length];
    int worstType=0;
    for (int i=0; i < pids.length; i++) {
      ProcessRecord proc=mPidsSelfLocked.get(pids[i]);
      if (proc != null) {
        int type=proc.setAdj;
        types[i]=type;
        if (type > worstType) {
          worstType=type;
        }
      }
    }
    if (worstType < EMPTY_APP_ADJ && worstType > HIDDEN_APP_MIN_ADJ) {
      worstType=HIDDEN_APP_MIN_ADJ;
    }
    Slog.w(TAG,"String_Node_Str" + reason + "String_Node_Str"+ worstType);
    for (int i=0; i < pids.length; i++) {
      ProcessRecord proc=mPidsSelfLocked.get(pids[i]);
      if (proc == null) {
        continue;
      }
      int adj=proc.setAdj;
      if (adj >= worstType) {
        Slog.w(TAG,"String_Node_Str" + proc + "String_Node_Str"+ adj+ "String_Node_Str"+ reason);
        EventLog.writeEvent(EventLogTags.AM_KILL,proc.pid,proc.processName,adj,reason);
        killed=true;
        Process.killProcess(pids[i]);
      }
    }
  }
  return killed;
}
Program: 22316
Project: 22316
Buggy source:
private final void removeDyingProviderLocked(ProcessRecord proc,ContentProviderRecord cpr){
synchronized (cpr) {
    cpr.launchingApp=null;
    cpr.notifyAll();
  }
  mProvidersByClass.remove(cpr.info.name);
  String names[]=cpr.info.authority.split("String_Node_Str");
  for (int j=0; j < names.length; j++) {
    mProvidersByName.remove(names[j]);
  }
  Iterator<ProcessRecord> cit=cpr.clients.iterator();
  while (cit.hasNext()) {
    ProcessRecord capp=cit.next();
    if (!capp.persistent && capp.thread != null && capp.pid != 0 && capp.pid != MY_PID) {
      Slog.i(TAG,"String_Node_Str" + capp.processName + "String_Node_Str"+ capp.pid+ "String_Node_Str"+ cpr.info.name+ "String_Node_Str"+ proc.processName);
      Process.killProcess(capp.pid);
    }
  }
  mLaunchingProviders.remove(cpr);
}

Fixed version (ground truth):
private final void removeDyingProviderLocked(ProcessRecord proc,ContentProviderRecord cpr){
synchronized (cpr) {
    cpr.launchingApp=null;
    cpr.notifyAll();
  }
  mProvidersByClass.remove(cpr.info.name);
  String names[]=cpr.info.authority.split("String_Node_Str");
  for (int j=0; j < names.length; j++) {
    mProvidersByName.remove(names[j]);
  }
  Iterator<ProcessRecord> cit=cpr.clients.iterator();
  while (cit.hasNext()) {
    ProcessRecord capp=cit.next();
    if (!capp.persistent && capp.thread != null && capp.pid != 0 && capp.pid != MY_PID) {
      Slog.i(TAG,"String_Node_Str" + capp.processName + "String_Node_Str"+ capp.pid+ "String_Node_Str"+ cpr.info.name+ "String_Node_Str"+ proc.processName);
      EventLog.writeEvent(EventLogTags.AM_KILL,capp.pid,capp.processName,capp.setAdj,"String_Node_Str" + proc.processName);
      Process.killProcess(capp.pid);
    }
  }
  mLaunchingProviders.remove(cpr);
}
Program: 22317
Project: 22317
Buggy source:
public void setServiceForeground(ComponentName className,IBinder token,int id,Notification notification,boolean removeNotification){
  final long origId=Binder.clearCallingIdentity();
  try {
synchronized (this) {
      ServiceRecord r=findServiceLocked(className,token);
      if (r != null) {
        if (id != 0) {
          if (notification == null) {
            throw new IllegalArgumentException("String_Node_Str");
          }
          if (r.foregroundId != id) {
            r.cancelNotification();
            r.foregroundId=id;
          }
          notification.flags|=Notification.FLAG_FOREGROUND_SERVICE;
          r.foregroundNoti=notification;
          r.isForeground=true;
          r.postNotification();
          if (r.app != null) {
            updateServiceForegroundLocked(r.app,true);
          }
        }
 else {
          if (r.isForeground) {
            r.isForeground=false;
            if (r.app != null) {
              updateServiceForegroundLocked(r.app,true);
            }
          }
          if (removeNotification) {
            r.cancelNotification();
            r.foregroundId=0;
            r.foregroundNoti=null;
          }
        }
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(origId);
  }
}

Fixed version (ground truth):
public void setServiceForeground(ComponentName className,IBinder token,int id,Notification notification,boolean removeNotification){
  final long origId=Binder.clearCallingIdentity();
  try {
synchronized (this) {
      ServiceRecord r=findServiceLocked(className,token);
      if (r != null) {
        if (id != 0) {
          if (notification == null) {
            throw new IllegalArgumentException("String_Node_Str");
          }
          if (r.foregroundId != id) {
            r.cancelNotification();
            r.foregroundId=id;
          }
          notification.flags|=Notification.FLAG_FOREGROUND_SERVICE;
          r.foregroundNoti=notification;
          r.isForeground=true;
          r.postNotification();
          if (r.app != null) {
            updateServiceForegroundLocked(r.app,true);
          }
        }
 else {
          if (r.isForeground) {
            r.isForeground=false;
            if (r.app != null) {
              updateLruProcessLocked(r.app,false,true);
              updateServiceForegroundLocked(r.app,true);
            }
          }
          if (removeNotification) {
            r.cancelNotification();
            r.foregroundId=0;
            r.foregroundNoti=null;
          }
        }
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(origId);
  }
}
Program: 22318
Project: 22318
Buggy source:
/** 
 * Try to parse this message as an email gateway message There are two ways specified in TS 23.040 Section 3.8 : - SMS message "may have its TP-PID set for internet electronic mail - MT SMS format: [<from-address><space>]<message> - "Depending on the nature of the gateway, the destination/origination address is either derived from the content of the SMS TP-OA or TP-DA field, or the TP-OA/TP-DA field contains a generic gateway address and the to/from address is added at the beginning as shown above." (which is supported here) - Multiple addreses separated by commas, no spaces, Subject field delimited by '()' or '##' and '#' Section 9.2.3.24.11 (which are NOT supported here)
 */
protected void extractEmailAddressFromMessageBody(){
  String[] parts=messageBody.split("String_Node_Str",2);
  if (parts.length < 2)   return;
  emailFrom=parts[0];
  emailBody=parts[1];
  isEmail=true;
}

Fixed version (ground truth):
/** 
 * Try to parse this message as an email gateway message There are two ways specified in TS 23.040 Section 3.8 : - SMS message "may have its TP-PID set for internet electronic mail - MT SMS format: [<from-address><space>]<message> - "Depending on the nature of the gateway, the destination/origination address is either derived from the content of the SMS TP-OA or TP-DA field, or the TP-OA/TP-DA field contains a generic gateway address and the to/from address is added at the beginning as shown above." (which is supported here) - Multiple addreses separated by commas, no spaces, Subject field delimited by '()' or '##' and '#' Section 9.2.3.24.11 (which are NOT supported here)
 */
protected void extractEmailAddressFromMessageBody(){
  String[] parts=messageBody.split("String_Node_Str",2);
  if (parts.length < 2)   return;
  emailFrom=parts[0];
  emailBody=parts[1];
  isEmail=Telephony.Mms.isEmailAddress(emailFrom);
}
Program: 22321
Project: 22321
Buggy source:
private final boolean updateOomAdjLocked(){
  boolean didOomAdj=true;
  final HistoryRecord TOP_ACT=resumedAppLocked();
  final ProcessRecord TOP_APP=TOP_ACT != null ? TOP_ACT.app : null;
  if (false) {
    RuntimeException e=new RuntimeException();
    e.fillInStackTrace();
    Slog.i(TAG,"String_Node_Str" + TOP_ACT,e);
  }
  mAdjSeq++;
  int numSlots=HIDDEN_APP_MAX_ADJ - HIDDEN_APP_MIN_ADJ + 1;
  int factor=(mLruProcesses.size() - 4) / numSlots;
  if (factor < 1)   factor=1;
  int step=0;
  int numHidden=0;
  int i=mLruProcesses.size();
  int curHiddenAdj=HIDDEN_APP_MIN_ADJ;
  while (i > 0) {
    i--;
    ProcessRecord app=mLruProcesses.get(i);
    if (updateOomAdjLocked(app,curHiddenAdj,TOP_APP)) {
      if (curHiddenAdj < EMPTY_APP_ADJ && app.curAdj == curHiddenAdj) {
        step++;
        if (step >= factor) {
          step=0;
          curHiddenAdj++;
        }
      }
      if (app.curAdj >= HIDDEN_APP_MIN_ADJ) {
        numHidden++;
        if (numHidden > MAX_HIDDEN_APPS) {
          Slog.i(TAG,"String_Node_Str" + app.processName + "String_Node_Str"+ app.pid+ "String_Node_Str"+ numHidden+ "String_Node_Str"+ MAX_HIDDEN_APPS);
          EventLog.writeEvent(EventLogTags.AM_KILL,app.pid,app.processName,app.setAdj,"String_Node_Str");
          Process.killProcess(app.pid);
        }
      }
    }
 else {
      didOomAdj=false;
    }
  }
  return ENFORCE_PROCESS_LIMIT || mProcessLimit > 0 ? false : didOomAdj;
}

Fixed version (ground truth):
private final boolean updateOomAdjLocked(){
  boolean didOomAdj=true;
  final HistoryRecord TOP_ACT=resumedAppLocked();
  final ProcessRecord TOP_APP=TOP_ACT != null ? TOP_ACT.app : null;
  if (false) {
    RuntimeException e=new RuntimeException();
    e.fillInStackTrace();
    Slog.i(TAG,"String_Node_Str" + TOP_ACT,e);
  }
  mAdjSeq++;
  int numSlots=HIDDEN_APP_MAX_ADJ - HIDDEN_APP_MIN_ADJ + 1;
  int factor=(mLruProcesses.size() - 4) / numSlots;
  if (factor < 1)   factor=1;
  int step=0;
  int numHidden=0;
  int i=mLruProcesses.size();
  int curHiddenAdj=HIDDEN_APP_MIN_ADJ;
  while (i > 0) {
    i--;
    ProcessRecord app=mLruProcesses.get(i);
    if (updateOomAdjLocked(app,curHiddenAdj,TOP_APP)) {
      if (curHiddenAdj < EMPTY_APP_ADJ && app.curAdj == curHiddenAdj) {
        step++;
        if (step >= factor) {
          step=0;
          curHiddenAdj++;
        }
      }
      if (app.curAdj >= HIDDEN_APP_MIN_ADJ) {
        if (!app.killedBackground) {
          numHidden++;
          if (numHidden > MAX_HIDDEN_APPS) {
            Slog.i(TAG,"String_Node_Str" + app.processName + "String_Node_Str"+ app.pid+ "String_Node_Str"+ numHidden+ "String_Node_Str"+ MAX_HIDDEN_APPS);
            EventLog.writeEvent(EventLogTags.AM_KILL,app.pid,app.processName,app.setAdj,"String_Node_Str");
            app.killedBackground=true;
            Process.killProcess(app.pid);
          }
        }
      }
    }
 else {
      didOomAdj=false;
    }
  }
  return ENFORCE_PROCESS_LIMIT || mProcessLimit > 0 ? false : didOomAdj;
}
Program: 22323
Project: 22323
Buggy source:
/** 
 * Try to parse this message as an email gateway message There are two ways specified in TS 23.040 Section 3.8 : - SMS message "may have its TP-PID set for internet electronic mail - MT SMS format: [<from-address><space>]<message> - "Depending on the nature of the gateway, the destination/origination address is either derived from the content of the SMS TP-OA or TP-DA field, or the TP-OA/TP-DA field contains a generic gateway address and the to/from address is added at the beginning as shown above." (which is supported here) - Multiple addreses separated by commas, no spaces, Subject field delimited by '()' or '##' and '#' Section 9.2.3.24.11 (which are NOT supported here)
 */
protected void extractEmailAddressFromMessageBody(){
  String[] parts=messageBody.split("String_Node_Str",2);
  if (parts.length < 2)   return;
  emailFrom=parts[0];
  emailBody=parts[1];
  isEmail=true;
}

Fixed version (ground truth):
/** 
 * Try to parse this message as an email gateway message There are two ways specified in TS 23.040 Section 3.8 : - SMS message "may have its TP-PID set for internet electronic mail - MT SMS format: [<from-address><space>]<message> - "Depending on the nature of the gateway, the destination/origination address is either derived from the content of the SMS TP-OA or TP-DA field, or the TP-OA/TP-DA field contains a generic gateway address and the to/from address is added at the beginning as shown above." (which is supported here) - Multiple addreses separated by commas, no spaces, Subject field delimited by '()' or '##' and '#' Section 9.2.3.24.11 (which are NOT supported here)
 */
protected void extractEmailAddressFromMessageBody(){
  String[] parts=messageBody.split("String_Node_Str",2);
  if (parts.length < 2)   return;
  emailFrom=parts[0];
  emailBody=parts[1];
  isEmail=Telephony.Mms.isEmailAddress(emailFrom);
}
Program: 22327
Project: 22327
Buggy source:
private final boolean updateOomAdjLocked(){
  boolean didOomAdj=true;
  final HistoryRecord TOP_ACT=resumedAppLocked();
  final ProcessRecord TOP_APP=TOP_ACT != null ? TOP_ACT.app : null;
  if (false) {
    RuntimeException e=new RuntimeException();
    e.fillInStackTrace();
    Slog.i(TAG,"String_Node_Str" + TOP_ACT,e);
  }
  mAdjSeq++;
  int numSlots=HIDDEN_APP_MAX_ADJ - HIDDEN_APP_MIN_ADJ + 1;
  int factor=(mLruProcesses.size() - 4) / numSlots;
  if (factor < 1)   factor=1;
  int step=0;
  int numHidden=0;
  int i=mLruProcesses.size();
  int curHiddenAdj=HIDDEN_APP_MIN_ADJ;
  while (i > 0) {
    i--;
    ProcessRecord app=mLruProcesses.get(i);
    if (updateOomAdjLocked(app,curHiddenAdj,TOP_APP)) {
      if (curHiddenAdj < EMPTY_APP_ADJ && app.curAdj == curHiddenAdj) {
        step++;
        if (step >= factor) {
          step=0;
          curHiddenAdj++;
        }
      }
      if (app.curAdj >= HIDDEN_APP_MIN_ADJ) {
        numHidden++;
        if (numHidden > MAX_HIDDEN_APPS) {
          Slog.i(TAG,"String_Node_Str" + app.processName + "String_Node_Str"+ app.pid+ "String_Node_Str"+ numHidden+ "String_Node_Str"+ MAX_HIDDEN_APPS);
          EventLog.writeEvent(EventLogTags.AM_KILL,app.pid,app.processName,app.setAdj,"String_Node_Str");
          Process.killProcess(app.pid);
        }
      }
    }
 else {
      didOomAdj=false;
    }
  }
  return ENFORCE_PROCESS_LIMIT || mProcessLimit > 0 ? false : didOomAdj;
}

Fixed version (ground truth):
private final boolean updateOomAdjLocked(){
  boolean didOomAdj=true;
  final HistoryRecord TOP_ACT=resumedAppLocked();
  final ProcessRecord TOP_APP=TOP_ACT != null ? TOP_ACT.app : null;
  if (false) {
    RuntimeException e=new RuntimeException();
    e.fillInStackTrace();
    Slog.i(TAG,"String_Node_Str" + TOP_ACT,e);
  }
  mAdjSeq++;
  int numSlots=HIDDEN_APP_MAX_ADJ - HIDDEN_APP_MIN_ADJ + 1;
  int factor=(mLruProcesses.size() - 4) / numSlots;
  if (factor < 1)   factor=1;
  int step=0;
  int numHidden=0;
  int i=mLruProcesses.size();
  int curHiddenAdj=HIDDEN_APP_MIN_ADJ;
  while (i > 0) {
    i--;
    ProcessRecord app=mLruProcesses.get(i);
    if (updateOomAdjLocked(app,curHiddenAdj,TOP_APP)) {
      if (curHiddenAdj < EMPTY_APP_ADJ && app.curAdj == curHiddenAdj) {
        step++;
        if (step >= factor) {
          step=0;
          curHiddenAdj++;
        }
      }
      if (app.curAdj >= HIDDEN_APP_MIN_ADJ) {
        if (!app.killedBackground) {
          numHidden++;
          if (numHidden > MAX_HIDDEN_APPS) {
            Slog.i(TAG,"String_Node_Str" + app.processName + "String_Node_Str"+ app.pid+ "String_Node_Str"+ numHidden+ "String_Node_Str"+ MAX_HIDDEN_APPS);
            EventLog.writeEvent(EventLogTags.AM_KILL,app.pid,app.processName,app.setAdj,"String_Node_Str");
            app.killedBackground=true;
            Process.killProcess(app.pid);
          }
        }
      }
    }
 else {
      didOomAdj=false;
    }
  }
  return ENFORCE_PROCESS_LIMIT || mProcessLimit > 0 ? false : didOomAdj;
}
Program: 22329
Project: 22329
Buggy source:
void killAppAtUsersRequest(ProcessRecord app,Dialog fromDialog){
synchronized (this) {
    app.crashing=false;
    app.crashingReport=null;
    app.notResponding=false;
    app.notRespondingReport=null;
    if (app.anrDialog == fromDialog) {
      app.anrDialog=null;
    }
    if (app.waitDialog == fromDialog) {
      app.waitDialog=null;
    }
    if (app.pid > 0 && app.pid != MY_PID) {
      handleAppCrashLocked(app);
      Slog.i(ActivityManagerService.TAG,"String_Node_Str" + app.processName + "String_Node_Str"+ app.pid+ "String_Node_Str");
      Process.killProcess(app.pid);
    }
  }
}

Fixed version (ground truth):
void killAppAtUsersRequest(ProcessRecord app,Dialog fromDialog){
synchronized (this) {
    app.crashing=false;
    app.crashingReport=null;
    app.notResponding=false;
    app.notRespondingReport=null;
    if (app.anrDialog == fromDialog) {
      app.anrDialog=null;
    }
    if (app.waitDialog == fromDialog) {
      app.waitDialog=null;
    }
    if (app.pid > 0 && app.pid != MY_PID) {
      handleAppCrashLocked(app);
      Slog.i(ActivityManagerService.TAG,"String_Node_Str" + app.processName + "String_Node_Str"+ app.pid+ "String_Node_Str");
      EventLog.writeEvent(EventLogTags.AM_KILL,app.pid,app.processName,app.setAdj,"String_Node_Str");
      Process.killProcess(app.pid);
    }
  }
}
Program: 22330
Project: 22330
Buggy source:
private final boolean updateOomAdjLocked(){
  boolean didOomAdj=true;
  final HistoryRecord TOP_ACT=resumedAppLocked();
  final ProcessRecord TOP_APP=TOP_ACT != null ? TOP_ACT.app : null;
  if (false) {
    RuntimeException e=new RuntimeException();
    e.fillInStackTrace();
    Slog.i(TAG,"String_Node_Str" + TOP_ACT,e);
  }
  mAdjSeq++;
  int numSlots=HIDDEN_APP_MAX_ADJ - HIDDEN_APP_MIN_ADJ + 1;
  int factor=(mLruProcesses.size() - 4) / numSlots;
  if (factor < 1)   factor=1;
  int step=0;
  int i=mLruProcesses.size();
  int curHiddenAdj=HIDDEN_APP_MIN_ADJ;
  while (i > 0) {
    i--;
    ProcessRecord app=mLruProcesses.get(i);
    if (updateOomAdjLocked(app,curHiddenAdj,TOP_APP)) {
      if (curHiddenAdj < EMPTY_APP_ADJ && app.curAdj == curHiddenAdj) {
        step++;
        if (step >= factor) {
          step=0;
          curHiddenAdj++;
        }
      }
    }
 else {
      didOomAdj=false;
    }
  }
  return ENFORCE_PROCESS_LIMIT || mProcessLimit > 0 ? false : didOomAdj;
}

Fixed version (ground truth):
private final boolean updateOomAdjLocked(){
  boolean didOomAdj=true;
  final HistoryRecord TOP_ACT=resumedAppLocked();
  final ProcessRecord TOP_APP=TOP_ACT != null ? TOP_ACT.app : null;
  if (false) {
    RuntimeException e=new RuntimeException();
    e.fillInStackTrace();
    Slog.i(TAG,"String_Node_Str" + TOP_ACT,e);
  }
  mAdjSeq++;
  int numSlots=HIDDEN_APP_MAX_ADJ - HIDDEN_APP_MIN_ADJ + 1;
  int factor=(mLruProcesses.size() - 4) / numSlots;
  if (factor < 1)   factor=1;
  int step=0;
  int numHidden=0;
  int i=mLruProcesses.size();
  int curHiddenAdj=HIDDEN_APP_MIN_ADJ;
  while (i > 0) {
    i--;
    ProcessRecord app=mLruProcesses.get(i);
    if (updateOomAdjLocked(app,curHiddenAdj,TOP_APP)) {
      if (curHiddenAdj < EMPTY_APP_ADJ && app.curAdj == curHiddenAdj) {
        step++;
        if (step >= factor) {
          step=0;
          curHiddenAdj++;
        }
      }
      if (app.curAdj >= HIDDEN_APP_MIN_ADJ) {
        numHidden++;
        if (numHidden > MAX_HIDDEN_APPS) {
          Slog.i(TAG,"String_Node_Str" + app.processName + "String_Node_Str"+ app.pid+ "String_Node_Str"+ numHidden+ "String_Node_Str"+ MAX_HIDDEN_APPS);
          EventLog.writeEvent(EventLogTags.AM_KILL,app.pid,app.processName,app.setAdj,"String_Node_Str");
          Process.killProcess(app.pid);
        }
      }
    }
 else {
      didOomAdj=false;
    }
  }
  return ENFORCE_PROCESS_LIMIT || mProcessLimit > 0 ? false : didOomAdj;
}