nus-yam/ex-repair huggingface dataset:
Program: 199855
Project: 199855
Buggy source:
/** 
 * Return estimated power (in mAs) of sending or receiving a packet with the mobile radio.
 */
private double getMobilePowerPerPacket(){
  final long MOBILE_BPS=200000;
  final double MOBILE_POWER=mPowerProfile.getAveragePower(PowerProfile.POWER_RADIO_ACTIVE) / 3600;
  final long mobileRx=mStats.getNetworkActivityPackets(NETWORK_MOBILE_RX_DATA,mStatsType);
  final long mobileTx=mStats.getNetworkActivityPackets(NETWORK_MOBILE_TX_DATA,mStatsType);
  final long mobileData=mobileRx + mobileTx;
  final long radioDataUptimeMs=mStats.getMobileRadioActiveTime(mBatteryRealtime,mStatsType) / 1000;
  final double mobilePps=radioDataUptimeMs != 0 ? mobileData / (double)radioDataUptimeMs : (((double)MOBILE_BPS) / 8 / 2048);
  return (MOBILE_POWER / mobilePps) / (60 * 60);
}

Fixed version (ground truth):
/** 
 * Return estimated power (in mAs) of sending or receiving a packet with the mobile radio.
 */
private double getMobilePowerPerPacket(){
  final long MOBILE_BPS=200000;
  final double MOBILE_POWER=mPowerProfile.getAveragePower(PowerProfile.POWER_RADIO_ACTIVE) / 3600;
  final long mobileRx=mStats.getNetworkActivityPackets(NETWORK_MOBILE_RX_DATA,mStatsType);
  final long mobileTx=mStats.getNetworkActivityPackets(NETWORK_MOBILE_TX_DATA,mStatsType);
  final long mobileData=mobileRx + mobileTx;
  final long radioDataUptimeMs=mStats.getMobileRadioActiveTime(mBatteryRealtime,mStatsType) / 1000;
  final double mobilePps=(mobileData != 0 && radioDataUptimeMs != 0) ? (mobileData / (double)radioDataUptimeMs) : (((double)MOBILE_BPS) / 8 / 2048);
  return (MOBILE_POWER / mobilePps) / (60 * 60);
}
Program: 199858
Project: 199858
Buggy source:
public void readLocked(){
  if (mFile == null) {
    Slog.w("String_Node_Str","String_Node_Str");
    return;
  }
  mUidStats.clear();
  try {
    File file=mFile.chooseForRead();
    if (!file.exists()) {
      return;
    }
    FileInputStream stream=new FileInputStream(file);
    byte[] raw=readFully(stream);
    Parcel in=Parcel.obtain();
    in.unmarshall(raw,0,raw.length);
    in.setDataPosition(0);
    stream.close();
    readSummaryFromParcel(in);
  }
 catch (  java.io.IOException e) {
    Slog.e("String_Node_Str","String_Node_Str",e);
  }
  long now=SystemClock.elapsedRealtime();
  if (USE_OLD_HISTORY) {
    addHistoryRecordLocked(now,HistoryItem.CMD_START);
  }
  addHistoryBufferLocked(now,HistoryItem.CMD_START);
}

Fixed version (ground truth):
public void readLocked(){
  if (mFile == null) {
    Slog.w("String_Node_Str","String_Node_Str");
    return;
  }
  mUidStats.clear();
  try {
    File file=mFile.chooseForRead();
    if (!file.exists()) {
      return;
    }
    FileInputStream stream=new FileInputStream(file);
    byte[] raw=readFully(stream);
    Parcel in=Parcel.obtain();
    in.unmarshall(raw,0,raw.length);
    in.setDataPosition(0);
    stream.close();
    readSummaryFromParcel(in);
  }
 catch (  Exception e) {
    Slog.e("String_Node_Str","String_Node_Str",e);
  }
  long now=SystemClock.elapsedRealtime();
  if (USE_OLD_HISTORY) {
    addHistoryRecordLocked(now,HistoryItem.CMD_START);
  }
  addHistoryBufferLocked(now,HistoryItem.CMD_START);
}
Program: 199860
Project: 199860
Buggy source:
public void readLocked(){
  if (mFile == null) {
    Slog.w("String_Node_Str","String_Node_Str");
    return;
  }
  mUidStats.clear();
  try {
    File file=mFile.chooseForRead();
    if (!file.exists()) {
      return;
    }
    FileInputStream stream=new FileInputStream(file);
    byte[] raw=readFully(stream);
    Parcel in=Parcel.obtain();
    in.unmarshall(raw,0,raw.length);
    in.setDataPosition(0);
    stream.close();
    readSummaryFromParcel(in);
  }
 catch (  java.io.IOException e) {
    Slog.e("String_Node_Str","String_Node_Str",e);
  }
  long now=SystemClock.elapsedRealtime();
  if (USE_OLD_HISTORY) {
    addHistoryRecordLocked(now,HistoryItem.CMD_START);
  }
  addHistoryBufferLocked(now,HistoryItem.CMD_START);
}

Fixed version (ground truth):
public void readLocked(){
  if (mFile == null) {
    Slog.w("String_Node_Str","String_Node_Str");
    return;
  }
  mUidStats.clear();
  try {
    File file=mFile.chooseForRead();
    if (!file.exists()) {
      return;
    }
    FileInputStream stream=new FileInputStream(file);
    byte[] raw=readFully(stream);
    Parcel in=Parcel.obtain();
    in.unmarshall(raw,0,raw.length);
    in.setDataPosition(0);
    stream.close();
    readSummaryFromParcel(in);
  }
 catch (  Exception e) {
    Slog.e("String_Node_Str","String_Node_Str",e);
  }
  long now=SystemClock.elapsedRealtime();
  if (USE_OLD_HISTORY) {
    addHistoryRecordLocked(now,HistoryItem.CMD_START);
  }
  addHistoryBufferLocked(now,HistoryItem.CMD_START);
}
Program: 199862
Project: 199862
Buggy source:
public void readLocked(){
  if (mFile == null) {
    Slog.w("String_Node_Str","String_Node_Str");
    return;
  }
  mUidStats.clear();
  try {
    File file=mFile.chooseForRead();
    if (!file.exists()) {
      return;
    }
    FileInputStream stream=new FileInputStream(file);
    byte[] raw=readFully(stream);
    Parcel in=Parcel.obtain();
    in.unmarshall(raw,0,raw.length);
    in.setDataPosition(0);
    stream.close();
    readSummaryFromParcel(in);
  }
 catch (  java.io.IOException e) {
    Slog.e("String_Node_Str","String_Node_Str",e);
  }
  long now=SystemClock.elapsedRealtime();
  if (USE_OLD_HISTORY) {
    addHistoryRecordLocked(now,HistoryItem.CMD_START);
  }
  addHistoryBufferLocked(now,HistoryItem.CMD_START);
}

