nus-yam/ex-repair huggingface dataset:
Program: 23339
Project: 23339
Buggy source:
public final void scheduleRelaunchActivity(IBinder token,List<ResultInfo> pendingResults,List<Intent> pendingNewIntents,int configChanges,boolean notResumed){
  ActivityRecord r=new ActivityRecord();
  r.token=token;
  r.pendingResults=pendingResults;
  r.pendingIntents=pendingNewIntents;
  r.startsNotResumed=notResumed;
synchronized (mRelaunchingActivities) {
    mRelaunchingActivities.add(r);
  }
  queueOrSendMessage(H.RELAUNCH_ACTIVITY,r,configChanges);
}

Fixed version (ground truth):
public final void scheduleRelaunchActivity(IBinder token,List<ResultInfo> pendingResults,List<Intent> pendingNewIntents,int configChanges,boolean notResumed,Configuration config){
  ActivityRecord r=new ActivityRecord();
  r.token=token;
  r.pendingResults=pendingResults;
  r.pendingIntents=pendingNewIntents;
  r.startsNotResumed=notResumed;
  r.createdConfig=config;
synchronized (mRelaunchingActivities) {
    mRelaunchingActivities.add(r);
  }
  queueOrSendMessage(H.RELAUNCH_ACTIVITY,r,configChanges);
}
Program: 23341
Project: 23341
Buggy source:
private final void handleLaunchActivity(ActivityRecord r,Intent customIntent){
  unscheduleGcIdler();
  if (localLOGV)   Log.v(TAG,"String_Node_Str" + r);
  Activity a=performLaunchActivity(r,customIntent);
  if (a != null) {
    r.createdConfig=new Configuration(a.getResources().getConfiguration());
    handleResumeActivity(r.token,false,r.isForward);
    if (!r.activity.mFinished && r.startsNotResumed) {
      try {
        r.activity.mCalled=false;
        mInstrumentation.callActivityOnPause(r.activity);
        if (!r.activity.mCalled) {
          throw new SuperNotCalledException("String_Node_Str" + r.intent.getComponent().toShortString() + "String_Node_Str");
        }
      }
 catch (      SuperNotCalledException e) {
        throw e;
      }
catch (      Exception e) {
        if (!mInstrumentation.onException(r.activity,e)) {
          throw new RuntimeException("String_Node_Str" + r.intent.getComponent().toShortString() + "String_Node_Str"+ e.toString(),e);
        }
      }
      r.paused=true;
    }
  }
 else {
    try {
      ActivityManagerNative.getDefault().finishActivity(r.token,Activity.RESULT_CANCELED,null);
    }
 catch (    RemoteException ex) {
    }
  }
}

Fixed version (ground truth):
private final void handleLaunchActivity(ActivityRecord r,Intent customIntent){
  unscheduleGcIdler();
  if (localLOGV)   Log.v(TAG,"String_Node_Str" + r);
  Activity a=performLaunchActivity(r,customIntent);
  if (a != null) {
    r.createdConfig=new Configuration(mConfiguration);
    handleResumeActivity(r.token,false,r.isForward);
    if (!r.activity.mFinished && r.startsNotResumed) {
      try {
        r.activity.mCalled=false;
        mInstrumentation.callActivityOnPause(r.activity);
        if (!r.activity.mCalled) {
          throw new SuperNotCalledException("String_Node_Str" + r.intent.getComponent().toShortString() + "String_Node_Str");
        }
      }
 catch (      SuperNotCalledException e) {
        throw e;
      }
catch (      Exception e) {
        if (!mInstrumentation.onException(r.activity,e)) {
          throw new RuntimeException("String_Node_Str" + r.intent.getComponent().toShortString() + "String_Node_Str"+ e.toString(),e);
        }
      }
      r.paused=true;
    }
  }
 else {
    try {
      ActivityManagerNative.getDefault().finishActivity(r.token,Activity.RESULT_CANCELED,null);
    }
 catch (    RemoteException ex) {
    }
  }
}
Program: 23342
Project: 23342
Buggy source:
public final void scheduleRelaunchActivity(IBinder token,List<ResultInfo> pendingResults,List<Intent> pendingNewIntents,int configChanges,boolean notResumed) throws RemoteException {
  Parcel data=Parcel.obtain();
  data.writeInterfaceToken(IApplicationThread.descriptor);
  data.writeStrongBinder(token);
  data.writeTypedList(pendingResults);
  data.writeTypedList(pendingNewIntents);
  data.writeInt(configChanges);
  data.writeInt(notResumed ? 1 : 0);
  mRemote.transact(SCHEDULE_RELAUNCH_ACTIVITY_TRANSACTION,data,null,IBinder.FLAG_ONEWAY);
  data.recycle();
}

Fixed version (ground truth):
public final void scheduleRelaunchActivity(IBinder token,List<ResultInfo> pendingResults,List<Intent> pendingNewIntents,int configChanges,boolean notResumed,Configuration config) throws RemoteException {
  Parcel data=Parcel.obtain();
  data.writeInterfaceToken(IApplicationThread.descriptor);
  data.writeStrongBinder(token);
  data.writeTypedList(pendingResults);
  data.writeTypedList(pendingNewIntents);
  data.writeInt(configChanges);
  data.writeInt(notResumed ? 1 : 0);
  if (config != null) {
    data.writeInt(1);
    config.writeToParcel(data,0);
  }
 else {
    data.writeInt(0);
  }
  mRemote.transact(SCHEDULE_RELAUNCH_ACTIVITY_TRANSACTION,data,null,IBinder.FLAG_ONEWAY);
  data.recycle();
}
Program: 23344
Project: 23344
Buggy source:
void scheduleRelaunchActivity(IBinder token,List<ResultInfo> pendingResults,List<Intent> pendingNewIntents,int configChanges,boolean notResumed) throws RemoteException ;

Fixed version (ground truth):
void scheduleRelaunchActivity(IBinder token,List<ResultInfo> pendingResults,List<Intent> pendingNewIntents,int configChanges,boolean notResumed,Configuration config) throws RemoteException ;
Program: 23345
Project: 23345
Buggy source:
private final boolean relaunchActivityLocked(HistoryRecord r,int changes,boolean andResume){
  List<ResultInfo> results=null;
  List<Intent> newIntents=null;
  if (andResume) {
    results=r.results;
    newIntents=r.newIntents;
  }
  if (DEBUG_SWITCH)   Log.v(TAG,"String_Node_Str" + r + "String_Node_Str"+ results+ "String_Node_Str"+ newIntents+ "String_Node_Str"+ andResume);
  EventLog.writeEvent(andResume ? LOG_AM_RELAUNCH_RESUME_ACTIVITY : LOG_AM_RELAUNCH_ACTIVITY,System.identityHashCode(r),r.task.taskId,r.shortComponentName);
  r.startFreezingScreenLocked(r.app,0);
  try {
    if (DEBUG_SWITCH)     Log.i(TAG,"String_Node_Str" + r);
    r.app.thread.scheduleRelaunchActivity(r,results,newIntents,changes,!andResume);
  }
 catch (  RemoteException e) {
    return false;
  }
  if (andResume) {
    r.results=null;
    r.newIntents=null;
    reportResumedActivityLocked(r);
  }
  return true;
}

