nus-yam/ex-repair huggingface dataset:
Program: 42747
Project: 42747
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: 42748
Project: 42748
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: 42750
Project: 42750
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: 42751
Project: 42751
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: 42753
Project: 42753
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: 42754
Project: 42754
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: 42755
Project: 42755
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: 42756
Project: 42756
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: 42757
Project: 42757
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: 42758
Project: 42758
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: 42759
Project: 42759
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: 42761
Project: 42761
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: 42762
Project: 42762
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: 42763
Project: 42763
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: 42764
Project: 42764
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: 42765
Project: 42765
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: 42766
Project: 42766
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: 42767
Project: 42767
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: 42768
Project: 42768
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: 42769
Project: 42769
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: 42774
Project: 42774
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: 42775
Project: 42775
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: 42787
Project: 42787
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: 42788
Project: 42788
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: 42789
Project: 42789
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: 42790
Project: 42790
Buggy source:
void doVisibilityChanged(boolean visible){
  mVisible=visible;
  reportVisibility();
}

Fixed version (ground truth):
void doVisibilityChanged(boolean visible){
  if (!mDestroyed) {
    mVisible=visible;
    reportVisibility();
  }
}
Program: 42791
Project: 42791
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;
  }
}
Program: 42792
Project: 42792
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: 42793
Project: 42793
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: 42794
Project: 42794
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: 42795
Project: 42795
Buggy source:
void doVisibilityChanged(boolean visible){
  mVisible=visible;
  reportVisibility();
}

Fixed version (ground truth):
void doVisibilityChanged(boolean visible){
  if (!mDestroyed) {
    mVisible=visible;
    reportVisibility();
  }
}
Program: 42796
Project: 42796
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;
  }
}