Fixed version (ground truth):
public void readLocked(){
  if (mFile == null) {
    Slog.w("String_Node_Str","String_Node_Str");
    return;
  }
  mUidStats.clear();
  try {
    File file=mFile.chooseForRead();
    if (!file.exists()) {
      return;
    }
    FileInputStream stream=new FileInputStream(file);
    byte[] raw=readFully(stream);
    Parcel in=Parcel.obtain();
    in.unmarshall(raw,0,raw.length);
    in.setDataPosition(0);
    stream.close();
    readSummaryFromParcel(in);
  }
 catch (  Exception e) {
    Slog.e("String_Node_Str","String_Node_Str",e);
  }
  long now=SystemClock.elapsedRealtime();
  if (USE_OLD_HISTORY) {
    addHistoryRecordLocked(now,HistoryItem.CMD_START);
  }
  addHistoryBufferLocked(now,HistoryItem.CMD_START);
}
Program: 199864
Project: 199864
Buggy source:
public void readLocked(){
  if (mFile == null) {
    Slog.w("String_Node_Str","String_Node_Str");
    return;
  }
  mUidStats.clear();
  try {
    File file=mFile.chooseForRead();
    if (!file.exists()) {
      return;
    }
    FileInputStream stream=new FileInputStream(file);
    byte[] raw=readFully(stream);
    Parcel in=Parcel.obtain();
    in.unmarshall(raw,0,raw.length);
    in.setDataPosition(0);
    stream.close();
    readSummaryFromParcel(in);
  }
 catch (  java.io.IOException e) {
    Slog.e("String_Node_Str","String_Node_Str",e);
  }
  long now=SystemClock.elapsedRealtime();
  if (USE_OLD_HISTORY) {
    addHistoryRecordLocked(now,HistoryItem.CMD_START);
  }
  addHistoryBufferLocked(now,HistoryItem.CMD_START);
}

Fixed version (ground truth):
public void readLocked(){
  if (mFile == null) {
    Slog.w("String_Node_Str","String_Node_Str");
    return;
  }
  mUidStats.clear();
  try {
    File file=mFile.chooseForRead();
    if (!file.exists()) {
      return;
    }
    FileInputStream stream=new FileInputStream(file);
    byte[] raw=readFully(stream);
    Parcel in=Parcel.obtain();
    in.unmarshall(raw,0,raw.length);
    in.setDataPosition(0);
    stream.close();
    readSummaryFromParcel(in);
  }
 catch (  Exception e) {
    Slog.e("String_Node_Str","String_Node_Str",e);
  }
  long now=SystemClock.elapsedRealtime();
  if (USE_OLD_HISTORY) {
    addHistoryRecordLocked(now,HistoryItem.CMD_START);
  }
  addHistoryBufferLocked(now,HistoryItem.CMD_START);
}
Program: 199865
Project: 199865
Buggy source:
public boolean isInUse(){
  return mOwner != null;
}

Fixed version (ground truth):
public boolean isInUse(){
  return mOwner != null || mRestarting;
}
Program: 199866
Project: 199866
Buggy source:
public boolean isInUse(){
  return mOwner != null;
}

Fixed version (ground truth):
public boolean isInUse(){
  return mOwner != null || mRestarting;
}
Program: 199867
Project: 199867
Buggy source:
public boolean isInUse(){
  return mOwner != null;
}

Fixed version (ground truth):
public boolean isInUse(){
  return mOwner != null || mRestarting;
}
Program: 199868
Project: 199868
Buggy source:
static public AllocationAdapter create2D(RenderScript rs,Allocation a){
  android.util.Log.e("String_Node_Str","String_Node_Str" + a);
  rs.validate();
  AllocationAdapter aa=new AllocationAdapter(0,rs,a);
  aa.mConstrainedLOD=true;
  aa.mConstrainedFace=true;
  aa.mConstrainedY=false;
  aa.mConstrainedZ=true;
  aa.initLOD(0);
  return aa;
}

Fixed version (ground truth):
static public AllocationAdapter create2D(RenderScript rs,Allocation a){
  rs.validate();
  AllocationAdapter aa=new AllocationAdapter(0,rs,a);
  aa.mConstrainedLOD=true;
  aa.mConstrainedFace=true;
  aa.mConstrainedY=false;
  aa.mConstrainedZ=true;
  aa.initLOD(0);
  return aa;
}
Program: 199869
Project: 199869
Buggy source:
private void helpDestroy(){
  boolean shouldDestroy=false;
synchronized (this) {
    if (!mDestroyed) {
      shouldDestroy=true;
      mDestroyed=true;
    }
  }
  if (shouldDestroy) {
    ReentrantReadWriteLock.ReadLock rlock=mRS.mRWLock.readLock();
    rlock.lock();
    if (mRS.isAlive()) {
      mRS.nObjDestroy(mID);
    }
    rlock.unlock();
    mRS=null;
    mID=0;
  }
}

Fixed version (ground truth):
private void helpDestroy(){
  boolean shouldDestroy=false;
synchronized (this) {
    if (!mDestroyed) {
      shouldDestroy=true;
      mDestroyed=true;
    }
  }
  if (shouldDestroy) {
    ReentrantReadWriteLock.ReadLock rlock=mRS.mRWLock.readLock();
    rlock.lock();
    if (mRS.isAlive() && mID != 0) {
      mRS.nObjDestroy(mID);
    }
    rlock.unlock();
    mRS=null;
    mID=0;
  }
}
Program: 199870
Project: 199870
Buggy source:
static public AllocationAdapter create2D(RenderScript rs,Allocation a){
  android.util.Log.e("String_Node_Str","String_Node_Str" + a);
  rs.validate();
  AllocationAdapter aa=new AllocationAdapter(0,rs,a);
  aa.mConstrainedLOD=true;
  aa.mConstrainedFace=true;
  aa.mConstrainedY=false;
  aa.mConstrainedZ=true;
  aa.initLOD(0);
  return aa;
}

Fixed version (ground truth):
static public AllocationAdapter create2D(RenderScript rs,Allocation a){
  rs.validate();
  AllocationAdapter aa=new AllocationAdapter(0,rs,a);
  aa.mConstrainedLOD=true;
  aa.mConstrainedFace=true;
  aa.mConstrainedY=false;
  aa.mConstrainedZ=true;
  aa.initLOD(0);
  return aa;
}
Program: 199871
Project: 199871
Buggy source:
private void helpDestroy(){
  boolean shouldDestroy=false;
synchronized (this) {
    if (!mDestroyed) {
      shouldDestroy=true;
      mDestroyed=true;
    }
  }
  if (shouldDestroy) {
    ReentrantReadWriteLock.ReadLock rlock=mRS.mRWLock.readLock();
    rlock.lock();
    if (mRS.isAlive()) {
      mRS.nObjDestroy(mID);
    }
    rlock.unlock();
    mRS=null;
    mID=0;
  }
}

