nus-yam/ex-repair huggingface dataset:
Program: 197270
Project: 197270
Buggy source:
void startHomeActivity(Intent intent,ActivityInfo aInfo){
  moveHomeStackTaskToTop(HOME_ACTIVITY_TYPE);
  startActivityLocked(null,intent,null,aInfo,null,null,null,null,0,0,0,null,0,null,false,null,null,null);
}

Fixed version (ground truth):
void startHomeActivity(Intent intent,ActivityInfo aInfo){
  moveHomeStackTaskToTop(HOME_ACTIVITY_TYPE);
  startActivityLocked(null,intent,null,aInfo,null,null,null,null,0,0,0,null,0,0,0,null,false,null,null,null);
}
Program: 197276
Project: 197276
Buggy source:
private boolean updateServiceClientActivitiesLocked(ProcessRecord proc,ConnectionRecord modCr){
  if (modCr != null && modCr.binding.client != null) {
    if (modCr.binding.client.activities.size() <= 0) {
      return false;
    }
  }
  boolean anyClientActivities=false;
  for (int i=proc.services.size() - 1; i >= 0 && !anyClientActivities; i--) {
    ServiceRecord sr=proc.services.valueAt(i);
    for (int conni=sr.connections.size() - 1; conni >= 0 && !anyClientActivities; conni--) {
      ArrayList<ConnectionRecord> clist=sr.connections.valueAt(conni);
      for (int cri=clist.size() - 1; cri >= 0; cri--) {
        ConnectionRecord cr=clist.get(cri);
        if (cr.binding.client == null || cr.binding.client == proc) {
          continue;
        }
        if (cr.binding.client.activities.size() > 0) {
          anyClientActivities=true;
          break;
        }
      }
    }
  }
  if (anyClientActivities != proc.hasClientActivities) {
    proc.hasClientActivities=anyClientActivities;
    mAm.updateLruProcessLocked(proc,anyClientActivities,null);
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean updateServiceClientActivitiesLocked(ProcessRecord proc,ConnectionRecord modCr,boolean updateLru){
  if (modCr != null && modCr.binding.client != null) {
    if (modCr.binding.client.activities.size() <= 0) {
      return false;
    }
  }
  boolean anyClientActivities=false;
  for (int i=proc.services.size() - 1; i >= 0 && !anyClientActivities; i--) {
    ServiceRecord sr=proc.services.valueAt(i);
    for (int conni=sr.connections.size() - 1; conni >= 0 && !anyClientActivities; conni--) {
      ArrayList<ConnectionRecord> clist=sr.connections.valueAt(conni);
      for (int cri=clist.size() - 1; cri >= 0; cri--) {
        ConnectionRecord cr=clist.get(cri);
        if (cr.binding.client == null || cr.binding.client == proc) {
          continue;
        }
        if (cr.binding.client.activities.size() > 0) {
          anyClientActivities=true;
          break;
        }
      }
    }
  }
  if (anyClientActivities != proc.hasClientActivities) {
    proc.hasClientActivities=anyClientActivities;
    if (updateLru) {
      mAm.updateLruProcessLocked(proc,anyClientActivities,null);
    }
    return true;
  }
  return false;
}
Program: 197282
Project: 197282
Buggy source:
public static int computeEmptyProcessLimit(int totalProcessLimit){
  return (totalProcessLimit * 2) / 3;
}

Fixed version (ground truth):
public static int computeEmptyProcessLimit(int totalProcessLimit){
  return totalProcessLimit / 2;
}
Program: 197286
Project: 197286
Buggy source:
private boolean updateServiceClientActivitiesLocked(ProcessRecord proc,ConnectionRecord modCr){
  if (modCr != null && modCr.binding.client != null) {
    if (modCr.binding.client.activities.size() <= 0) {
      return false;
    }
  }
  boolean anyClientActivities=false;
  for (int i=proc.services.size() - 1; i >= 0 && !anyClientActivities; i--) {
    ServiceRecord sr=proc.services.valueAt(i);
    for (int conni=sr.connections.size() - 1; conni >= 0 && !anyClientActivities; conni--) {
      ArrayList<ConnectionRecord> clist=sr.connections.valueAt(conni);
      for (int cri=clist.size() - 1; cri >= 0; cri--) {
        ConnectionRecord cr=clist.get(cri);
        if (cr.binding.client == null || cr.binding.client == proc) {
          continue;
        }
        if (cr.binding.client.activities.size() > 0) {
          anyClientActivities=true;
          break;
        }
      }
    }
  }
  if (anyClientActivities != proc.hasClientActivities) {
    proc.hasClientActivities=anyClientActivities;
    mAm.updateLruProcessLocked(proc,anyClientActivities,null);
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean updateServiceClientActivitiesLocked(ProcessRecord proc,ConnectionRecord modCr,boolean updateLru){
  if (modCr != null && modCr.binding.client != null) {
    if (modCr.binding.client.activities.size() <= 0) {
      return false;
    }
  }
  boolean anyClientActivities=false;
  for (int i=proc.services.size() - 1; i >= 0 && !anyClientActivities; i--) {
    ServiceRecord sr=proc.services.valueAt(i);
    for (int conni=sr.connections.size() - 1; conni >= 0 && !anyClientActivities; conni--) {
      ArrayList<ConnectionRecord> clist=sr.connections.valueAt(conni);
      for (int cri=clist.size() - 1; cri >= 0; cri--) {
        ConnectionRecord cr=clist.get(cri);
        if (cr.binding.client == null || cr.binding.client == proc) {
          continue;
        }
        if (cr.binding.client.activities.size() > 0) {
          anyClientActivities=true;
          break;
        }
      }
    }
  }
  if (anyClientActivities != proc.hasClientActivities) {
    proc.hasClientActivities=anyClientActivities;
    if (updateLru) {
      mAm.updateLruProcessLocked(proc,anyClientActivities,null);
    }
    return true;
  }
  return false;
}
Program: 197292
Project: 197292
Buggy source:
public static int computeEmptyProcessLimit(int totalProcessLimit){
  return (totalProcessLimit * 2) / 3;
}

Fixed version (ground truth):
public static int computeEmptyProcessLimit(int totalProcessLimit){
  return totalProcessLimit / 2;
}
Program: 197296
Project: 197296
Buggy source:
private boolean updateServiceClientActivitiesLocked(ProcessRecord proc,ConnectionRecord modCr){
  if (modCr != null && modCr.binding.client != null) {
    if (modCr.binding.client.activities.size() <= 0) {
      return false;
    }
  }
  boolean anyClientActivities=false;
  for (int i=proc.services.size() - 1; i >= 0 && !anyClientActivities; i--) {
    ServiceRecord sr=proc.services.valueAt(i);
    for (int conni=sr.connections.size() - 1; conni >= 0 && !anyClientActivities; conni--) {
      ArrayList<ConnectionRecord> clist=sr.connections.valueAt(conni);
      for (int cri=clist.size() - 1; cri >= 0; cri--) {
        ConnectionRecord cr=clist.get(cri);
        if (cr.binding.client == null || cr.binding.client == proc) {
          continue;
        }
        if (cr.binding.client.activities.size() > 0) {
          anyClientActivities=true;
          break;
        }
      }
    }
  }
  if (anyClientActivities != proc.hasClientActivities) {
    proc.hasClientActivities=anyClientActivities;
    mAm.updateLruProcessLocked(proc,anyClientActivities,null);
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean updateServiceClientActivitiesLocked(ProcessRecord proc,ConnectionRecord modCr,boolean updateLru){
  if (modCr != null && modCr.binding.client != null) {
    if (modCr.binding.client.activities.size() <= 0) {
      return false;
    }
  }
  boolean anyClientActivities=false;
  for (int i=proc.services.size() - 1; i >= 0 && !anyClientActivities; i--) {
    ServiceRecord sr=proc.services.valueAt(i);
    for (int conni=sr.connections.size() - 1; conni >= 0 && !anyClientActivities; conni--) {
      ArrayList<ConnectionRecord> clist=sr.connections.valueAt(conni);
      for (int cri=clist.size() - 1; cri >= 0; cri--) {
        ConnectionRecord cr=clist.get(cri);
        if (cr.binding.client == null || cr.binding.client == proc) {
          continue;
        }
        if (cr.binding.client.activities.size() > 0) {
          anyClientActivities=true;
          break;
        }
      }
    }
  }
  if (anyClientActivities != proc.hasClientActivities) {
    proc.hasClientActivities=anyClientActivities;
    if (updateLru) {
      mAm.updateLruProcessLocked(proc,anyClientActivities,null);
    }
    return true;
  }
  return false;
}
Program: 197302
Project: 197302
Buggy source:
public static int computeEmptyProcessLimit(int totalProcessLimit){
  return (totalProcessLimit * 2) / 3;
}

Fixed version (ground truth):
public static int computeEmptyProcessLimit(int totalProcessLimit){
  return totalProcessLimit / 2;
}
Program: 197306
Project: 197306
Buggy source:
private boolean updateServiceClientActivitiesLocked(ProcessRecord proc,ConnectionRecord modCr){
  if (modCr != null && modCr.binding.client != null) {
    if (modCr.binding.client.activities.size() <= 0) {
      return false;
    }
  }
  boolean anyClientActivities=false;
  for (int i=proc.services.size() - 1; i >= 0 && !anyClientActivities; i--) {
    ServiceRecord sr=proc.services.valueAt(i);
    for (int conni=sr.connections.size() - 1; conni >= 0 && !anyClientActivities; conni--) {
      ArrayList<ConnectionRecord> clist=sr.connections.valueAt(conni);
      for (int cri=clist.size() - 1; cri >= 0; cri--) {
        ConnectionRecord cr=clist.get(cri);
        if (cr.binding.client == null || cr.binding.client == proc) {
          continue;
        }
        if (cr.binding.client.activities.size() > 0) {
          anyClientActivities=true;
          break;
        }
      }
    }
  }
  if (anyClientActivities != proc.hasClientActivities) {
    proc.hasClientActivities=anyClientActivities;
    mAm.updateLruProcessLocked(proc,anyClientActivities,null);
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean updateServiceClientActivitiesLocked(ProcessRecord proc,ConnectionRecord modCr,boolean updateLru){
  if (modCr != null && modCr.binding.client != null) {
    if (modCr.binding.client.activities.size() <= 0) {
      return false;
    }
  }
  boolean anyClientActivities=false;
  for (int i=proc.services.size() - 1; i >= 0 && !anyClientActivities; i--) {
    ServiceRecord sr=proc.services.valueAt(i);
    for (int conni=sr.connections.size() - 1; conni >= 0 && !anyClientActivities; conni--) {
      ArrayList<ConnectionRecord> clist=sr.connections.valueAt(conni);
      for (int cri=clist.size() - 1; cri >= 0; cri--) {
        ConnectionRecord cr=clist.get(cri);
        if (cr.binding.client == null || cr.binding.client == proc) {
          continue;
        }
        if (cr.binding.client.activities.size() > 0) {
          anyClientActivities=true;
          break;
        }
      }
    }
  }
  if (anyClientActivities != proc.hasClientActivities) {
    proc.hasClientActivities=anyClientActivities;
    if (updateLru) {
      mAm.updateLruProcessLocked(proc,anyClientActivities,null);
    }
    return true;
  }
  return false;
}
Program: 197312
Project: 197312
Buggy source:
public static int computeEmptyProcessLimit(int totalProcessLimit){
  return (totalProcessLimit * 2) / 3;
}

Fixed version (ground truth):
public static int computeEmptyProcessLimit(int totalProcessLimit){
  return totalProcessLimit / 2;
}
Program: 197316
Project: 197316
Buggy source:
private boolean updateServiceClientActivitiesLocked(ProcessRecord proc,ConnectionRecord modCr){
  if (modCr != null && modCr.binding.client != null) {
    if (modCr.binding.client.activities.size() <= 0) {
      return false;
    }
  }
  boolean anyClientActivities=false;
  for (int i=proc.services.size() - 1; i >= 0 && !anyClientActivities; i--) {
    ServiceRecord sr=proc.services.valueAt(i);
    for (int conni=sr.connections.size() - 1; conni >= 0 && !anyClientActivities; conni--) {
      ArrayList<ConnectionRecord> clist=sr.connections.valueAt(conni);
      for (int cri=clist.size() - 1; cri >= 0; cri--) {
        ConnectionRecord cr=clist.get(cri);
        if (cr.binding.client == null || cr.binding.client == proc) {
          continue;
        }
        if (cr.binding.client.activities.size() > 0) {
          anyClientActivities=true;
          break;
        }
      }
    }
  }
  if (anyClientActivities != proc.hasClientActivities) {
    proc.hasClientActivities=anyClientActivities;
    mAm.updateLruProcessLocked(proc,anyClientActivities,null);
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean updateServiceClientActivitiesLocked(ProcessRecord proc,ConnectionRecord modCr,boolean updateLru){
  if (modCr != null && modCr.binding.client != null) {
    if (modCr.binding.client.activities.size() <= 0) {
      return false;
    }
  }
  boolean anyClientActivities=false;
  for (int i=proc.services.size() - 1; i >= 0 && !anyClientActivities; i--) {
    ServiceRecord sr=proc.services.valueAt(i);
    for (int conni=sr.connections.size() - 1; conni >= 0 && !anyClientActivities; conni--) {
      ArrayList<ConnectionRecord> clist=sr.connections.valueAt(conni);
      for (int cri=clist.size() - 1; cri >= 0; cri--) {
        ConnectionRecord cr=clist.get(cri);
        if (cr.binding.client == null || cr.binding.client == proc) {
          continue;
        }
        if (cr.binding.client.activities.size() > 0) {
          anyClientActivities=true;
          break;
        }
      }
    }
  }
  if (anyClientActivities != proc.hasClientActivities) {
    proc.hasClientActivities=anyClientActivities;
    if (updateLru) {
      mAm.updateLruProcessLocked(proc,anyClientActivities,null);
    }
    return true;
  }
  return false;
}
Program: 197322
Project: 197322
Buggy source:
public static int computeEmptyProcessLimit(int totalProcessLimit){
  return (totalProcessLimit * 2) / 3;
}

Fixed version (ground truth):
public static int computeEmptyProcessLimit(int totalProcessLimit){
  return totalProcessLimit / 2;
}
Program: 197326
Project: 197326
Buggy source:
private boolean updateServiceClientActivitiesLocked(ProcessRecord proc,ConnectionRecord modCr){
  if (modCr != null && modCr.binding.client != null) {
    if (modCr.binding.client.activities.size() <= 0) {
      return false;
    }
  }
  boolean anyClientActivities=false;
  for (int i=proc.services.size() - 1; i >= 0 && !anyClientActivities; i--) {
    ServiceRecord sr=proc.services.valueAt(i);
    for (int conni=sr.connections.size() - 1; conni >= 0 && !anyClientActivities; conni--) {
      ArrayList<ConnectionRecord> clist=sr.connections.valueAt(conni);
      for (int cri=clist.size() - 1; cri >= 0; cri--) {
        ConnectionRecord cr=clist.get(cri);
        if (cr.binding.client == null || cr.binding.client == proc) {
          continue;
        }
        if (cr.binding.client.activities.size() > 0) {
          anyClientActivities=true;
          break;
        }
      }
    }
  }
  if (anyClientActivities != proc.hasClientActivities) {
    proc.hasClientActivities=anyClientActivities;
    mAm.updateLruProcessLocked(proc,anyClientActivities,null);
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean updateServiceClientActivitiesLocked(ProcessRecord proc,ConnectionRecord modCr,boolean updateLru){
  if (modCr != null && modCr.binding.client != null) {
    if (modCr.binding.client.activities.size() <= 0) {
      return false;
    }
  }
  boolean anyClientActivities=false;
  for (int i=proc.services.size() - 1; i >= 0 && !anyClientActivities; i--) {
    ServiceRecord sr=proc.services.valueAt(i);
    for (int conni=sr.connections.size() - 1; conni >= 0 && !anyClientActivities; conni--) {
      ArrayList<ConnectionRecord> clist=sr.connections.valueAt(conni);
      for (int cri=clist.size() - 1; cri >= 0; cri--) {
        ConnectionRecord cr=clist.get(cri);
        if (cr.binding.client == null || cr.binding.client == proc) {
          continue;
        }
        if (cr.binding.client.activities.size() > 0) {
          anyClientActivities=true;
          break;
        }
      }
    }
  }
  if (anyClientActivities != proc.hasClientActivities) {
    proc.hasClientActivities=anyClientActivities;
    if (updateLru) {
      mAm.updateLruProcessLocked(proc,anyClientActivities,null);
    }
    return true;
  }
  return false;
}
Program: 197332
Project: 197332
Buggy source:
public static int computeEmptyProcessLimit(int totalProcessLimit){
  return (totalProcessLimit * 2) / 3;
}

Fixed version (ground truth):
public static int computeEmptyProcessLimit(int totalProcessLimit){
  return totalProcessLimit / 2;
}
Program: 197336
Project: 197336
Buggy source:
private boolean updateServiceClientActivitiesLocked(ProcessRecord proc,ConnectionRecord modCr){
  if (modCr != null && modCr.binding.client != null) {
    if (modCr.binding.client.activities.size() <= 0) {
      return false;
    }
  }
  boolean anyClientActivities=false;
  for (int i=proc.services.size() - 1; i >= 0 && !anyClientActivities; i--) {
    ServiceRecord sr=proc.services.valueAt(i);
    for (int conni=sr.connections.size() - 1; conni >= 0 && !anyClientActivities; conni--) {
      ArrayList<ConnectionRecord> clist=sr.connections.valueAt(conni);
      for (int cri=clist.size() - 1; cri >= 0; cri--) {
        ConnectionRecord cr=clist.get(cri);
        if (cr.binding.client == null || cr.binding.client == proc) {
          continue;
        }
        if (cr.binding.client.activities.size() > 0) {
          anyClientActivities=true;
          break;
        }
      }
    }
  }
  if (anyClientActivities != proc.hasClientActivities) {
    proc.hasClientActivities=anyClientActivities;
    mAm.updateLruProcessLocked(proc,anyClientActivities,null);
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean updateServiceClientActivitiesLocked(ProcessRecord proc,ConnectionRecord modCr,boolean updateLru){
  if (modCr != null && modCr.binding.client != null) {
    if (modCr.binding.client.activities.size() <= 0) {
      return false;
    }
  }
  boolean anyClientActivities=false;
  for (int i=proc.services.size() - 1; i >= 0 && !anyClientActivities; i--) {
    ServiceRecord sr=proc.services.valueAt(i);
    for (int conni=sr.connections.size() - 1; conni >= 0 && !anyClientActivities; conni--) {
      ArrayList<ConnectionRecord> clist=sr.connections.valueAt(conni);
      for (int cri=clist.size() - 1; cri >= 0; cri--) {
        ConnectionRecord cr=clist.get(cri);
        if (cr.binding.client == null || cr.binding.client == proc) {
          continue;
        }
        if (cr.binding.client.activities.size() > 0) {
          anyClientActivities=true;
          break;
        }
      }
    }
  }
  if (anyClientActivities != proc.hasClientActivities) {
    proc.hasClientActivities=anyClientActivities;
    if (updateLru) {
      mAm.updateLruProcessLocked(proc,anyClientActivities,null);
    }
    return true;
  }
  return false;
}
Program: 197342
Project: 197342
Buggy source:
public static int computeEmptyProcessLimit(int totalProcessLimit){
  return (totalProcessLimit * 2) / 3;
}

Fixed version (ground truth):
public static int computeEmptyProcessLimit(int totalProcessLimit){
  return totalProcessLimit / 2;
}
Program: 197346
Project: 197346
Buggy source:
private boolean updateServiceClientActivitiesLocked(ProcessRecord proc,ConnectionRecord modCr){
  if (modCr != null && modCr.binding.client != null) {
    if (modCr.binding.client.activities.size() <= 0) {
      return false;
    }
  }
  boolean anyClientActivities=false;
  for (int i=proc.services.size() - 1; i >= 0 && !anyClientActivities; i--) {
    ServiceRecord sr=proc.services.valueAt(i);
    for (int conni=sr.connections.size() - 1; conni >= 0 && !anyClientActivities; conni--) {
      ArrayList<ConnectionRecord> clist=sr.connections.valueAt(conni);
      for (int cri=clist.size() - 1; cri >= 0; cri--) {
        ConnectionRecord cr=clist.get(cri);
        if (cr.binding.client == null || cr.binding.client == proc) {
          continue;
        }
        if (cr.binding.client.activities.size() > 0) {
          anyClientActivities=true;
          break;
        }
      }
    }
  }
  if (anyClientActivities != proc.hasClientActivities) {
    proc.hasClientActivities=anyClientActivities;
    mAm.updateLruProcessLocked(proc,anyClientActivities,null);
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean updateServiceClientActivitiesLocked(ProcessRecord proc,ConnectionRecord modCr,boolean updateLru){
  if (modCr != null && modCr.binding.client != null) {
    if (modCr.binding.client.activities.size() <= 0) {
      return false;
    }
  }
  boolean anyClientActivities=false;
  for (int i=proc.services.size() - 1; i >= 0 && !anyClientActivities; i--) {
    ServiceRecord sr=proc.services.valueAt(i);
    for (int conni=sr.connections.size() - 1; conni >= 0 && !anyClientActivities; conni--) {
      ArrayList<ConnectionRecord> clist=sr.connections.valueAt(conni);
      for (int cri=clist.size() - 1; cri >= 0; cri--) {
        ConnectionRecord cr=clist.get(cri);
        if (cr.binding.client == null || cr.binding.client == proc) {
          continue;
        }
        if (cr.binding.client.activities.size() > 0) {
          anyClientActivities=true;
          break;
        }
      }
    }
  }
  if (anyClientActivities != proc.hasClientActivities) {
    proc.hasClientActivities=anyClientActivities;
    if (updateLru) {
      mAm.updateLruProcessLocked(proc,anyClientActivities,null);
    }
    return true;
  }
  return false;
}
Program: 197352
Project: 197352
Buggy source:
public static int computeEmptyProcessLimit(int totalProcessLimit){
  return (totalProcessLimit * 2) / 3;
}

Fixed version (ground truth):
public static int computeEmptyProcessLimit(int totalProcessLimit){
  return totalProcessLimit / 2;
}
Program: 197361
Project: 197361
Buggy source:
public boolean isSleepingOrShuttingDown(){
  return mSleeping || mShuttingDown;
}

Fixed version (ground truth):
public boolean isSleepingOrShuttingDown(){
  return isSleeping() || mShuttingDown;
}
Program: 197362
Project: 197362
Buggy source:
void goToSleepIfNeededLocked(){
  if (mWentToSleep && !mRunningVoice) {
    if (!mSleeping) {
      mSleeping=true;
      mStackSupervisor.goingToSleepLocked();
      checkExcessivePowerUsageLocked(false);
      mHandler.removeMessages(CHECK_EXCESSIVE_WAKE_LOCKS_MSG);
      Message nmsg=mHandler.obtainMessage(CHECK_EXCESSIVE_WAKE_LOCKS_MSG);
      mHandler.sendMessageDelayed(nmsg,POWER_CHECK_DELAY);
    }
  }
}

Fixed version (ground truth):
void goToSleepIfNeededLocked(){
  if (mWentToSleep && !mRunningVoice) {
    if (!mSleeping) {
      mSleeping=true;
      mKeyguardWaitingForDraw=false;
      mStackSupervisor.goingToSleepLocked();
      checkExcessivePowerUsageLocked(false);
      mHandler.removeMessages(CHECK_EXCESSIVE_WAKE_LOCKS_MSG);
      Message nmsg=mHandler.obtainMessage(CHECK_EXCESSIVE_WAKE_LOCKS_MSG);
      mHandler.sendMessageDelayed(nmsg,POWER_CHECK_DELAY);
    }
  }
}
Program: 197363
Project: 197363
Buggy source:
public void setLockScreenShown(boolean shown){
  if (checkCallingPermission(android.Manifest.permission.DEVICE_POWER) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.DEVICE_POWER);
  }
synchronized (this) {
    long ident=Binder.clearCallingIdentity();
    try {
      if (DEBUG_LOCKSCREEN)       logLockScreen("String_Node_Str" + shown);
      mLockScreenShown=shown;
      comeOutOfSleepIfNeededLocked();
    }
  finally {
      Binder.restoreCallingIdentity(ident);
    }
  }
}

Fixed version (ground truth):
public void setLockScreenShown(boolean shown){
  if (checkCallingPermission(android.Manifest.permission.DEVICE_POWER) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.DEVICE_POWER);
  }
synchronized (this) {
    long ident=Binder.clearCallingIdentity();
    try {
      if (DEBUG_LOCKSCREEN)       logLockScreen("String_Node_Str" + shown);
      mLockScreenShown=shown;
      mKeyguardWaitingForDraw=false;
      comeOutOfSleepIfNeededLocked();
    }
  finally {
      Binder.restoreCallingIdentity(ident);
    }
  }
}
Program: 197364
Project: 197364
Buggy source:
public boolean isSleeping(){
  return mSleeping;
}

Fixed version (ground truth):
public boolean isSleeping(){
  return mSleeping && !mKeyguardWaitingForDraw;
}
Program: 197365
Project: 197365
Buggy source:
@Override public void keyguardWaitingForActivityDrawn(){
  enforceNotIsolatedCaller("String_Node_Str");
  final long token=Binder.clearCallingIdentity();
  try {
synchronized (this) {
      if (DEBUG_LOCKSCREEN)       logLockScreen("String_Node_Str");
      mWindowManager.keyguardWaitingForActivityDrawn();
    }
  }
  finally {
    Binder.restoreCallingIdentity(token);
  }
}

Fixed version (ground truth):
@Override public void keyguardWaitingForActivityDrawn(){
  enforceNotIsolatedCaller("String_Node_Str");
  final long token=Binder.clearCallingIdentity();
  try {
synchronized (this) {
      if (DEBUG_LOCKSCREEN)       logLockScreen("String_Node_Str");
      mWindowManager.keyguardWaitingForActivityDrawn();
      mKeyguardWaitingForDraw=true;
    }
  }
  finally {
    Binder.restoreCallingIdentity(token);
  }
}
Program: 197366
Project: 197366
Buggy source:
public boolean isSleepingOrShuttingDown(){
  return mSleeping || mShuttingDown;
}

Fixed version (ground truth):
public boolean isSleepingOrShuttingDown(){
  return isSleeping() || mShuttingDown;
}
Program: 197367
Project: 197367
Buggy source:
void goToSleepIfNeededLocked(){
  if (mWentToSleep && !mRunningVoice) {
    if (!mSleeping) {
      mSleeping=true;
      mStackSupervisor.goingToSleepLocked();
      checkExcessivePowerUsageLocked(false);
      mHandler.removeMessages(CHECK_EXCESSIVE_WAKE_LOCKS_MSG);
      Message nmsg=mHandler.obtainMessage(CHECK_EXCESSIVE_WAKE_LOCKS_MSG);
      mHandler.sendMessageDelayed(nmsg,POWER_CHECK_DELAY);
    }
  }
}

Fixed version (ground truth):
void goToSleepIfNeededLocked(){
  if (mWentToSleep && !mRunningVoice) {
    if (!mSleeping) {
      mSleeping=true;
      mKeyguardWaitingForDraw=false;
      mStackSupervisor.goingToSleepLocked();
      checkExcessivePowerUsageLocked(false);
      mHandler.removeMessages(CHECK_EXCESSIVE_WAKE_LOCKS_MSG);
      Message nmsg=mHandler.obtainMessage(CHECK_EXCESSIVE_WAKE_LOCKS_MSG);
      mHandler.sendMessageDelayed(nmsg,POWER_CHECK_DELAY);
    }
  }
}
Program: 197368
Project: 197368
Buggy source:
public void setLockScreenShown(boolean shown){
  if (checkCallingPermission(android.Manifest.permission.DEVICE_POWER) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.DEVICE_POWER);
  }
synchronized (this) {
    long ident=Binder.clearCallingIdentity();
    try {
      if (DEBUG_LOCKSCREEN)       logLockScreen("String_Node_Str" + shown);
      mLockScreenShown=shown;
      comeOutOfSleepIfNeededLocked();
    }
  finally {
      Binder.restoreCallingIdentity(ident);
    }
  }
}

Fixed version (ground truth):
public void setLockScreenShown(boolean shown){
  if (checkCallingPermission(android.Manifest.permission.DEVICE_POWER) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.DEVICE_POWER);
  }
synchronized (this) {
    long ident=Binder.clearCallingIdentity();
    try {
      if (DEBUG_LOCKSCREEN)       logLockScreen("String_Node_Str" + shown);
      mLockScreenShown=shown;
      mKeyguardWaitingForDraw=false;
      comeOutOfSleepIfNeededLocked();
    }
  finally {
      Binder.restoreCallingIdentity(ident);
    }
  }
}
Program: 197369
Project: 197369
Buggy source:
public boolean isSleeping(){
  return mSleeping;
}

Fixed version (ground truth):
public boolean isSleeping(){
  return mSleeping && !mKeyguardWaitingForDraw;
}
Program: 197370
Project: 197370
Buggy source:
@Override public void keyguardWaitingForActivityDrawn(){
  enforceNotIsolatedCaller("String_Node_Str");
  final long token=Binder.clearCallingIdentity();
  try {
synchronized (this) {
      if (DEBUG_LOCKSCREEN)       logLockScreen("String_Node_Str");
      mWindowManager.keyguardWaitingForActivityDrawn();
    }
  }
  finally {
    Binder.restoreCallingIdentity(token);
  }
}

Fixed version (ground truth):
@Override public void keyguardWaitingForActivityDrawn(){
  enforceNotIsolatedCaller("String_Node_Str");
  final long token=Binder.clearCallingIdentity();
  try {
synchronized (this) {
      if (DEBUG_LOCKSCREEN)       logLockScreen("String_Node_Str");
      mWindowManager.keyguardWaitingForActivityDrawn();
      mKeyguardWaitingForDraw=true;
    }
  }
  finally {
    Binder.restoreCallingIdentity(token);
  }
}
Program: 197371
Project: 197371
Buggy source:
public boolean isSleepingOrShuttingDown(){
  return mSleeping || mShuttingDown;
}

Fixed version (ground truth):
public boolean isSleepingOrShuttingDown(){
  return isSleeping() || mShuttingDown;
}
Program: 197372
Project: 197372
Buggy source:
void goToSleepIfNeededLocked(){
  if (mWentToSleep && !mRunningVoice) {
    if (!mSleeping) {
      mSleeping=true;
      mStackSupervisor.goingToSleepLocked();
      checkExcessivePowerUsageLocked(false);
      mHandler.removeMessages(CHECK_EXCESSIVE_WAKE_LOCKS_MSG);
      Message nmsg=mHandler.obtainMessage(CHECK_EXCESSIVE_WAKE_LOCKS_MSG);
      mHandler.sendMessageDelayed(nmsg,POWER_CHECK_DELAY);
    }
  }
}

Fixed version (ground truth):
void goToSleepIfNeededLocked(){
  if (mWentToSleep && !mRunningVoice) {
    if (!mSleeping) {
      mSleeping=true;
      mKeyguardWaitingForDraw=false;
      mStackSupervisor.goingToSleepLocked();
      checkExcessivePowerUsageLocked(false);
      mHandler.removeMessages(CHECK_EXCESSIVE_WAKE_LOCKS_MSG);
      Message nmsg=mHandler.obtainMessage(CHECK_EXCESSIVE_WAKE_LOCKS_MSG);
      mHandler.sendMessageDelayed(nmsg,POWER_CHECK_DELAY);
    }
  }
}
Program: 197373
Project: 197373
Buggy source:
public void setLockScreenShown(boolean shown){
  if (checkCallingPermission(android.Manifest.permission.DEVICE_POWER) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.DEVICE_POWER);
  }
synchronized (this) {
    long ident=Binder.clearCallingIdentity();
    try {
      if (DEBUG_LOCKSCREEN)       logLockScreen("String_Node_Str" + shown);
      mLockScreenShown=shown;
      comeOutOfSleepIfNeededLocked();
    }
  finally {
      Binder.restoreCallingIdentity(ident);
    }
  }
}

Fixed version (ground truth):
public void setLockScreenShown(boolean shown){
  if (checkCallingPermission(android.Manifest.permission.DEVICE_POWER) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.DEVICE_POWER);
  }
synchronized (this) {
    long ident=Binder.clearCallingIdentity();
    try {
      if (DEBUG_LOCKSCREEN)       logLockScreen("String_Node_Str" + shown);
      mLockScreenShown=shown;
      mKeyguardWaitingForDraw=false;
      comeOutOfSleepIfNeededLocked();
    }
  finally {
      Binder.restoreCallingIdentity(ident);
    }
  }
}
Program: 197374
Project: 197374
Buggy source:
public boolean isSleeping(){
  return mSleeping;
}

Fixed version (ground truth):
public boolean isSleeping(){
  return mSleeping && !mKeyguardWaitingForDraw;
}
Program: 197375
Project: 197375
Buggy source:
@Override public void keyguardWaitingForActivityDrawn(){
  enforceNotIsolatedCaller("String_Node_Str");
  final long token=Binder.clearCallingIdentity();
  try {
synchronized (this) {
      if (DEBUG_LOCKSCREEN)       logLockScreen("String_Node_Str");
      mWindowManager.keyguardWaitingForActivityDrawn();
    }
  }
  finally {
    Binder.restoreCallingIdentity(token);
  }
}

Fixed version (ground truth):
@Override public void keyguardWaitingForActivityDrawn(){
  enforceNotIsolatedCaller("String_Node_Str");
  final long token=Binder.clearCallingIdentity();
  try {
synchronized (this) {
      if (DEBUG_LOCKSCREEN)       logLockScreen("String_Node_Str");
      mWindowManager.keyguardWaitingForActivityDrawn();
      mKeyguardWaitingForDraw=true;
    }
  }
  finally {
    Binder.restoreCallingIdentity(token);
  }
}
Program: 197376
Project: 197376
Buggy source:
public boolean isSleepingOrShuttingDown(){
  return mSleeping || mShuttingDown;
}

Fixed version (ground truth):
public boolean isSleepingOrShuttingDown(){
  return isSleeping() || mShuttingDown;
}
Program: 197377
Project: 197377
Buggy source:
void goToSleepIfNeededLocked(){
  if (mWentToSleep && !mRunningVoice) {
    if (!mSleeping) {
      mSleeping=true;
      mStackSupervisor.goingToSleepLocked();
      checkExcessivePowerUsageLocked(false);
      mHandler.removeMessages(CHECK_EXCESSIVE_WAKE_LOCKS_MSG);
      Message nmsg=mHandler.obtainMessage(CHECK_EXCESSIVE_WAKE_LOCKS_MSG);
      mHandler.sendMessageDelayed(nmsg,POWER_CHECK_DELAY);
    }
  }
}

Fixed version (ground truth):
void goToSleepIfNeededLocked(){
  if (mWentToSleep && !mRunningVoice) {
    if (!mSleeping) {
      mSleeping=true;
      mKeyguardWaitingForDraw=false;
      mStackSupervisor.goingToSleepLocked();
      checkExcessivePowerUsageLocked(false);
      mHandler.removeMessages(CHECK_EXCESSIVE_WAKE_LOCKS_MSG);
      Message nmsg=mHandler.obtainMessage(CHECK_EXCESSIVE_WAKE_LOCKS_MSG);
      mHandler.sendMessageDelayed(nmsg,POWER_CHECK_DELAY);
    }
  }
}
Program: 197378
Project: 197378
Buggy source:
public void setLockScreenShown(boolean shown){
  if (checkCallingPermission(android.Manifest.permission.DEVICE_POWER) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.DEVICE_POWER);
  }
synchronized (this) {
    long ident=Binder.clearCallingIdentity();
    try {
      if (DEBUG_LOCKSCREEN)       logLockScreen("String_Node_Str" + shown);
      mLockScreenShown=shown;
      comeOutOfSleepIfNeededLocked();
    }
  finally {
      Binder.restoreCallingIdentity(ident);
    }
  }
}

Fixed version (ground truth):
public void setLockScreenShown(boolean shown){
  if (checkCallingPermission(android.Manifest.permission.DEVICE_POWER) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.DEVICE_POWER);
  }
synchronized (this) {
    long ident=Binder.clearCallingIdentity();
    try {
      if (DEBUG_LOCKSCREEN)       logLockScreen("String_Node_Str" + shown);
      mLockScreenShown=shown;
      mKeyguardWaitingForDraw=false;
      comeOutOfSleepIfNeededLocked();
    }
  finally {
      Binder.restoreCallingIdentity(ident);
    }
  }
}
Program: 197379
Project: 197379
Buggy source:
public boolean isSleeping(){
  return mSleeping;
}

Fixed version (ground truth):
public boolean isSleeping(){
  return mSleeping && !mKeyguardWaitingForDraw;
}
Program: 197380
Project: 197380
Buggy source:
@Override public void keyguardWaitingForActivityDrawn(){
  enforceNotIsolatedCaller("String_Node_Str");
  final long token=Binder.clearCallingIdentity();
  try {
synchronized (this) {
      if (DEBUG_LOCKSCREEN)       logLockScreen("String_Node_Str");
      mWindowManager.keyguardWaitingForActivityDrawn();
    }
  }
  finally {
    Binder.restoreCallingIdentity(token);
  }
}

Fixed version (ground truth):
@Override public void keyguardWaitingForActivityDrawn(){
  enforceNotIsolatedCaller("String_Node_Str");
  final long token=Binder.clearCallingIdentity();
  try {
synchronized (this) {
      if (DEBUG_LOCKSCREEN)       logLockScreen("String_Node_Str");
      mWindowManager.keyguardWaitingForActivityDrawn();
      mKeyguardWaitingForDraw=true;
    }
  }
  finally {
    Binder.restoreCallingIdentity(token);
  }
}
Program: 197381
Project: 197381
Buggy source:
public boolean isSleepingOrShuttingDown(){
  return mSleeping || mShuttingDown;
}

Fixed version (ground truth):
public boolean isSleepingOrShuttingDown(){
  return isSleeping() || mShuttingDown;
}
Program: 197382
Project: 197382
Buggy source:
void goToSleepIfNeededLocked(){
  if (mWentToSleep && !mRunningVoice) {
    if (!mSleeping) {
      mSleeping=true;
      mStackSupervisor.goingToSleepLocked();
      checkExcessivePowerUsageLocked(false);
      mHandler.removeMessages(CHECK_EXCESSIVE_WAKE_LOCKS_MSG);
      Message nmsg=mHandler.obtainMessage(CHECK_EXCESSIVE_WAKE_LOCKS_MSG);
      mHandler.sendMessageDelayed(nmsg,POWER_CHECK_DELAY);
    }
  }
}

Fixed version (ground truth):
void goToSleepIfNeededLocked(){
  if (mWentToSleep && !mRunningVoice) {
    if (!mSleeping) {
      mSleeping=true;
      mKeyguardWaitingForDraw=false;
      mStackSupervisor.goingToSleepLocked();
      checkExcessivePowerUsageLocked(false);
      mHandler.removeMessages(CHECK_EXCESSIVE_WAKE_LOCKS_MSG);
      Message nmsg=mHandler.obtainMessage(CHECK_EXCESSIVE_WAKE_LOCKS_MSG);
      mHandler.sendMessageDelayed(nmsg,POWER_CHECK_DELAY);
    }
  }
}
Program: 197383
Project: 197383
Buggy source:
public void setLockScreenShown(boolean shown){
  if (checkCallingPermission(android.Manifest.permission.DEVICE_POWER) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.DEVICE_POWER);
  }
synchronized (this) {
    long ident=Binder.clearCallingIdentity();
    try {
      if (DEBUG_LOCKSCREEN)       logLockScreen("String_Node_Str" + shown);
      mLockScreenShown=shown;
      comeOutOfSleepIfNeededLocked();
    }
  finally {
      Binder.restoreCallingIdentity(ident);
    }
  }
}

Fixed version (ground truth):
public void setLockScreenShown(boolean shown){
  if (checkCallingPermission(android.Manifest.permission.DEVICE_POWER) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.DEVICE_POWER);
  }
synchronized (this) {
    long ident=Binder.clearCallingIdentity();
    try {
      if (DEBUG_LOCKSCREEN)       logLockScreen("String_Node_Str" + shown);
      mLockScreenShown=shown;
      mKeyguardWaitingForDraw=false;
      comeOutOfSleepIfNeededLocked();
    }
  finally {
      Binder.restoreCallingIdentity(ident);
    }
  }
}
Program: 197384
Project: 197384
Buggy source:
public boolean isSleeping(){
  return mSleeping;
}

Fixed version (ground truth):
public boolean isSleeping(){
  return mSleeping && !mKeyguardWaitingForDraw;
}
Program: 197385
Project: 197385
Buggy source:
@Override public void keyguardWaitingForActivityDrawn(){
  enforceNotIsolatedCaller("String_Node_Str");
  final long token=Binder.clearCallingIdentity();
  try {
synchronized (this) {
      if (DEBUG_LOCKSCREEN)       logLockScreen("String_Node_Str");
      mWindowManager.keyguardWaitingForActivityDrawn();
    }
  }
  finally {
    Binder.restoreCallingIdentity(token);
  }
}

Fixed version (ground truth):
@Override public void keyguardWaitingForActivityDrawn(){
  enforceNotIsolatedCaller("String_Node_Str");
  final long token=Binder.clearCallingIdentity();
  try {
synchronized (this) {
      if (DEBUG_LOCKSCREEN)       logLockScreen("String_Node_Str");
      mWindowManager.keyguardWaitingForActivityDrawn();
      mKeyguardWaitingForDraw=true;
    }
  }
  finally {
    Binder.restoreCallingIdentity(token);
  }
}
Program: 197386
Project: 197386
Buggy source:
public boolean isSleepingOrShuttingDown(){
  return mSleeping || mShuttingDown;
}

Fixed version (ground truth):
public boolean isSleepingOrShuttingDown(){
  return isSleeping() || mShuttingDown;
}
Program: 197387
Project: 197387
Buggy source:
void goToSleepIfNeededLocked(){
  if (mWentToSleep && !mRunningVoice) {
    if (!mSleeping) {
      mSleeping=true;
      mStackSupervisor.goingToSleepLocked();
      checkExcessivePowerUsageLocked(false);
      mHandler.removeMessages(CHECK_EXCESSIVE_WAKE_LOCKS_MSG);
      Message nmsg=mHandler.obtainMessage(CHECK_EXCESSIVE_WAKE_LOCKS_MSG);
      mHandler.sendMessageDelayed(nmsg,POWER_CHECK_DELAY);
    }
  }
}

Fixed version (ground truth):
void goToSleepIfNeededLocked(){
  if (mWentToSleep && !mRunningVoice) {
    if (!mSleeping) {
      mSleeping=true;
      mKeyguardWaitingForDraw=false;
      mStackSupervisor.goingToSleepLocked();
      checkExcessivePowerUsageLocked(false);
      mHandler.removeMessages(CHECK_EXCESSIVE_WAKE_LOCKS_MSG);
      Message nmsg=mHandler.obtainMessage(CHECK_EXCESSIVE_WAKE_LOCKS_MSG);
      mHandler.sendMessageDelayed(nmsg,POWER_CHECK_DELAY);
    }
  }
}
Program: 197388
Project: 197388
Buggy source:
public void setLockScreenShown(boolean shown){
  if (checkCallingPermission(android.Manifest.permission.DEVICE_POWER) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.DEVICE_POWER);
  }
synchronized (this) {
    long ident=Binder.clearCallingIdentity();
    try {
      if (DEBUG_LOCKSCREEN)       logLockScreen("String_Node_Str" + shown);
      mLockScreenShown=shown;
      comeOutOfSleepIfNeededLocked();
    }
  finally {
      Binder.restoreCallingIdentity(ident);
    }
  }
}

Fixed version (ground truth):
public void setLockScreenShown(boolean shown){
  if (checkCallingPermission(android.Manifest.permission.DEVICE_POWER) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.DEVICE_POWER);
  }
synchronized (this) {
    long ident=Binder.clearCallingIdentity();
    try {
      if (DEBUG_LOCKSCREEN)       logLockScreen("String_Node_Str" + shown);
      mLockScreenShown=shown;
      mKeyguardWaitingForDraw=false;
      comeOutOfSleepIfNeededLocked();
    }
  finally {
      Binder.restoreCallingIdentity(ident);
    }
  }
}
Program: 197389
Project: 197389
Buggy source:
public boolean isSleeping(){
  return mSleeping;
}

Fixed version (ground truth):
public boolean isSleeping(){
  return mSleeping && !mKeyguardWaitingForDraw;
}
Program: 197390
Project: 197390
Buggy source:
@Override public void keyguardWaitingForActivityDrawn(){
  enforceNotIsolatedCaller("String_Node_Str");
  final long token=Binder.clearCallingIdentity();
  try {
synchronized (this) {
      if (DEBUG_LOCKSCREEN)       logLockScreen("String_Node_Str");
      mWindowManager.keyguardWaitingForActivityDrawn();
    }
  }
  finally {
    Binder.restoreCallingIdentity(token);
  }
}

Fixed version (ground truth):
@Override public void keyguardWaitingForActivityDrawn(){
  enforceNotIsolatedCaller("String_Node_Str");
  final long token=Binder.clearCallingIdentity();
  try {
synchronized (this) {
      if (DEBUG_LOCKSCREEN)       logLockScreen("String_Node_Str");
      mWindowManager.keyguardWaitingForActivityDrawn();
      mKeyguardWaitingForDraw=true;
    }
  }
  finally {
    Binder.restoreCallingIdentity(token);
  }
}
Program: 197391
Project: 197391
Buggy source:
public boolean isSleepingOrShuttingDown(){
  return mSleeping || mShuttingDown;
}

Fixed version (ground truth):
public boolean isSleepingOrShuttingDown(){
  return isSleeping() || mShuttingDown;
}
Program: 197392
Project: 197392
Buggy source:
void goToSleepIfNeededLocked(){
  if (mWentToSleep && !mRunningVoice) {
    if (!mSleeping) {
      mSleeping=true;
      mStackSupervisor.goingToSleepLocked();
      checkExcessivePowerUsageLocked(false);
      mHandler.removeMessages(CHECK_EXCESSIVE_WAKE_LOCKS_MSG);
      Message nmsg=mHandler.obtainMessage(CHECK_EXCESSIVE_WAKE_LOCKS_MSG);
      mHandler.sendMessageDelayed(nmsg,POWER_CHECK_DELAY);
    }
  }
}

Fixed version (ground truth):
void goToSleepIfNeededLocked(){
  if (mWentToSleep && !mRunningVoice) {
    if (!mSleeping) {
      mSleeping=true;
      mKeyguardWaitingForDraw=false;
      mStackSupervisor.goingToSleepLocked();
      checkExcessivePowerUsageLocked(false);
      mHandler.removeMessages(CHECK_EXCESSIVE_WAKE_LOCKS_MSG);
      Message nmsg=mHandler.obtainMessage(CHECK_EXCESSIVE_WAKE_LOCKS_MSG);
      mHandler.sendMessageDelayed(nmsg,POWER_CHECK_DELAY);
    }
  }
}
Program: 197393
Project: 197393
Buggy source:
public void setLockScreenShown(boolean shown){
  if (checkCallingPermission(android.Manifest.permission.DEVICE_POWER) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.DEVICE_POWER);
  }
synchronized (this) {
    long ident=Binder.clearCallingIdentity();
    try {
      if (DEBUG_LOCKSCREEN)       logLockScreen("String_Node_Str" + shown);
      mLockScreenShown=shown;
      comeOutOfSleepIfNeededLocked();
    }
  finally {
      Binder.restoreCallingIdentity(ident);
    }
  }
}

Fixed version (ground truth):
public void setLockScreenShown(boolean shown){
  if (checkCallingPermission(android.Manifest.permission.DEVICE_POWER) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.DEVICE_POWER);
  }
synchronized (this) {
    long ident=Binder.clearCallingIdentity();
    try {
      if (DEBUG_LOCKSCREEN)       logLockScreen("String_Node_Str" + shown);
      mLockScreenShown=shown;
      mKeyguardWaitingForDraw=false;
      comeOutOfSleepIfNeededLocked();
    }
  finally {
      Binder.restoreCallingIdentity(ident);
    }
  }
}
Program: 197394
Project: 197394
Buggy source:
public boolean isSleeping(){
  return mSleeping;
}

Fixed version (ground truth):
public boolean isSleeping(){
  return mSleeping && !mKeyguardWaitingForDraw;
}
Program: 197395
Project: 197395
Buggy source:
@Override public void keyguardWaitingForActivityDrawn(){
  enforceNotIsolatedCaller("String_Node_Str");
  final long token=Binder.clearCallingIdentity();
  try {
synchronized (this) {
      if (DEBUG_LOCKSCREEN)       logLockScreen("String_Node_Str");
      mWindowManager.keyguardWaitingForActivityDrawn();
    }
  }
  finally {
    Binder.restoreCallingIdentity(token);
  }
}

Fixed version (ground truth):
@Override public void keyguardWaitingForActivityDrawn(){
  enforceNotIsolatedCaller("String_Node_Str");
  final long token=Binder.clearCallingIdentity();
  try {
synchronized (this) {
      if (DEBUG_LOCKSCREEN)       logLockScreen("String_Node_Str");
      mWindowManager.keyguardWaitingForActivityDrawn();
      mKeyguardWaitingForDraw=true;
    }
  }
  finally {
    Binder.restoreCallingIdentity(token);
  }
}
Program: 197396
Project: 197396
Buggy source:
private Ops getOpsLocked(int uid,String packageName,boolean edit){
  HashMap<String,Ops> pkgOps=mUidOps.get(uid);
  if (pkgOps == null) {
    if (!edit) {
      return null;
    }
    pkgOps=new HashMap<String,Ops>();
    mUidOps.put(uid,pkgOps);
  }
  if (uid == 0) {
    packageName="String_Node_Str";
  }
 else   if (uid == Process.SHELL_UID) {
    packageName="String_Node_Str";
  }
  Ops ops=pkgOps.get(packageName);
  if (ops == null) {
    if (!edit) {
      return null;
    }
    boolean isPrivileged=false;
    if (uid != 0) {
      final long ident=Binder.clearCallingIdentity();
      try {
        int pkgUid=-1;
        try {
          ApplicationInfo appInfo=ActivityThread.getPackageManager().getApplicationInfo(packageName,0,UserHandle.getUserId(uid));
          if (appInfo != null) {
            pkgUid=appInfo.uid;
            isPrivileged=(appInfo.flags & ApplicationInfo.FLAG_PRIVILEGED) != 0;
          }
 else {
            if ("String_Node_Str".equals(packageName)) {
              pkgUid=Process.MEDIA_UID;
              isPrivileged=false;
            }
          }
        }
 catch (        RemoteException e) {
          Slog.w(TAG,"String_Node_Str",e);
        }
        if (pkgUid != uid) {
          Slog.w(TAG,"String_Node_Str" + packageName + "String_Node_Str"+ uid+ "String_Node_Str"+ pkgUid);
          return null;
        }
      }
  finally {
        Binder.restoreCallingIdentity(ident);
      }
    }
    ops=new Ops(packageName,uid,isPrivileged);
    pkgOps.put(packageName,ops);
  }
  return ops;
}

Fixed version (ground truth):
private Ops getOpsLocked(int uid,String packageName,boolean edit){
  if (uid == 0) {
    packageName="String_Node_Str";
  }
 else   if (uid == Process.SHELL_UID) {
    packageName="String_Node_Str";
  }
  return getOpsRawLocked(uid,packageName,edit);
}
Program: 197397
Project: 197397
Buggy source:
@Override public int checkPackage(int uid,String packageName){
synchronized (this) {
    if (getOpsLocked(uid,packageName,true) != null) {
      return AppOpsManager.MODE_ALLOWED;
    }
 else {
      return AppOpsManager.MODE_ERRORED;
    }
  }
}

Fixed version (ground truth):
@Override public int checkPackage(int uid,String packageName){
synchronized (this) {
    if (getOpsRawLocked(uid,packageName,true) != null) {
      return AppOpsManager.MODE_ALLOWED;
    }
 else {
      return AppOpsManager.MODE_ERRORED;
    }
  }
}