nus-yam/ex-repair huggingface dataset:
Program: 198755
Project: 198755
Buggy source:
@Override public WindowInsets dispatchApplyWindowInsets(WindowInsets insets){
  if (mOutsetBottom != null) {
    final DisplayMetrics metrics=getContext().getResources().getDisplayMetrics();
    int bottom=(int)mOutsetBottom.getDimension(metrics);
    WindowInsets newInsets=insets.replaceSystemWindowInsets(insets.getSystemWindowInsetLeft(),insets.getSystemWindowInsetTop(),insets.getSystemWindowInsetRight(),insets.getSystemWindowInsetBottom() + bottom);
    return super.dispatchApplyWindowInsets(newInsets);
  }
 else {
    return super.dispatchApplyWindowInsets(insets);
  }
}

Fixed version (ground truth):
@Override public WindowInsets dispatchApplyWindowInsets(WindowInsets insets){
  if (mOutsetBottom != null) {
    final DisplayMetrics metrics=getContext().getResources().getDisplayMetrics();
    int bottom=(int)mOutsetBottom.getDimension(metrics);
    WindowInsets newInsets=insets.replaceSystemWindowInsets(insets.getSystemWindowInsetLeft(),insets.getSystemWindowInsetTop(),insets.getSystemWindowInsetRight(),bottom);
    return super.dispatchApplyWindowInsets(newInsets);
  }
 else {
    return super.dispatchApplyWindowInsets(insets);
  }
}
Program: 198756
Project: 198756
Buggy source:
/** 
 * Retrieve the Drawable for the attribute at <var>index</var>.
 * @param index Index of attribute to retrieve.
 * @return Drawable for the attribute, or null if not defined.
 */