Fixed version (ground truth):
private final boolean relaunchActivityLocked(HistoryRecord r,int changes,boolean andResume){
  List<ResultInfo> results=null;
  List<Intent> newIntents=null;
  if (andResume) {
    results=r.results;
    newIntents=r.newIntents;
  }
  if (DEBUG_SWITCH)   Log.v(TAG,"String_Node_Str" + r + "String_Node_Str"+ results+ "String_Node_Str"+ newIntents+ "String_Node_Str"+ andResume);
  EventLog.writeEvent(andResume ? LOG_AM_RELAUNCH_RESUME_ACTIVITY : LOG_AM_RELAUNCH_ACTIVITY,System.identityHashCode(r),r.task.taskId,r.shortComponentName);
  r.startFreezingScreenLocked(r.app,0);
  try {
    if (DEBUG_SWITCH)     Log.i(TAG,"String_Node_Str" + r);
    r.app.thread.scheduleRelaunchActivity(r,results,newIntents,changes,!andResume,mConfiguration);
  }
 catch (  RemoteException e) {
    return false;
  }
  if (andResume) {
    r.results=null;
    r.newIntents=null;
    reportResumedActivityLocked(r);
  }
  return true;
}
Program: 23346
Project: 23346
Buggy source:
private final void sendIntent(int headset){
  if ((mHeadsetState & headset) != (mPrevHeadsetState & headset)) {
    Intent intent=new Intent(Intent.ACTION_HEADSET_PLUG);
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY);
    int state=0;
    int microphone=0;
    if ((headset & HEADSETS_WITH_MIC) != 0) {
      microphone=1;
    }
    if ((mHeadsetState & headset) != 0) {
      state=1;
    }
    intent.putExtra("String_Node_Str",state);
    intent.putExtra("String_Node_Str",mHeadsetName);
    intent.putExtra("String_Node_Str",microphone);
    if (LOG)     Log.v(TAG,"String_Node_Str" + state + "String_Node_Str"+ mHeadsetName+ "String_Node_Str"+ microphone);
    ActivityManagerNative.broadcastStickyIntent(intent,null);
  }
}

Fixed version (ground truth):
private final void sendIntent(int headset,int headsetState,int prevHeadsetState,String headsetName){
  if ((headsetState & headset) != (prevHeadsetState & headset)) {
    Intent intent=new Intent(Intent.ACTION_HEADSET_PLUG);
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY);
    int state=0;
    int microphone=0;
    if ((headset & HEADSETS_WITH_MIC) != 0) {
      microphone=1;
    }
    if ((headsetState & headset) != 0) {
      state=1;
    }
    intent.putExtra("String_Node_Str",state);
    intent.putExtra("String_Node_Str",headsetName);
    intent.putExtra("String_Node_Str",microphone);
    if (LOG)     Log.v(TAG,"String_Node_Str" + state + "String_Node_Str"+ headsetName+ "String_Node_Str"+ microphone);
    ActivityManagerNative.broadcastStickyIntent(intent,null);
  }
}
Program: 23347
Project: 23347
Buggy source:
@Override public void handleMessage(Message msg){
  if (mPendingIntent) {
    sendIntents();
    mPendingIntent=false;
  }
  mWakeLock.release();
}

Fixed version (ground truth):
@Override public void handleMessage(Message msg){
  sendIntents(msg.arg1,msg.arg2,(String)msg.obj);
  mWakeLock.release();
}
Program: 23348
Project: 23348
Buggy source:
private synchronized final void update(String newName,int newState){
  int headsetState=newState & SUPPORTED_HEADSETS;
  int newOrOld=headsetState | mHeadsetState;
  if (mHeadsetState == headsetState || ((newOrOld & (newOrOld - 1)) != 0)) {
    return;
  }
  mHeadsetName=newName;
  mPrevHeadsetState=mHeadsetState;
  mHeadsetState=headsetState;
  mPendingIntent=true;
  if (headsetState == 0) {
    Intent intent=new Intent(AudioManager.ACTION_AUDIO_BECOMING_NOISY);
    mContext.sendBroadcast(intent);
    mWakeLock.acquire();
    mHandler.sendEmptyMessageDelayed(0,1000);
  }
 else {
    sendIntents();
    mPendingIntent=false;
  }
}

Fixed version (ground truth):
private synchronized final void update(String newName,int newState){
  int headsetState=newState & SUPPORTED_HEADSETS;
  int newOrOld=headsetState | mHeadsetState;
  if (mHeadsetState == headsetState || ((newOrOld & (newOrOld - 1)) != 0)) {
    return;
  }
  mHeadsetName=newName;
  mPrevHeadsetState=mHeadsetState;
  mHeadsetState=headsetState;
  if (headsetState == 0) {
    Intent intent=new Intent(AudioManager.ACTION_AUDIO_BECOMING_NOISY);
    mContext.sendBroadcast(intent);
    mWakeLock.acquire();
    mHandler.sendMessageDelayed(mHandler.obtainMessage(0,mHeadsetState,mPrevHeadsetState,mHeadsetName),1000);
  }
 else {
    sendIntents(mHeadsetState,mPrevHeadsetState,mHeadsetName);
  }
}
Program: 23349
Project: 23349
Buggy source:
private synchronized final void sendIntents(){
  int allHeadsets=SUPPORTED_HEADSETS;
  for (int curHeadset=1; allHeadsets != 0; curHeadset<<=1) {
    if ((curHeadset & allHeadsets) != 0) {
      sendIntent(curHeadset);
      allHeadsets&=~curHeadset;
    }
  }
}

Fixed version (ground truth):
private synchronized final void sendIntents(int headsetState,int prevHeadsetState,String headsetName){
  int allHeadsets=SUPPORTED_HEADSETS;
  for (int curHeadset=1; allHeadsets != 0; curHeadset<<=1) {
    if ((curHeadset & allHeadsets) != 0) {
      sendIntent(curHeadset,headsetState,prevHeadsetState,headsetName);
      allHeadsets&=~curHeadset;
    }
  }
}
Program: 23351
Project: 23351
Buggy source:
/** 
 * {@inheritDoc} 
 */
