nus-yam/ex-repair huggingface dataset:
Program: 2783
Project: 2783
Buggy source:
/** 
 * Return the uid of the application that created this PendingIntent, that is the identity under which you will actually be sending the Intent.  The returned integer is supplied by the system, so that an application can not spoof its uid.
 * @return The uid of the PendingIntent, or -1 if there isnone associated with it.
 */
public int getCreatorUid(){
  try {
    return ActivityManagerNative.getDefault().getUidForIntentSender(mTarget);
  }
 catch (  RemoteException e) {
    return -1;
  }
}

Fixed version (ground truth):
/** 
 * Return the uid of the application that created this PendingIntent, that is the identity under which you will actually be sending the Intent.  The returned integer is supplied by the system, so that an application can not spoof its uid. <p class="note">Be careful about how you use this.  All this tells you is who created the PendingIntent.  It does <strong>not</strong> tell you who handed the PendingIntent to you: that is, PendingIntent objects are intended to be passed between applications, so the PendingIntent you receive from an application could actually be one it received from another application, meaning the result you get here will identify the original application.  Because of this, you should only use this information to identify who you expect to be interacting with through a   {@link #send} call, not who gave you the PendingIntent.</p>
 * @return The uid of the PendingIntent, or -1 if there isnone associated with it.
 */
public int getCreatorUid(){
  try {
    return ActivityManagerNative.getDefault().getUidForIntentSender(mTarget);
  }
 catch (  RemoteException e) {
    return -1;
  }
}
Program: 2785
Project: 2785
Buggy source:
/** 
 * Retrieve a PendingIntent that will perform a broadcast, like calling  {@link Context#sendBroadcast(Intent) Context.sendBroadcast()}.
 * @param context The Context in which this PendingIntent should performthe broadcast.
 * @param requestCode Private request code for the sender (currentlynot used).
 * @param intent The Intent to be broadcast.
 * @param flags May be {@link #FLAG_ONE_SHOT},   {@link #FLAG_NO_CREATE},  {@link #FLAG_CANCEL_CURRENT},   {@link #FLAG_UPDATE_CURRENT}, or any of the flags as supported by  {@link Intent#fillIn Intent.fillIn()} to control which unspecified partsof the intent that can be supplied when the actual send happens.
 * @return Returns an existing or new PendingIntent matching the givenparameters.  May return null only if  {@link #FLAG_NO_CREATE} has beensupplied.
 */
public static PendingIntent getBroadcast(Context context,int requestCode,Intent intent,int flags){
  return getBroadcastAsUser(context,requestCode,intent,flags,new UserHandle(UserHandle.myUserId()));
}

Fixed version (ground truth):
/** 
 * Retrieve a PendingIntent that will perform a broadcast, like calling  {@link Context#sendBroadcast(Intent) Context.sendBroadcast()}. <p class="note">For security reasons, the   {@link android.content.Intent}you supply here should almost always be an <em>explicit intent</em>, that is specify an explicit component to be delivered to through  {@link Intent#setClass(android.content.Context,Class)} Intent.setClass</p>
 * @param context The Context in which this PendingIntent should performthe broadcast.
 * @param requestCode Private request code for the sender (currentlynot used).
 * @param intent The Intent to be broadcast.
 * @param flags May be {@link #FLAG_ONE_SHOT},   {@link #FLAG_NO_CREATE},  {@link #FLAG_CANCEL_CURRENT},   {@link #FLAG_UPDATE_CURRENT}, or any of the flags as supported by  {@link Intent#fillIn Intent.fillIn()} to control which unspecified partsof the intent that can be supplied when the actual send happens.
 * @return Returns an existing or new PendingIntent matching the givenparameters.  May return null only if  {@link #FLAG_NO_CREATE} has beensupplied.
 */
public static PendingIntent getBroadcast(Context context,int requestCode,Intent intent,int flags){
  return getBroadcastAsUser(context,requestCode,intent,flags,new UserHandle(UserHandle.myUserId()));
}
Program: 2788
Project: 2788
Buggy source:
/** 
 * Return the package name of the application that created this PendingIntent, that is the identity under which you will actually be sending the Intent.  The returned string is supplied by the system, so that an application can not spoof its package.
 * @return The package name of the PendingIntent, or null if there isnone associated with it.
 */
