nus-yam/ex-repair huggingface dataset:
Program: 194101
Project: 194101
Buggy source:
Parcel readParcel(){
  if (DEBUG_PARCEL)   Log.d(TAG,"String_Node_Str" + mCurParcel.dataPosition() + "String_Node_Str"+ mCurParcel.dataAvail()+ "String_Node_Str"+ mNumReadWindows+ "String_Node_Str"+ mNumReadViews);
  if (mCurParcel.readInt() != 0) {
    return mCurParcel;
  }
  mTransferToken=mCurParcel.readStrongBinder();
  if (mTransferToken == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (DEBUG_PARCEL)   Log.d(TAG,"String_Node_Str" + mCurParcel.dataPosition() + "String_Node_Str"+ mTransferToken);
  fetchData();
  if (DEBUG_PARCEL)   Log.d(TAG,"String_Node_Str" + mCurParcel.dataPosition());
  mStringReader=new PooledStringReader(mCurParcel);
  if (DEBUG_PARCEL)   Log.d(TAG,"String_Node_Str" + mStringReader.getStringCount());
  if (DEBUG_PARCEL)   Log.d(TAG,"String_Node_Str" + mCurParcel.dataPosition() + "String_Node_Str"+ mCurParcel.dataAvail()+ "String_Node_Str"+ mNumReadWindows+ "String_Node_Str"+ mNumReadViews);
  mCurParcel.readInt();
  return mCurParcel;
}

Fixed version (ground truth):
Parcel readParcel(int validateToken,int level){
  if (DEBUG_PARCEL)   Log.d(TAG,"String_Node_Str" + mCurParcel.dataPosition() + "String_Node_Str"+ mCurParcel.dataAvail()+ "String_Node_Str"+ mNumReadWindows+ "String_Node_Str"+ mNumReadViews+ "String_Node_Str"+ level);
  int token=mCurParcel.readInt();
  if (token != 0) {
    if (token != validateToken) {
      throw new BadParcelableException("String_Node_Str" + Integer.toHexString(token) + "String_Node_Str"+ Integer.toHexString(validateToken));
    }
    return mCurParcel;
  }
  mTransferToken=mCurParcel.readStrongBinder();
  if (mTransferToken == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (DEBUG_PARCEL)   Log.d(TAG,"String_Node_Str" + mCurParcel.dataPosition() + "String_Node_Str"+ mTransferToken);
  fetchData();
  if (DEBUG_PARCEL)   Log.d(TAG,"String_Node_Str" + mCurParcel.dataPosition());
  mStringReader=new PooledStringReader(mCurParcel);
  if (DEBUG_PARCEL)   Log.d(TAG,"String_Node_Str" + mStringReader.getStringCount());
  if (DEBUG_PARCEL)   Log.d(TAG,"String_Node_Str" + mCurParcel.dataPosition() + "String_Node_Str"+ mCurParcel.dataAvail()+ "String_Node_Str"+ mNumReadWindows+ "String_Node_Str"+ mNumReadViews);
  mCurParcel.readInt();
  return mCurParcel;
}
Program: 194104
Project: 194104
Buggy source:
WindowNode(ParcelTransferReader reader){
  Parcel in=reader.readParcel();
  reader.mNumReadWindows++;
  mX=in.readInt();
  mY=in.readInt();
  mWidth=in.readInt();
  mHeight=in.readInt();
  mTitle=TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
  mDisplayId=in.readInt();
  mRoot=new ViewNode(reader);
}

Fixed version (ground truth):
WindowNode(ParcelTransferReader reader){
  Parcel in=reader.readParcel(VALIDATE_WINDOW_TOKEN,0);
  reader.mNumReadWindows++;
  mX=in.readInt();
  mY=in.readInt();
  mWidth=in.readInt();
  mHeight=in.readInt();
  mTitle=TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
  mDisplayId=in.readInt();
  mRoot=new ViewNode(reader,0);
}
Program: 194105
Project: 194105
Buggy source:
@Override public long getStartClockTime(){
  if (!isStartClockTimeValid()) {
    mStartClockTime=System.currentTimeMillis();
    if (isStartClockTimeValid()) {
      recordCurrentTimeChangeLocked(mStartClockTime,SystemClock.elapsedRealtime(),SystemClock.uptimeMillis());
    }
  }
  return mStartClockTime;
}

Fixed version (ground truth):
@Override public long getStartClockTime(){
  final long currentTime=System.currentTimeMillis();
  if (ensureStartClockTime(currentTime)) {
    recordCurrentTimeChangeLocked(currentTime,SystemClock.elapsedRealtime(),SystemClock.uptimeMillis());
  }
  return mStartClockTime;
}
Program: 194106
Project: 194106
Buggy source:
public void noteCurrentTimeChangedLocked(){
  final long currentTime=System.currentTimeMillis();
  final long elapsedRealtime=SystemClock.elapsedRealtime();
  final long uptime=SystemClock.uptimeMillis();
  recordCurrentTimeChangeLocked(currentTime,elapsedRealtime,uptime);
  if (isStartClockTimeValid()) {
    mStartClockTime=currentTime;
  }
}

Fixed version (ground truth):
public void noteCurrentTimeChangedLocked(){
  final long currentTime=System.currentTimeMillis();
  final long elapsedRealtime=SystemClock.elapsedRealtime();
  final long uptime=SystemClock.uptimeMillis();
  recordCurrentTimeChangeLocked(currentTime,elapsedRealtime,uptime);
  ensureStartClockTime(currentTime);
}
Program: 194107
Project: 194107
Buggy source:
/** 
 * Returns the first activity (starting from the top of the stack) that is the same as the given activity.  Returns null if no such activity is found.
 */
ActivityRecord findActivityLocked(Intent intent,ActivityInfo info){
  ComponentName cls=intent.getComponent();
  if (info.targetActivity != null) {
    cls=new ComponentName(info.packageName,info.targetActivity);
  }
  final int userId=UserHandle.getUserId(info.applicationInfo.uid);
  for (int taskNdx=mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
    final TaskRecord task=mTaskHistory.get(taskNdx);
    final boolean notCurrentUserTask=!mStackSupervisor.isCurrentProfileLocked(task.userId);
    final ArrayList<ActivityRecord> activities=task.mActivities;
    for (int activityNdx=activities.size() - 1; activityNdx >= 0; --activityNdx) {
      ActivityRecord r=activities.get(activityNdx);
      if (notCurrentUserTask && (r.info.flags & FLAG_SHOW_FOR_ALL_USERS) == 0) {
        return null;
      }
      if (!r.finishing && r.intent.getComponent().equals(cls) && r.userId == userId) {
        return r;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns the first activity (starting from the top of the stack) that is the same as the given activity.  Returns null if no such activity is found.
 */
ActivityRecord findActivityLocked(Intent intent,ActivityInfo info){
  ComponentName cls=intent.getComponent();
  if (info.targetActivity != null) {
    cls=new ComponentName(info.packageName,info.targetActivity);
  }
  final int userId=UserHandle.getUserId(info.applicationInfo.uid);
  for (int taskNdx=mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
    final TaskRecord task=mTaskHistory.get(taskNdx);
    final boolean notCurrentUserTask=!mStackSupervisor.isCurrentProfileLocked(task.userId);
    final ArrayList<ActivityRecord> activities=task.mActivities;
    for (int activityNdx=activities.size() - 1; activityNdx >= 0; --activityNdx) {
      ActivityRecord r=activities.get(activityNdx);
      if (notCurrentUserTask && (r.info.flags & FLAG_SHOW_FOR_ALL_USERS) == 0) {
        continue;
      }
      if (!r.finishing && r.intent.getComponent().equals(cls) && r.userId == userId) {
        return r;
      }
    }
  }
  return null;
}
Program: 194108
Project: 194108
Buggy source:
/** 
 * Returns the first activity (starting from the top of the stack) that is the same as the given activity.  Returns null if no such activity is found.
 */
ActivityRecord findActivityLocked(Intent intent,ActivityInfo info){
  ComponentName cls=intent.getComponent();
  if (info.targetActivity != null) {
    cls=new ComponentName(info.packageName,info.targetActivity);
  }
  final int userId=UserHandle.getUserId(info.applicationInfo.uid);
  for (int taskNdx=mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
    final TaskRecord task=mTaskHistory.get(taskNdx);
    final boolean notCurrentUserTask=!mStackSupervisor.isCurrentProfileLocked(task.userId);
    final ArrayList<ActivityRecord> activities=task.mActivities;
    for (int activityNdx=activities.size() - 1; activityNdx >= 0; --activityNdx) {
      ActivityRecord r=activities.get(activityNdx);
      if (notCurrentUserTask && (r.info.flags & FLAG_SHOW_FOR_ALL_USERS) == 0) {
        return null;
      }
      if (!r.finishing && r.intent.getComponent().equals(cls) && r.userId == userId) {
        return r;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns the first activity (starting from the top of the stack) that is the same as the given activity.  Returns null if no such activity is found.
 */
ActivityRecord findActivityLocked(Intent intent,ActivityInfo info){
  ComponentName cls=intent.getComponent();
  if (info.targetActivity != null) {
    cls=new ComponentName(info.packageName,info.targetActivity);
  }
  final int userId=UserHandle.getUserId(info.applicationInfo.uid);
  for (int taskNdx=mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
    final TaskRecord task=mTaskHistory.get(taskNdx);
    final boolean notCurrentUserTask=!mStackSupervisor.isCurrentProfileLocked(task.userId);
    final ArrayList<ActivityRecord> activities=task.mActivities;
    for (int activityNdx=activities.size() - 1; activityNdx >= 0; --activityNdx) {
      ActivityRecord r=activities.get(activityNdx);
      if (notCurrentUserTask && (r.info.flags & FLAG_SHOW_FOR_ALL_USERS) == 0) {
        continue;
      }
      if (!r.finishing && r.intent.getComponent().equals(cls) && r.userId == userId) {
        return r;
      }
    }
  }
  return null;
}
Program: 194109
Project: 194109
Buggy source:
private static int showUsage(){
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  return 1;
}

Fixed version (ground truth):
private static int showUsage(){
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  return 1;
}
Program: 194110
Project: 194110
Buggy source:
public void runListDisks() throws RemoteException {
  final DiskInfo[] disks=mSm.getDisks();
  for (  DiskInfo disk : disks) {
    System.out.println(disk.getId());
  }
}

Fixed version (ground truth):
public void runListDisks() throws RemoteException {
  final boolean onlyAdoptable="String_Node_Str".equals(nextArg());
  final DiskInfo[] disks=mSm.getDisks();
  for (  DiskInfo disk : disks) {
    if (!onlyAdoptable || disk.isAdoptable()) {
      System.out.println(disk.getId());
    }
  }
}
Program: 194111
Project: 194111
Buggy source:
public void run(String[] args) throws Exception {
  if (args.length < 1) {
    throw new IllegalArgumentException();
  }
  mSm=IMountService.Stub.asInterface(ServiceManager.getService("String_Node_Str"));
  if (mSm == null) {
    throw new RemoteException("String_Node_Str");
  }
  mArgs=args;
  String op=args[0];
  mNextArg=1;
  if ("String_Node_Str".equals(op)) {
    runListDisks();
  }
 else   if ("String_Node_Str".equals(op)) {
    runListVolumes();
  }
 else   if ("String_Node_Str".equals(op)) {
    runHasAdoptable();
  }
 else   if ("String_Node_Str".equals(op)) {
    runGetPrimaryStorageUuid();
  }
 else   if ("String_Node_Str".equals(op)) {
    runSetForceAdoptable();
  }
 else   if ("String_Node_Str".equals(op)) {
    runPartition();
  }
 else   if ("String_Node_Str".equals(op)) {
    runMount();
  }
 else   if ("String_Node_Str".equals(op)) {
    runUnmount();
  }
 else   if ("String_Node_Str".equals(op)) {
    runFormat();
  }
 else   if ("String_Node_Str".equals(op)) {
    runForget();
  }
 else {
    throw new IllegalArgumentException();
  }
}

Fixed version (ground truth):
public void run(String[] args) throws Exception {
  if (args.length < 1) {
    throw new IllegalArgumentException();
  }
  mSm=IMountService.Stub.asInterface(ServiceManager.getService("String_Node_Str"));
  if (mSm == null) {
    throw new RemoteException("String_Node_Str");
  }
  mArgs=args;
  String op=args[0];
  mNextArg=1;
  if ("String_Node_Str".equals(op)) {
    runListDisks();
  }
 else   if ("String_Node_Str".equals(op)) {
    runListVolumes();
  }
 else   if ("String_Node_Str".equals(op)) {
    runHasAdoptable();
  }
 else   if ("String_Node_Str".equals(op)) {
    runGetPrimaryStorageUuid();
  }
 else   if ("String_Node_Str".equals(op)) {
    runSetForceAdoptable();
  }
 else   if ("String_Node_Str".equals(op)) {
    runPartition();
  }
 else   if ("String_Node_Str".equals(op)) {
    runMount();
  }
 else   if ("String_Node_Str".equals(op)) {
    runUnmount();
  }
 else   if ("String_Node_Str".equals(op)) {
    runFormat();
  }
 else   if ("String_Node_Str".equals(op)) {
    runBenchmark();
  }
 else   if ("String_Node_Str".equals(op)) {
    runForget();
  }
 else {
    throw new IllegalArgumentException();
  }
}
Program: 194115
Project: 194115
Buggy source:
private static int showUsage(){
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  return 1;
}

Fixed version (ground truth):
private static int showUsage(){
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  return 1;
}
Program: 194116
Project: 194116
Buggy source:
public void runListDisks() throws RemoteException {
  final DiskInfo[] disks=mSm.getDisks();
  for (  DiskInfo disk : disks) {
    System.out.println(disk.getId());
  }
}

Fixed version (ground truth):
public void runListDisks() throws RemoteException {
  final boolean onlyAdoptable="String_Node_Str".equals(nextArg());
  final DiskInfo[] disks=mSm.getDisks();
  for (  DiskInfo disk : disks) {
    if (!onlyAdoptable || disk.isAdoptable()) {
      System.out.println(disk.getId());
    }
  }
}
Program: 194117
Project: 194117
Buggy source:
public void run(String[] args) throws Exception {
  if (args.length < 1) {
    throw new IllegalArgumentException();
  }
  mSm=IMountService.Stub.asInterface(ServiceManager.getService("String_Node_Str"));
  if (mSm == null) {
    throw new RemoteException("String_Node_Str");
  }
  mArgs=args;
  String op=args[0];
  mNextArg=1;
  if ("String_Node_Str".equals(op)) {
    runListDisks();
  }
 else   if ("String_Node_Str".equals(op)) {
    runListVolumes();
  }
 else   if ("String_Node_Str".equals(op)) {
    runHasAdoptable();
  }
 else   if ("String_Node_Str".equals(op)) {
    runGetPrimaryStorageUuid();
  }
 else   if ("String_Node_Str".equals(op)) {
    runSetForceAdoptable();
  }
 else   if ("String_Node_Str".equals(op)) {
    runPartition();
  }
 else   if ("String_Node_Str".equals(op)) {
    runMount();
  }
 else   if ("String_Node_Str".equals(op)) {
    runUnmount();
  }
 else   if ("String_Node_Str".equals(op)) {
    runFormat();
  }
 else   if ("String_Node_Str".equals(op)) {
    runForget();
  }
 else {
    throw new IllegalArgumentException();
  }
}

Fixed version (ground truth):
public void run(String[] args) throws Exception {
  if (args.length < 1) {
    throw new IllegalArgumentException();
  }
  mSm=IMountService.Stub.asInterface(ServiceManager.getService("String_Node_Str"));
  if (mSm == null) {
    throw new RemoteException("String_Node_Str");
  }
  mArgs=args;
  String op=args[0];
  mNextArg=1;
  if ("String_Node_Str".equals(op)) {
    runListDisks();
  }
 else   if ("String_Node_Str".equals(op)) {
    runListVolumes();
  }
 else   if ("String_Node_Str".equals(op)) {
    runHasAdoptable();
  }
 else   if ("String_Node_Str".equals(op)) {
    runGetPrimaryStorageUuid();
  }
 else   if ("String_Node_Str".equals(op)) {
    runSetForceAdoptable();
  }
 else   if ("String_Node_Str".equals(op)) {
    runPartition();
  }
 else   if ("String_Node_Str".equals(op)) {
    runMount();
  }
 else   if ("String_Node_Str".equals(op)) {
    runUnmount();
  }
 else   if ("String_Node_Str".equals(op)) {
    runFormat();
  }
 else   if ("String_Node_Str".equals(op)) {
    runBenchmark();
  }
 else   if ("String_Node_Str".equals(op)) {
    runForget();
  }
 else {
    throw new IllegalArgumentException();
  }
}
Program: 194121
Project: 194121
Buggy source:
/** 
 * Returns the first activity (starting from the top of the stack) that is the same as the given activity.  Returns null if no such activity is found.
 */
ActivityRecord findActivityLocked(Intent intent,ActivityInfo info){
  ComponentName cls=intent.getComponent();
  if (info.targetActivity != null) {
    cls=new ComponentName(info.packageName,info.targetActivity);
  }
  final int userId=UserHandle.getUserId(info.applicationInfo.uid);
  for (int taskNdx=mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
    final TaskRecord task=mTaskHistory.get(taskNdx);
    final boolean notCurrentUserTask=!mStackSupervisor.isCurrentProfileLocked(task.userId);
    final ArrayList<ActivityRecord> activities=task.mActivities;
    for (int activityNdx=activities.size() - 1; activityNdx >= 0; --activityNdx) {
      ActivityRecord r=activities.get(activityNdx);
      if (notCurrentUserTask && (r.info.flags & FLAG_SHOW_FOR_ALL_USERS) == 0) {
        return null;
      }
      if (!r.finishing && r.intent.getComponent().equals(cls) && r.userId == userId) {
        return r;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns the first activity (starting from the top of the stack) that is the same as the given activity.  Returns null if no such activity is found.
 */
ActivityRecord findActivityLocked(Intent intent,ActivityInfo info){
  ComponentName cls=intent.getComponent();
  if (info.targetActivity != null) {
    cls=new ComponentName(info.packageName,info.targetActivity);
  }
  final int userId=UserHandle.getUserId(info.applicationInfo.uid);
  for (int taskNdx=mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
    final TaskRecord task=mTaskHistory.get(taskNdx);
    final boolean notCurrentUserTask=!mStackSupervisor.isCurrentProfileLocked(task.userId);
    final ArrayList<ActivityRecord> activities=task.mActivities;
    for (int activityNdx=activities.size() - 1; activityNdx >= 0; --activityNdx) {
      ActivityRecord r=activities.get(activityNdx);
      if (notCurrentUserTask && (r.info.flags & FLAG_SHOW_FOR_ALL_USERS) == 0) {
        continue;
      }
      if (!r.finishing && r.intent.getComponent().equals(cls) && r.userId == userId) {
        return r;
      }
    }
  }
  return null;
}
Program: 194122
Project: 194122
Buggy source:
/** 
 * Returns the first activity (starting from the top of the stack) that is the same as the given activity.  Returns null if no such activity is found.
 */
ActivityRecord findActivityLocked(Intent intent,ActivityInfo info){
  ComponentName cls=intent.getComponent();
  if (info.targetActivity != null) {
    cls=new ComponentName(info.packageName,info.targetActivity);
  }
  final int userId=UserHandle.getUserId(info.applicationInfo.uid);
  for (int taskNdx=mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
    final TaskRecord task=mTaskHistory.get(taskNdx);
    final boolean notCurrentUserTask=!mStackSupervisor.isCurrentProfileLocked(task.userId);
    final ArrayList<ActivityRecord> activities=task.mActivities;
    for (int activityNdx=activities.size() - 1; activityNdx >= 0; --activityNdx) {
      ActivityRecord r=activities.get(activityNdx);
      if (notCurrentUserTask && (r.info.flags & FLAG_SHOW_FOR_ALL_USERS) == 0) {
        return null;
      }
      if (!r.finishing && r.intent.getComponent().equals(cls) && r.userId == userId) {
        return r;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns the first activity (starting from the top of the stack) that is the same as the given activity.  Returns null if no such activity is found.
 */
ActivityRecord findActivityLocked(Intent intent,ActivityInfo info){
  ComponentName cls=intent.getComponent();
  if (info.targetActivity != null) {
    cls=new ComponentName(info.packageName,info.targetActivity);
  }
  final int userId=UserHandle.getUserId(info.applicationInfo.uid);
  for (int taskNdx=mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
    final TaskRecord task=mTaskHistory.get(taskNdx);
    final boolean notCurrentUserTask=!mStackSupervisor.isCurrentProfileLocked(task.userId);
    final ArrayList<ActivityRecord> activities=task.mActivities;
    for (int activityNdx=activities.size() - 1; activityNdx >= 0; --activityNdx) {
      ActivityRecord r=activities.get(activityNdx);
      if (notCurrentUserTask && (r.info.flags & FLAG_SHOW_FOR_ALL_USERS) == 0) {
        continue;
      }
      if (!r.finishing && r.intent.getComponent().equals(cls) && r.userId == userId) {
        return r;
      }
    }
  }
  return null;
}
Program: 194141
Project: 194141
Buggy source:
/** 
 * Shows the next security screen if there is one.
 * @param authenticated true if the user entered the correct authentication
 * @return true if keyguard is done
 */
boolean showNextSecurityScreenOrFinish(boolean authenticated){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + authenticated + "String_Node_Str");
  boolean finish=false;
  if (mUpdateMonitor.getUserHasTrust(KeyguardUpdateMonitor.getCurrentUser())) {
    finish=true;
  }
 else   if (SecurityMode.None == mCurrentSecuritySelection) {
    SecurityMode securityMode=mSecurityModel.getSecurityMode();
    if (SecurityMode.None == securityMode) {
      finish=true;
    }
 else {
      showSecurityScreen(securityMode);
    }
  }
 else   if (authenticated) {
switch (mCurrentSecuritySelection) {
case Pattern:
case Password:
case PIN:
      finish=true;
    break;
case SimPin:
case SimPuk:
  SecurityMode securityMode=mSecurityModel.getSecurityMode();
if (securityMode != SecurityMode.None || !mLockPatternUtils.isLockScreenDisabled(KeyguardUpdateMonitor.getCurrentUser())) {
  showSecurityScreen(securityMode);
}
 else {
  finish=true;
}
break;
default :
Log.v(TAG,"String_Node_Str" + mCurrentSecuritySelection + "String_Node_Str");
showPrimarySecurityScreen(false);
break;
}
}
if (finish) {
mSecurityCallback.finish();
}
return finish;
}

Fixed version (ground truth):
/** 
 * Shows the next security screen if there is one.
 * @param authenticated true if the user entered the correct authentication
 * @return true if keyguard is done
 */
boolean showNextSecurityScreenOrFinish(boolean authenticated){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + authenticated + "String_Node_Str");
  boolean finish=false;
  if (mUpdateMonitor.getUserCanSkipBouncer(KeyguardUpdateMonitor.getCurrentUser())) {
    finish=true;
  }
 else   if (SecurityMode.None == mCurrentSecuritySelection) {
    SecurityMode securityMode=mSecurityModel.getSecurityMode();
    if (SecurityMode.None == securityMode) {
      finish=true;
    }
 else {
      showSecurityScreen(securityMode);
    }
  }
 else   if (authenticated) {
switch (mCurrentSecuritySelection) {
case Pattern:
case Password:
case PIN:
      finish=true;
    break;
case SimPin:
case SimPuk:
  SecurityMode securityMode=mSecurityModel.getSecurityMode();
if (securityMode != SecurityMode.None || !mLockPatternUtils.isLockScreenDisabled(KeyguardUpdateMonitor.getCurrentUser())) {
  showSecurityScreen(securityMode);
}
 else {
  finish=true;
}
break;
default :
Log.v(TAG,"String_Node_Str" + mCurrentSecuritySelection + "String_Node_Str");
showPrimarySecurityScreen(false);
break;
}
}
if (finish) {
mSecurityCallback.finish();
}
return finish;
}
Program: 194142
Project: 194142
Buggy source:
public boolean getUserHasTrust(int userId){
  return !isTrustDisabled(userId) && mUserHasTrust.get(userId) || mUserFingerprintAuthenticated.get(userId);
}

Fixed version (ground truth):
public boolean getUserHasTrust(int userId){
  return !isTrustDisabled(userId) && mUserHasTrust.get(userId);
}
Program: 194143
Project: 194143
Buggy source:
@Override protected void handleUpdateState(BooleanState state,Object arg){
  state.visible=!(mKeyguard.isSecure() && mKeyguard.isShowing() && !mKeyguard.isTrusted());
  state.label=mContext.getString(R.string.quick_settings_cast_title);
  state.value=false;
  state.autoMirrorDrawable=false;
  final Set<CastDevice> devices=mController.getCastDevices();
  boolean connecting=false;
  for (  CastDevice device : devices) {
    if (device.state == CastDevice.STATE_CONNECTED) {
      state.value=true;
      state.label=getDeviceName(device);
    }
 else     if (device.state == CastDevice.STATE_CONNECTING) {
      connecting=true;
    }
  }
  if (!state.value && connecting) {
    state.label=mContext.getString(R.string.quick_settings_connecting);
  }
  state.icon=ResourceIcon.get(state.value ? R.drawable.ic_qs_cast_on : R.drawable.ic_qs_cast_off);
  mDetailAdapter.updateItems(devices);
}

Fixed version (ground truth):
@Override protected void handleUpdateState(BooleanState state,Object arg){
  state.visible=!mKeyguard.isSecure() || !mKeyguard.isShowing() || mKeyguard.canSkipBouncer();
  state.label=mContext.getString(R.string.quick_settings_cast_title);
  state.value=false;
  state.autoMirrorDrawable=false;
  final Set<CastDevice> devices=mController.getCastDevices();
  boolean connecting=false;
  for (  CastDevice device : devices) {
    if (device.state == CastDevice.STATE_CONNECTED) {
      state.value=true;
      state.label=getDeviceName(device);
    }
 else     if (device.state == CastDevice.STATE_CONNECTING) {
      connecting=true;
    }
  }
  if (!state.value && connecting) {
    state.label=mContext.getString(R.string.quick_settings_connecting);
  }
  state.icon=ResourceIcon.get(state.value ? R.drawable.ic_qs_cast_on : R.drawable.ic_qs_cast_off);
  mDetailAdapter.updateItems(devices);
}
Program: 194144
Project: 194144
Buggy source:
private Intent getCameraIntent(){
  KeyguardUpdateMonitor updateMonitor=KeyguardUpdateMonitor.getInstance(mContext);
  boolean currentUserHasTrust=updateMonitor.getUserHasTrust(KeyguardUpdateMonitor.getCurrentUser());
  boolean secure=mLockPatternUtils.isSecure(KeyguardUpdateMonitor.getCurrentUser());
  return (secure && !currentUserHasTrust) ? SECURE_CAMERA_INTENT : INSECURE_CAMERA_INTENT;
}

Fixed version (ground truth):
private Intent getCameraIntent(){
  KeyguardUpdateMonitor updateMonitor=KeyguardUpdateMonitor.getInstance(mContext);
  boolean canSkipBouncer=updateMonitor.getUserCanSkipBouncer(KeyguardUpdateMonitor.getCurrentUser());
  boolean secure=mLockPatternUtils.isSecure(KeyguardUpdateMonitor.getCurrentUser());
  return (secure && !canSkipBouncer) ? SECURE_CAMERA_INTENT : INSECURE_CAMERA_INTENT;
}
Program: 194145
Project: 194145
Buggy source:
private int getAnimationResForTransition(int oldState,int newState,boolean oldScreenOn,boolean screenOn){
  if (oldState == STATE_FINGERPRINT && newState == STATE_FINGERPRINT_ERROR) {
    return R.drawable.lockscreen_fingerprint_fp_to_error_state_animation;
  }
 else   if (oldState == STATE_FINGERPRINT_ERROR && newState == STATE_FINGERPRINT) {
    return R.drawable.lockscreen_fingerprint_error_state_to_fp_animation;
  }
 else   if (oldState == STATE_FINGERPRINT && newState == STATE_LOCK_OPEN && !mUnlockMethodCache.isCurrentlyInsecure()) {
    return R.drawable.lockscreen_fingerprint_draw_off_animation;
  }
 else   if (newState == STATE_FINGERPRINT && !oldScreenOn && screenOn) {
    return R.drawable.lockscreen_fingerprint_draw_on_animation;
  }
 else {
    return -1;
  }
}

Fixed version (ground truth):
private int getAnimationResForTransition(int oldState,int newState,boolean oldScreenOn,boolean screenOn){
  if (oldState == STATE_FINGERPRINT && newState == STATE_FINGERPRINT_ERROR) {
    return R.drawable.lockscreen_fingerprint_fp_to_error_state_animation;
  }
 else   if (oldState == STATE_FINGERPRINT_ERROR && newState == STATE_FINGERPRINT) {
    return R.drawable.lockscreen_fingerprint_error_state_to_fp_animation;
  }
 else   if (oldState == STATE_FINGERPRINT && newState == STATE_LOCK_OPEN && !mUnlockMethodCache.isTrusted()) {
    return R.drawable.lockscreen_fingerprint_draw_off_animation;
  }
 else   if (newState == STATE_FINGERPRINT && !oldScreenOn && screenOn) {
    return R.drawable.lockscreen_fingerprint_draw_on_animation;
  }
 else {
    return -1;
  }
}
Program: 194146
Project: 194146
Buggy source:
private int getState(){
  boolean fingerprintRunning=KeyguardUpdateMonitor.getInstance(mContext).isFingerprintDetectionRunning();
  if (mUnlockMethodCache.isCurrentlyInsecure()) {
    return STATE_LOCK_OPEN;
  }
 else   if (mTransientFpError) {
    return STATE_FINGERPRINT_ERROR;
  }
 else   if (fingerprintRunning) {
    return STATE_FINGERPRINT;
  }
 else   if (mUnlockMethodCache.isFaceUnlockRunning()) {
    return STATE_FACE_UNLOCK;
  }
 else {
    return STATE_LOCKED;
  }
}

Fixed version (ground truth):
private int getState(){
  boolean fingerprintRunning=KeyguardUpdateMonitor.getInstance(mContext).isFingerprintDetectionRunning();
  if (mUnlockMethodCache.canSkipBouncer()) {
    return STATE_LOCK_OPEN;
  }
 else   if (mTransientFpError) {
    return STATE_FINGERPRINT_ERROR;
  }
 else   if (fingerprintRunning) {
    return STATE_FINGERPRINT;
  }
 else   if (mUnlockMethodCache.isFaceUnlockRunning()) {
    return STATE_FACE_UNLOCK;
  }
 else {
    return STATE_LOCKED;
  }
}
Program: 194147
Project: 194147
Buggy source:
public void onTrackingStopped(boolean expand){
  if (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED) {
    if (!expand && !mUnlockMethodCache.isCurrentlyInsecure()) {
      showBouncer();
    }
  }
}

Fixed version (ground truth):
public void onTrackingStopped(boolean expand){
  if (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED) {
    if (!expand && !mUnlockMethodCache.canSkipBouncer()) {
      showBouncer();
    }
  }
}
Program: 194148
Project: 194148
Buggy source:
private void logStateToEventlog(){
  boolean isShowing=mStatusBarKeyguardViewManager.isShowing();
  boolean isOccluded=mStatusBarKeyguardViewManager.isOccluded();
  boolean isBouncerShowing=mStatusBarKeyguardViewManager.isBouncerShowing();
  boolean isSecure=mUnlockMethodCache.isMethodSecure();
  boolean isCurrentlyInsecure=mUnlockMethodCache.isCurrentlyInsecure();
  int stateFingerprint=getLoggingFingerprint(mState,isShowing,isOccluded,isBouncerShowing,isSecure,isCurrentlyInsecure);
  if (stateFingerprint != mLastLoggedStateFingerprint) {
    EventLogTags.writeSysuiStatusBarState(mState,isShowing ? 1 : 0,isOccluded ? 1 : 0,isBouncerShowing ? 1 : 0,isSecure ? 1 : 0,isCurrentlyInsecure ? 1 : 0);
    mLastLoggedStateFingerprint=stateFingerprint;
  }
}

Fixed version (ground truth):
private void logStateToEventlog(){
  boolean isShowing=mStatusBarKeyguardViewManager.isShowing();
  boolean isOccluded=mStatusBarKeyguardViewManager.isOccluded();
  boolean isBouncerShowing=mStatusBarKeyguardViewManager.isBouncerShowing();
  boolean isSecure=mUnlockMethodCache.isMethodSecure();
  boolean canSkipBouncer=mUnlockMethodCache.canSkipBouncer();
  int stateFingerprint=getLoggingFingerprint(mState,isShowing,isOccluded,isBouncerShowing,isSecure,canSkipBouncer);
  if (stateFingerprint != mLastLoggedStateFingerprint) {
    EventLogTags.writeSysuiStatusBarState(mState,isShowing ? 1 : 0,isOccluded ? 1 : 0,isBouncerShowing ? 1 : 0,isSecure ? 1 : 0,canSkipBouncer ? 1 : 0);
    mLastLoggedStateFingerprint=stateFingerprint;
  }
}
Program: 194149
Project: 194149
Buggy source:
public boolean isKeyguardCurrentlySecure(){
  return !mUnlockMethodCache.isCurrentlyInsecure();
}

Fixed version (ground truth):
public boolean isKeyguardCurrentlySecure(){
  return !mUnlockMethodCache.canSkipBouncer();
}
Program: 194150
Project: 194150
Buggy source:
public void onTrackingStarted(){
  mExpanding=true;
  mDarkenWhileDragging=!mUnlockMethodCache.isCurrentlyInsecure();
}

Fixed version (ground truth):
public void onTrackingStarted(){
  mExpanding=true;
  mDarkenWhileDragging=!mUnlockMethodCache.canSkipBouncer();
}
Program: 194151
Project: 194151
Buggy source:
private void update(boolean updateAlways){
  int user=KeyguardUpdateMonitor.getCurrentUser();
  boolean secure=mLockPatternUtils.isSecure(user);
  boolean currentlyInsecure=!secure || mKeyguardUpdateMonitor.getUserHasTrust(user);
  boolean trustManaged=mKeyguardUpdateMonitor.getUserTrustIsManaged(user);
  boolean faceUnlockRunning=mKeyguardUpdateMonitor.isFaceUnlockRunning(user) && trustManaged;
  boolean changed=secure != mSecure || currentlyInsecure != mCurrentlyInsecure || trustManaged != mTrustManaged || faceUnlockRunning != mFaceUnlockRunning;
  if (changed || updateAlways) {
    mSecure=secure;
    mCurrentlyInsecure=currentlyInsecure;
    mTrustManaged=trustManaged;
    mFaceUnlockRunning=faceUnlockRunning;
    notifyListeners();
  }
}

Fixed version (ground truth):
private void update(boolean updateAlways){
  int user=KeyguardUpdateMonitor.getCurrentUser();
  boolean secure=mLockPatternUtils.isSecure(user);
  boolean canSkipBouncer=!secure || mKeyguardUpdateMonitor.getUserCanSkipBouncer(user);
  boolean trustManaged=mKeyguardUpdateMonitor.getUserTrustIsManaged(user);
  boolean trusted=mKeyguardUpdateMonitor.getUserHasTrust(user);
  boolean faceUnlockRunning=mKeyguardUpdateMonitor.isFaceUnlockRunning(user) && trustManaged;
  boolean changed=secure != mSecure || canSkipBouncer != mCanSkipBouncer || trustManaged != mTrustManaged || faceUnlockRunning != mFaceUnlockRunning;
  if (changed || updateAlways) {
    mSecure=secure;
    mCanSkipBouncer=canSkipBouncer;
    mTrusted=trusted;
    mTrustManaged=trustManaged;
    mFaceUnlockRunning=faceUnlockRunning;
    notifyListeners();
  }
}
Program: 194152
Project: 194152
Buggy source:
public KeyguardMonitor(Context context){
  mContext=context;
  mKeyguardUpdateMonitor=KeyguardUpdateMonitor.getInstance(mContext);
  mUserTracker=new CurrentUserTracker(mContext){
    @Override public void onUserSwitched(    int newUserId){
      mCurrentUser=newUserId;
      updateTrustedState();
    }
  }
;
}

Fixed version (ground truth):
public KeyguardMonitor(Context context){
  mContext=context;
  mKeyguardUpdateMonitor=KeyguardUpdateMonitor.getInstance(mContext);
  mUserTracker=new CurrentUserTracker(mContext){
    @Override public void onUserSwitched(    int newUserId){
      mCurrentUser=newUserId;
      updateCanSkipBouncerState();
    }
  }
;
}
Program: 194153
Project: 194153
Buggy source:
@Override public void onTrustChanged(int userId){
  updateTrustedState();
  notifyKeyguardChanged();
}

Fixed version (ground truth):
@Override public void onTrustChanged(int userId){
  updateCanSkipBouncerState();
  notifyKeyguardChanged();
}
Program: 194154
Project: 194154
Buggy source:
@Override public void onUserSwitched(int newUserId){
  mCurrentUser=newUserId;
  updateTrustedState();
}

Fixed version (ground truth):
@Override public void onUserSwitched(int newUserId){
  mCurrentUser=newUserId;
  updateCanSkipBouncerState();
}
Program: 194155
Project: 194155
Buggy source:
public void addCallback(Callback callback){
  mCallbacks.add(callback);
  if (mCallbacks.size() != 0 && !mListening) {
    mListening=true;
    mCurrentUser=ActivityManager.getCurrentUser();
    updateTrustedState();
    mKeyguardUpdateMonitor.registerCallback(this);
    mUserTracker.startTracking();
  }
}

Fixed version (ground truth):
public void addCallback(Callback callback){
  mCallbacks.add(callback);
  if (mCallbacks.size() != 0 && !mListening) {
    mListening=true;
    mCurrentUser=ActivityManager.getCurrentUser();
    updateCanSkipBouncerState();
    mKeyguardUpdateMonitor.registerCallback(this);
    mUserTracker.startTracking();
  }
}
Program: 194156
Project: 194156
Buggy source:
@Override public int getCount(){
  boolean secureKeyguardShowing=mController.mKeyguardMonitor.isShowing() && mController.mKeyguardMonitor.isSecure() && !mController.mKeyguardMonitor.isTrusted();
  if (!secureKeyguardShowing) {
    return mController.mUsers.size();
  }
  final int N=mController.mUsers.size();
  int count=0;
  for (int i=0; i < N; i++) {
    if (mController.mUsers.get(i).isRestricted) {
      break;
    }
 else {
      count++;
    }
  }
  return count;
}

Fixed version (ground truth):
@Override public int getCount(){
  boolean secureKeyguardShowing=mController.mKeyguardMonitor.isShowing() && mController.mKeyguardMonitor.isSecure() && !mController.mKeyguardMonitor.canSkipBouncer();
  if (!secureKeyguardShowing) {
    return mController.mUsers.size();
  }
  final int N=mController.mUsers.size();
  int count=0;
  for (int i=0; i < N; i++) {
    if (mController.mUsers.get(i).isRestricted) {
      break;
    }
 else {
      count++;
    }
  }
  return count;
}
Program: 194157
Project: 194157
Buggy source:
private RemoteViews generateActionButton(Action action){
  final boolean tombstone=(action.actionIntent == null);
  RemoteViews button=new RemoteViews(mContext.getPackageName(),tombstone ? getActionTombstoneLayoutResource() : getActionLayoutResource());
  button.setTextViewCompoundDrawablesRelative(R.id.action0,action.icon,0,0,0);
  button.setTextViewText(R.id.action0,processLegacyText(action.title));
  if (!tombstone) {
    button.setOnClickPendingIntent(R.id.action0,action.actionIntent);
  }
  button.setContentDescription(R.id.action0,action.title);
  processLegacyAction(action,button);
  return button;
}

Fixed version (ground truth):
private RemoteViews generateActionButton(Action action){
  final boolean tombstone=(action.actionIntent == null);
  RemoteViews button=new BuilderRemoteViews(mContext.getApplicationInfo(),tombstone ? getActionTombstoneLayoutResource() : getActionLayoutResource());
  button.setTextViewCompoundDrawablesRelative(R.id.action0,action.icon,0,0,0);
  button.setTextViewText(R.id.action0,processLegacyText(action.title));
  if (!tombstone) {
    button.setOnClickPendingIntent(R.id.action0,action.actionIntent);
  }
  button.setContentDescription(R.id.action0,action.title);
  processLegacyAction(action,button);
  return button;
}
Program: 194158
Project: 194158
Buggy source:
private RemoteViews generateMediaActionButton(Action action){
  final boolean tombstone=(action.actionIntent == null);
  RemoteViews button=new RemoteViews(mBuilder.mContext.getPackageName(),R.layout.notification_material_media_action);
  button.setImageViewResource(R.id.action0,action.icon);
  button.setDrawableParameters(R.id.action0,false,-1,0xFFFFFFFF,PorterDuff.Mode.SRC_ATOP,-1);
  if (!tombstone) {
    button.setOnClickPendingIntent(R.id.action0,action.actionIntent);
  }
  button.setContentDescription(R.id.action0,action.title);
  return button;
}

Fixed version (ground truth):
private RemoteViews generateMediaActionButton(Action action){
  final boolean tombstone=(action.actionIntent == null);
  RemoteViews button=new BuilderRemoteViews(mBuilder.mContext.getApplicationInfo(),R.layout.notification_material_media_action);
  button.setImageViewResource(R.id.action0,action.icon);
  button.setDrawableParameters(R.id.action0,false,-1,0xFFFFFFFF,PorterDuff.Mode.SRC_ATOP,-1);
  if (!tombstone) {
    button.setOnClickPendingIntent(R.id.action0,action.actionIntent);
  }
  button.setContentDescription(R.id.action0,action.title);
  return button;
}
Program: 194159
Project: 194159
Buggy source:
private RemoteViews generateActionButton(Action action){
  final boolean tombstone=(action.actionIntent == null);
  RemoteViews button=new RemoteViews(mContext.getPackageName(),tombstone ? getActionTombstoneLayoutResource() : getActionLayoutResource());
  button.setTextViewCompoundDrawablesRelative(R.id.action0,action.icon,0,0,0);
  button.setTextViewText(R.id.action0,processLegacyText(action.title));
  if (!tombstone) {
    button.setOnClickPendingIntent(R.id.action0,action.actionIntent);
  }
  button.setContentDescription(R.id.action0,action.title);
  processLegacyAction(action,button);
  return button;
}

Fixed version (ground truth):
private RemoteViews generateActionButton(Action action){
  final boolean tombstone=(action.actionIntent == null);
  RemoteViews button=new BuilderRemoteViews(mContext.getApplicationInfo(),tombstone ? getActionTombstoneLayoutResource() : getActionLayoutResource());
  button.setTextViewCompoundDrawablesRelative(R.id.action0,action.icon,0,0,0);
  button.setTextViewText(R.id.action0,processLegacyText(action.title));
  if (!tombstone) {
    button.setOnClickPendingIntent(R.id.action0,action.actionIntent);
  }
  button.setContentDescription(R.id.action0,action.title);
  processLegacyAction(action,button);
  return button;
}
Program: 194160
Project: 194160
Buggy source:
private RemoteViews generateMediaActionButton(Action action){
  final boolean tombstone=(action.actionIntent == null);
  RemoteViews button=new RemoteViews(mBuilder.mContext.getPackageName(),R.layout.notification_material_media_action);
  button.setImageViewResource(R.id.action0,action.icon);
  button.setDrawableParameters(R.id.action0,false,-1,0xFFFFFFFF,PorterDuff.Mode.SRC_ATOP,-1);
  if (!tombstone) {
    button.setOnClickPendingIntent(R.id.action0,action.actionIntent);
  }
  button.setContentDescription(R.id.action0,action.title);
  return button;
}

Fixed version (ground truth):
private RemoteViews generateMediaActionButton(Action action){
  final boolean tombstone=(action.actionIntent == null);
  RemoteViews button=new BuilderRemoteViews(mBuilder.mContext.getApplicationInfo(),R.layout.notification_material_media_action);
  button.setImageViewResource(R.id.action0,action.icon);
  button.setDrawableParameters(R.id.action0,false,-1,0xFFFFFFFF,PorterDuff.Mode.SRC_ATOP,-1);
  if (!tombstone) {
    button.setOnClickPendingIntent(R.id.action0,action.actionIntent);
  }
  button.setContentDescription(R.id.action0,action.title);
  return button;
}
Program: 194161
Project: 194161
Buggy source:
private RemoteViews generateActionButton(Action action){
  final boolean tombstone=(action.actionIntent == null);
  RemoteViews button=new RemoteViews(mContext.getPackageName(),tombstone ? getActionTombstoneLayoutResource() : getActionLayoutResource());
  button.setTextViewCompoundDrawablesRelative(R.id.action0,action.icon,0,0,0);
  button.setTextViewText(R.id.action0,processLegacyText(action.title));
  if (!tombstone) {
    button.setOnClickPendingIntent(R.id.action0,action.actionIntent);
  }
  button.setContentDescription(R.id.action0,action.title);
  processLegacyAction(action,button);
  return button;
}

Fixed version (ground truth):
private RemoteViews generateActionButton(Action action){
  final boolean tombstone=(action.actionIntent == null);
  RemoteViews button=new BuilderRemoteViews(mContext.getApplicationInfo(),tombstone ? getActionTombstoneLayoutResource() : getActionLayoutResource());
  button.setTextViewCompoundDrawablesRelative(R.id.action0,action.icon,0,0,0);
  button.setTextViewText(R.id.action0,processLegacyText(action.title));
  if (!tombstone) {
    button.setOnClickPendingIntent(R.id.action0,action.actionIntent);
  }
  button.setContentDescription(R.id.action0,action.title);
  processLegacyAction(action,button);
  return button;
}
Program: 194162
Project: 194162
Buggy source:
private RemoteViews generateMediaActionButton(Action action){
  final boolean tombstone=(action.actionIntent == null);
  RemoteViews button=new RemoteViews(mBuilder.mContext.getPackageName(),R.layout.notification_material_media_action);
  button.setImageViewResource(R.id.action0,action.icon);
  button.setDrawableParameters(R.id.action0,false,-1,0xFFFFFFFF,PorterDuff.Mode.SRC_ATOP,-1);
  if (!tombstone) {
    button.setOnClickPendingIntent(R.id.action0,action.actionIntent);
  }
  button.setContentDescription(R.id.action0,action.title);
  return button;
}

Fixed version (ground truth):
private RemoteViews generateMediaActionButton(Action action){
  final boolean tombstone=(action.actionIntent == null);
  RemoteViews button=new BuilderRemoteViews(mBuilder.mContext.getApplicationInfo(),R.layout.notification_material_media_action);
  button.setImageViewResource(R.id.action0,action.icon);
  button.setDrawableParameters(R.id.action0,false,-1,0xFFFFFFFF,PorterDuff.Mode.SRC_ATOP,-1);
  if (!tombstone) {
    button.setOnClickPendingIntent(R.id.action0,action.actionIntent);
  }
  button.setContentDescription(R.id.action0,action.title);
  return button;
}
Program: 194163
Project: 194163
Buggy source:
/** 
 * Shows the next security screen if there is one.
 * @param authenticated true if the user entered the correct authentication
 * @return true if keyguard is done
 */
boolean showNextSecurityScreenOrFinish(boolean authenticated){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + authenticated + "String_Node_Str");
  boolean finish=false;
  if (mUpdateMonitor.getUserHasTrust(KeyguardUpdateMonitor.getCurrentUser())) {
    finish=true;
  }
 else   if (SecurityMode.None == mCurrentSecuritySelection) {
    SecurityMode securityMode=mSecurityModel.getSecurityMode();
    if (SecurityMode.None == securityMode) {
      finish=true;
    }
 else {
      showSecurityScreen(securityMode);
    }
  }
 else   if (authenticated) {
switch (mCurrentSecuritySelection) {
case Pattern:
case Password:
case PIN:
      finish=true;
    break;
case SimPin:
case SimPuk:
  SecurityMode securityMode=mSecurityModel.getSecurityMode();
if (securityMode != SecurityMode.None || !mLockPatternUtils.isLockScreenDisabled(KeyguardUpdateMonitor.getCurrentUser())) {
  showSecurityScreen(securityMode);
}
 else {
  finish=true;
}
break;
default :
Log.v(TAG,"String_Node_Str" + mCurrentSecuritySelection + "String_Node_Str");
showPrimarySecurityScreen(false);
break;
}
}
if (finish) {
mSecurityCallback.finish();
}
return finish;
}

Fixed version (ground truth):
/** 
 * Shows the next security screen if there is one.
 * @param authenticated true if the user entered the correct authentication
 * @return true if keyguard is done
 */
boolean showNextSecurityScreenOrFinish(boolean authenticated){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + authenticated + "String_Node_Str");
  boolean finish=false;
  if (mUpdateMonitor.getUserCanSkipBouncer(KeyguardUpdateMonitor.getCurrentUser())) {
    finish=true;
  }
 else   if (SecurityMode.None == mCurrentSecuritySelection) {
    SecurityMode securityMode=mSecurityModel.getSecurityMode();
    if (SecurityMode.None == securityMode) {
      finish=true;
    }
 else {
      showSecurityScreen(securityMode);
    }
  }
 else   if (authenticated) {
switch (mCurrentSecuritySelection) {
case Pattern:
case Password:
case PIN:
      finish=true;
    break;
case SimPin:
case SimPuk:
  SecurityMode securityMode=mSecurityModel.getSecurityMode();
if (securityMode != SecurityMode.None || !mLockPatternUtils.isLockScreenDisabled(KeyguardUpdateMonitor.getCurrentUser())) {
  showSecurityScreen(securityMode);
}
 else {
  finish=true;
}
break;
default :
Log.v(TAG,"String_Node_Str" + mCurrentSecuritySelection + "String_Node_Str");
showPrimarySecurityScreen(false);
break;
}
}
if (finish) {
mSecurityCallback.finish();
}
return finish;
}
Program: 194164
Project: 194164
Buggy source:
public boolean getUserHasTrust(int userId){
  return !isTrustDisabled(userId) && mUserHasTrust.get(userId) || mUserFingerprintAuthenticated.get(userId);
}

Fixed version (ground truth):
public boolean getUserHasTrust(int userId){
  return !isTrustDisabled(userId) && mUserHasTrust.get(userId);
}