public int windowTypeToLayerLw(int type){
  if (type >= FIRST_APPLICATION_WINDOW && type <= LAST_APPLICATION_WINDOW) {
    return APPLICATION_LAYER;
  }
switch (type) {
case TYPE_STATUS_BAR:
    return STATUS_BAR_LAYER;
case TYPE_STATUS_BAR_PANEL:
  return STATUS_BAR_PANEL_LAYER;
case TYPE_SEARCH_BAR:
return SEARCH_BAR_LAYER;
case TYPE_PHONE:
return PHONE_LAYER;
case TYPE_KEYGUARD:
return KEYGUARD_LAYER;
case TYPE_KEYGUARD_DIALOG:
return KEYGUARD_DIALOG_LAYER;
case TYPE_SYSTEM_ALERT:
return SYSTEM_ALERT_LAYER;
case TYPE_SYSTEM_ERROR:
return SYSTEM_ERROR_LAYER;
case TYPE_INPUT_METHOD:
return INPUT_METHOD_LAYER;
case TYPE_INPUT_METHOD_DIALOG:
return INPUT_METHOD_DIALOG_LAYER;
case TYPE_SYSTEM_OVERLAY:
return SYSTEM_OVERLAY_LAYER;
case TYPE_PRIORITY_PHONE:
return PRIORITY_PHONE_LAYER;
case TYPE_TOAST:
return TOAST_LAYER;
case TYPE_WALLPAPER:
return WALLPAPER_LAYER;
}
Log.e(TAG,"String_Node_Str" + type);
return APPLICATION_LAYER;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public int windowTypeToLayerLw(int type){
  if (type >= FIRST_APPLICATION_WINDOW && type <= LAST_APPLICATION_WINDOW) {
    return APPLICATION_LAYER;
  }
switch (type) {
case TYPE_STATUS_BAR:
    return STATUS_BAR_LAYER;
case TYPE_STATUS_BAR_PANEL:
  return STATUS_BAR_PANEL_LAYER;
case TYPE_SYSTEM_DIALOG:
return SYSTEM_DIALOG_LAYER;
case TYPE_SEARCH_BAR:
return SEARCH_BAR_LAYER;
case TYPE_PHONE:
return PHONE_LAYER;
case TYPE_KEYGUARD:
return KEYGUARD_LAYER;
case TYPE_KEYGUARD_DIALOG:
return KEYGUARD_DIALOG_LAYER;
case TYPE_SYSTEM_ALERT:
return SYSTEM_ALERT_LAYER;
case TYPE_SYSTEM_ERROR:
return SYSTEM_ERROR_LAYER;
case TYPE_INPUT_METHOD:
return INPUT_METHOD_LAYER;
case TYPE_INPUT_METHOD_DIALOG:
return INPUT_METHOD_DIALOG_LAYER;
case TYPE_SYSTEM_OVERLAY:
return SYSTEM_OVERLAY_LAYER;
case TYPE_PRIORITY_PHONE:
return PRIORITY_PHONE_LAYER;
case TYPE_TOAST:
return TOAST_LAYER;
case TYPE_WALLPAPER:
return WALLPAPER_LAYER;
}
Log.e(TAG,"String_Node_Str" + type);
return APPLICATION_LAYER;
}
Program: 23352
Project: 23352
Buggy source:
/** 
 * {@inheritDoc} 
 */
public int windowTypeToLayerLw(int type){
  if (type >= FIRST_APPLICATION_WINDOW && type <= LAST_APPLICATION_WINDOW) {
    return APPLICATION_LAYER;
  }
switch (type) {
case TYPE_STATUS_BAR:
    return STATUS_BAR_LAYER;
case TYPE_STATUS_BAR_PANEL:
  return STATUS_BAR_PANEL_LAYER;
case TYPE_SEARCH_BAR:
return SEARCH_BAR_LAYER;
case TYPE_PHONE:
return PHONE_LAYER;
case TYPE_KEYGUARD:
return KEYGUARD_LAYER;
case TYPE_KEYGUARD_DIALOG:
return KEYGUARD_DIALOG_LAYER;
case TYPE_SYSTEM_ALERT:
return SYSTEM_ALERT_LAYER;
case TYPE_SYSTEM_ERROR:
return SYSTEM_ERROR_LAYER;
case TYPE_INPUT_METHOD:
return INPUT_METHOD_LAYER;
case TYPE_INPUT_METHOD_DIALOG:
return INPUT_METHOD_DIALOG_LAYER;
case TYPE_SYSTEM_OVERLAY:
return SYSTEM_OVERLAY_LAYER;
case TYPE_PRIORITY_PHONE:
return PRIORITY_PHONE_LAYER;
case TYPE_TOAST:
return TOAST_LAYER;
case TYPE_WALLPAPER:
return WALLPAPER_LAYER;
}
Log.e(TAG,"String_Node_Str" + type);
return APPLICATION_LAYER;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public int windowTypeToLayerLw(int type){
  if (type >= FIRST_APPLICATION_WINDOW && type <= LAST_APPLICATION_WINDOW) {
    return APPLICATION_LAYER;
  }
switch (type) {
case TYPE_STATUS_BAR:
    return STATUS_BAR_LAYER;
case TYPE_STATUS_BAR_PANEL:
  return STATUS_BAR_PANEL_LAYER;
case TYPE_SYSTEM_DIALOG:
return SYSTEM_DIALOG_LAYER;
case TYPE_SEARCH_BAR:
return SEARCH_BAR_LAYER;
case TYPE_PHONE:
return PHONE_LAYER;
case TYPE_KEYGUARD:
return KEYGUARD_LAYER;
case TYPE_KEYGUARD_DIALOG:
return KEYGUARD_DIALOG_LAYER;
case TYPE_SYSTEM_ALERT:
return SYSTEM_ALERT_LAYER;
case TYPE_SYSTEM_ERROR:
return SYSTEM_ERROR_LAYER;
case TYPE_INPUT_METHOD:
return INPUT_METHOD_LAYER;
case TYPE_INPUT_METHOD_DIALOG:
return INPUT_METHOD_DIALOG_LAYER;
case TYPE_SYSTEM_OVERLAY:
return SYSTEM_OVERLAY_LAYER;
case TYPE_PRIORITY_PHONE:
return PRIORITY_PHONE_LAYER;
case TYPE_TOAST:
return TOAST_LAYER;
case TYPE_WALLPAPER:
return WALLPAPER_LAYER;
}
Log.e(TAG,"String_Node_Str" + type);
return APPLICATION_LAYER;
}
Program: 23353
Project: 23353
Buggy source:
/** 
 * {@inheritDoc} 
 */
public int windowTypeToLayerLw(int type){
  if (type >= FIRST_APPLICATION_WINDOW && type <= LAST_APPLICATION_WINDOW) {
    return APPLICATION_LAYER;
  }
switch (type) {
case TYPE_STATUS_BAR:
    return STATUS_BAR_LAYER;
case TYPE_STATUS_BAR_PANEL:
  return STATUS_BAR_PANEL_LAYER;
case TYPE_SEARCH_BAR:
return SEARCH_BAR_LAYER;
case TYPE_PHONE:
return PHONE_LAYER;
case TYPE_KEYGUARD:
return KEYGUARD_LAYER;
case TYPE_KEYGUARD_DIALOG:
return KEYGUARD_DIALOG_LAYER;
case TYPE_SYSTEM_ALERT:
return SYSTEM_ALERT_LAYER;
case TYPE_SYSTEM_ERROR:
return SYSTEM_ERROR_LAYER;
case TYPE_INPUT_METHOD:
return INPUT_METHOD_LAYER;
case TYPE_INPUT_METHOD_DIALOG:
return INPUT_METHOD_DIALOG_LAYER;
case TYPE_SYSTEM_OVERLAY:
return SYSTEM_OVERLAY_LAYER;
case TYPE_PRIORITY_PHONE:
return PRIORITY_PHONE_LAYER;
case TYPE_TOAST:
return TOAST_LAYER;
case TYPE_WALLPAPER:
return WALLPAPER_LAYER;
}
Log.e(TAG,"String_Node_Str" + type);
return APPLICATION_LAYER;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public int windowTypeToLayerLw(int type){
  if (type >= FIRST_APPLICATION_WINDOW && type <= LAST_APPLICATION_WINDOW) {
    return APPLICATION_LAYER;
  }
switch (type) {
case TYPE_STATUS_BAR:
    return STATUS_BAR_LAYER;
case TYPE_STATUS_BAR_PANEL:
  return STATUS_BAR_PANEL_LAYER;
case TYPE_SYSTEM_DIALOG:
return SYSTEM_DIALOG_LAYER;
case TYPE_SEARCH_BAR:
return SEARCH_BAR_LAYER;
case TYPE_PHONE:
return PHONE_LAYER;
case TYPE_KEYGUARD:
return KEYGUARD_LAYER;
case TYPE_KEYGUARD_DIALOG:
return KEYGUARD_DIALOG_LAYER;
case TYPE_SYSTEM_ALERT:
return SYSTEM_ALERT_LAYER;
case TYPE_SYSTEM_ERROR:
return SYSTEM_ERROR_LAYER;
case TYPE_INPUT_METHOD:
return INPUT_METHOD_LAYER;
case TYPE_INPUT_METHOD_DIALOG:
return INPUT_METHOD_DIALOG_LAYER;
case TYPE_SYSTEM_OVERLAY:
return SYSTEM_OVERLAY_LAYER;
case TYPE_PRIORITY_PHONE:
return PRIORITY_PHONE_LAYER;
case TYPE_TOAST:
return TOAST_LAYER;
case TYPE_WALLPAPER:
return WALLPAPER_LAYER;
}
Log.e(TAG,"String_Node_Str" + type);
return APPLICATION_LAYER;
}
Program: 23354
Project: 23354
Buggy source:
/** 
 * {@inheritDoc} 
 */
public int windowTypeToLayerLw(int type){
  if (type >= FIRST_APPLICATION_WINDOW && type <= LAST_APPLICATION_WINDOW) {
    return APPLICATION_LAYER;
  }
switch (type) {
case TYPE_STATUS_BAR:
    return STATUS_BAR_LAYER;
case TYPE_STATUS_BAR_PANEL:
  return STATUS_BAR_PANEL_LAYER;
case TYPE_SEARCH_BAR:
return SEARCH_BAR_LAYER;
case TYPE_PHONE:
return PHONE_LAYER;
case TYPE_KEYGUARD:
return KEYGUARD_LAYER;
case TYPE_KEYGUARD_DIALOG:
return KEYGUARD_DIALOG_LAYER;
case TYPE_SYSTEM_ALERT:
return SYSTEM_ALERT_LAYER;
case TYPE_SYSTEM_ERROR:
return SYSTEM_ERROR_LAYER;
case TYPE_INPUT_METHOD:
return INPUT_METHOD_LAYER;
case TYPE_INPUT_METHOD_DIALOG:
return INPUT_METHOD_DIALOG_LAYER;
case TYPE_SYSTEM_OVERLAY:
return SYSTEM_OVERLAY_LAYER;
case TYPE_PRIORITY_PHONE:
return PRIORITY_PHONE_LAYER;
case TYPE_TOAST:
return TOAST_LAYER;
case TYPE_WALLPAPER:
return WALLPAPER_LAYER;
}
Log.e(TAG,"String_Node_Str" + type);
return APPLICATION_LAYER;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public int windowTypeToLayerLw(int type){
  if (type >= FIRST_APPLICATION_WINDOW && type <= LAST_APPLICATION_WINDOW) {
    return APPLICATION_LAYER;
  }
switch (type) {
case TYPE_STATUS_BAR:
    return STATUS_BAR_LAYER;
case TYPE_STATUS_BAR_PANEL:
  return STATUS_BAR_PANEL_LAYER;
case TYPE_SYSTEM_DIALOG:
return SYSTEM_DIALOG_LAYER;
case TYPE_SEARCH_BAR:
return SEARCH_BAR_LAYER;
case TYPE_PHONE:
return PHONE_LAYER;
case TYPE_KEYGUARD:
return KEYGUARD_LAYER;
case TYPE_KEYGUARD_DIALOG:
return KEYGUARD_DIALOG_LAYER;
case TYPE_SYSTEM_ALERT:
return SYSTEM_ALERT_LAYER;
case TYPE_SYSTEM_ERROR:
return SYSTEM_ERROR_LAYER;
case TYPE_INPUT_METHOD:
return INPUT_METHOD_LAYER;
case TYPE_INPUT_METHOD_DIALOG:
return INPUT_METHOD_DIALOG_LAYER;
case TYPE_SYSTEM_OVERLAY:
return SYSTEM_OVERLAY_LAYER;
case TYPE_PRIORITY_PHONE:
return PRIORITY_PHONE_LAYER;
case TYPE_TOAST:
return TOAST_LAYER;
case TYPE_WALLPAPER:
return WALLPAPER_LAYER;
}
Log.e(TAG,"String_Node_Str" + type);
return APPLICATION_LAYER;
}
Program: 23355
Project: 23355
Buggy source:
/** 
 * {@inheritDoc} 
 */
public int windowTypeToLayerLw(int type){
  if (type >= FIRST_APPLICATION_WINDOW && type <= LAST_APPLICATION_WINDOW) {
    return APPLICATION_LAYER;
  }
switch (type) {
case TYPE_STATUS_BAR:
    return STATUS_BAR_LAYER;
case TYPE_STATUS_BAR_PANEL:
  return STATUS_BAR_PANEL_LAYER;
case TYPE_SEARCH_BAR:
return SEARCH_BAR_LAYER;
case TYPE_PHONE:
return PHONE_LAYER;
case TYPE_KEYGUARD:
return KEYGUARD_LAYER;
case TYPE_KEYGUARD_DIALOG:
return KEYGUARD_DIALOG_LAYER;
case TYPE_SYSTEM_ALERT:
return SYSTEM_ALERT_LAYER;
case TYPE_SYSTEM_ERROR:
return SYSTEM_ERROR_LAYER;
case TYPE_INPUT_METHOD:
return INPUT_METHOD_LAYER;
case TYPE_INPUT_METHOD_DIALOG:
return INPUT_METHOD_DIALOG_LAYER;
case TYPE_SYSTEM_OVERLAY:
return SYSTEM_OVERLAY_LAYER;
case TYPE_PRIORITY_PHONE:
return PRIORITY_PHONE_LAYER;
case TYPE_TOAST:
return TOAST_LAYER;
case TYPE_WALLPAPER:
return WALLPAPER_LAYER;
}
Log.e(TAG,"String_Node_Str" + type);
return APPLICATION_LAYER;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public int windowTypeToLayerLw(int type){
  if (type >= FIRST_APPLICATION_WINDOW && type <= LAST_APPLICATION_WINDOW) {
    return APPLICATION_LAYER;
  }
switch (type) {
case TYPE_STATUS_BAR:
    return STATUS_BAR_LAYER;
case TYPE_STATUS_BAR_PANEL:
  return STATUS_BAR_PANEL_LAYER;
case TYPE_SYSTEM_DIALOG:
return SYSTEM_DIALOG_LAYER;
case TYPE_SEARCH_BAR:
return SEARCH_BAR_LAYER;
case TYPE_PHONE:
return PHONE_LAYER;
case TYPE_KEYGUARD:
return KEYGUARD_LAYER;
case TYPE_KEYGUARD_DIALOG:
return KEYGUARD_DIALOG_LAYER;
case TYPE_SYSTEM_ALERT:
return SYSTEM_ALERT_LAYER;
case TYPE_SYSTEM_ERROR:
return SYSTEM_ERROR_LAYER;
case TYPE_INPUT_METHOD:
return INPUT_METHOD_LAYER;
case TYPE_INPUT_METHOD_DIALOG:
return INPUT_METHOD_DIALOG_LAYER;
case TYPE_SYSTEM_OVERLAY:
return SYSTEM_OVERLAY_LAYER;
case TYPE_PRIORITY_PHONE:
return PRIORITY_PHONE_LAYER;
case TYPE_TOAST:
return TOAST_LAYER;
case TYPE_WALLPAPER:
return WALLPAPER_LAYER;
}
Log.e(TAG,"String_Node_Str" + type);
return APPLICATION_LAYER;
}
Program: 23356
Project: 23356
Buggy source:
/** 
 * @see android.app.KeyguardManager#exitKeyguardSecurely
 */
public void verifyUnlock(WindowManagerPolicy.OnKeyguardExitResult callback){
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    if (!mUpdateMonitor.isDeviceProvisioned()) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      callback.onKeyguardExitResult(false);
    }
 else     if (mExitSecureCallback != null) {
      callback.onKeyguardExitResult(false);
    }
 else     if (mExternallyEnabled) {
      if (mHidden) {
        if (isSecure()) {
          callback.onKeyguardExitResult(true);
        }
 else {
          mExitSecureCallback=callback;
          verifyUnlockLocked();
        }
      }
 else {
        Log.w(TAG,"String_Node_Str");
        callback.onKeyguardExitResult(false);
      }
    }
 else {
      mExitSecureCallback=callback;
      verifyUnlockLocked();
    }
  }
}

Fixed version (ground truth):
/** 
 * @see android.app.KeyguardManager#exitKeyguardSecurely
 */
public void verifyUnlock(WindowManagerPolicy.OnKeyguardExitResult callback){
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    if (!mUpdateMonitor.isDeviceProvisioned()) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      callback.onKeyguardExitResult(false);
    }
 else     if (mExternallyEnabled) {
      Log.w(TAG,"String_Node_Str");
      callback.onKeyguardExitResult(false);
    }
 else     if (mExitSecureCallback != null) {
      callback.onKeyguardExitResult(false);
    }
 else {
      mExitSecureCallback=callback;
      verifyUnlockLocked();
    }
  }
}
Program: 23357
Project: 23357
Buggy source:
/** 
 * @see android.app.KeyguardManager#exitKeyguardSecurely
 */
public void verifyUnlock(WindowManagerPolicy.OnKeyguardExitResult callback){
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    if (!mUpdateMonitor.isDeviceProvisioned()) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      callback.onKeyguardExitResult(false);
    }
 else     if (mExternallyEnabled) {
      Log.w(TAG,"String_Node_Str");
      callback.onKeyguardExitResult(false);
    }
 else     if (mExitSecureCallback != null) {
      callback.onKeyguardExitResult(false);
    }
 else {
      mExitSecureCallback=callback;
      verifyUnlockLocked();
    }
  }
}