public Drawable getDrawable(int index){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  final TypedValue value=mValue;
  if (getValueAt(index * AssetManager.STYLE_NUM_ENTRIES,value)) {
    if (value.type == TypedValue.TYPE_ATTRIBUTE) {
      throw new RuntimeException("String_Node_Str" + index);
    }
    return mResources.loadDrawable(value,value.resourceId,mTheme);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Retrieve the Drawable for the attribute at <var>index</var>.  This gets the resource ID of the selected attribute, and uses  {@link Resources#getDrawable Resources.getDrawable} of the owningResources object to retrieve its Drawable.
 * @param index Index of attribute to retrieve.
 * @return Drawable for the attribute, or null if not defined.
 */
public Drawable getDrawable(int index){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  final TypedValue value=mValue;
  if (getValueAt(index * AssetManager.STYLE_NUM_ENTRIES,value)) {
    if (value.type == TypedValue.TYPE_ATTRIBUTE) {
      throw new RuntimeException("String_Node_Str" + index);
    }
    return mResources.loadDrawable(value,value.resourceId,mTheme);
  }
  return null;
}
Program: 198757
Project: 198757
Buggy source:
/** 
 * Retrieve the Drawable for the attribute at <var>index</var>.
 * @param index Index of attribute to retrieve.
 * @return Drawable for the attribute, or null if not defined.
 */
public Drawable getDrawable(int index){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  final TypedValue value=mValue;
  if (getValueAt(index * AssetManager.STYLE_NUM_ENTRIES,value)) {
    if (value.type == TypedValue.TYPE_ATTRIBUTE) {
      throw new RuntimeException("String_Node_Str" + index);
    }
    return mResources.loadDrawable(value,value.resourceId,mTheme);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Retrieve the Drawable for the attribute at <var>index</var>.  This gets the resource ID of the selected attribute, and uses  {@link Resources#getDrawable Resources.getDrawable} of the owningResources object to retrieve its Drawable.
 * @param index Index of attribute to retrieve.
 * @return Drawable for the attribute, or null if not defined.
 */
public Drawable getDrawable(int index){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  final TypedValue value=mValue;
  if (getValueAt(index * AssetManager.STYLE_NUM_ENTRIES,value)) {
    if (value.type == TypedValue.TYPE_ATTRIBUTE) {
      throw new RuntimeException("String_Node_Str" + index);
    }
    return mResources.loadDrawable(value,value.resourceId,mTheme);
  }
  return null;
}
Program: 198758
Project: 198758
Buggy source:
@Override public WindowInsets dispatchApplyWindowInsets(WindowInsets insets){
  if (mOutsetBottom != null) {
    final DisplayMetrics metrics=getContext().getResources().getDisplayMetrics();
    int bottom=(int)mOutsetBottom.getDimension(metrics);
    WindowInsets newInsets=insets.replaceSystemWindowInsets(insets.getSystemWindowInsetLeft(),insets.getSystemWindowInsetTop(),insets.getSystemWindowInsetRight(),insets.getSystemWindowInsetBottom() + bottom);
    return super.dispatchApplyWindowInsets(newInsets);
  }
 else {
    return super.dispatchApplyWindowInsets(insets);
  }
}

Fixed version (ground truth):
@Override public WindowInsets dispatchApplyWindowInsets(WindowInsets insets){
  if (mOutsetBottom != null) {
    final DisplayMetrics metrics=getContext().getResources().getDisplayMetrics();
    int bottom=(int)mOutsetBottom.getDimension(metrics);
    WindowInsets newInsets=insets.replaceSystemWindowInsets(insets.getSystemWindowInsetLeft(),insets.getSystemWindowInsetTop(),insets.getSystemWindowInsetRight(),bottom);
    return super.dispatchApplyWindowInsets(newInsets);
  }
 else {
    return super.dispatchApplyWindowInsets(insets);
  }
}
Program: 198763
Project: 198763
Buggy source:
@Override public Void doInBackground(Void... params){
  int availability=internalGetInitialAvailability();
  KeyphraseSoundModel soundModel=null;
  if (availability == STATE_NOT_READY || availability == STATE_KEYPHRASE_UNENROLLED || availability == STATE_KEYPHRASE_ENROLLED) {
    soundModel=internalGetKeyphraseSoundModel(mKeyphraseMetadata.id);
    if (soundModel == null) {
      availability=STATE_KEYPHRASE_UNENROLLED;
    }
 else {
      availability=STATE_KEYPHRASE_ENROLLED;
    }
  }
synchronized (mLock) {
    if (DBG) {
      Slog.d(TAG,"String_Node_Str" + mAvailability + "String_Node_Str"+ availability);
    }
    mAvailability=availability;
    mEnrolledSoundModel=soundModel;
    notifyStateChangedLocked();
  }
  return null;
}

Fixed version (ground truth):
@Override public Void doInBackground(Void... params){
  int availability=internalGetInitialAvailability();
  boolean enrolled=false;
  if (availability == STATE_NOT_READY || availability == STATE_KEYPHRASE_UNENROLLED || availability == STATE_KEYPHRASE_ENROLLED) {
    enrolled=internalGetIsEnrolled(mKeyphraseMetadata.id);
    if (!enrolled) {
      availability=STATE_KEYPHRASE_UNENROLLED;
    }
 else {
      availability=STATE_KEYPHRASE_ENROLLED;
    }
  }
synchronized (mLock) {
    if (DBG) {
      Slog.d(TAG,"String_Node_Str" + mAvailability + "String_Node_Str"+ availability);
    }
    mIsEnrolledForDetection=enrolled;
    mAvailability=availability;
    notifyStateChangedLocked();
  }
  return null;
}
Program: 198764
Project: 198764
Buggy source:
private int startRecognitionLocked(int recognitionFlags){
  if (mAvailability != STATE_KEYPHRASE_ENROLLED) {
    throw new UnsupportedOperationException("String_Node_Str");
  }
  KeyphraseRecognitionExtra[] recognitionExtra=new KeyphraseRecognitionExtra[1];
  recognitionExtra[0]=new KeyphraseRecognitionExtra(mKeyphraseMetadata.id,mKeyphraseMetadata.recognitionModeFlags,new ConfidenceLevel[0]);
  boolean captureTriggerAudio=(recognitionFlags & RECOGNITION_FLAG_CAPTURE_TRIGGER_AUDIO) != 0;
  int code=STATUS_ERROR;
  try {
    code=mModelManagementService.startRecognition(mVoiceInteractionService,mKeyphraseMetadata.id,mEnrolledSoundModel,mInternalCallback,new RecognitionConfig(captureTriggerAudio,recognitionExtra,null));
  }
 catch (  RemoteException e) {
    Slog.w(TAG,"String_Node_Str");
  }
  if (code != STATUS_OK) {
    Slog.w(TAG,"String_Node_Str" + code);
  }
  return code;
}

Fixed version (ground truth):
private int startRecognitionLocked(int recognitionFlags){
  if (mAvailability != STATE_KEYPHRASE_ENROLLED) {
    throw new UnsupportedOperationException("String_Node_Str");
  }
  KeyphraseRecognitionExtra[] recognitionExtra=new KeyphraseRecognitionExtra[1];
  recognitionExtra[0]=new KeyphraseRecognitionExtra(mKeyphraseMetadata.id,mKeyphraseMetadata.recognitionModeFlags,new ConfidenceLevel[0]);
  boolean captureTriggerAudio=(recognitionFlags & RECOGNITION_FLAG_CAPTURE_TRIGGER_AUDIO) != 0;
  int code=STATUS_ERROR;
  try {
    code=mModelManagementService.startRecognition(mVoiceInteractionService,mKeyphraseMetadata.id,mInternalCallback,new RecognitionConfig(captureTriggerAudio,recognitionExtra,null));
  }
 catch (  RemoteException e) {
    Slog.w(TAG,"String_Node_Str");
  }
  if (code != STATUS_OK) {
    Slog.w(TAG,"String_Node_Str" + code);
  }
  return code;
}
Program: 198765
Project: 198765
Buggy source:
@Override public Void doInBackground(Void... params){
  int availability=internalGetInitialAvailability();
  KeyphraseSoundModel soundModel=null;
  if (availability == STATE_NOT_READY || availability == STATE_KEYPHRASE_UNENROLLED || availability == STATE_KEYPHRASE_ENROLLED) {
    soundModel=internalGetKeyphraseSoundModel(mKeyphraseMetadata.id);
    if (soundModel == null) {
      availability=STATE_KEYPHRASE_UNENROLLED;
    }
 else {
      availability=STATE_KEYPHRASE_ENROLLED;
    }
  }
synchronized (mLock) {
    if (DBG) {
      Slog.d(TAG,"String_Node_Str" + mAvailability + "String_Node_Str"+ availability);
    }
    mAvailability=availability;
    mEnrolledSoundModel=soundModel;
    notifyStateChangedLocked();
  }
  return null;
}

Fixed version (ground truth):
@Override public Void doInBackground(Void... params){
  int availability=internalGetInitialAvailability();
  boolean enrolled=false;
  if (availability == STATE_NOT_READY || availability == STATE_KEYPHRASE_UNENROLLED || availability == STATE_KEYPHRASE_ENROLLED) {
    enrolled=internalGetIsEnrolled(mKeyphraseMetadata.id);
    if (!enrolled) {
      availability=STATE_KEYPHRASE_UNENROLLED;
    }
 else {
      availability=STATE_KEYPHRASE_ENROLLED;
    }
  }
synchronized (mLock) {
    if (DBG) {
      Slog.d(TAG,"String_Node_Str" + mAvailability + "String_Node_Str"+ availability);
    }
    mIsEnrolledForDetection=enrolled;
    mAvailability=availability;
    notifyStateChangedLocked();
  }
  return null;
}
Program: 198766
Project: 198766
Buggy source:
private int startRecognitionLocked(int recognitionFlags){
  if (mAvailability != STATE_KEYPHRASE_ENROLLED) {
    throw new UnsupportedOperationException("String_Node_Str");
  }
  KeyphraseRecognitionExtra[] recognitionExtra=new KeyphraseRecognitionExtra[1];
  recognitionExtra[0]=new KeyphraseRecognitionExtra(mKeyphraseMetadata.id,mKeyphraseMetadata.recognitionModeFlags,new ConfidenceLevel[0]);
  boolean captureTriggerAudio=(recognitionFlags & RECOGNITION_FLAG_CAPTURE_TRIGGER_AUDIO) != 0;
  int code=STATUS_ERROR;
  try {
    code=mModelManagementService.startRecognition(mVoiceInteractionService,mKeyphraseMetadata.id,mEnrolledSoundModel,mInternalCallback,new RecognitionConfig(captureTriggerAudio,recognitionExtra,null));
  }
 catch (  RemoteException e) {
    Slog.w(TAG,"String_Node_Str");
  }
  if (code != STATUS_OK) {
    Slog.w(TAG,"String_Node_Str" + code);
  }
  return code;
}

Fixed version (ground truth):
private int startRecognitionLocked(int recognitionFlags){
  if (mAvailability != STATE_KEYPHRASE_ENROLLED) {
    throw new UnsupportedOperationException("String_Node_Str");
  }
  KeyphraseRecognitionExtra[] recognitionExtra=new KeyphraseRecognitionExtra[1];
  recognitionExtra[0]=new KeyphraseRecognitionExtra(mKeyphraseMetadata.id,mKeyphraseMetadata.recognitionModeFlags,new ConfidenceLevel[0]);
  boolean captureTriggerAudio=(recognitionFlags & RECOGNITION_FLAG_CAPTURE_TRIGGER_AUDIO) != 0;
  int code=STATUS_ERROR;
  try {
    code=mModelManagementService.startRecognition(mVoiceInteractionService,mKeyphraseMetadata.id,mInternalCallback,new RecognitionConfig(captureTriggerAudio,recognitionExtra,null));
  }
 catch (  RemoteException e) {
    Slog.w(TAG,"String_Node_Str");
  }
  if (code != STATUS_OK) {
    Slog.w(TAG,"String_Node_Str" + code);
  }
  return code;
}
Program: 198767
Project: 198767
Buggy source:
@Override public Void doInBackground(Void... params){
  int availability=internalGetInitialAvailability();
  KeyphraseSoundModel soundModel=null;
  if (availability == STATE_NOT_READY || availability == STATE_KEYPHRASE_UNENROLLED || availability == STATE_KEYPHRASE_ENROLLED) {
    soundModel=internalGetKeyphraseSoundModel(mKeyphraseMetadata.id);
    if (soundModel == null) {
      availability=STATE_KEYPHRASE_UNENROLLED;
    }
 else {
      availability=STATE_KEYPHRASE_ENROLLED;
    }
  }
synchronized (mLock) {
    if (DBG) {
      Slog.d(TAG,"String_Node_Str" + mAvailability + "String_Node_Str"+ availability);
    }
    mAvailability=availability;
    mEnrolledSoundModel=soundModel;
    notifyStateChangedLocked();
  }
  return null;
}

Fixed version (ground truth):
@Override public Void doInBackground(Void... params){
  int availability=internalGetInitialAvailability();
  boolean enrolled=false;
  if (availability == STATE_NOT_READY || availability == STATE_KEYPHRASE_UNENROLLED || availability == STATE_KEYPHRASE_ENROLLED) {
    enrolled=internalGetIsEnrolled(mKeyphraseMetadata.id);
    if (!enrolled) {
      availability=STATE_KEYPHRASE_UNENROLLED;
    }
 else {
      availability=STATE_KEYPHRASE_ENROLLED;
    }
  }
synchronized (mLock) {
    if (DBG) {
      Slog.d(TAG,"String_Node_Str" + mAvailability + "String_Node_Str"+ availability);
    }
    mIsEnrolledForDetection=enrolled;
    mAvailability=availability;
    notifyStateChangedLocked();
  }
  return null;
}
Program: 198768
Project: 198768
Buggy source:
private int startRecognitionLocked(int recognitionFlags){
  if (mAvailability != STATE_KEYPHRASE_ENROLLED) {
    throw new UnsupportedOperationException("String_Node_Str");
  }
  KeyphraseRecognitionExtra[] recognitionExtra=new KeyphraseRecognitionExtra[1];
  recognitionExtra[0]=new KeyphraseRecognitionExtra(mKeyphraseMetadata.id,mKeyphraseMetadata.recognitionModeFlags,new ConfidenceLevel[0]);
  boolean captureTriggerAudio=(recognitionFlags & RECOGNITION_FLAG_CAPTURE_TRIGGER_AUDIO) != 0;
  int code=STATUS_ERROR;
  try {
    code=mModelManagementService.startRecognition(mVoiceInteractionService,mKeyphraseMetadata.id,mEnrolledSoundModel,mInternalCallback,new RecognitionConfig(captureTriggerAudio,recognitionExtra,null));
  }
 catch (  RemoteException e) {
    Slog.w(TAG,"String_Node_Str");
  }
  if (code != STATUS_OK) {
    Slog.w(TAG,"String_Node_Str" + code);
  }
  return code;
}

Fixed version (ground truth):
private int startRecognitionLocked(int recognitionFlags){
  if (mAvailability != STATE_KEYPHRASE_ENROLLED) {
    throw new UnsupportedOperationException("String_Node_Str");
  }
  KeyphraseRecognitionExtra[] recognitionExtra=new KeyphraseRecognitionExtra[1];
  recognitionExtra[0]=new KeyphraseRecognitionExtra(mKeyphraseMetadata.id,mKeyphraseMetadata.recognitionModeFlags,new ConfidenceLevel[0]);
  boolean captureTriggerAudio=(recognitionFlags & RECOGNITION_FLAG_CAPTURE_TRIGGER_AUDIO) != 0;
  int code=STATUS_ERROR;
  try {
    code=mModelManagementService.startRecognition(mVoiceInteractionService,mKeyphraseMetadata.id,mInternalCallback,new RecognitionConfig(captureTriggerAudio,recognitionExtra,null));
  }
 catch (  RemoteException e) {
    Slog.w(TAG,"String_Node_Str");
  }
  if (code != STATUS_OK) {
    Slog.w(TAG,"String_Node_Str" + code);
  }
  return code;
}
Program: 198771
Project: 198771
Buggy source:
/** 
 * OnAnimationStartedListener Implementation 
 */
@Override public void onAnimationStarted(){
  if (!mStartAnimationTriggered) {
    Intent intent=new Intent(RecentsActivity.ACTION_START_ENTER_ANIMATION);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
    mContext.sendBroadcast(intent);
    mStartAnimationTriggered=true;
  }
}

Fixed version (ground truth):
/** 
 * OnAnimationStartedListener Implementation 
 */
@Override public void onAnimationStarted(){
  if (!mStartAnimationTriggered) {
    Intent intent=new Intent(RecentsActivity.ACTION_START_ENTER_ANIMATION);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
    mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    mStartAnimationTriggered=true;
  }
}
Program: 198772
Project: 198772
Buggy source:
/** 
 * Hides the recents 
 */
public void onHideRecents(boolean triggeredFromAltTab){
  if (mBootCompleted) {
    if (isRecentsTopMost(getTopMostTask(),null)) {
      Intent intent=new Intent(RecentsActivity.ACTION_HIDE_RECENTS_ACTIVITY);
      intent.setPackage(mContext.getPackageName());
      intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
      intent.putExtra(RecentsActivity.EXTRA_TRIGGERED_FROM_ALT_TAB,triggeredFromAltTab);
      mContext.sendBroadcast(intent);
    }
  }
}

Fixed version (ground truth):
/** 
 * Hides the recents 
 */
public void onHideRecents(boolean triggeredFromAltTab){
  if (mBootCompleted) {
    if (isRecentsTopMost(getTopMostTask(),null)) {
      Intent intent=new Intent(RecentsActivity.ACTION_HIDE_RECENTS_ACTIVITY);
      intent.setPackage(mContext.getPackageName());
      intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
      intent.putExtra(RecentsActivity.EXTRA_TRIGGERED_FROM_ALT_TAB,triggeredFromAltTab);
      mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    }
  }
}
Program: 198773
Project: 198773
Buggy source:
/** 
 * Toggles the recents activity 
 */
void toggleRecentsActivity(){
  if (System.currentTimeMillis() - mLastToggleTime < sMinToggleDelay) {
    return;
  }
  ActivityManager.RunningTaskInfo topTask=getTopMostTask();
  AtomicBoolean isTopTaskHome=new AtomicBoolean();
  if (isRecentsTopMost(topTask,isTopTaskHome)) {
    Intent intent=new Intent(RecentsActivity.ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
    mContext.sendBroadcast(intent);
    mLastToggleTime=System.currentTimeMillis();
    return;
  }
 else {
    startRecentsActivity(topTask,isTopTaskHome.get());
  }
}

Fixed version (ground truth):
/** 
 * Toggles the recents activity 
 */
void toggleRecentsActivity(){
  if (System.currentTimeMillis() - mLastToggleTime < sMinToggleDelay) {
    return;
  }
  ActivityManager.RunningTaskInfo topTask=getTopMostTask();
  AtomicBoolean isTopTaskHome=new AtomicBoolean();
  if (isRecentsTopMost(topTask,isTopTaskHome)) {
    Intent intent=new Intent(RecentsActivity.ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
    mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    mLastToggleTime=System.currentTimeMillis();
    return;
  }
 else {
    startRecentsActivity(topTask,isTopTaskHome.get());
  }
}
Program: 198774
Project: 198774
Buggy source:
/** 
 * OnAnimationStartedListener Implementation 
 */
@Override public void onAnimationStarted(){
  if (!mStartAnimationTriggered) {
    Intent intent=new Intent(RecentsActivity.ACTION_START_ENTER_ANIMATION);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
    mContext.sendBroadcast(intent);
    mStartAnimationTriggered=true;
  }
}

Fixed version (ground truth):
/** 
 * OnAnimationStartedListener Implementation 
 */
@Override public void onAnimationStarted(){
  if (!mStartAnimationTriggered) {
    Intent intent=new Intent(RecentsActivity.ACTION_START_ENTER_ANIMATION);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
    mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    mStartAnimationTriggered=true;
  }
}
Program: 198775
Project: 198775
Buggy source:
/** 
 * Hides the recents 
 */
public void onHideRecents(boolean triggeredFromAltTab){
  if (mBootCompleted) {
    if (isRecentsTopMost(getTopMostTask(),null)) {
      Intent intent=new Intent(RecentsActivity.ACTION_HIDE_RECENTS_ACTIVITY);
      intent.setPackage(mContext.getPackageName());
      intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
      intent.putExtra(RecentsActivity.EXTRA_TRIGGERED_FROM_ALT_TAB,triggeredFromAltTab);
      mContext.sendBroadcast(intent);
    }
  }
}

Fixed version (ground truth):
/** 
 * Hides the recents 
 */
public void onHideRecents(boolean triggeredFromAltTab){
  if (mBootCompleted) {
    if (isRecentsTopMost(getTopMostTask(),null)) {
      Intent intent=new Intent(RecentsActivity.ACTION_HIDE_RECENTS_ACTIVITY);
      intent.setPackage(mContext.getPackageName());
      intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
      intent.putExtra(RecentsActivity.EXTRA_TRIGGERED_FROM_ALT_TAB,triggeredFromAltTab);
      mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    }
  }
}
Program: 198776
Project: 198776
Buggy source:
/** 
 * Toggles the recents activity 
 */
void toggleRecentsActivity(){
  if (System.currentTimeMillis() - mLastToggleTime < sMinToggleDelay) {
    return;
  }
  ActivityManager.RunningTaskInfo topTask=getTopMostTask();
  AtomicBoolean isTopTaskHome=new AtomicBoolean();
  if (isRecentsTopMost(topTask,isTopTaskHome)) {
    Intent intent=new Intent(RecentsActivity.ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
    mContext.sendBroadcast(intent);
    mLastToggleTime=System.currentTimeMillis();
    return;
  }
 else {
    startRecentsActivity(topTask,isTopTaskHome.get());
  }
}

Fixed version (ground truth):
/** 
 * Toggles the recents activity 
 */
void toggleRecentsActivity(){
  if (System.currentTimeMillis() - mLastToggleTime < sMinToggleDelay) {
    return;
  }
  ActivityManager.RunningTaskInfo topTask=getTopMostTask();
  AtomicBoolean isTopTaskHome=new AtomicBoolean();
  if (isRecentsTopMost(topTask,isTopTaskHome)) {
    Intent intent=new Intent(RecentsActivity.ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
    mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    mLastToggleTime=System.currentTimeMillis();
    return;
  }
 else {
    startRecentsActivity(topTask,isTopTaskHome.get());
  }
}
Program: 198777
Project: 198777
Buggy source:
@Override public Void doInBackground(Void... params){
  int availability=internalGetInitialAvailability();
  KeyphraseSoundModel soundModel=null;
  if (availability == STATE_NOT_READY || availability == STATE_KEYPHRASE_UNENROLLED || availability == STATE_KEYPHRASE_ENROLLED) {
    soundModel=internalGetKeyphraseSoundModel(mKeyphraseMetadata.id);
    if (soundModel == null) {
      availability=STATE_KEYPHRASE_UNENROLLED;
    }
 else {
      availability=STATE_KEYPHRASE_ENROLLED;
    }
  }
synchronized (mLock) {
    if (DBG) {
      Slog.d(TAG,"String_Node_Str" + mAvailability + "String_Node_Str"+ availability);
    }
    mAvailability=availability;
    mEnrolledSoundModel=soundModel;
    notifyStateChangedLocked();
  }
  return null;
}

Fixed version (ground truth):
@Override public Void doInBackground(Void... params){
  int availability=internalGetInitialAvailability();
  boolean enrolled=false;
  if (availability == STATE_NOT_READY || availability == STATE_KEYPHRASE_UNENROLLED || availability == STATE_KEYPHRASE_ENROLLED) {
    enrolled=internalGetIsEnrolled(mKeyphraseMetadata.id);
    if (!enrolled) {
      availability=STATE_KEYPHRASE_UNENROLLED;
    }
 else {
      availability=STATE_KEYPHRASE_ENROLLED;
    }
  }
synchronized (mLock) {
    if (DBG) {
      Slog.d(TAG,"String_Node_Str" + mAvailability + "String_Node_Str"+ availability);
    }
    mIsEnrolledForDetection=enrolled;
    mAvailability=availability;
    notifyStateChangedLocked();
  }
  return null;
}
Program: 198778
Project: 198778
Buggy source:
private int startRecognitionLocked(int recognitionFlags){
  if (mAvailability != STATE_KEYPHRASE_ENROLLED) {
    throw new UnsupportedOperationException("String_Node_Str");
  }
  KeyphraseRecognitionExtra[] recognitionExtra=new KeyphraseRecognitionExtra[1];
  recognitionExtra[0]=new KeyphraseRecognitionExtra(mKeyphraseMetadata.id,mKeyphraseMetadata.recognitionModeFlags,new ConfidenceLevel[0]);
  boolean captureTriggerAudio=(recognitionFlags & RECOGNITION_FLAG_CAPTURE_TRIGGER_AUDIO) != 0;
  int code=STATUS_ERROR;
  try {
    code=mModelManagementService.startRecognition(mVoiceInteractionService,mKeyphraseMetadata.id,mEnrolledSoundModel,mInternalCallback,new RecognitionConfig(captureTriggerAudio,recognitionExtra,null));
  }
 catch (  RemoteException e) {
    Slog.w(TAG,"String_Node_Str");
  }
  if (code != STATUS_OK) {
    Slog.w(TAG,"String_Node_Str" + code);
  }
  return code;
}

Fixed version (ground truth):
private int startRecognitionLocked(int recognitionFlags){
  if (mAvailability != STATE_KEYPHRASE_ENROLLED) {
    throw new UnsupportedOperationException("String_Node_Str");
  }
  KeyphraseRecognitionExtra[] recognitionExtra=new KeyphraseRecognitionExtra[1];
  recognitionExtra[0]=new KeyphraseRecognitionExtra(mKeyphraseMetadata.id,mKeyphraseMetadata.recognitionModeFlags,new ConfidenceLevel[0]);
  boolean captureTriggerAudio=(recognitionFlags & RECOGNITION_FLAG_CAPTURE_TRIGGER_AUDIO) != 0;
  int code=STATUS_ERROR;
  try {
    code=mModelManagementService.startRecognition(mVoiceInteractionService,mKeyphraseMetadata.id,mInternalCallback,new RecognitionConfig(captureTriggerAudio,recognitionExtra,null));
  }
 catch (  RemoteException e) {
    Slog.w(TAG,"String_Node_Str");
  }
  if (code != STATUS_OK) {
    Slog.w(TAG,"String_Node_Str" + code);
  }
  return code;
}
Program: 198779
Project: 198779
Buggy source:
/** 
 * OnAnimationStartedListener Implementation 
 */
@Override public void onAnimationStarted(){
  if (!mStartAnimationTriggered) {
    Intent intent=new Intent(RecentsActivity.ACTION_START_ENTER_ANIMATION);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
    mContext.sendBroadcast(intent);
    mStartAnimationTriggered=true;
  }
}

Fixed version (ground truth):
/** 
 * OnAnimationStartedListener Implementation 
 */
@Override public void onAnimationStarted(){
  if (!mStartAnimationTriggered) {
    Intent intent=new Intent(RecentsActivity.ACTION_START_ENTER_ANIMATION);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
    mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    mStartAnimationTriggered=true;
  }
}
Program: 198780
Project: 198780
Buggy source:
/** 
 * Hides the recents 
 */
public void onHideRecents(boolean triggeredFromAltTab){
  if (mBootCompleted) {
    if (isRecentsTopMost(getTopMostTask(),null)) {
      Intent intent=new Intent(RecentsActivity.ACTION_HIDE_RECENTS_ACTIVITY);
      intent.setPackage(mContext.getPackageName());
      intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
      intent.putExtra(RecentsActivity.EXTRA_TRIGGERED_FROM_ALT_TAB,triggeredFromAltTab);
      mContext.sendBroadcast(intent);
    }
  }
}

Fixed version (ground truth):
/** 
 * Hides the recents 
 */
public void onHideRecents(boolean triggeredFromAltTab){
  if (mBootCompleted) {
    if (isRecentsTopMost(getTopMostTask(),null)) {
      Intent intent=new Intent(RecentsActivity.ACTION_HIDE_RECENTS_ACTIVITY);
      intent.setPackage(mContext.getPackageName());
      intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
      intent.putExtra(RecentsActivity.EXTRA_TRIGGERED_FROM_ALT_TAB,triggeredFromAltTab);
      mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    }
  }
}
Program: 198781
Project: 198781
Buggy source:
/** 
 * Toggles the recents activity 
 */
void toggleRecentsActivity(){
  if (System.currentTimeMillis() - mLastToggleTime < sMinToggleDelay) {
    return;
  }
  ActivityManager.RunningTaskInfo topTask=getTopMostTask();
  AtomicBoolean isTopTaskHome=new AtomicBoolean();
  if (isRecentsTopMost(topTask,isTopTaskHome)) {
    Intent intent=new Intent(RecentsActivity.ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
    mContext.sendBroadcast(intent);
    mLastToggleTime=System.currentTimeMillis();
    return;
  }
 else {
    startRecentsActivity(topTask,isTopTaskHome.get());
  }
}

Fixed version (ground truth):
/** 
 * Toggles the recents activity 
 */
void toggleRecentsActivity(){
  if (System.currentTimeMillis() - mLastToggleTime < sMinToggleDelay) {
    return;
  }
  ActivityManager.RunningTaskInfo topTask=getTopMostTask();
  AtomicBoolean isTopTaskHome=new AtomicBoolean();
  if (isRecentsTopMost(topTask,isTopTaskHome)) {
    Intent intent=new Intent(RecentsActivity.ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
    mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    mLastToggleTime=System.currentTimeMillis();
    return;
  }
 else {
    startRecentsActivity(topTask,isTopTaskHome.get());
  }
}
Program: 198786
Project: 198786
Buggy source:
/** 
 * OnAnimationStartedListener Implementation 
 */
@Override public void onAnimationStarted(){
  if (!mStartAnimationTriggered) {
    Intent intent=new Intent(RecentsActivity.ACTION_START_ENTER_ANIMATION);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
    mContext.sendBroadcast(intent);
    mStartAnimationTriggered=true;
  }
}

Fixed version (ground truth):
/** 
 * OnAnimationStartedListener Implementation 
 */
@Override public void onAnimationStarted(){
  if (!mStartAnimationTriggered) {
    Intent intent=new Intent(RecentsActivity.ACTION_START_ENTER_ANIMATION);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
    mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    mStartAnimationTriggered=true;
  }
}
Program: 198787
Project: 198787
Buggy source:
/** 
 * Hides the recents 
 */
public void onHideRecents(boolean triggeredFromAltTab){
  if (mBootCompleted) {
    if (isRecentsTopMost(getTopMostTask(),null)) {
      Intent intent=new Intent(RecentsActivity.ACTION_HIDE_RECENTS_ACTIVITY);
      intent.setPackage(mContext.getPackageName());
      intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
      intent.putExtra(RecentsActivity.EXTRA_TRIGGERED_FROM_ALT_TAB,triggeredFromAltTab);
      mContext.sendBroadcast(intent);
    }
  }
}

Fixed version (ground truth):
/** 
 * Hides the recents 
 */
public void onHideRecents(boolean triggeredFromAltTab){
  if (mBootCompleted) {
    if (isRecentsTopMost(getTopMostTask(),null)) {
      Intent intent=new Intent(RecentsActivity.ACTION_HIDE_RECENTS_ACTIVITY);
      intent.setPackage(mContext.getPackageName());
      intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
      intent.putExtra(RecentsActivity.EXTRA_TRIGGERED_FROM_ALT_TAB,triggeredFromAltTab);
      mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    }
  }
}
Program: 198788
Project: 198788
Buggy source:
/** 
 * Toggles the recents activity 
 */
void toggleRecentsActivity(){
  if (System.currentTimeMillis() - mLastToggleTime < sMinToggleDelay) {
    return;
  }
  ActivityManager.RunningTaskInfo topTask=getTopMostTask();
  AtomicBoolean isTopTaskHome=new AtomicBoolean();
  if (isRecentsTopMost(topTask,isTopTaskHome)) {
    Intent intent=new Intent(RecentsActivity.ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
    mContext.sendBroadcast(intent);
    mLastToggleTime=System.currentTimeMillis();
    return;
  }
 else {
    startRecentsActivity(topTask,isTopTaskHome.get());
  }
}

Fixed version (ground truth):
/** 
 * Toggles the recents activity 
 */
void toggleRecentsActivity(){
  if (System.currentTimeMillis() - mLastToggleTime < sMinToggleDelay) {
    return;
  }
  ActivityManager.RunningTaskInfo topTask=getTopMostTask();
  AtomicBoolean isTopTaskHome=new AtomicBoolean();
  if (isRecentsTopMost(topTask,isTopTaskHome)) {
    Intent intent=new Intent(RecentsActivity.ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
    mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    mLastToggleTime=System.currentTimeMillis();
    return;
  }
 else {
    startRecentsActivity(topTask,isTopTaskHome.get());
  }
}
Program: 198791
Project: 198791
Buggy source:
/** 
 * Retrieve the Drawable for the attribute at <var>index</var>.  This gets the resource ID of the selected attribute, and uses  {@link Resources#getDrawable Resources.getDrawable} of the owningResources object to retrieve its Drawable.
 * @param index Index of attribute to retrieve.
 * @return Drawable for the attribute, or null if not defined.
 */
public Drawable getDrawable(int index){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  final TypedValue value=mValue;
  if (getValueAt(index * AssetManager.STYLE_NUM_ENTRIES,value)) {
    if (false) {
      System.out.println("String_Node_Str");
      System.out.println("String_Node_Str" + value.type + "String_Node_Str"+ value.string+ "String_Node_Str"+ Integer.toHexString(value.data)+ "String_Node_Str"+ value.assetCookie);
      System.out.println("String_Node_Str");
    }
    return mResources.loadDrawable(value,value.resourceId,mTheme);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Retrieve the Drawable for the attribute at <var>index</var>.
 * @param index Index of attribute to retrieve.
 * @return Drawable for the attribute, or null if not defined.
 */
public Drawable getDrawable(int index){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  final TypedValue value=mValue;
  if (getValueAt(index * AssetManager.STYLE_NUM_ENTRIES,value)) {
    if (value.type == TypedValue.TYPE_ATTRIBUTE) {
      throw new RuntimeException("String_Node_Str" + index);
    }
    return mResources.loadDrawable(value,value.resourceId,mTheme);
  }
  return null;
}
Program: 198792
Project: 198792
Buggy source:
/** 
 * Retrieve a dimensional unit attribute at <var>index</var> for use as an offset in raw pixels.  This is the same as  {@link #getDimension}, except the returned value is converted to integer pixels for you.  An offset conversion involves simply truncating the base value to an integer.
 * @param index Index of attribute to retrieve.
 * @param defValue Value to return if the attribute is not defined ornot a resource.
 * @return Attribute dimension value multiplied by the appropriatemetric and truncated to integer pixels, or defValue if not defined.
 * @see #getDimension
 * @see #getDimensionPixelSize
 */
public int getDimensionPixelOffset(int index,int defValue){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  index*=AssetManager.STYLE_NUM_ENTRIES;
  final int[] data=mData;
  final int type=data[index + AssetManager.STYLE_TYPE];
  if (type == TypedValue.TYPE_NULL) {
    return defValue;
  }
 else   if (type == TypedValue.TYPE_DIMENSION) {
    return TypedValue.complexToDimensionPixelOffset(data[index + AssetManager.STYLE_DATA],mMetrics);
  }
  throw new UnsupportedOperationException("String_Node_Str" + Integer.toHexString(type));
}

Fixed version (ground truth):
/** 
 * Retrieve a dimensional unit attribute at <var>index</var> for use as an offset in raw pixels.  This is the same as  {@link #getDimension}, except the returned value is converted to integer pixels for you.  An offset conversion involves simply truncating the base value to an integer.
 * @param index Index of attribute to retrieve.
 * @param defValue Value to return if the attribute is not defined ornot a resource.
 * @return Attribute dimension value multiplied by the appropriatemetric and truncated to integer pixels, or defValue if not defined.
 * @see #getDimension
 * @see #getDimensionPixelSize
 */
public int getDimensionPixelOffset(int index,int defValue){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  index*=AssetManager.STYLE_NUM_ENTRIES;
  final int[] data=mData;
  final int type=data[index + AssetManager.STYLE_TYPE];
  if (type == TypedValue.TYPE_NULL) {
    return defValue;
  }
 else   if (type == TypedValue.TYPE_DIMENSION) {
    return TypedValue.complexToDimensionPixelOffset(data[index + AssetManager.STYLE_DATA],mMetrics);
  }
 else   if (type == TypedValue.TYPE_ATTRIBUTE) {
    throw new RuntimeException("String_Node_Str" + index);
  }
  throw new UnsupportedOperationException("String_Node_Str" + Integer.toHexString(type));
}
Program: 198793
Project: 198793
Buggy source:
/** 
 * Retrieve the integer value for the attribute at <var>index</var>.
 * @param index Index of attribute to retrieve.
 * @param defValue Value to return if the attribute is not defined ornot a resource.
 * @return Attribute integer value, or defValue if not defined.
 */
public int getInteger(int index,int defValue){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  index*=AssetManager.STYLE_NUM_ENTRIES;
  final int[] data=mData;
  final int type=data[index + AssetManager.STYLE_TYPE];
  if (type == TypedValue.TYPE_NULL) {
    return defValue;
  }
 else   if (type >= TypedValue.TYPE_FIRST_INT && type <= TypedValue.TYPE_LAST_INT) {
    return data[index + AssetManager.STYLE_DATA];
  }
  throw new UnsupportedOperationException("String_Node_Str" + Integer.toHexString(type));
}

Fixed version (ground truth):
/** 
 * Retrieve the integer value for the attribute at <var>index</var>.
 * @param index Index of attribute to retrieve.
 * @param defValue Value to return if the attribute is not defined ornot a resource.
 * @return Attribute integer value, or defValue if not defined.
 */
public int getInteger(int index,int defValue){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  index*=AssetManager.STYLE_NUM_ENTRIES;
  final int[] data=mData;
  final int type=data[index + AssetManager.STYLE_TYPE];
  if (type == TypedValue.TYPE_NULL) {
    return defValue;
  }
 else   if (type >= TypedValue.TYPE_FIRST_INT && type <= TypedValue.TYPE_LAST_INT) {
    return data[index + AssetManager.STYLE_DATA];
  }
 else   if (type == TypedValue.TYPE_ATTRIBUTE) {
    throw new RuntimeException("String_Node_Str" + index);
  }
  throw new UnsupportedOperationException("String_Node_Str" + Integer.toHexString(type));
}
Program: 198794
Project: 198794
Buggy source:
/** 
 * Retrieve a dimensional unit attribute at <var>index</var>.  Unit conversions are based on the current   {@link DisplayMetrics}associated with the resources this   {@link TypedArray} objectcame from.
 * @param index Index of attribute to retrieve.
 * @param defValue Value to return if the attribute is not defined ornot a resource.
 * @return Attribute dimension value multiplied by the appropriatemetric, or defValue if not defined.
 * @see #getDimensionPixelOffset
 * @see #getDimensionPixelSize
 */
public float getDimension(int index,float defValue){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  index*=AssetManager.STYLE_NUM_ENTRIES;
  final int[] data=mData;
  final int type=data[index + AssetManager.STYLE_TYPE];
  if (type == TypedValue.TYPE_NULL) {
    return defValue;
  }
 else   if (type == TypedValue.TYPE_DIMENSION) {
    return TypedValue.complexToDimension(data[index + AssetManager.STYLE_DATA],mMetrics);
  }
  throw new UnsupportedOperationException("String_Node_Str" + Integer.toHexString(type));
}

Fixed version (ground truth):
/** 
 * Retrieve a dimensional unit attribute at <var>index</var>.  Unit conversions are based on the current   {@link DisplayMetrics}associated with the resources this   {@link TypedArray} objectcame from.
 * @param index Index of attribute to retrieve.
 * @param defValue Value to return if the attribute is not defined ornot a resource.
 * @return Attribute dimension value multiplied by the appropriatemetric, or defValue if not defined.
 * @see #getDimensionPixelOffset
 * @see #getDimensionPixelSize
 */
public float getDimension(int index,float defValue){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  index*=AssetManager.STYLE_NUM_ENTRIES;
  final int[] data=mData;
  final int type=data[index + AssetManager.STYLE_TYPE];
  if (type == TypedValue.TYPE_NULL) {
    return defValue;
  }
 else   if (type == TypedValue.TYPE_DIMENSION) {
    return TypedValue.complexToDimension(data[index + AssetManager.STYLE_DATA],mMetrics);
  }
 else   if (type == TypedValue.TYPE_ATTRIBUTE) {
    throw new RuntimeException("String_Node_Str" + index);
  }
  throw new UnsupportedOperationException("String_Node_Str" + Integer.toHexString(type));
}
Program: 198795
Project: 198795
Buggy source:
/** 
 * Retrieve the CharSequence[] for the attribute at <var>index</var>. This gets the resource ID of the selected attribute, and uses  {@link Resources#getTextArray Resources.getTextArray} of the owningResources object to retrieve its String[].
 * @param index Index of attribute to retrieve.
 * @return CharSequence[] for the attribute, or null if not defined.
 */
public CharSequence[] getTextArray(int index){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  final TypedValue value=mValue;
  if (getValueAt(index * AssetManager.STYLE_NUM_ENTRIES,value)) {
    if (false) {
      System.out.println("String_Node_Str");
      System.out.println("String_Node_Str" + value.type + "String_Node_Str"+ value.string+ "String_Node_Str"+ Integer.toHexString(value.data)+ "String_Node_Str"+ value.assetCookie);
      System.out.println("String_Node_Str");
    }
    return mResources.getTextArray(value.resourceId);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Retrieve the CharSequence[] for the attribute at <var>index</var>. This gets the resource ID of the selected attribute, and uses  {@link Resources#getTextArray Resources.getTextArray} of the owningResources object to retrieve its String[].
 * @param index Index of attribute to retrieve.
 * @return CharSequence[] for the attribute, or null if not defined.
 */
public CharSequence[] getTextArray(int index){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  final TypedValue value=mValue;
  if (getValueAt(index * AssetManager.STYLE_NUM_ENTRIES,value)) {
    return mResources.getTextArray(value.resourceId);
  }
  return null;
}
Program: 198796
Project: 198796
Buggy source:
/** 
 * Retrieve a dimensional unit attribute at <var>index</var> for use as a size in raw pixels.  This is the same as  {@link #getDimension}, except the returned value is converted to integer pixels for use as a size.  A size conversion involves rounding the base value, and ensuring that a non-zero base value is at least one pixel in size.
 * @param index Index of attribute to retrieve.
 * @param defValue Value to return if the attribute is not defined ornot a resource.
 * @return Attribute dimension value multiplied by the appropriatemetric and truncated to integer pixels, or defValue if not defined.
 * @see #getDimension
 * @see #getDimensionPixelOffset
 */
public int getDimensionPixelSize(int index,int defValue){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  index*=AssetManager.STYLE_NUM_ENTRIES;
  final int[] data=mData;
  final int type=data[index + AssetManager.STYLE_TYPE];
  if (type == TypedValue.TYPE_NULL) {
    return defValue;
  }
 else   if (type == TypedValue.TYPE_DIMENSION) {
    return TypedValue.complexToDimensionPixelSize(data[index + AssetManager.STYLE_DATA],mMetrics);
  }
  throw new UnsupportedOperationException("String_Node_Str" + Integer.toHexString(type));
}

Fixed version (ground truth):
/** 
 * Retrieve a dimensional unit attribute at <var>index</var> for use as a size in raw pixels.  This is the same as  {@link #getDimension}, except the returned value is converted to integer pixels for use as a size.  A size conversion involves rounding the base value, and ensuring that a non-zero base value is at least one pixel in size.
 * @param index Index of attribute to retrieve.
 * @param defValue Value to return if the attribute is not defined ornot a resource.
 * @return Attribute dimension value multiplied by the appropriatemetric and truncated to integer pixels, or defValue if not defined.
 * @see #getDimension
 * @see #getDimensionPixelOffset
 */
public int getDimensionPixelSize(int index,int defValue){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  index*=AssetManager.STYLE_NUM_ENTRIES;
  final int[] data=mData;
  final int type=data[index + AssetManager.STYLE_TYPE];
  if (type == TypedValue.TYPE_NULL) {
    return defValue;
  }
 else   if (type == TypedValue.TYPE_DIMENSION) {
    return TypedValue.complexToDimensionPixelSize(data[index + AssetManager.STYLE_DATA],mMetrics);
  }
 else   if (type == TypedValue.TYPE_ATTRIBUTE) {
    throw new RuntimeException("String_Node_Str" + index);
  }
  throw new UnsupportedOperationException("String_Node_Str" + Integer.toHexString(type));
}
Program: 198797
Project: 198797
Buggy source:
/** 
 * Retrieve the color value for the attribute at <var>index</var>.  If the attribute references a color resource holding a complex  {@link android.content.res.ColorStateList}, then the default color from the set is returned.
 * @param index Index of attribute to retrieve.
 * @param defValue Value to return if the attribute is not defined ornot a resource.
 * @return Attribute color value, or defValue if not defined.
 */
public int getColor(int index,int defValue){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  index*=AssetManager.STYLE_NUM_ENTRIES;
  final int[] data=mData;
  final int type=data[index + AssetManager.STYLE_TYPE];
  if (type == TypedValue.TYPE_NULL) {
    return defValue;
  }
 else   if (type >= TypedValue.TYPE_FIRST_INT && type <= TypedValue.TYPE_LAST_INT) {
    return data[index + AssetManager.STYLE_DATA];
  }
 else   if (type == TypedValue.TYPE_STRING) {
    final TypedValue value=mValue;
    if (getValueAt(index,value)) {
      ColorStateList csl=mResources.loadColorStateList(value,value.resourceId);
      return csl.getDefaultColor();
    }
    return defValue;
  }
  throw new UnsupportedOperationException("String_Node_Str" + Integer.toHexString(type));
}

Fixed version (ground truth):
/** 
 * Retrieve the color value for the attribute at <var>index</var>.  If the attribute references a color resource holding a complex  {@link android.content.res.ColorStateList}, then the default color from the set is returned.
 * @param index Index of attribute to retrieve.
 * @param defValue Value to return if the attribute is not defined ornot a resource.
 * @return Attribute color value, or defValue if not defined.
 */
public int getColor(int index,int defValue){
  if (mRecycled) {
    throw new RuntimeException("String_Node_Str");
  }
  index*=AssetManager.STYLE_NUM_ENTRIES;
  final int[] data=mData;
  final int type=data[index + AssetManager.STYLE_TYPE];
  if (type == TypedValue.TYPE_NULL) {
    return defValue;
  }
 else   if (type >= TypedValue.TYPE_FIRST_INT && type <= TypedValue.TYPE_LAST_INT) {
    return data[index + AssetManager.STYLE_DATA];
  }
 else   if (type == TypedValue.TYPE_STRING) {
    final TypedValue value=mValue;
    if (getValueAt(index,value)) {
      ColorStateList csl=mResources.loadColorStateList(value,value.resourceId);
      return csl.getDefaultColor();
    }
    return defValue;
  }
 else   if (type == TypedValue.TYPE_ATTRIBUTE) {
    throw new RuntimeException("String_Node_Str" + index);
  }
  throw new UnsupportedOperationException("String_Node_Str" + Integer.toHexString(type));
}