Fixed version (ground truth):
private void helpDestroy(){
  boolean shouldDestroy=false;
synchronized (this) {
    if (!mDestroyed) {
      shouldDestroy=true;
      mDestroyed=true;
    }
  }
  if (shouldDestroy) {
    ReentrantReadWriteLock.ReadLock rlock=mRS.mRWLock.readLock();
    rlock.lock();
    if (mRS.isAlive() && mID != 0) {
      mRS.nObjDestroy(mID);
    }
    rlock.unlock();
    mRS=null;
    mID=0;
  }
}
Program: 199872
Project: 199872
Buggy source:
static public AllocationAdapter create2D(RenderScript rs,Allocation a){
  android.util.Log.e("String_Node_Str","String_Node_Str" + a);
  rs.validate();
  AllocationAdapter aa=new AllocationAdapter(0,rs,a);
  aa.mConstrainedLOD=true;
  aa.mConstrainedFace=true;
  aa.mConstrainedY=false;
  aa.mConstrainedZ=true;
  aa.initLOD(0);
  return aa;
}

Fixed version (ground truth):
static public AllocationAdapter create2D(RenderScript rs,Allocation a){
  rs.validate();
  AllocationAdapter aa=new AllocationAdapter(0,rs,a);
  aa.mConstrainedLOD=true;
  aa.mConstrainedFace=true;
  aa.mConstrainedY=false;
  aa.mConstrainedZ=true;
  aa.initLOD(0);
  return aa;
}
Program: 199873
Project: 199873
Buggy source:
private void helpDestroy(){
  boolean shouldDestroy=false;
synchronized (this) {
    if (!mDestroyed) {
      shouldDestroy=true;
      mDestroyed=true;
    }
  }
  if (shouldDestroy) {
    ReentrantReadWriteLock.ReadLock rlock=mRS.mRWLock.readLock();
    rlock.lock();
    if (mRS.isAlive()) {
      mRS.nObjDestroy(mID);
    }
    rlock.unlock();
    mRS=null;
    mID=0;
  }
}

Fixed version (ground truth):
private void helpDestroy(){
  boolean shouldDestroy=false;
synchronized (this) {
    if (!mDestroyed) {
      shouldDestroy=true;
      mDestroyed=true;
    }
  }
  if (shouldDestroy) {
    ReentrantReadWriteLock.ReadLock rlock=mRS.mRWLock.readLock();
    rlock.lock();
    if (mRS.isAlive() && mID != 0) {
      mRS.nObjDestroy(mID);
    }
    rlock.unlock();
    mRS=null;
    mID=0;
  }
}
Program: 199874
Project: 199874
Buggy source:
static public AllocationAdapter create2D(RenderScript rs,Allocation a){
  android.util.Log.e("String_Node_Str","String_Node_Str" + a);
  rs.validate();
  AllocationAdapter aa=new AllocationAdapter(0,rs,a);
  aa.mConstrainedLOD=true;
  aa.mConstrainedFace=true;
  aa.mConstrainedY=false;
  aa.mConstrainedZ=true;
  aa.initLOD(0);
  return aa;
}

Fixed version (ground truth):
static public AllocationAdapter create2D(RenderScript rs,Allocation a){
  rs.validate();
  AllocationAdapter aa=new AllocationAdapter(0,rs,a);
  aa.mConstrainedLOD=true;
  aa.mConstrainedFace=true;
  aa.mConstrainedY=false;
  aa.mConstrainedZ=true;
  aa.initLOD(0);
  return aa;
}
Program: 199875
Project: 199875
Buggy source:
private void helpDestroy(){
  boolean shouldDestroy=false;
synchronized (this) {
    if (!mDestroyed) {
      shouldDestroy=true;
      mDestroyed=true;
    }
  }
  if (shouldDestroy) {
    ReentrantReadWriteLock.ReadLock rlock=mRS.mRWLock.readLock();
    rlock.lock();
    if (mRS.isAlive()) {
      mRS.nObjDestroy(mID);
    }
    rlock.unlock();
    mRS=null;
    mID=0;
  }
}

Fixed version (ground truth):
private void helpDestroy(){
  boolean shouldDestroy=false;
synchronized (this) {
    if (!mDestroyed) {
      shouldDestroy=true;
      mDestroyed=true;
    }
  }
  if (shouldDestroy) {
    ReentrantReadWriteLock.ReadLock rlock=mRS.mRWLock.readLock();
    rlock.lock();
    if (mRS.isAlive() && mID != 0) {
      mRS.nObjDestroy(mID);
    }
    rlock.unlock();
    mRS=null;
    mID=0;
  }
}
Program: 199876
Project: 199876
Buggy source:
static public AllocationAdapter create2D(RenderScript rs,Allocation a){
  android.util.Log.e("String_Node_Str","String_Node_Str" + a);
  rs.validate();
  AllocationAdapter aa=new AllocationAdapter(0,rs,a);
  aa.mConstrainedLOD=true;
  aa.mConstrainedFace=true;
  aa.mConstrainedY=false;
  aa.mConstrainedZ=true;
  aa.initLOD(0);
  return aa;
}

Fixed version (ground truth):
static public AllocationAdapter create2D(RenderScript rs,Allocation a){
  rs.validate();
  AllocationAdapter aa=new AllocationAdapter(0,rs,a);
  aa.mConstrainedLOD=true;
  aa.mConstrainedFace=true;
  aa.mConstrainedY=false;
  aa.mConstrainedZ=true;
  aa.initLOD(0);
  return aa;
}
Program: 199877
Project: 199877
Buggy source:
private void helpDestroy(){
  boolean shouldDestroy=false;
synchronized (this) {
    if (!mDestroyed) {
      shouldDestroy=true;
      mDestroyed=true;
    }
  }
  if (shouldDestroy) {
    ReentrantReadWriteLock.ReadLock rlock=mRS.mRWLock.readLock();
    rlock.lock();
    if (mRS.isAlive()) {
      mRS.nObjDestroy(mID);
    }
    rlock.unlock();
    mRS=null;
    mID=0;
  }
}

Fixed version (ground truth):
private void helpDestroy(){
  boolean shouldDestroy=false;
synchronized (this) {
    if (!mDestroyed) {
      shouldDestroy=true;
      mDestroyed=true;
    }
  }
  if (shouldDestroy) {
    ReentrantReadWriteLock.ReadLock rlock=mRS.mRWLock.readLock();
    rlock.lock();
    if (mRS.isAlive() && mID != 0) {
      mRS.nObjDestroy(mID);
    }
    rlock.unlock();
    mRS=null;
    mID=0;
  }
}
Program: 199883
Project: 199883
Buggy source:
/** 
 * Drop a content provider from a ProcessRecord's bookkeeping
 */
