nus-yam/ex-repair huggingface dataset:
Program: 182794
Project: 182794
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: 182795
Project: 182795
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: 182797
Project: 182797
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: 182798
Project: 182798
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: 182800
Project: 182800
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: 182801
Project: 182801
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: 182802
Project: 182802
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: 182803
Project: 182803
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: 182804
Project: 182804
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: 182805
Project: 182805
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: 182806
Project: 182806
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: 182808
Project: 182808
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: 182809
Project: 182809
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: 182810
Project: 182810
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: 182811
Project: 182811
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: 182812
Project: 182812
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: 182813
Project: 182813
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: 182814
Project: 182814
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: 182815
Project: 182815
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: 182816
Project: 182816
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: 182821
Project: 182821
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: 182822
Project: 182822
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: 182834
Project: 182834
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: 182835
Project: 182835
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: 182836
Project: 182836
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: 182837
Project: 182837
Buggy source:
void doVisibilityChanged(boolean visible){
  mVisible=visible;
  reportVisibility();
}

Fixed version (ground truth):
void doVisibilityChanged(boolean visible){
  if (!mDestroyed) {
    mVisible=visible;
    reportVisibility();
  }
}
Program: 182838
Project: 182838
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: 182839
Project: 182839
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: 182840
Project: 182840
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: 182841
Project: 182841
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: 182842
Project: 182842
Buggy source:
void doVisibilityChanged(boolean visible){
  mVisible=visible;
  reportVisibility();
}

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