Fixed version (ground truth):
/** 
 * @see android.app.KeyguardManager#exitKeyguardSecurely
 */
public void verifyUnlock(WindowManagerPolicy.OnKeyguardExitResult callback){
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    if (!mUpdateMonitor.isDeviceProvisioned()) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      callback.onKeyguardExitResult(false);
    }
 else     if (mExitSecureCallback != null) {
      callback.onKeyguardExitResult(false);
    }
 else     if (mExternallyEnabled) {
      if (mHidden) {
        if (isSecure()) {
          callback.onKeyguardExitResult(true);
        }
 else {
          mExitSecureCallback=callback;
          verifyUnlockLocked();
        }
      }
 else {
        Log.w(TAG,"String_Node_Str");
        callback.onKeyguardExitResult(false);
      }
    }
 else {
      mExitSecureCallback=callback;
      verifyUnlockLocked();
    }
  }
}
Program: 23359
Project: 23359
Buggy source:
/** 
 * @see android.app.KeyguardManager#exitKeyguardSecurely
 */
public void verifyUnlock(WindowManagerPolicy.OnKeyguardExitResult callback){
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    if (!mUpdateMonitor.isDeviceProvisioned()) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      callback.onKeyguardExitResult(false);
    }
 else     if (mExitSecureCallback != null) {
      callback.onKeyguardExitResult(false);
    }
 else     if (mExternallyEnabled) {
      if (mHidden) {
        if (isSecure()) {
          callback.onKeyguardExitResult(true);
        }
 else {
          mExitSecureCallback=callback;
          verifyUnlockLocked();
        }
      }
 else {
        Log.w(TAG,"String_Node_Str");
        callback.onKeyguardExitResult(false);
      }
    }
 else {
      mExitSecureCallback=callback;
      verifyUnlockLocked();
    }
  }
}