public void removeContentProvider(IBinder connection,boolean stable){
  enforceNotIsolatedCaller("String_Node_Str");
synchronized (this) {
    ContentProviderConnection conn;
    try {
      conn=(ContentProviderConnection)connection;
    }
 catch (    ClassCastException e) {
      String msg="String_Node_Str" + connection + "String_Node_Str";
      Slog.w(TAG,msg);
      throw new IllegalArgumentException(msg);
    }
    if (conn == null) {
      throw new NullPointerException("String_Node_Str");
    }
    if (decProviderCountLocked(conn,null,null,stable)) {
      updateOomAdjLocked();
    }
  }
}

Fixed version (ground truth):
/** 
 * Drop a content provider from a ProcessRecord's bookkeeping
 */
public void removeContentProvider(IBinder connection,boolean stable){
  enforceNotIsolatedCaller("String_Node_Str");
  long ident=Binder.clearCallingIdentity();
  try {
synchronized (this) {
      ContentProviderConnection conn;
      try {
        conn=(ContentProviderConnection)connection;
      }
 catch (      ClassCastException e) {
        String msg="String_Node_Str" + connection + "String_Node_Str";
        Slog.w(TAG,msg);
        throw new IllegalArgumentException(msg);
      }
      if (conn == null) {
        throw new NullPointerException("String_Node_Str");
      }
      if (decProviderCountLocked(conn,null,null,stable)) {
        updateOomAdjLocked();
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}
Program: 199884
Project: 199884
Buggy source:
/** 
 * Drop a content provider from a ProcessRecord's bookkeeping
 */
public void removeContentProvider(IBinder connection,boolean stable){
  enforceNotIsolatedCaller("String_Node_Str");
synchronized (this) {
    ContentProviderConnection conn;
    try {
      conn=(ContentProviderConnection)connection;
    }
 catch (    ClassCastException e) {
      String msg="String_Node_Str" + connection + "String_Node_Str";
      Slog.w(TAG,msg);
      throw new IllegalArgumentException(msg);
    }
    if (conn == null) {
      throw new NullPointerException("String_Node_Str");
    }
    if (decProviderCountLocked(conn,null,null,stable)) {
      updateOomAdjLocked();
    }
  }
}

Fixed version (ground truth):
/** 
 * Drop a content provider from a ProcessRecord's bookkeeping
 */
public void removeContentProvider(IBinder connection,boolean stable){
  enforceNotIsolatedCaller("String_Node_Str");
  long ident=Binder.clearCallingIdentity();
  try {
synchronized (this) {
      ContentProviderConnection conn;
      try {
        conn=(ContentProviderConnection)connection;
      }
 catch (      ClassCastException e) {
        String msg="String_Node_Str" + connection + "String_Node_Str";
        Slog.w(TAG,msg);
        throw new IllegalArgumentException(msg);
      }
      if (conn == null) {
        throw new NullPointerException("String_Node_Str");
      }
      if (decProviderCountLocked(conn,null,null,stable)) {
        updateOomAdjLocked();
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}
Program: 199885
Project: 199885
Buggy source:
@Override protected void onLayout(boolean changed,int l,int t,int r,int b){
  mTextureView.layout(l,t,r,b);
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int l,int t,int r,int b){
  mTextureView.layout(0,0,r - l,b - t);
}
Program: 199886
Project: 199886
Buggy source:
@Override protected void onLayout(boolean changed,int l,int t,int r,int b){
  mTextureView.layout(l,t,r,b);
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int l,int t,int r,int b){
  mTextureView.layout(0,0,r - l,b - t);
}
Program: 199887
Project: 199887
Buggy source:
@Override protected void onLayout(boolean changed,int l,int t,int r,int b){
  mTextureView.layout(l,t,r,b);
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int l,int t,int r,int b){
  mTextureView.layout(0,0,r - l,b - t);
}
Program: 199888
Project: 199888
Buggy source:
@Override protected void onLayout(boolean changed,int l,int t,int r,int b){
  mTextureView.layout(l,t,r,b);
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int l,int t,int r,int b){
  mTextureView.layout(0,0,r - l,b - t);
}
Program: 199889
Project: 199889
Buggy source:
/** 
 * Drop a content provider from a ProcessRecord's bookkeeping
 */
public void removeContentProvider(IBinder connection,boolean stable){
  enforceNotIsolatedCaller("String_Node_Str");
synchronized (this) {
    ContentProviderConnection conn;
    try {
      conn=(ContentProviderConnection)connection;
    }
 catch (    ClassCastException e) {
      String msg="String_Node_Str" + connection + "String_Node_Str";
      Slog.w(TAG,msg);
      throw new IllegalArgumentException(msg);
    }
    if (conn == null) {
      throw new NullPointerException("String_Node_Str");
    }
    if (decProviderCountLocked(conn,null,null,stable)) {
      updateOomAdjLocked();
    }
  }
}

Fixed version (ground truth):
/** 
 * Drop a content provider from a ProcessRecord's bookkeeping
 */
public void removeContentProvider(IBinder connection,boolean stable){
  enforceNotIsolatedCaller("String_Node_Str");
  long ident=Binder.clearCallingIdentity();
  try {
synchronized (this) {
      ContentProviderConnection conn;
      try {
        conn=(ContentProviderConnection)connection;
      }
 catch (      ClassCastException e) {
        String msg="String_Node_Str" + connection + "String_Node_Str";
        Slog.w(TAG,msg);
        throw new IllegalArgumentException(msg);
      }
      if (conn == null) {
        throw new NullPointerException("String_Node_Str");
      }
      if (decProviderCountLocked(conn,null,null,stable)) {
        updateOomAdjLocked();
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}
Program: 199890
Project: 199890
Buggy source:
@Override protected boolean dismiss(boolean authenticated){
  boolean finished=super.dismiss(authenticated);
  if (!finished) {
    mViewStateManager.showBouncer(true);
    SecurityMode securityMode=getSecurityContainer().getSecurityMode();
    boolean isFullScreen=getResources().getBoolean(R.bool.kg_sim_puk_account_full_screen);
    boolean isSimOrAccount=securityMode == SecurityMode.SimPin || securityMode == SecurityMode.SimPuk || securityMode == SecurityMode.Account;
    mAppWidgetContainer.setVisibility(isSimOrAccount && isFullScreen ? View.GONE : View.VISIBLE);
    setSystemUiVisibility(isSimOrAccount ? (getSystemUiVisibility() | View.STATUS_BAR_DISABLE_SEARCH) : (getSystemUiVisibility() & ~View.STATUS_BAR_DISABLE_SEARCH));
    if (mSlidingChallengeLayout != null) {
      mSlidingChallengeLayout.setChallengeInteractive(!isFullScreen);
    }
  }
  return finished;
}

Fixed version (ground truth):
@Override public boolean dismiss(boolean authenticated){
  boolean finished=super.dismiss(authenticated);
  if (!finished) {
    mViewStateManager.showBouncer(true);
    SecurityMode securityMode=getSecurityContainer().getSecurityMode();
    boolean isFullScreen=getResources().getBoolean(R.bool.kg_sim_puk_account_full_screen);
    boolean isSimOrAccount=securityMode == SecurityMode.SimPin || securityMode == SecurityMode.SimPuk || securityMode == SecurityMode.Account;
    mAppWidgetContainer.setVisibility(isSimOrAccount && isFullScreen ? View.GONE : View.VISIBLE);
    setSystemUiVisibility(isSimOrAccount ? (getSystemUiVisibility() | View.STATUS_BAR_DISABLE_SEARCH) : (getSystemUiVisibility() & ~View.STATUS_BAR_DISABLE_SEARCH));
    if (mSlidingChallengeLayout != null) {
      mSlidingChallengeLayout.setChallengeInteractive(!isFullScreen);
    }
  }
  return finished;
}
Program: 199891
Project: 199891
Buggy source:
boolean showNextSecurityScreenOrFinish(boolean authenticated){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + authenticated + "String_Node_Str");
  boolean finish=false;
  if (SecurityMode.None == mCurrentSecuritySelection) {
    SecurityMode securityMode=mSecurityModel.getSecurityMode();
    securityMode=mSecurityModel.getAlternateFor(securityMode);
    if (SecurityMode.None == securityMode) {
      finish=true;
    }
 else {
      showSecurityScreen(securityMode);
    }
  }
 else   if (authenticated) {
switch (mCurrentSecuritySelection) {
case Pattern:
case Password:
case PIN:
case Account:
case Biometric:
      finish=true;
    break;
case SimPin:
case SimPuk:
  SecurityMode securityMode=mSecurityModel.getSecurityMode();
if (securityMode != SecurityMode.None) {
  showSecurityScreen(securityMode);
}
 else {
  finish=true;
}
break;
default :
Log.v(TAG,"String_Node_Str" + mCurrentSecuritySelection + "String_Node_Str");
showPrimarySecurityScreen(false);
break;
}
}
 else {
showPrimarySecurityScreen(false);
}
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
 * @param authenticated
 * @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 (SecurityMode.None == mCurrentSecuritySelection) {
    SecurityMode securityMode=mSecurityModel.getSecurityMode();
    securityMode=mSecurityModel.getAlternateFor(securityMode);
    if (SecurityMode.None == securityMode) {
      finish=true;
    }
 else {
      showSecurityScreen(securityMode);
    }
  }
 else   if (authenticated) {
switch (mCurrentSecuritySelection) {
case Pattern:
case Password:
case PIN:
case Account:
case Biometric:
      finish=true;
    break;
case SimPin:
case SimPuk:
  SecurityMode securityMode=mSecurityModel.getSecurityMode();
if (securityMode != SecurityMode.None) {
  showSecurityScreen(securityMode);
}
 else {
  finish=true;
}
break;
default :
Log.v(TAG,"String_Node_Str" + mCurrentSecuritySelection + "String_Node_Str");
showPrimarySecurityScreen(false);
break;
}
}
 else {
showPrimarySecurityScreen(false);
}
if (finish) {
mSecurityCallback.finish();
}
return finish;
}
Program: 199892
Project: 199892
Buggy source:
/** 
 * Switches to the given security view unless it's already being shown, in which case this is a no-op.
 * @param securityMode
 */
private void showSecurityScreen(SecurityMode securityMode){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + securityMode + "String_Node_Str");
  if (securityMode == mCurrentSecuritySelection)   return;
  KeyguardSecurityView oldView=getSecurityView(mCurrentSecuritySelection);
  KeyguardSecurityView newView=getSecurityView(securityMode);
  if (oldView != null) {
    oldView.onPause();
    oldView.setKeyguardCallback(mNullCallback);
  }
  newView.onResume(KeyguardSecurityView.VIEW_REVEALED);
  newView.setKeyguardCallback(mCallback);
  final int childCount=mSecurityViewFlipper.getChildCount();
  final int securityViewIdForMode=getSecurityViewIdForMode(securityMode);
  for (int i=0; i < childCount; i++) {
    if (mSecurityViewFlipper.getChildAt(i).getId() == securityViewIdForMode) {
      mSecurityViewFlipper.setDisplayedChild(i);
      break;
    }
  }
  mCurrentSecuritySelection=securityMode;
}

Fixed version (ground truth):
/** 
 * Switches to the given security view unless it's already being shown, in which case this is a no-op.
 * @param securityMode
 */
private void showSecurityScreen(SecurityMode securityMode){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + securityMode + "String_Node_Str");
  if (securityMode == mCurrentSecuritySelection)   return;
  KeyguardSecurityView oldView=getSecurityView(mCurrentSecuritySelection);
  KeyguardSecurityView newView=getSecurityView(securityMode);
  if (oldView != null) {
    oldView.onPause();
    oldView.setKeyguardCallback(mNullCallback);
  }
  newView.onResume(KeyguardSecurityView.VIEW_REVEALED);
  newView.setKeyguardCallback(mCallback);
  final int childCount=mSecurityViewFlipper.getChildCount();
  final int securityViewIdForMode=getSecurityViewIdForMode(securityMode);
  for (int i=0; i < childCount; i++) {
    if (mSecurityViewFlipper.getChildAt(i).getId() == securityViewIdForMode) {
      mSecurityViewFlipper.setDisplayedChild(i);
      break;
    }
  }
  mCurrentSecuritySelection=securityMode;
  mSecurityCallback.onSecurityModeChanged(securityMode,newView.needsInput());
}
Program: 199893
Project: 199893
Buggy source:
public void setViewMediatorCallback(KeyguardViewMediator.ViewMediatorCallback viewMediatorCallback){
  mViewMediatorCallback=viewMediatorCallback;
}

Fixed version (ground truth):
public void setViewMediatorCallback(KeyguardViewMediator.ViewMediatorCallback viewMediatorCallback){
  mViewMediatorCallback=viewMediatorCallback;
  mViewMediatorCallback.setNeedsInput(mSecurityContainer.needsInput());
}
Program: 199894
Project: 199894
Buggy source:
/** 
 * Authentication has happened and it's time to dismiss keyguard. This function should clean up and inform KeyguardViewMediator.
 */
public void finish(){
  KeyguardUpdateMonitor.getInstance(mContext).setAlternateUnlockEnabled(true);
  boolean deferKeyguardDone=false;
  if (mDismissAction != null) {
    deferKeyguardDone=mDismissAction.onDismiss();
    mDismissAction=null;
  }
  if (mViewMediatorCallback != null) {
    if (deferKeyguardDone) {
      mViewMediatorCallback.keyguardDonePending();
    }
 else {
      mViewMediatorCallback.keyguardDone(true);
    }
  }
}

Fixed version (ground truth):
/** 
 * Authentication has happened and it's time to dismiss keyguard. This function should clean up and inform KeyguardViewMediator.
 */
@Override public void finish(){
  KeyguardUpdateMonitor.getInstance(mContext).setAlternateUnlockEnabled(true);
  boolean deferKeyguardDone=false;
  if (mDismissAction != null) {
    deferKeyguardDone=mDismissAction.onDismiss();
    mDismissAction=null;
  }
  if (mViewMediatorCallback != null) {
    if (deferKeyguardDone) {
      mViewMediatorCallback.keyguardDonePending();
    }
 else {
      mViewMediatorCallback.keyguardDone(true);
    }
  }
}
Program: 199895
Project: 199895
Buggy source:
/** 
 * Verify that the user can get past the keyguard securely.  This is called, for example, when the phone disables the keyguard but then wants to launch something else that requires secure access. The result will be propogated back via   {@link KeyguardViewCallback#keyguardDone(boolean)}
 */
public void verifyUnlock(){
  SecurityMode securityMode=getSecurityContainer().getSecurityMode();
  if (securityMode == KeyguardSecurityModel.SecurityMode.None) {
    if (mViewMediatorCallback != null) {
      mViewMediatorCallback.keyguardDone(true);
    }
  }
 else   if (securityMode != KeyguardSecurityModel.SecurityMode.Pattern && securityMode != KeyguardSecurityModel.SecurityMode.PIN && securityMode != KeyguardSecurityModel.SecurityMode.Password) {
    if (mViewMediatorCallback != null) {
      mViewMediatorCallback.keyguardDone(false);
    }
  }
 else {
    mSecurityContainer.verifyUnlock();
  }
}

Fixed version (ground truth):
/** 
 * Verify that the user can get past the keyguard securely.  This is called, for example, when the phone disables the keyguard but then wants to launch something else that requires secure access. The result will be propogated back via   {@link KeyguardViewCallback#keyguardDone(boolean)}
 */
public void verifyUnlock(){
  SecurityMode securityMode=mSecurityContainer.getSecurityMode();
  if (securityMode == KeyguardSecurityModel.SecurityMode.None) {
    if (mViewMediatorCallback != null) {
      mViewMediatorCallback.keyguardDone(true);
    }
  }
 else   if (securityMode != KeyguardSecurityModel.SecurityMode.Pattern && securityMode != KeyguardSecurityModel.SecurityMode.PIN && securityMode != KeyguardSecurityModel.SecurityMode.Password) {
    if (mViewMediatorCallback != null) {
      mViewMediatorCallback.keyguardDone(false);
    }
  }
 else {
    mSecurityContainer.verifyUnlock();
  }
}
Program: 199896
Project: 199896
Buggy source:
protected boolean dismiss(boolean authenticated){
  boolean finished=getSecurityContainer().showNextSecurityScreenOrFinish(authenticated);
  if (!finished) {
    updateAfterSecuritySelection();
  }
  return finished;
}

Fixed version (ground truth):
@Override public boolean dismiss(boolean authenticated){
  return mSecurityContainer.showNextSecurityScreenOrFinish(authenticated);
}
Program: 199897
Project: 199897
Buggy source:
protected void userActivity(){
  if (mViewMediatorCallback != null) {
    mViewMediatorCallback.userActivity();
  }
}

Fixed version (ground truth):
public void userActivity(){
  if (mViewMediatorCallback != null) {
    mViewMediatorCallback.userActivity();
  }
}
Program: 199898
Project: 199898
Buggy source:
@Override protected void onFinishInflate(){
  mSecurityContainer=(KeyguardSecurityContainer)findViewById(R.id.keyguard_security_container);
  mLockPatternUtils=new LockPatternUtils(mContext);
  mSecurityContainer.setLockPatternUtils(mLockPatternUtils);
  mSecurityContainer.setSecurityCallback(new SecurityCallback(){
    @Override public void userActivity(    long timeout){
      KeyguardViewBase.this.userActivity(timeout);
    }
    @Override public void dismiss(    boolean authenticated){
      KeyguardViewBase.this.dismiss(authenticated);
    }
    @Override public void finish(){
      KeyguardViewBase.this.finish();
    }
  }
);
  mSecurityContainer.showPrimarySecurityScreen(false);
  setBackButtonEnabled(false);
}

Fixed version (ground truth):
@Override protected void onFinishInflate(){
  mSecurityContainer=(KeyguardSecurityContainer)findViewById(R.id.keyguard_security_container);
  mLockPatternUtils=new LockPatternUtils(mContext);
  mSecurityContainer.setLockPatternUtils(mLockPatternUtils);
  mSecurityContainer.setSecurityCallback(this);
  mSecurityContainer.showPrimarySecurityScreen(false);
  setBackButtonEnabled(false);
}
Program: 199899
Project: 199899
Buggy source:
private void inflateKeyguardView(Bundle options){
  View v=mKeyguardHost.findViewById(R.id.keyguard_host_view);
  if (v != null) {
    mKeyguardHost.removeView(v);
  }
  final LayoutInflater inflater=LayoutInflater.from(mContext);
  View view=inflater.inflate(HOST_LAYOUT,mKeyguardHost,true);
  mKeyguardView=(KeyguardViewBase)view.findViewById(R.id.keyguard_host_view);
  mKeyguardView.setLockPatternUtils(mLockPatternUtils);
  mKeyguardView.setViewMediatorCallback(mViewMediatorCallback);
  mKeyguardView.onUserSwitching(options != null && options.getBoolean(IS_SWITCHING_USER));
  if (mViewMediatorCallback != null) {
    KeyguardPasswordView kpv=(KeyguardPasswordView)mKeyguardView.findViewById(R.id.keyguard_password_view);
    if (kpv != null) {
      mViewMediatorCallback.setNeedsInput(kpv.needsInput());
    }
  }
  mKeyguardView.onCreateOptions(options);
}

Fixed version (ground truth):
private KeyguardViewBase inflateKeyguardView(Bundle options,int layoutId){
  View v=mKeyguardHost.findViewById(R.id.keyguard_host_view);
  if (v != null) {
    mKeyguardHost.removeView(v);
  }
  final LayoutInflater inflater=LayoutInflater.from(mContext);
  View view=inflater.inflate(layoutId,mKeyguardHost,true);
  KeyguardViewBase keyguard=(KeyguardViewBase)view.findViewById(R.id.keyguard_host_view);
  keyguard.setLockPatternUtils(mLockPatternUtils);
  keyguard.setViewMediatorCallback(mViewMediatorCallback);
  keyguard.onUserSwitching(options != null && options.getBoolean(IS_SWITCHING_USER));
  keyguard.onCreateOptions(options);
  return keyguard;
}
Program: 199901
Project: 199901
Buggy source:
@Override protected boolean dismiss(boolean authenticated){
  boolean finished=super.dismiss(authenticated);
  if (!finished) {
    mViewStateManager.showBouncer(true);
    SecurityMode securityMode=getSecurityContainer().getSecurityMode();
    boolean isFullScreen=getResources().getBoolean(R.bool.kg_sim_puk_account_full_screen);
    boolean isSimOrAccount=securityMode == SecurityMode.SimPin || securityMode == SecurityMode.SimPuk || securityMode == SecurityMode.Account;
    mAppWidgetContainer.setVisibility(isSimOrAccount && isFullScreen ? View.GONE : View.VISIBLE);
    setSystemUiVisibility(isSimOrAccount ? (getSystemUiVisibility() | View.STATUS_BAR_DISABLE_SEARCH) : (getSystemUiVisibility() & ~View.STATUS_BAR_DISABLE_SEARCH));
    if (mSlidingChallengeLayout != null) {
      mSlidingChallengeLayout.setChallengeInteractive(!isFullScreen);
    }
  }
  return finished;
}

Fixed version (ground truth):
@Override public boolean dismiss(boolean authenticated){
  boolean finished=super.dismiss(authenticated);
  if (!finished) {
    mViewStateManager.showBouncer(true);
    SecurityMode securityMode=getSecurityContainer().getSecurityMode();
    boolean isFullScreen=getResources().getBoolean(R.bool.kg_sim_puk_account_full_screen);
    boolean isSimOrAccount=securityMode == SecurityMode.SimPin || securityMode == SecurityMode.SimPuk || securityMode == SecurityMode.Account;
    mAppWidgetContainer.setVisibility(isSimOrAccount && isFullScreen ? View.GONE : View.VISIBLE);
    setSystemUiVisibility(isSimOrAccount ? (getSystemUiVisibility() | View.STATUS_BAR_DISABLE_SEARCH) : (getSystemUiVisibility() & ~View.STATUS_BAR_DISABLE_SEARCH));
    if (mSlidingChallengeLayout != null) {
      mSlidingChallengeLayout.setChallengeInteractive(!isFullScreen);
    }
  }
  return finished;
}
Program: 199902
Project: 199902
Buggy source:
boolean showNextSecurityScreenOrFinish(boolean authenticated){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + authenticated + "String_Node_Str");
  boolean finish=false;
  if (SecurityMode.None == mCurrentSecuritySelection) {
    SecurityMode securityMode=mSecurityModel.getSecurityMode();
    securityMode=mSecurityModel.getAlternateFor(securityMode);
    if (SecurityMode.None == securityMode) {
      finish=true;
    }
 else {
      showSecurityScreen(securityMode);
    }
  }
 else   if (authenticated) {
switch (mCurrentSecuritySelection) {
case Pattern:
case Password:
case PIN:
case Account:
case Biometric:
      finish=true;
    break;
case SimPin:
case SimPuk:
  SecurityMode securityMode=mSecurityModel.getSecurityMode();
if (securityMode != SecurityMode.None) {
  showSecurityScreen(securityMode);
}
 else {
  finish=true;
}
break;
default :
Log.v(TAG,"String_Node_Str" + mCurrentSecuritySelection + "String_Node_Str");
showPrimarySecurityScreen(false);
break;
}
}
 else {
showPrimarySecurityScreen(false);
}
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
 * @param authenticated
 * @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 (SecurityMode.None == mCurrentSecuritySelection) {
    SecurityMode securityMode=mSecurityModel.getSecurityMode();
    securityMode=mSecurityModel.getAlternateFor(securityMode);
    if (SecurityMode.None == securityMode) {
      finish=true;
    }
 else {
      showSecurityScreen(securityMode);
    }
  }
 else   if (authenticated) {
switch (mCurrentSecuritySelection) {
case Pattern:
case Password:
case PIN:
case Account:
case Biometric:
      finish=true;
    break;
case SimPin:
case SimPuk:
  SecurityMode securityMode=mSecurityModel.getSecurityMode();
if (securityMode != SecurityMode.None) {
  showSecurityScreen(securityMode);
}
 else {
  finish=true;
}
break;
default :
Log.v(TAG,"String_Node_Str" + mCurrentSecuritySelection + "String_Node_Str");
showPrimarySecurityScreen(false);
break;
}
}
 else {
showPrimarySecurityScreen(false);
}
if (finish) {
mSecurityCallback.finish();
}
return finish;
}
Program: 199903
Project: 199903
Buggy source:
/** 
 * Switches to the given security view unless it's already being shown, in which case this is a no-op.
 * @param securityMode
 */
private void showSecurityScreen(SecurityMode securityMode){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + securityMode + "String_Node_Str");
  if (securityMode == mCurrentSecuritySelection)   return;
  KeyguardSecurityView oldView=getSecurityView(mCurrentSecuritySelection);
  KeyguardSecurityView newView=getSecurityView(securityMode);
  if (oldView != null) {
    oldView.onPause();
    oldView.setKeyguardCallback(mNullCallback);
  }
  newView.onResume(KeyguardSecurityView.VIEW_REVEALED);
  newView.setKeyguardCallback(mCallback);
  final int childCount=mSecurityViewFlipper.getChildCount();
  final int securityViewIdForMode=getSecurityViewIdForMode(securityMode);
  for (int i=0; i < childCount; i++) {
    if (mSecurityViewFlipper.getChildAt(i).getId() == securityViewIdForMode) {
      mSecurityViewFlipper.setDisplayedChild(i);
      break;
    }
  }
  mCurrentSecuritySelection=securityMode;
}

Fixed version (ground truth):
/** 
 * Switches to the given security view unless it's already being shown, in which case this is a no-op.
 * @param securityMode
 */
private void showSecurityScreen(SecurityMode securityMode){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + securityMode + "String_Node_Str");
  if (securityMode == mCurrentSecuritySelection)   return;
  KeyguardSecurityView oldView=getSecurityView(mCurrentSecuritySelection);
  KeyguardSecurityView newView=getSecurityView(securityMode);
  if (oldView != null) {
    oldView.onPause();
    oldView.setKeyguardCallback(mNullCallback);
  }
  newView.onResume(KeyguardSecurityView.VIEW_REVEALED);
  newView.setKeyguardCallback(mCallback);
  final int childCount=mSecurityViewFlipper.getChildCount();
  final int securityViewIdForMode=getSecurityViewIdForMode(securityMode);
  for (int i=0; i < childCount; i++) {
    if (mSecurityViewFlipper.getChildAt(i).getId() == securityViewIdForMode) {
      mSecurityViewFlipper.setDisplayedChild(i);
      break;
    }
  }
  mCurrentSecuritySelection=securityMode;
  mSecurityCallback.onSecurityModeChanged(securityMode,newView.needsInput());
}
Program: 199904
Project: 199904
Buggy source:
public void setViewMediatorCallback(KeyguardViewMediator.ViewMediatorCallback viewMediatorCallback){
  mViewMediatorCallback=viewMediatorCallback;
}

Fixed version (ground truth):
public void setViewMediatorCallback(KeyguardViewMediator.ViewMediatorCallback viewMediatorCallback){
  mViewMediatorCallback=viewMediatorCallback;
  mViewMediatorCallback.setNeedsInput(mSecurityContainer.needsInput());
}
Program: 199905
Project: 199905
Buggy source:
/** 
 * Authentication has happened and it's time to dismiss keyguard. This function should clean up and inform KeyguardViewMediator.
 */
public void finish(){
  KeyguardUpdateMonitor.getInstance(mContext).setAlternateUnlockEnabled(true);
  boolean deferKeyguardDone=false;
  if (mDismissAction != null) {
    deferKeyguardDone=mDismissAction.onDismiss();
    mDismissAction=null;
  }
  if (mViewMediatorCallback != null) {
    if (deferKeyguardDone) {
      mViewMediatorCallback.keyguardDonePending();
    }
 else {
      mViewMediatorCallback.keyguardDone(true);
    }
  }
}

Fixed version (ground truth):
/** 
 * Authentication has happened and it's time to dismiss keyguard. This function should clean up and inform KeyguardViewMediator.
 */
@Override public void finish(){
  KeyguardUpdateMonitor.getInstance(mContext).setAlternateUnlockEnabled(true);
  boolean deferKeyguardDone=false;
  if (mDismissAction != null) {
    deferKeyguardDone=mDismissAction.onDismiss();
    mDismissAction=null;
  }
  if (mViewMediatorCallback != null) {
    if (deferKeyguardDone) {
      mViewMediatorCallback.keyguardDonePending();
    }
 else {
      mViewMediatorCallback.keyguardDone(true);
    }
  }
}
Program: 199906
Project: 199906
Buggy source:
/** 
 * Verify that the user can get past the keyguard securely.  This is called, for example, when the phone disables the keyguard but then wants to launch something else that requires secure access. The result will be propogated back via   {@link KeyguardViewCallback#keyguardDone(boolean)}
 */
public void verifyUnlock(){
  SecurityMode securityMode=getSecurityContainer().getSecurityMode();
  if (securityMode == KeyguardSecurityModel.SecurityMode.None) {
    if (mViewMediatorCallback != null) {
      mViewMediatorCallback.keyguardDone(true);
    }
  }
 else   if (securityMode != KeyguardSecurityModel.SecurityMode.Pattern && securityMode != KeyguardSecurityModel.SecurityMode.PIN && securityMode != KeyguardSecurityModel.SecurityMode.Password) {
    if (mViewMediatorCallback != null) {
      mViewMediatorCallback.keyguardDone(false);
    }
  }
 else {
    mSecurityContainer.verifyUnlock();
  }
}

Fixed version (ground truth):
/** 
 * Verify that the user can get past the keyguard securely.  This is called, for example, when the phone disables the keyguard but then wants to launch something else that requires secure access. The result will be propogated back via   {@link KeyguardViewCallback#keyguardDone(boolean)}
 */
public void verifyUnlock(){
  SecurityMode securityMode=mSecurityContainer.getSecurityMode();
  if (securityMode == KeyguardSecurityModel.SecurityMode.None) {
    if (mViewMediatorCallback != null) {
      mViewMediatorCallback.keyguardDone(true);
    }
  }
 else   if (securityMode != KeyguardSecurityModel.SecurityMode.Pattern && securityMode != KeyguardSecurityModel.SecurityMode.PIN && securityMode != KeyguardSecurityModel.SecurityMode.Password) {
    if (mViewMediatorCallback != null) {
      mViewMediatorCallback.keyguardDone(false);
    }
  }
 else {
    mSecurityContainer.verifyUnlock();
  }
}
Program: 199907
Project: 199907
Buggy source:
protected boolean dismiss(boolean authenticated){
  boolean finished=getSecurityContainer().showNextSecurityScreenOrFinish(authenticated);
  if (!finished) {
    updateAfterSecuritySelection();
  }
  return finished;
}

Fixed version (ground truth):
@Override public boolean dismiss(boolean authenticated){
  return mSecurityContainer.showNextSecurityScreenOrFinish(authenticated);
}
Program: 199908
Project: 199908
Buggy source:
protected void userActivity(){
  if (mViewMediatorCallback != null) {
    mViewMediatorCallback.userActivity();
  }
}

Fixed version (ground truth):
public void userActivity(){
  if (mViewMediatorCallback != null) {
    mViewMediatorCallback.userActivity();
  }
}
Program: 199909
Project: 199909
Buggy source:
@Override protected void onFinishInflate(){
  mSecurityContainer=(KeyguardSecurityContainer)findViewById(R.id.keyguard_security_container);
  mLockPatternUtils=new LockPatternUtils(mContext);
  mSecurityContainer.setLockPatternUtils(mLockPatternUtils);
  mSecurityContainer.setSecurityCallback(new SecurityCallback(){
    @Override public void userActivity(    long timeout){
      KeyguardViewBase.this.userActivity(timeout);
    }
    @Override public void dismiss(    boolean authenticated){
      KeyguardViewBase.this.dismiss(authenticated);
    }
    @Override public void finish(){
      KeyguardViewBase.this.finish();
    }
  }
);
  mSecurityContainer.showPrimarySecurityScreen(false);
  setBackButtonEnabled(false);
}

Fixed version (ground truth):
@Override protected void onFinishInflate(){
  mSecurityContainer=(KeyguardSecurityContainer)findViewById(R.id.keyguard_security_container);
  mLockPatternUtils=new LockPatternUtils(mContext);
  mSecurityContainer.setLockPatternUtils(mLockPatternUtils);
  mSecurityContainer.setSecurityCallback(this);
  mSecurityContainer.showPrimarySecurityScreen(false);
  setBackButtonEnabled(false);
}