public String getCreatorPackage(){
  try {
    return ActivityManagerNative.getDefault().getPackageForIntentSender(mTarget);
  }
 catch (  RemoteException e) {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Return the package name of the application that created this PendingIntent, that is the identity under which you will actually be sending the Intent.  The returned string is supplied by the system, so that an application can not spoof its package. <p class="note">Be careful about how you use this.  All this tells you is who created the PendingIntent.  It does <strong>not</strong> tell you who handed the PendingIntent to you: that is, PendingIntent objects are intended to be passed between applications, so the PendingIntent you receive from an application could actually be one it received from another application, meaning the result you get here will identify the original application.  Because of this, you should only use this information to identify who you expect to be interacting with through a   {@link #send} call, not who gave you the PendingIntent.</p>
 * @return The package name of the PendingIntent, or null if there isnone associated with it.
 */
public String getCreatorPackage(){
  try {
    return ActivityManagerNative.getDefault().getPackageForIntentSender(mTarget);
  }
 catch (  RemoteException e) {
    return null;
  }
}
Program: 2789
Project: 2789
Buggy source:
/** 
 * Return the user handle of the application that created this PendingIntent, that is the user under which you will actually be sending the Intent.  The returned UserHandle is supplied by the system, so that an application can not spoof its user.  See  {@link android.os.Process#myUserHandle() Process.myUserHandle()} formore explanation of user handles.
 * @return The user handle of the PendingIntent, or null if there isnone associated with it.
 */
public UserHandle getCreatorUserHandle(){
  try {
    int uid=ActivityManagerNative.getDefault().getUidForIntentSender(mTarget);
    return uid > 0 ? new UserHandle(UserHandle.getUserId(uid)) : null;
  }
 catch (  RemoteException e) {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Return the user handle of the application that created this PendingIntent, that is the user under which you will actually be sending the Intent.  The returned UserHandle is supplied by the system, so that an application can not spoof its user.  See  {@link android.os.Process#myUserHandle() Process.myUserHandle()} formore explanation of user handles. <p class="note">Be careful about how you use this.  All this tells you is who created the PendingIntent.  It does <strong>not</strong> tell you who handed the PendingIntent to you: that is, PendingIntent objects are intended to be passed between applications, so the PendingIntent you receive from an application could actually be one it received from another application, meaning the result you get here will identify the original application.  Because of this, you should only use this information to identify who you expect to be interacting with through a  {@link #send} call, not who gave you the PendingIntent.</p>
 * @return The user handle of the PendingIntent, or null if there isnone associated with it.
 */
public UserHandle getCreatorUserHandle(){
  try {
    int uid=ActivityManagerNative.getDefault().getUidForIntentSender(mTarget);
    return uid > 0 ? new UserHandle(UserHandle.getUserId(uid)) : null;
  }
 catch (  RemoteException e) {
    return null;
  }
}
Program: 2793
Project: 2793
Buggy source:
public KeyguardHostView(Context context,AttributeSet attrs){
  super(context,attrs);
  mLockPatternUtils=new LockPatternUtils(context);
  mUserId=mLockPatternUtils.getCurrentUser();
  mAppWidgetHost=new AppWidgetHost(context,APPWIDGET_HOST_ID,mOnClickHandler,Looper.myLooper());
  mAppWidgetHost.setUserId(mUserId);
  cleanupAppWidgetIds();
  mAppWidgetManager=AppWidgetManager.getInstance(mContext);
  mSecurityModel=new KeyguardSecurityModel(context);
  mViewStateManager=new KeyguardViewStateManager(this);
  DevicePolicyManager dpm=(DevicePolicyManager)mContext.getSystemService(Context.DEVICE_POLICY_SERVICE);
  if (dpm != null) {
    mDisabledFeatures=getDisabledFeatures(dpm);
    mCameraDisabled=dpm.getCameraDisabled(null);
  }
  mSafeModeEnabled=LockPatternUtils.isSafeModeEnabled();
  mUserSetupCompleted=Settings.Secure.getIntForUser(mContext.getContentResolver(),Settings.Secure.USER_SETUP_COMPLETE,0,UserHandle.USER_CURRENT) != 0;
  if (mSafeModeEnabled) {
    Log.v(TAG,"String_Node_Str");
  }
  if ((mDisabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_WIDGETS_ALL) != 0) {
    Log.v(TAG,"String_Node_Str");
  }
  if ((mDisabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_SECURE_CAMERA) != 0) {
    Log.v(TAG,"String_Node_Str");
  }
}

Fixed version (ground truth):
public KeyguardHostView(Context context,AttributeSet attrs){
  super(context,attrs);
  mLockPatternUtils=new LockPatternUtils(context);
  mUserId=mLockPatternUtils.getCurrentUser();
  mAppWidgetHost=new AppWidgetHost(context,APPWIDGET_HOST_ID,mOnClickHandler,Looper.myLooper());
  mAppWidgetHost.setUserId(mUserId);
  DevicePolicyManager dpm=(DevicePolicyManager)mContext.getSystemService(Context.DEVICE_POLICY_SERVICE);
  if (dpm != null) {
    mDisabledFeatures=getDisabledFeatures(dpm);
    mCameraDisabled=dpm.getCameraDisabled(null);
  }
  mSafeModeEnabled=LockPatternUtils.isSafeModeEnabled();
  cleanupAppWidgetIds();
  mAppWidgetManager=AppWidgetManager.getInstance(mContext);
  mSecurityModel=new KeyguardSecurityModel(context);
  mViewStateManager=new KeyguardViewStateManager(this);
  mUserSetupCompleted=Settings.Secure.getIntForUser(mContext.getContentResolver(),Settings.Secure.USER_SETUP_COMPLETE,0,UserHandle.USER_CURRENT) != 0;
  if (mSafeModeEnabled) {
    Log.v(TAG,"String_Node_Str");
  }
  if ((mDisabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_WIDGETS_ALL) != 0) {
    Log.v(TAG,"String_Node_Str");
  }
  if ((mDisabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_SECURE_CAMERA) != 0) {
    Log.v(TAG,"String_Node_Str");
  }
}
Program: 2794
Project: 2794
Buggy source:
private void cleanupAppWidgetIds(){
  if (!KeyguardUpdateMonitor.getInstance(mContext).hasBootCompleted()) {
    mCleanupAppWidgetsOnBootCompleted=true;
    return;
  }
  int[] appWidgetIdsInKeyguardSettings=mLockPatternUtils.getAppWidgets();
  int[] appWidgetIdsBoundToHost=mAppWidgetHost.getAppWidgetIds();
  for (int i=0; i < appWidgetIdsBoundToHost.length; i++) {
    int appWidgetId=appWidgetIdsBoundToHost[i];
    if (!contains(appWidgetIdsInKeyguardSettings,appWidgetId)) {
      Log.d(TAG,"String_Node_Str" + appWidgetId);
      mAppWidgetHost.deleteAppWidgetId(appWidgetId);
    }
  }
}

Fixed version (ground truth):
private void cleanupAppWidgetIds(){
  if (!KeyguardUpdateMonitor.getInstance(mContext).hasBootCompleted()) {
    mCleanupAppWidgetsOnBootCompleted=true;
    return;
  }
  if (!mSafeModeEnabled && !widgetsDisabledByDpm()) {
    int[] appWidgetIdsInKeyguardSettings=mLockPatternUtils.getAppWidgets();
    int[] appWidgetIdsBoundToHost=mAppWidgetHost.getAppWidgetIds();
    for (int i=0; i < appWidgetIdsBoundToHost.length; i++) {
      int appWidgetId=appWidgetIdsBoundToHost[i];
      if (!contains(appWidgetIdsInKeyguardSettings,appWidgetId)) {
        Log.d(TAG,"String_Node_Str" + appWidgetId);
        mAppWidgetHost.deleteAppWidgetId(appWidgetId);
      }
    }
  }
}
Program: 2795
Project: 2795
Buggy source:
public KeyguardHostView(Context context,AttributeSet attrs){
  super(context,attrs);
  mLockPatternUtils=new LockPatternUtils(context);
  mUserId=mLockPatternUtils.getCurrentUser();
  mAppWidgetHost=new AppWidgetHost(context,APPWIDGET_HOST_ID,mOnClickHandler,Looper.myLooper());
  mAppWidgetHost.setUserId(mUserId);
  cleanupAppWidgetIds();
  mAppWidgetManager=AppWidgetManager.getInstance(mContext);
  mSecurityModel=new KeyguardSecurityModel(context);
  mViewStateManager=new KeyguardViewStateManager(this);
  DevicePolicyManager dpm=(DevicePolicyManager)mContext.getSystemService(Context.DEVICE_POLICY_SERVICE);
  if (dpm != null) {
    mDisabledFeatures=getDisabledFeatures(dpm);
    mCameraDisabled=dpm.getCameraDisabled(null);
  }
  mSafeModeEnabled=LockPatternUtils.isSafeModeEnabled();
  mUserSetupCompleted=Settings.Secure.getIntForUser(mContext.getContentResolver(),Settings.Secure.USER_SETUP_COMPLETE,0,UserHandle.USER_CURRENT) != 0;
  if (mSafeModeEnabled) {
    Log.v(TAG,"String_Node_Str");
  }
  if ((mDisabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_WIDGETS_ALL) != 0) {
    Log.v(TAG,"String_Node_Str");
  }
  if ((mDisabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_SECURE_CAMERA) != 0) {
    Log.v(TAG,"String_Node_Str");
  }
}

Fixed version (ground truth):
public KeyguardHostView(Context context,AttributeSet attrs){
  super(context,attrs);
  mLockPatternUtils=new LockPatternUtils(context);
  mUserId=mLockPatternUtils.getCurrentUser();
  mAppWidgetHost=new AppWidgetHost(context,APPWIDGET_HOST_ID,mOnClickHandler,Looper.myLooper());
  mAppWidgetHost.setUserId(mUserId);
  DevicePolicyManager dpm=(DevicePolicyManager)mContext.getSystemService(Context.DEVICE_POLICY_SERVICE);
  if (dpm != null) {
    mDisabledFeatures=getDisabledFeatures(dpm);
    mCameraDisabled=dpm.getCameraDisabled(null);
  }
  mSafeModeEnabled=LockPatternUtils.isSafeModeEnabled();
  cleanupAppWidgetIds();
  mAppWidgetManager=AppWidgetManager.getInstance(mContext);
  mSecurityModel=new KeyguardSecurityModel(context);
  mViewStateManager=new KeyguardViewStateManager(this);
  mUserSetupCompleted=Settings.Secure.getIntForUser(mContext.getContentResolver(),Settings.Secure.USER_SETUP_COMPLETE,0,UserHandle.USER_CURRENT) != 0;
  if (mSafeModeEnabled) {
    Log.v(TAG,"String_Node_Str");
  }
  if ((mDisabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_WIDGETS_ALL) != 0) {
    Log.v(TAG,"String_Node_Str");
  }
  if ((mDisabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_SECURE_CAMERA) != 0) {
    Log.v(TAG,"String_Node_Str");
  }
}
Program: 2796
Project: 2796
Buggy source:
private void cleanupAppWidgetIds(){
  if (!KeyguardUpdateMonitor.getInstance(mContext).hasBootCompleted()) {
    mCleanupAppWidgetsOnBootCompleted=true;
    return;
  }
  int[] appWidgetIdsInKeyguardSettings=mLockPatternUtils.getAppWidgets();
  int[] appWidgetIdsBoundToHost=mAppWidgetHost.getAppWidgetIds();
  for (int i=0; i < appWidgetIdsBoundToHost.length; i++) {
    int appWidgetId=appWidgetIdsBoundToHost[i];
    if (!contains(appWidgetIdsInKeyguardSettings,appWidgetId)) {
      Log.d(TAG,"String_Node_Str" + appWidgetId);
      mAppWidgetHost.deleteAppWidgetId(appWidgetId);
    }
  }
}

Fixed version (ground truth):
private void cleanupAppWidgetIds(){
  if (!KeyguardUpdateMonitor.getInstance(mContext).hasBootCompleted()) {
    mCleanupAppWidgetsOnBootCompleted=true;
    return;
  }
  if (!mSafeModeEnabled && !widgetsDisabledByDpm()) {
    int[] appWidgetIdsInKeyguardSettings=mLockPatternUtils.getAppWidgets();
    int[] appWidgetIdsBoundToHost=mAppWidgetHost.getAppWidgetIds();
    for (int i=0; i < appWidgetIdsBoundToHost.length; i++) {
      int appWidgetId=appWidgetIdsBoundToHost[i];
      if (!contains(appWidgetIdsInKeyguardSettings,appWidgetId)) {
        Log.d(TAG,"String_Node_Str" + appWidgetId);
        mAppWidgetHost.deleteAppWidgetId(appWidgetId);
      }
    }
  }
}
Program: 2797
Project: 2797
Buggy source:
private void resetAllInternalStateLocked(final boolean updateOnlyWhenLocaleChanged){
  if (!mSystemReady) {
    return;
  }
  final Locale newLocale=mRes.getConfiguration().locale;
  if (!updateOnlyWhenLocaleChanged || (newLocale != null && !newLocale.equals(mLastSystemLocale))) {
    if (!updateOnlyWhenLocaleChanged) {
      hideCurrentInputLocked(0,null);
      mCurMethodId=null;
      unbindCurrentMethodLocked(true,false);
    }
    if (DEBUG) {
      Slog.i(TAG,"String_Node_Str" + newLocale);
    }
    mImListManager=new InputMethodAndSubtypeListManager(mContext,this);
    buildInputMethodListLocked(mMethodList,mMethodMap,updateOnlyWhenLocaleChanged);
    if (!updateOnlyWhenLocaleChanged) {
      final String selectedImiId=mSettings.getSelectedInputMethod();
      if (TextUtils.isEmpty(selectedImiId)) {
        resetDefaultImeLocked(mContext);
      }
    }
 else {
      resetDefaultImeLocked(mContext);
    }
    updateFromSettingsLocked(true);
    mLastSystemLocale=newLocale;
    if (!updateOnlyWhenLocaleChanged) {
      try {
        startInputInnerLocked();
      }
 catch (      RuntimeException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
  }
}

Fixed version (ground truth):
private void resetAllInternalStateLocked(final boolean updateOnlyWhenLocaleChanged,final boolean resetDefaultEnabledIme){
  if (!mSystemReady) {
    return;
  }
  final Locale newLocale=mRes.getConfiguration().locale;
  if (!updateOnlyWhenLocaleChanged || (newLocale != null && !newLocale.equals(mLastSystemLocale))) {
    if (!updateOnlyWhenLocaleChanged) {
      hideCurrentInputLocked(0,null);
      mCurMethodId=null;
      unbindCurrentMethodLocked(true,false);
    }
    if (DEBUG) {
      Slog.i(TAG,"String_Node_Str" + newLocale);
    }
    mImListManager=new InputMethodAndSubtypeListManager(mContext,this);
    buildInputMethodListLocked(mMethodList,mMethodMap,resetDefaultEnabledIme);
    if (!updateOnlyWhenLocaleChanged) {
      final String selectedImiId=mSettings.getSelectedInputMethod();
      if (TextUtils.isEmpty(selectedImiId)) {
        resetDefaultImeLocked(mContext);
      }
    }
 else {
      resetDefaultImeLocked(mContext);
    }
    updateFromSettingsLocked(true);
    mLastSystemLocale=newLocale;
    if (!updateOnlyWhenLocaleChanged) {
      try {
        startInputInnerLocked();
      }
 catch (      RuntimeException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
  }
}
Program: 2798
Project: 2798
Buggy source:
private void checkCurrentLocaleChangedLocked(){
  resetAllInternalStateLocked(true);
}

Fixed version (ground truth):
private void checkCurrentLocaleChangedLocked(){
  resetAllInternalStateLocked(true,true);
}
Program: 2799
Project: 2799
Buggy source:
private void switchUserLocked(int newUserId){
  mSettings.setCurrentUserId(newUserId);
  mFileManager=new InputMethodFileManager(mMethodMap,newUserId);
  resetAllInternalStateLocked(false);
}

Fixed version (ground truth):
private void switchUserLocked(int newUserId){
  mSettings.setCurrentUserId(newUserId);
  mFileManager=new InputMethodFileManager(mMethodMap,newUserId);
  final String defaultImiId=mSettings.getSelectedInputMethod();
  final boolean needsToResetDefaultIme=TextUtils.isEmpty(defaultImiId);
  if (DEBUG) {
    Slog.d(TAG,"String_Node_Str" + newUserId + "String_Node_Str"+ defaultImiId);
  }
  resetAllInternalStateLocked(false,needsToResetDefaultIme);
}
Program: 2800
Project: 2800
Buggy source:
private void resetAllInternalStateLocked(final boolean updateOnlyWhenLocaleChanged){
  if (!mSystemReady) {
    return;
  }
  final Locale newLocale=mRes.getConfiguration().locale;
  if (!updateOnlyWhenLocaleChanged || (newLocale != null && !newLocale.equals(mLastSystemLocale))) {
    if (!updateOnlyWhenLocaleChanged) {
      hideCurrentInputLocked(0,null);
      mCurMethodId=null;
      unbindCurrentMethodLocked(true,false);
    }
    if (DEBUG) {
      Slog.i(TAG,"String_Node_Str" + newLocale);
    }
    mImListManager=new InputMethodAndSubtypeListManager(mContext,this);
    buildInputMethodListLocked(mMethodList,mMethodMap,updateOnlyWhenLocaleChanged);
    if (!updateOnlyWhenLocaleChanged) {
      final String selectedImiId=mSettings.getSelectedInputMethod();
      if (TextUtils.isEmpty(selectedImiId)) {
        resetDefaultImeLocked(mContext);
      }
    }
 else {
      resetDefaultImeLocked(mContext);
    }
    updateFromSettingsLocked(true);
    mLastSystemLocale=newLocale;
    if (!updateOnlyWhenLocaleChanged) {
      try {
        startInputInnerLocked();
      }
 catch (      RuntimeException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
  }
}

Fixed version (ground truth):
private void resetAllInternalStateLocked(final boolean updateOnlyWhenLocaleChanged,final boolean resetDefaultEnabledIme){
  if (!mSystemReady) {
    return;
  }
  final Locale newLocale=mRes.getConfiguration().locale;
  if (!updateOnlyWhenLocaleChanged || (newLocale != null && !newLocale.equals(mLastSystemLocale))) {
    if (!updateOnlyWhenLocaleChanged) {
      hideCurrentInputLocked(0,null);
      mCurMethodId=null;
      unbindCurrentMethodLocked(true,false);
    }
    if (DEBUG) {
      Slog.i(TAG,"String_Node_Str" + newLocale);
    }
    mImListManager=new InputMethodAndSubtypeListManager(mContext,this);
    buildInputMethodListLocked(mMethodList,mMethodMap,resetDefaultEnabledIme);
    if (!updateOnlyWhenLocaleChanged) {
      final String selectedImiId=mSettings.getSelectedInputMethod();
      if (TextUtils.isEmpty(selectedImiId)) {
        resetDefaultImeLocked(mContext);
      }
    }
 else {
      resetDefaultImeLocked(mContext);
    }
    updateFromSettingsLocked(true);
    mLastSystemLocale=newLocale;
    if (!updateOnlyWhenLocaleChanged) {
      try {
        startInputInnerLocked();
      }
 catch (      RuntimeException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
  }
}
Program: 2801
Project: 2801
Buggy source:
private void checkCurrentLocaleChangedLocked(){
  resetAllInternalStateLocked(true);
}

Fixed version (ground truth):
private void checkCurrentLocaleChangedLocked(){
  resetAllInternalStateLocked(true,true);
}
Program: 2802
Project: 2802
Buggy source:
private void switchUserLocked(int newUserId){
  mSettings.setCurrentUserId(newUserId);
  mFileManager=new InputMethodFileManager(mMethodMap,newUserId);
  resetAllInternalStateLocked(false);
}

Fixed version (ground truth):
private void switchUserLocked(int newUserId){
  mSettings.setCurrentUserId(newUserId);
  mFileManager=new InputMethodFileManager(mMethodMap,newUserId);
  final String defaultImiId=mSettings.getSelectedInputMethod();
  final boolean needsToResetDefaultIme=TextUtils.isEmpty(defaultImiId);
  if (DEBUG) {
    Slog.d(TAG,"String_Node_Str" + newUserId + "String_Node_Str"+ defaultImiId);
  }
  resetAllInternalStateLocked(false,needsToResetDefaultIme);
}
Program: 2803
Project: 2803
Buggy source:
public KeyguardHostView(Context context,AttributeSet attrs){
  super(context,attrs);
  mLockPatternUtils=new LockPatternUtils(context);
  mUserId=mLockPatternUtils.getCurrentUser();
  mAppWidgetHost=new AppWidgetHost(context,APPWIDGET_HOST_ID,mOnClickHandler,Looper.myLooper());
  mAppWidgetHost.setUserId(mUserId);
  cleanupAppWidgetIds();
  mAppWidgetManager=AppWidgetManager.getInstance(mContext);
  mSecurityModel=new KeyguardSecurityModel(context);
  mViewStateManager=new KeyguardViewStateManager(this);
  DevicePolicyManager dpm=(DevicePolicyManager)mContext.getSystemService(Context.DEVICE_POLICY_SERVICE);
  if (dpm != null) {
    mDisabledFeatures=getDisabledFeatures(dpm);
    mCameraDisabled=dpm.getCameraDisabled(null);
  }
  mSafeModeEnabled=LockPatternUtils.isSafeModeEnabled();
  mUserSetupCompleted=Settings.Secure.getIntForUser(mContext.getContentResolver(),Settings.Secure.USER_SETUP_COMPLETE,0,UserHandle.USER_CURRENT) != 0;
  if (mSafeModeEnabled) {
    Log.v(TAG,"String_Node_Str");
  }
  if ((mDisabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_WIDGETS_ALL) != 0) {
    Log.v(TAG,"String_Node_Str");
  }
  if ((mDisabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_SECURE_CAMERA) != 0) {
    Log.v(TAG,"String_Node_Str");
  }
}

Fixed version (ground truth):
public KeyguardHostView(Context context,AttributeSet attrs){
  super(context,attrs);
  mLockPatternUtils=new LockPatternUtils(context);
  mUserId=mLockPatternUtils.getCurrentUser();
  mAppWidgetHost=new AppWidgetHost(context,APPWIDGET_HOST_ID,mOnClickHandler,Looper.myLooper());
  mAppWidgetHost.setUserId(mUserId);
  DevicePolicyManager dpm=(DevicePolicyManager)mContext.getSystemService(Context.DEVICE_POLICY_SERVICE);
  if (dpm != null) {
    mDisabledFeatures=getDisabledFeatures(dpm);
    mCameraDisabled=dpm.getCameraDisabled(null);
  }
  mSafeModeEnabled=LockPatternUtils.isSafeModeEnabled();
  cleanupAppWidgetIds();
  mAppWidgetManager=AppWidgetManager.getInstance(mContext);
  mSecurityModel=new KeyguardSecurityModel(context);
  mViewStateManager=new KeyguardViewStateManager(this);
  mUserSetupCompleted=Settings.Secure.getIntForUser(mContext.getContentResolver(),Settings.Secure.USER_SETUP_COMPLETE,0,UserHandle.USER_CURRENT) != 0;
  if (mSafeModeEnabled) {
    Log.v(TAG,"String_Node_Str");
  }
  if ((mDisabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_WIDGETS_ALL) != 0) {
    Log.v(TAG,"String_Node_Str");
  }
  if ((mDisabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_SECURE_CAMERA) != 0) {
    Log.v(TAG,"String_Node_Str");
  }
}
Program: 2804
Project: 2804
Buggy source:
private void cleanupAppWidgetIds(){
  if (!KeyguardUpdateMonitor.getInstance(mContext).hasBootCompleted()) {
    mCleanupAppWidgetsOnBootCompleted=true;
    return;
  }
  int[] appWidgetIdsInKeyguardSettings=mLockPatternUtils.getAppWidgets();
  int[] appWidgetIdsBoundToHost=mAppWidgetHost.getAppWidgetIds();
  for (int i=0; i < appWidgetIdsBoundToHost.length; i++) {
    int appWidgetId=appWidgetIdsBoundToHost[i];
    if (!contains(appWidgetIdsInKeyguardSettings,appWidgetId)) {
      Log.d(TAG,"String_Node_Str" + appWidgetId);
      mAppWidgetHost.deleteAppWidgetId(appWidgetId);
    }
  }
}

Fixed version (ground truth):
private void cleanupAppWidgetIds(){
  if (!KeyguardUpdateMonitor.getInstance(mContext).hasBootCompleted()) {
    mCleanupAppWidgetsOnBootCompleted=true;
    return;
  }
  if (!mSafeModeEnabled && !widgetsDisabledByDpm()) {
    int[] appWidgetIdsInKeyguardSettings=mLockPatternUtils.getAppWidgets();
    int[] appWidgetIdsBoundToHost=mAppWidgetHost.getAppWidgetIds();
    for (int i=0; i < appWidgetIdsBoundToHost.length; i++) {
      int appWidgetId=appWidgetIdsBoundToHost[i];
      if (!contains(appWidgetIdsInKeyguardSettings,appWidgetId)) {
        Log.d(TAG,"String_Node_Str" + appWidgetId);
        mAppWidgetHost.deleteAppWidgetId(appWidgetId);
      }
    }
  }
}
Program: 2805
Project: 2805
Buggy source:
private void computeGroupBounds(){
  Bounds[] values=groupBounds.values;
  for (int i=0; i < values.length; i++) {
    values[i].reset();
  }
  for (int i=0, N=getChildCount(); i < N; i++) {
    View c=getChildAt(i);
    if (c.getVisibility() == View.GONE)     continue;
    LayoutParams lp=getLayoutParams(c);
    Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
    groupBounds.getValue(i).include(GridLayout.this,c,spec,this);
  }
}

Fixed version (ground truth):
private void computeGroupBounds(){
  Bounds[] values=groupBounds.values;
  for (int i=0; i < values.length; i++) {
    values[i].reset();
  }
  for (int i=0, N=getChildCount(); i < N; i++) {
    View c=getChildAt(i);
    LayoutParams lp=getLayoutParams(c);
    Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
    groupBounds.getValue(i).include(GridLayout.this,c,spec,this);
  }
}
Program: 2806
Project: 2806
Buggy source:
private PackedMap<Spec,Bounds> createGroupBounds(){
  Assoc<Spec,Bounds> assoc=Assoc.of(Spec.class,Bounds.class);
  for (int i=0, N=getChildCount(); i < N; i++) {
    View c=getChildAt(i);
    if (c.getVisibility() == View.GONE)     continue;
    LayoutParams lp=getLayoutParams(c);
    Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
    Bounds bounds=getAlignment(spec.alignment,horizontal).getBounds();
    assoc.put(spec,bounds);
  }
  return assoc.pack();
}

Fixed version (ground truth):
private PackedMap<Spec,Bounds> createGroupBounds(){
  Assoc<Spec,Bounds> assoc=Assoc.of(Spec.class,Bounds.class);
  for (int i=0, N=getChildCount(); i < N; i++) {
    View c=getChildAt(i);
    LayoutParams lp=getLayoutParams(c);
    Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
    Bounds bounds=getAlignment(spec.alignment,horizontal).getBounds();
    assoc.put(spec,bounds);
  }
  return assoc.pack();
}
Program: 2807
Project: 2807
Buggy source:
private void computeGroupBounds(){
  Bounds[] values=groupBounds.values;
  for (int i=0; i < values.length; i++) {
    values[i].reset();
  }
  for (int i=0, N=getChildCount(); i < N; i++) {
    View c=getChildAt(i);
    if (c.getVisibility() == View.GONE)     continue;
    LayoutParams lp=getLayoutParams(c);
    Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
    groupBounds.getValue(i).include(GridLayout.this,c,spec,this);
  }
}

Fixed version (ground truth):
private void computeGroupBounds(){
  Bounds[] values=groupBounds.values;
  for (int i=0; i < values.length; i++) {
    values[i].reset();
  }
  for (int i=0, N=getChildCount(); i < N; i++) {
    View c=getChildAt(i);
    LayoutParams lp=getLayoutParams(c);
    Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
    groupBounds.getValue(i).include(GridLayout.this,c,spec,this);
  }
}
Program: 2808
Project: 2808
Buggy source:
private PackedMap<Spec,Bounds> createGroupBounds(){
  Assoc<Spec,Bounds> assoc=Assoc.of(Spec.class,Bounds.class);
  for (int i=0, N=getChildCount(); i < N; i++) {
    View c=getChildAt(i);
    if (c.getVisibility() == View.GONE)     continue;
    LayoutParams lp=getLayoutParams(c);
    Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
    Bounds bounds=getAlignment(spec.alignment,horizontal).getBounds();
    assoc.put(spec,bounds);
  }
  return assoc.pack();
}

Fixed version (ground truth):
private PackedMap<Spec,Bounds> createGroupBounds(){
  Assoc<Spec,Bounds> assoc=Assoc.of(Spec.class,Bounds.class);
  for (int i=0, N=getChildCount(); i < N; i++) {
    View c=getChildAt(i);
    LayoutParams lp=getLayoutParams(c);
    Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
    Bounds bounds=getAlignment(spec.alignment,horizontal).getBounds();
    assoc.put(spec,bounds);
  }
  return assoc.pack();
}
Program: 2809
Project: 2809
Buggy source:
private void computeGroupBounds(){
  Bounds[] values=groupBounds.values;
  for (int i=0; i < values.length; i++) {
    values[i].reset();
  }
  for (int i=0, N=getChildCount(); i < N; i++) {
    View c=getChildAt(i);
    if (c.getVisibility() == View.GONE)     continue;
    LayoutParams lp=getLayoutParams(c);
    Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
    groupBounds.getValue(i).include(GridLayout.this,c,spec,this);
  }
}

Fixed version (ground truth):
private void computeGroupBounds(){
  Bounds[] values=groupBounds.values;
  for (int i=0; i < values.length; i++) {
    values[i].reset();
  }
  for (int i=0, N=getChildCount(); i < N; i++) {
    View c=getChildAt(i);
    LayoutParams lp=getLayoutParams(c);
    Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
    groupBounds.getValue(i).include(GridLayout.this,c,spec,this);
  }
}
Program: 2810
Project: 2810
Buggy source:
private PackedMap<Spec,Bounds> createGroupBounds(){
  Assoc<Spec,Bounds> assoc=Assoc.of(Spec.class,Bounds.class);
  for (int i=0, N=getChildCount(); i < N; i++) {
    View c=getChildAt(i);
    if (c.getVisibility() == View.GONE)     continue;
    LayoutParams lp=getLayoutParams(c);
    Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
    Bounds bounds=getAlignment(spec.alignment,horizontal).getBounds();
    assoc.put(spec,bounds);
  }
  return assoc.pack();
}

Fixed version (ground truth):
private PackedMap<Spec,Bounds> createGroupBounds(){
  Assoc<Spec,Bounds> assoc=Assoc.of(Spec.class,Bounds.class);
  for (int i=0, N=getChildCount(); i < N; i++) {
    View c=getChildAt(i);
    LayoutParams lp=getLayoutParams(c);
    Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
    Bounds bounds=getAlignment(spec.alignment,horizontal).getBounds();
    assoc.put(spec,bounds);
  }
  return assoc.pack();
}
Program: 2811
Project: 2811
Buggy source:
private void computeGroupBounds(){
  Bounds[] values=groupBounds.values;
  for (int i=0; i < values.length; i++) {
    values[i].reset();
  }
  for (int i=0, N=getChildCount(); i < N; i++) {
    View c=getChildAt(i);
    if (c.getVisibility() == View.GONE)     continue;
    LayoutParams lp=getLayoutParams(c);
    Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
    groupBounds.getValue(i).include(GridLayout.this,c,spec,this);
  }
}

Fixed version (ground truth):
private void computeGroupBounds(){
  Bounds[] values=groupBounds.values;
  for (int i=0; i < values.length; i++) {
    values[i].reset();
  }
  for (int i=0, N=getChildCount(); i < N; i++) {
    View c=getChildAt(i);
    LayoutParams lp=getLayoutParams(c);
    Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
    groupBounds.getValue(i).include(GridLayout.this,c,spec,this);
  }
}
Program: 2812
Project: 2812
Buggy source:
private PackedMap<Spec,Bounds> createGroupBounds(){
  Assoc<Spec,Bounds> assoc=Assoc.of(Spec.class,Bounds.class);
  for (int i=0, N=getChildCount(); i < N; i++) {
    View c=getChildAt(i);
    if (c.getVisibility() == View.GONE)     continue;
    LayoutParams lp=getLayoutParams(c);
    Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
    Bounds bounds=getAlignment(spec.alignment,horizontal).getBounds();
    assoc.put(spec,bounds);
  }
  return assoc.pack();
}

Fixed version (ground truth):
private PackedMap<Spec,Bounds> createGroupBounds(){
  Assoc<Spec,Bounds> assoc=Assoc.of(Spec.class,Bounds.class);
  for (int i=0, N=getChildCount(); i < N; i++) {
    View c=getChildAt(i);
    LayoutParams lp=getLayoutParams(c);
    Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
    Bounds bounds=getAlignment(spec.alignment,horizontal).getBounds();
    assoc.put(spec,bounds);
  }
  return assoc.pack();
}
Program: 2813
Project: 2813
Buggy source:
/** 
 * Operates like   {@link #markAfter(String)}, but uses a given heuristic to estimate the  {@code str}'s directionality.
 * @param str String after which the mark may need to appear.
 * @param heuristic The text direction heuristic that will be used to estimate the {@code str}'s directionality.
 * @return LRM for RTL text in LTR context; RLM for LTR text in RTL context;else, the empty string.
 */
public String markAfter(String str,TextDirectionHeuristic heuristic){
  final boolean isRtl=heuristic.isRtl(str,0,str.length());
  if (!isRtlContext && (isRtl || getExitDir(str) == Dir.RTL)) {
    return LRM_STRING;
  }
  if (isRtlContext && (!isRtl || getExitDir(str) == Dir.LTR)) {
    return RLM_STRING;
  }
  return EMPTY_STRING;
}

Fixed version (ground truth):
/** 
 * Operates like   {@link #markAfter(String)}, but uses a given heuristic to estimate the  {@code str}'s directionality.
 * @param str String after which the mark may need to appear.
 * @param heuristic The text direction heuristic that will be used to estimate the {@code str}'s directionality.
 * @return LRM for RTL text in LTR context; RLM for LTR text in RTL context;else, the empty string.
 */
public String markAfter(String str,TextDirectionHeuristic heuristic){
  final boolean isRtl=heuristic.isRtl(str,0,str.length());
  if (!isRtlContext && (isRtl || getExitDir(str) == DIR_RTL)) {
    return LRM_STRING;
  }
  if (isRtlContext && (!isRtl || getExitDir(str) == DIR_LTR)) {
    return RLM_STRING;
  }
  return EMPTY_STRING;
}
Program: 2816
Project: 2816
Buggy source:
/** 
 * Operates like   {@link #markBefore(String)}, but uses a given heuristic to estimate the  {@code str}'s directionality.
 * @param str String before which the mark may need to appear.
 * @param heuristic The text direction heuristic that will be used to estimate the {@code str}'s directionality.
 * @return LRM for RTL text in LTR context; RLM for LTR text in RTL context;else, the empty string.
 */
public String markBefore(String str,TextDirectionHeuristic heuristic){
  final boolean isRtl=heuristic.isRtl(str,0,str.length());
  if (!isRtlContext && (isRtl || getEntryDir(str) == Dir.RTL)) {
    return LRM_STRING;
  }
  if (isRtlContext && (!isRtl || getEntryDir(str) == Dir.LTR)) {
    return RLM_STRING;
  }
  return EMPTY_STRING;
}

Fixed version (ground truth):
/** 
 * Operates like   {@link #markBefore(String)}, but uses a given heuristic to estimate the  {@code str}'s directionality.
 * @param str String before which the mark may need to appear.
 * @param heuristic The text direction heuristic that will be used to estimate the {@code str}'s directionality.
 * @return LRM for RTL text in LTR context; RLM for LTR text in RTL context;else, the empty string.
 */
public String markBefore(String str,TextDirectionHeuristic heuristic){
  final boolean isRtl=heuristic.isRtl(str,0,str.length());
  if (!isRtlContext && (isRtl || getEntryDir(str) == DIR_RTL)) {
    return LRM_STRING;
  }
  if (isRtlContext && (!isRtl || getEntryDir(str) == DIR_LTR)) {
    return RLM_STRING;
  }
  return EMPTY_STRING;
}
Program: 2817
Project: 2817
Buggy source:
private void computeGroupBounds(){
  Bounds[] values=groupBounds.values;
  for (int i=0; i < values.length; i++) {
    values[i].reset();
  }
  for (int i=0, N=getChildCount(); i < N; i++) {
    View c=getChildAt(i);
    LayoutParams lp=getLayoutParams(c);
    Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
    groupBounds.getValue(i).include(GridLayout.this,c,spec,this);
  }
}

Fixed version (ground truth):
private void computeGroupBounds(){
  Bounds[] values=groupBounds.values;
  for (int i=0; i < values.length; i++) {
    values[i].reset();
  }
  for (int i=0, N=getChildCount(); i < N; i++) {
    View c=getChildAt(i);
    if (c.getVisibility() == View.GONE)     continue;
    LayoutParams lp=getLayoutParams(c);
    Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
    groupBounds.getValue(i).include(GridLayout.this,c,spec,this);
  }
}
Program: 2818
Project: 2818
Buggy source:
private PackedMap<Spec,Bounds> createGroupBounds(){
  Assoc<Spec,Bounds> assoc=Assoc.of(Spec.class,Bounds.class);
  for (int i=0, N=getChildCount(); i < N; i++) {
    View c=getChildAt(i);
    LayoutParams lp=getLayoutParams(c);
    Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
    Bounds bounds=getAlignment(spec.alignment,horizontal).getBounds();
    assoc.put(spec,bounds);
  }
  return assoc.pack();
}

Fixed version (ground truth):
private PackedMap<Spec,Bounds> createGroupBounds(){
  Assoc<Spec,Bounds> assoc=Assoc.of(Spec.class,Bounds.class);
  for (int i=0, N=getChildCount(); i < N; i++) {
    View c=getChildAt(i);
    if (c.getVisibility() == View.GONE)     continue;
    LayoutParams lp=getLayoutParams(c);
    Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
    Bounds bounds=getAlignment(spec.alignment,horizontal).getBounds();
    assoc.put(spec,bounds);
  }
  return assoc.pack();
}
Program: 2819
Project: 2819
Buggy source:
/** 
 * Operates like   {@link #markAfter(String)}, but uses a given heuristic to estimate the  {@code str}'s directionality.
 * @param str String after which the mark may need to appear.
 * @param heuristic The text direction heuristic that will be used to estimate the {@code str}'s directionality.
 * @return LRM for RTL text in LTR context; RLM for LTR text in RTL context;else, the empty string.
 */
public String markAfter(String str,TextDirectionHeuristic heuristic){
  final boolean isRtl=heuristic.isRtl(str,0,str.length());
  if (!isRtlContext && (isRtl || getExitDir(str) == Dir.RTL)) {
    return LRM_STRING;
  }
  if (isRtlContext && (!isRtl || getExitDir(str) == Dir.LTR)) {
    return RLM_STRING;
  }
  return EMPTY_STRING;
}

Fixed version (ground truth):
/** 
 * Operates like   {@link #markAfter(String)}, but uses a given heuristic to estimate the  {@code str}'s directionality.
 * @param str String after which the mark may need to appear.
 * @param heuristic The text direction heuristic that will be used to estimate the {@code str}'s directionality.
 * @return LRM for RTL text in LTR context; RLM for LTR text in RTL context;else, the empty string.
 */
public String markAfter(String str,TextDirectionHeuristic heuristic){
  final boolean isRtl=heuristic.isRtl(str,0,str.length());
  if (!isRtlContext && (isRtl || getExitDir(str) == DIR_RTL)) {
    return LRM_STRING;
  }
  if (isRtlContext && (!isRtl || getExitDir(str) == DIR_LTR)) {
    return RLM_STRING;
  }
  return EMPTY_STRING;
}
Program: 2822
Project: 2822
Buggy source:
/** 
 * Operates like   {@link #markBefore(String)}, but uses a given heuristic to estimate the  {@code str}'s directionality.
 * @param str String before which the mark may need to appear.
 * @param heuristic The text direction heuristic that will be used to estimate the {@code str}'s directionality.
 * @return LRM for RTL text in LTR context; RLM for LTR text in RTL context;else, the empty string.
 */
public String markBefore(String str,TextDirectionHeuristic heuristic){
  final boolean isRtl=heuristic.isRtl(str,0,str.length());
  if (!isRtlContext && (isRtl || getEntryDir(str) == Dir.RTL)) {
    return LRM_STRING;
  }
  if (isRtlContext && (!isRtl || getEntryDir(str) == Dir.LTR)) {
    return RLM_STRING;
  }
  return EMPTY_STRING;
}

Fixed version (ground truth):
/** 
 * Operates like   {@link #markBefore(String)}, but uses a given heuristic to estimate the  {@code str}'s directionality.
 * @param str String before which the mark may need to appear.
 * @param heuristic The text direction heuristic that will be used to estimate the {@code str}'s directionality.
 * @return LRM for RTL text in LTR context; RLM for LTR text in RTL context;else, the empty string.
 */
public String markBefore(String str,TextDirectionHeuristic heuristic){
  final boolean isRtl=heuristic.isRtl(str,0,str.length());
  if (!isRtlContext && (isRtl || getEntryDir(str) == DIR_RTL)) {
    return LRM_STRING;
  }
  if (isRtlContext && (!isRtl || getEntryDir(str) == DIR_LTR)) {
    return RLM_STRING;
  }
  return EMPTY_STRING;
}
Program: 2823
Project: 2823
Buggy source:
private void computeGroupBounds(){
  Bounds[] values=groupBounds.values;
  for (int i=0; i < values.length; i++) {
    values[i].reset();
  }
  for (int i=0, N=getChildCount(); i < N; i++) {
    View c=getChildAt(i);
    LayoutParams lp=getLayoutParams(c);
    Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
    groupBounds.getValue(i).include(GridLayout.this,c,spec,this);
  }
}

Fixed version (ground truth):
private void computeGroupBounds(){
  Bounds[] values=groupBounds.values;
  for (int i=0; i < values.length; i++) {
    values[i].reset();
  }
  for (int i=0, N=getChildCount(); i < N; i++) {
    View c=getChildAt(i);
    if (c.getVisibility() == View.GONE)     continue;
    LayoutParams lp=getLayoutParams(c);
    Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
    groupBounds.getValue(i).include(GridLayout.this,c,spec,this);
  }
}
Program: 2824
Project: 2824
Buggy source:
private PackedMap<Spec,Bounds> createGroupBounds(){
  Assoc<Spec,Bounds> assoc=Assoc.of(Spec.class,Bounds.class);
  for (int i=0, N=getChildCount(); i < N; i++) {
    View c=getChildAt(i);
    LayoutParams lp=getLayoutParams(c);
    Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
    Bounds bounds=getAlignment(spec.alignment,horizontal).getBounds();
    assoc.put(spec,bounds);
  }
  return assoc.pack();
}

Fixed version (ground truth):
private PackedMap<Spec,Bounds> createGroupBounds(){
  Assoc<Spec,Bounds> assoc=Assoc.of(Spec.class,Bounds.class);
  for (int i=0, N=getChildCount(); i < N; i++) {
    View c=getChildAt(i);
    if (c.getVisibility() == View.GONE)     continue;
    LayoutParams lp=getLayoutParams(c);
    Spec spec=horizontal ? lp.columnSpec : lp.rowSpec;
    Bounds bounds=getAlignment(spec.alignment,horizontal).getBounds();
    assoc.put(spec,bounds);
  }
  return assoc.pack();
}
Program: 2825
Project: 2825
Buggy source:
/** 
 * Operates like   {@link #markAfter(String)}, but uses a given heuristic to estimate the  {@code str}'s directionality.
 * @param str String after which the mark may need to appear.
 * @param heuristic The text direction heuristic that will be used to estimate the {@code str}'s directionality.
 * @return LRM for RTL text in LTR context; RLM for LTR text in RTL context;else, the empty string.
 */
public String markAfter(String str,TextDirectionHeuristic heuristic){
  final boolean isRtl=heuristic.isRtl(str,0,str.length());
  if (!isRtlContext && (isRtl || getExitDir(str) == Dir.RTL)) {
    return LRM_STRING;
  }
  if (isRtlContext && (!isRtl || getExitDir(str) == Dir.LTR)) {
    return RLM_STRING;
  }
  return EMPTY_STRING;
}

Fixed version (ground truth):
/** 
 * Operates like   {@link #markAfter(String)}, but uses a given heuristic to estimate the  {@code str}'s directionality.
 * @param str String after which the mark may need to appear.
 * @param heuristic The text direction heuristic that will be used to estimate the {@code str}'s directionality.
 * @return LRM for RTL text in LTR context; RLM for LTR text in RTL context;else, the empty string.
 */
public String markAfter(String str,TextDirectionHeuristic heuristic){
  final boolean isRtl=heuristic.isRtl(str,0,str.length());
  if (!isRtlContext && (isRtl || getExitDir(str) == DIR_RTL)) {
    return LRM_STRING;
  }
  if (isRtlContext && (!isRtl || getExitDir(str) == DIR_LTR)) {
    return RLM_STRING;
  }
  return EMPTY_STRING;
}
Program: 2828
Project: 2828
Buggy source:
/** 
 * Operates like   {@link #markBefore(String)}, but uses a given heuristic to estimate the  {@code str}'s directionality.
 * @param str String before which the mark may need to appear.
 * @param heuristic The text direction heuristic that will be used to estimate the {@code str}'s directionality.
 * @return LRM for RTL text in LTR context; RLM for LTR text in RTL context;else, the empty string.
 */
public String markBefore(String str,TextDirectionHeuristic heuristic){
  final boolean isRtl=heuristic.isRtl(str,0,str.length());
  if (!isRtlContext && (isRtl || getEntryDir(str) == Dir.RTL)) {
    return LRM_STRING;
  }
  if (isRtlContext && (!isRtl || getEntryDir(str) == Dir.LTR)) {
    return RLM_STRING;
  }
  return EMPTY_STRING;
}

Fixed version (ground truth):
/** 
 * Operates like   {@link #markBefore(String)}, but uses a given heuristic to estimate the  {@code str}'s directionality.
 * @param str String before which the mark may need to appear.
 * @param heuristic The text direction heuristic that will be used to estimate the {@code str}'s directionality.
 * @return LRM for RTL text in LTR context; RLM for LTR text in RTL context;else, the empty string.
 */
public String markBefore(String str,TextDirectionHeuristic heuristic){
  final boolean isRtl=heuristic.isRtl(str,0,str.length());
  if (!isRtlContext && (isRtl || getEntryDir(str) == DIR_RTL)) {
    return LRM_STRING;
  }
  if (isRtlContext && (!isRtl || getEntryDir(str) == DIR_LTR)) {
    return RLM_STRING;
  }
  return EMPTY_STRING;
}
Program: 2829
Project: 2829
Buggy source:
private void initializeGlobals(RenderScript RS,ScriptC_alloc s){
  Type.Builder typeBuilder=new Type.Builder(RS,Element.I32(RS));
  int X=5;
  int Y=7;
  int Z=0;
  s.set_dimX(X);
  s.set_dimY(Y);
  s.set_dimZ(Z);
  typeBuilder.setX(X).setY(Y);
  Allocation A=Allocation.createTyped(RS,typeBuilder.create());
  s.bind_a(A);
  typeBuilder=new Type.Builder(RS,Element.I32(RS));
  typeBuilder.setX(X).setY(Y).setFaces(true);
  Allocation AFaces=Allocation.createTyped(RS,typeBuilder.create());
  s.set_aFaces(AFaces);
  typeBuilder.setFaces(false).setMipmaps(true);
  Allocation ALOD=Allocation.createTyped(RS,typeBuilder.create());
  s.set_aLOD(ALOD);
  typeBuilder.setFaces(true).setMipmaps(true);
  Allocation AFacesLOD=Allocation.createTyped(RS,typeBuilder.create());
  s.set_aFacesLOD(AFacesLOD);
  return;
}

Fixed version (ground truth):
private void initializeGlobals(RenderScript RS,ScriptC_alloc s){
  Type.Builder typeBuilder=new Type.Builder(RS,Element.I32(RS));
  int X=5;
  int Y=7;
  int Z=0;
  s.set_dimX(X);
  s.set_dimY(Y);
  s.set_dimZ(Z);
  typeBuilder.setX(X).setY(Y);
  Allocation A=Allocation.createTyped(RS,typeBuilder.create());
  s.bind_a(A);
  s.set_aRaw(A);
  typeBuilder=new Type.Builder(RS,Element.I32(RS));
  typeBuilder.setX(X).setY(Y).setFaces(true);
  Allocation AFaces=Allocation.createTyped(RS,typeBuilder.create());
  s.set_aFaces(AFaces);
  typeBuilder.setFaces(false).setMipmaps(true);
  Allocation ALOD=Allocation.createTyped(RS,typeBuilder.create());
  s.set_aLOD(ALOD);
  typeBuilder.setFaces(true).setMipmaps(true);
  Allocation AFacesLOD=Allocation.createTyped(RS,typeBuilder.create());
  s.set_aFacesLOD(AFacesLOD);
  return;
}