Fixed version (ground truth):
/** 
 * @see android.app.KeyguardManager#exitKeyguardSecurely
 */
public void verifyUnlock(WindowManagerPolicy.OnKeyguardExitResult callback){
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    if (!mUpdateMonitor.isDeviceProvisioned()) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      callback.onKeyguardExitResult(false);
    }
 else     if (mExternallyEnabled) {
      Log.w(TAG,"String_Node_Str");
      callback.onKeyguardExitResult(false);
    }
 else     if (mExitSecureCallback != null) {
      callback.onKeyguardExitResult(false);
    }
 else {
      mExitSecureCallback=callback;
      verifyUnlockLocked();
    }
  }
}
Program: 23360
Project: 23360
Buggy source:
/** 
 * @see android.app.KeyguardManager#exitKeyguardSecurely
 */
public void verifyUnlock(WindowManagerPolicy.OnKeyguardExitResult callback){
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    if (!mUpdateMonitor.isDeviceProvisioned()) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      callback.onKeyguardExitResult(false);
    }
 else     if (mExitSecureCallback != null) {
      callback.onKeyguardExitResult(false);
    }
 else     if (mExternallyEnabled) {
      if (mHidden) {
        if (isSecure()) {
          callback.onKeyguardExitResult(true);
        }
 else {
          mExitSecureCallback=callback;
          verifyUnlockLocked();
        }
      }
 else {
        Log.w(TAG,"String_Node_Str");
        callback.onKeyguardExitResult(false);
      }
    }
 else {
      mExitSecureCallback=callback;
      verifyUnlockLocked();
    }
  }
}

Fixed version (ground truth):
/** 
 * @see android.app.KeyguardManager#exitKeyguardSecurely
 */
public void verifyUnlock(WindowManagerPolicy.OnKeyguardExitResult callback){
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    if (!mUpdateMonitor.isDeviceProvisioned()) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      callback.onKeyguardExitResult(false);
    }
 else     if (mExternallyEnabled) {
      Log.w(TAG,"String_Node_Str");
      callback.onKeyguardExitResult(false);
    }
 else     if (mExitSecureCallback != null) {
      callback.onKeyguardExitResult(false);
    }
 else {
      mExitSecureCallback=callback;
      verifyUnlockLocked();
    }
  }
}
Program: 23361
Project: 23361
Buggy source:
/** 
 * @see android.app.KeyguardManager#exitKeyguardSecurely
 */
public void verifyUnlock(WindowManagerPolicy.OnKeyguardExitResult callback){
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    if (!mUpdateMonitor.isDeviceProvisioned()) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      callback.onKeyguardExitResult(false);
    }
 else     if (mExitSecureCallback != null) {
      callback.onKeyguardExitResult(false);
    }
 else     if (mExternallyEnabled) {
      if (mHidden) {
        if (isSecure()) {
          callback.onKeyguardExitResult(true);
        }
 else {
          mExitSecureCallback=callback;
          verifyUnlockLocked();
        }
      }
 else {
        Log.w(TAG,"String_Node_Str");
        callback.onKeyguardExitResult(false);
      }
    }
 else {
      mExitSecureCallback=callback;
      verifyUnlockLocked();
    }
  }
}

Fixed version (ground truth):
/** 
 * @see android.app.KeyguardManager#exitKeyguardSecurely
 */
public void verifyUnlock(WindowManagerPolicy.OnKeyguardExitResult callback){
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    if (!mUpdateMonitor.isDeviceProvisioned()) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      callback.onKeyguardExitResult(false);
    }
 else     if (mExternallyEnabled) {
      Log.w(TAG,"String_Node_Str");
      callback.onKeyguardExitResult(false);
    }
 else     if (mExitSecureCallback != null) {
      callback.onKeyguardExitResult(false);
    }
 else {
      mExitSecureCallback=callback;
      verifyUnlockLocked();
    }
  }
}
Program: 23362
Project: 23362
Buggy source:
/** 
 * @see android.app.KeyguardManager#exitKeyguardSecurely
 */
public void verifyUnlock(WindowManagerPolicy.OnKeyguardExitResult callback){
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    if (!mUpdateMonitor.isDeviceProvisioned()) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      callback.onKeyguardExitResult(false);
    }
 else     if (mExitSecureCallback != null) {
      callback.onKeyguardExitResult(false);
    }
 else     if (mExternallyEnabled) {
      if (mHidden) {
        if (isSecure()) {
          callback.onKeyguardExitResult(true);
        }
 else {
          mExitSecureCallback=callback;
          verifyUnlockLocked();
        }
      }
 else {
        Log.w(TAG,"String_Node_Str");
        callback.onKeyguardExitResult(false);
      }
    }
 else {
      mExitSecureCallback=callback;
      verifyUnlockLocked();
    }
  }
}

Fixed version (ground truth):
/** 
 * @see android.app.KeyguardManager#exitKeyguardSecurely
 */
public void verifyUnlock(WindowManagerPolicy.OnKeyguardExitResult callback){
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    if (!mUpdateMonitor.isDeviceProvisioned()) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      callback.onKeyguardExitResult(false);
    }
 else     if (mExternallyEnabled) {
      Log.w(TAG,"String_Node_Str");
      callback.onKeyguardExitResult(false);
    }
 else     if (mExitSecureCallback != null) {
      callback.onKeyguardExitResult(false);
    }
 else {
      mExitSecureCallback=callback;
      verifyUnlockLocked();
    }
  }
}
Program: 23363
Project: 23363
Buggy source:
/** 
 * @see android.app.KeyguardManager#exitKeyguardSecurely
 */
public void verifyUnlock(WindowManagerPolicy.OnKeyguardExitResult callback){
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    if (!mUpdateMonitor.isDeviceProvisioned()) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      callback.onKeyguardExitResult(false);
    }
 else     if (mExternallyEnabled) {
      Log.w(TAG,"String_Node_Str");
      callback.onKeyguardExitResult(false);
    }
 else     if (mExitSecureCallback != null) {
      callback.onKeyguardExitResult(false);
    }
 else {
      mExitSecureCallback=callback;
      verifyUnlockLocked();
    }
  }
}

Fixed version (ground truth):
/** 
 * @see android.app.KeyguardManager#exitKeyguardSecurely
 */
public void verifyUnlock(WindowManagerPolicy.OnKeyguardExitResult callback){
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    if (!mUpdateMonitor.isDeviceProvisioned()) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      callback.onKeyguardExitResult(false);
    }
 else     if (mExitSecureCallback != null) {
      callback.onKeyguardExitResult(false);
    }
 else     if (mExternallyEnabled) {
      if (mHidden) {
        if (isSecure()) {
          callback.onKeyguardExitResult(true);
        }
 else {
          mExitSecureCallback=callback;
          verifyUnlockLocked();
        }
      }
 else {
        Log.w(TAG,"String_Node_Str");
        callback.onKeyguardExitResult(false);
      }
    }
 else {
      mExitSecureCallback=callback;
      verifyUnlockLocked();
    }
  }
}
Program: 23364
Project: 23364
Buggy source:
/** 
 * @see android.app.KeyguardManager#exitKeyguardSecurely
 */
public void verifyUnlock(WindowManagerPolicy.OnKeyguardExitResult callback){
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    if (!mUpdateMonitor.isDeviceProvisioned()) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      callback.onKeyguardExitResult(false);
    }
 else     if (mExternallyEnabled) {
      Log.w(TAG,"String_Node_Str");
      callback.onKeyguardExitResult(false);
    }
 else     if (mExitSecureCallback != null) {
      callback.onKeyguardExitResult(false);
    }
 else {
      mExitSecureCallback=callback;
      verifyUnlockLocked();
    }
  }
}

Fixed version (ground truth):
/** 
 * @see android.app.KeyguardManager#exitKeyguardSecurely
 */
public void verifyUnlock(WindowManagerPolicy.OnKeyguardExitResult callback){
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    if (!mUpdateMonitor.isDeviceProvisioned()) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      callback.onKeyguardExitResult(false);
    }
 else     if (mExitSecureCallback != null) {
      callback.onKeyguardExitResult(false);
    }
 else     if (mExternallyEnabled) {
      if (mHidden) {
        if (isSecure()) {
          callback.onKeyguardExitResult(true);
        }
 else {
          mExitSecureCallback=callback;
          verifyUnlockLocked();
        }
      }
 else {
        Log.w(TAG,"String_Node_Str");
        callback.onKeyguardExitResult(false);
      }
    }
 else {
      mExitSecureCallback=callback;
      verifyUnlockLocked();
    }
  }
}
Program: 23365
Project: 23365
Buggy source:
/** 
 * @see android.app.KeyguardManager#exitKeyguardSecurely
 */
public void verifyUnlock(WindowManagerPolicy.OnKeyguardExitResult callback){
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    if (!mUpdateMonitor.isDeviceProvisioned()) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      callback.onKeyguardExitResult(false);
    }
 else     if (mExternallyEnabled) {
      Log.w(TAG,"String_Node_Str");
      callback.onKeyguardExitResult(false);
    }
 else     if (mExitSecureCallback != null) {
      callback.onKeyguardExitResult(false);
    }
 else {
      mExitSecureCallback=callback;
      verifyUnlockLocked();
    }
  }
}

Fixed version (ground truth):
/** 
 * @see android.app.KeyguardManager#exitKeyguardSecurely
 */
public void verifyUnlock(WindowManagerPolicy.OnKeyguardExitResult callback){
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    if (!mUpdateMonitor.isDeviceProvisioned()) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      callback.onKeyguardExitResult(false);
    }
 else     if (mExitSecureCallback != null) {
      callback.onKeyguardExitResult(false);
    }
 else     if (mExternallyEnabled) {
      if (mHidden) {
        if (isSecure()) {
          callback.onKeyguardExitResult(true);
        }
 else {
          mExitSecureCallback=callback;
          verifyUnlockLocked();
        }
      }
 else {
        Log.w(TAG,"String_Node_Str");
        callback.onKeyguardExitResult(false);
      }
    }
 else {
      mExitSecureCallback=callback;
      verifyUnlockLocked();
    }
  }
}
Program: 23366
Project: 23366
Buggy source:
/** 
 * @see android.app.KeyguardManager#exitKeyguardSecurely
 */
public void verifyUnlock(WindowManagerPolicy.OnKeyguardExitResult callback){
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    if (!mUpdateMonitor.isDeviceProvisioned()) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      callback.onKeyguardExitResult(false);
    }
 else     if (mExternallyEnabled) {
      Log.w(TAG,"String_Node_Str");
      callback.onKeyguardExitResult(false);
    }
 else     if (mExitSecureCallback != null) {
      callback.onKeyguardExitResult(false);
    }
 else {
      mExitSecureCallback=callback;
      verifyUnlockLocked();
    }
  }
}

Fixed version (ground truth):
/** 
 * @see android.app.KeyguardManager#exitKeyguardSecurely
 */
public void verifyUnlock(WindowManagerPolicy.OnKeyguardExitResult callback){
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    if (!mUpdateMonitor.isDeviceProvisioned()) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      callback.onKeyguardExitResult(false);
    }
 else     if (mExitSecureCallback != null) {
      callback.onKeyguardExitResult(false);
    }
 else     if (mExternallyEnabled) {
      if (mHidden) {
        if (isSecure()) {
          callback.onKeyguardExitResult(true);
        }
 else {
          mExitSecureCallback=callback;
          verifyUnlockLocked();
        }
      }
 else {
        Log.w(TAG,"String_Node_Str");
        callback.onKeyguardExitResult(false);
      }
    }
 else {
      mExitSecureCallback=callback;
      verifyUnlockLocked();
    }
  }
}
Program: 23367
Project: 23367
Buggy source:
private ViewManager.ChildView createSurface(WebkitPlugin webkitPlugin,int x,int y,int width,int height){
  if (mWebView == null) {
    return null;
  }
  SurfaceDrawingModel embeddedSurface=webkitPlugin.getEmbeddedSurface();
  if (embeddedSurface == null) {
    Log.e(LOGTAG,"String_Node_Str");
    return null;
  }
  View pluginView=embeddedSurface.getSurface();
  ViewManager.ChildView view=mWebView.mViewManager.createView();
  view.mView=pluginView;
  view.attachView(x,y,width,height);
  return view;
}

Fixed version (ground truth):
private ViewManager.ChildView createSurface(WebkitPlugin webkitPlugin,int x,int y,int width,int height){
  if (mWebView == null) {
    return null;
  }
  SurfaceDrawingModel embeddedSurface=webkitPlugin.getEmbeddedSurface();
  if (embeddedSurface == null) {
    Log.e(LOGTAG,"String_Node_Str");
    return null;
  }
  View pluginView=embeddedSurface.getSurface();
  pluginView.setWillNotDraw(false);
  ViewManager.ChildView view=mWebView.mViewManager.createView();
  view.mView=pluginView;
  view.attachView(x,y,width,height);
  return view;
}
Program: 23372
Project: 23372
Buggy source:
void logTimeStat(String sql,long beginNanos){
  int samplePercent;
  long nanos=Debug.threadCpuTimeNanos() - beginNanos;
  if (nanos >= QUERY_LOG_TIME_IN_NANOS) {
    samplePercent=100;
  }
 else {
    samplePercent=(int)(100 * nanos / QUERY_LOG_TIME_IN_NANOS) + 1;
    if (mRandom.nextInt(100) < samplePercent)     return;
  }
  if (sql.length() > QUERY_LOG_SQL_LENGTH)   sql=sql.substring(0,QUERY_LOG_SQL_LENGTH);
  String blockingPackage=ActivityThread.currentPackageName();
  if (blockingPackage == null)   blockingPackage="String_Node_Str";
  int millis=(int)(nanos / 1000000);
  EventLog.writeEvent(EVENT_DB_OPERATION,mPath,sql,millis,blockingPackage,samplePercent);
}

Fixed version (ground truth):
void logTimeStat(String sql,long beginNanos){
  int samplePercent;
  long nanos=Debug.threadCpuTimeNanos() - beginNanos;
  if (nanos >= QUERY_LOG_TIME_IN_NANOS) {
    samplePercent=100;
  }
 else {
    samplePercent=(int)(100 * nanos / QUERY_LOG_TIME_IN_NANOS) + 1;
    if (mRandom.nextInt(100) >= samplePercent)     return;
  }
  if (sql.length() > QUERY_LOG_SQL_LENGTH)   sql=sql.substring(0,QUERY_LOG_SQL_LENGTH);
  String blockingPackage=ActivityThread.currentPackageName();
  if (blockingPackage == null)   blockingPackage="String_Node_Str";
  int millis=(int)(nanos / 1000000);
  EventLog.writeEvent(EVENT_DB_OPERATION,mPath,sql,millis,blockingPackage,samplePercent);
}
Program: 23373
Project: 23373
Buggy source:
NameValueCache(String versionSystemProperty,Uri uri){
  mVersionSystemProperty=versionSystemProperty;
  mUri=uri;
}

Fixed version (ground truth):
public NameValueCache(String versionSystemProperty,Uri uri){
  mVersionSystemProperty=versionSystemProperty;
  mUri=uri;
}
Program: 23385
Project: 23385
Buggy source:
public void executeMessage(Message message){
switch (message.what) {
case DO_ATTACH:
{
      try {
        mConnection.attachEngine(this);
      }
 catch (      RemoteException e) {
        Log.w(TAG,"String_Node_Str",e);
        return;
      }
      Engine engine=onCreateEngine();
      mEngine=engine;
      engine.attach(this);
      return;
    }
case DO_DETACH:
{
    mEngine.detach();
    return;
  }
case DO_SET_DESIRED_SIZE:
{
  mEngine.doDesiredSizeChanged(message.arg1,message.arg2);
  return;
}
case MSG_UPDATE_SURFACE:
mEngine.updateSurface(true,false);
break;
case MSG_VISIBILITY_CHANGED:
if (DEBUG) Log.v(TAG,"String_Node_Str" + mEngine + "String_Node_Str"+ message.arg1);
mEngine.doVisibilityChanged(message.arg1 != 0);
break;
case MSG_WALLPAPER_OFFSETS:
{
mEngine.doOffsetsChanged();
}
break;
case MSG_WALLPAPER_COMMAND:
{
WallpaperCommand cmd=(WallpaperCommand)message.obj;
mEngine.doCommand(cmd);
}
break;
case MSG_WINDOW_RESIZED:
{
final boolean reportDraw=message.arg1 != 0;
mEngine.updateSurface(true,false);
if (reportDraw) {
try {
mEngine.mSession.finishDrawing(mEngine.mWindow);
}
 catch (RemoteException e) {
}
}
}
break;
case MSG_TOUCH_EVENT:
{
MotionEvent ev=(MotionEvent)message.obj;
synchronized (mEngine.mLock) {
if (mEngine.mPendingMove == ev) {
mEngine.mPendingMove=null;
}
}
if (DEBUG) Log.v(TAG,"String_Node_Str" + ev);
mEngine.onTouchEvent(ev);
ev.recycle();
}
break;
default :
Log.w(TAG,"String_Node_Str" + message.what);
}
}

Fixed version (ground truth):
public void executeMessage(Message message){
switch (message.what) {
case DO_ATTACH:
{
      try {
        mConnection.attachEngine(this);
      }
 catch (      RemoteException e) {
        Log.w(TAG,"String_Node_Str",e);
        return;
      }
      Engine engine=onCreateEngine();
      mEngine=engine;
      mActiveEngines.add(engine);
      engine.attach(this);
      return;
    }
case DO_DETACH:
{
    mActiveEngines.remove(mEngine);
    mEngine.detach();
    return;
  }
case DO_SET_DESIRED_SIZE:
{
  mEngine.doDesiredSizeChanged(message.arg1,message.arg2);
  return;
}
case MSG_UPDATE_SURFACE:
mEngine.updateSurface(true,false);
break;
case MSG_VISIBILITY_CHANGED:
if (DEBUG) Log.v(TAG,"String_Node_Str" + mEngine + "String_Node_Str"+ message.arg1);
mEngine.doVisibilityChanged(message.arg1 != 0);
break;
case MSG_WALLPAPER_OFFSETS:
{
mEngine.doOffsetsChanged();
}
break;
case MSG_WALLPAPER_COMMAND:
{
WallpaperCommand cmd=(WallpaperCommand)message.obj;
mEngine.doCommand(cmd);
}
break;
case MSG_WINDOW_RESIZED:
{
final boolean reportDraw=message.arg1 != 0;
mEngine.updateSurface(true,false);
if (reportDraw) {
try {
mEngine.mSession.finishDrawing(mEngine.mWindow);
}
 catch (RemoteException e) {
}
}
}
break;
case MSG_TOUCH_EVENT:
{
MotionEvent ev=(MotionEvent)message.obj;
synchronized (mEngine.mLock) {
if (mEngine.mPendingMove == ev) {
mEngine.mPendingMove=null;
}
}
if (DEBUG) Log.v(TAG,"String_Node_Str" + ev);
mEngine.onTouchEvent(ev);
ev.recycle();
}
break;
default :
Log.w(TAG,"String_Node_Str" + message.what);
}
}
Program: 23386
Project: 23386
Buggy source:
/** 
 * Called once to initialize the engine.  After returning, the engine's surface will be created by the framework.
 */
public void onCreate(SurfaceHolder surfaceHolder){
}

Fixed version (ground truth):
@Override public void onCreate(){
  super.onCreate();
}
Program: 23387
Project: 23387
Buggy source:
/** 
 * Called right before the engine is going away.  After this the surface will be destroyed and this Engine object is no longer valid.
 */
public void onDestroy(){
}

Fixed version (ground truth):
@Override public void onDestroy(){
  super.onDestroy();
  for (int i=0; i < mActiveEngines.size(); i++) {
    mActiveEngines.get(i).detach();
  }
  mActiveEngines.clear();
}
Program: 23388
Project: 23388
Buggy source:
void doVisibilityChanged(boolean visible){
  mVisible=visible;
  reportVisibility();
}

Fixed version (ground truth):
void doVisibilityChanged(boolean visible){
  if (!mDestroyed) {
    mVisible=visible;
    reportVisibility();
  }
}
Program: 23389
Project: 23389
Buggy source:
void detach(){
  mDestroyed=true;
  if (mVisible) {
    mVisible=false;
    if (DEBUG)     Log.v(TAG,"String_Node_Str" + this);
    onVisibilityChanged(false);
  }
  if (mDestroyReportNeeded) {
    mDestroyReportNeeded=false;
    SurfaceHolder.Callback callbacks[];
synchronized (mSurfaceHolder.mCallbacks) {
      callbacks=new SurfaceHolder.Callback[mSurfaceHolder.mCallbacks.size()];
      mSurfaceHolder.mCallbacks.toArray(callbacks);
    }
    for (    SurfaceHolder.Callback c : callbacks) {
      c.surfaceDestroyed(mSurfaceHolder);
    }
    if (DEBUG)     Log.v(TAG,"String_Node_Str" + mSurfaceHolder + "String_Node_Str"+ this);
    onSurfaceDestroyed(mSurfaceHolder);
  }
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + this);
  onDestroy();
  unregisterReceiver(mReceiver);
  if (mCreated) {
    try {
      mSession.remove(mWindow);
    }
 catch (    RemoteException e) {
    }
    mSurfaceHolder.mSurface.release();
    mCreated=false;
  }
}

Fixed version (ground truth):
void detach(){
  if (mDestroyed) {
    return;
  }
  mDestroyed=true;
  if (mVisible) {
    mVisible=false;
    if (DEBUG)     Log.v(TAG,"String_Node_Str" + this);
    onVisibilityChanged(false);
  }
  if (mDestroyReportNeeded) {
    mDestroyReportNeeded=false;
    SurfaceHolder.Callback callbacks[];
synchronized (mSurfaceHolder.mCallbacks) {
      callbacks=new SurfaceHolder.Callback[mSurfaceHolder.mCallbacks.size()];
      mSurfaceHolder.mCallbacks.toArray(callbacks);
    }
    for (    SurfaceHolder.Callback c : callbacks) {
      c.surfaceDestroyed(mSurfaceHolder);
    }
    if (DEBUG)     Log.v(TAG,"String_Node_Str" + mSurfaceHolder + "String_Node_Str"+ this);
    onSurfaceDestroyed(mSurfaceHolder);
  }
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + this);
  onDestroy();
  unregisterReceiver(mReceiver);
  if (mCreated) {
    try {
      mSession.remove(mWindow);
    }
 catch (    RemoteException e) {
    }
    mSurfaceHolder.mSurface.release();
    mCreated=false;
  }
}