nus-yam/ex-repair huggingface dataset:
Program: 182386
Project: 182386
Buggy source:
public void onPatternDetected(List<LockPatternView.Cell> pattern){
  if (mLockPatternUtils.checkPattern(pattern)) {
    mLockPatternView.setDisplayMode(LockPatternView.DisplayMode.Correct);
    mInstructions="String_Node_Str";
    updateStatusLines();
    mCallback.keyguardDone(true);
    mCallback.reportSuccessfulUnlockAttempt();
  }
 else {
    if (pattern.size() > MIN_PATTERN_BEFORE_POKE_WAKELOCK) {
      mCallback.pokeWakelock(UNLOCK_PATTERN_WAKE_INTERVAL_MS);
    }
    mLockPatternView.setDisplayMode(LockPatternView.DisplayMode.Wrong);
    if (pattern.size() >= LockPatternUtils.MIN_PATTERN_REGISTER_FAIL) {
      mTotalFailedPatternAttempts++;
      mFailedPatternAttemptsSinceLastTimeout++;
    }
    if (mFailedPatternAttemptsSinceLastTimeout >= LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT) {
      long deadline=mLockPatternUtils.setLockoutAttemptDeadline();
      handleAttemptLockout(deadline);
    }
 else {
      mInstructions=getContext().getString(R.string.lockscreen_pattern_wrong);
      updateStatusLines();
      mLockPatternView.postDelayed(mCancelPatternRunnable,PATTERN_CLEAR_TIMEOUT_MS);
    }
    if (pattern.size() > MIN_PATTERN_BEFORE_REPORT) {
      mCallback.reportFailedUnlockAttempt();
    }
  }
}

Fixed version (ground truth):
public void onPatternDetected(List<LockPatternView.Cell> pattern){
  if (mLockPatternUtils.checkPattern(pattern)) {
    mLockPatternView.setDisplayMode(LockPatternView.DisplayMode.Correct);
    mInstructions="String_Node_Str";
    updateStatusLines();
    mCallback.keyguardDone(true);
    mCallback.reportSuccessfulUnlockAttempt();
  }
 else {
    if (pattern.size() > MIN_PATTERN_BEFORE_POKE_WAKELOCK) {
      mCallback.pokeWakelock(UNLOCK_PATTERN_WAKE_INTERVAL_MS);
    }
    mLockPatternView.setDisplayMode(LockPatternView.DisplayMode.Wrong);
    if (pattern.size() >= LockPatternUtils.MIN_PATTERN_REGISTER_FAIL) {
      mTotalFailedPatternAttempts++;
      mFailedPatternAttemptsSinceLastTimeout++;
      mCallback.reportFailedUnlockAttempt();
    }
    if (mFailedPatternAttemptsSinceLastTimeout >= LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT) {
      long deadline=mLockPatternUtils.setLockoutAttemptDeadline();
      handleAttemptLockout(deadline);
    }
 else {
      mInstructions=getContext().getString(R.string.lockscreen_pattern_wrong);
      updateStatusLines();
      mLockPatternView.postDelayed(mCancelPatternRunnable,PATTERN_CLEAR_TIMEOUT_MS);
    }
  }
}
Program: 182387
Project: 182387
Buggy source:
private void setSystemVolume(VolumeStreamState streamState){
  setStreamVolumeIndex(streamState.mStreamType,streamState.mIndex);
  int numStreamTypes=AudioSystem.getNumStreamTypes();
  for (int streamType=numStreamTypes - 1; streamType >= 0; streamType--) {
    if (streamType != streamState.mStreamType && STREAM_VOLUME_ALIAS[streamType] == streamState.mStreamType) {
      setStreamVolumeIndex(streamType,mStreamStates[streamType].mIndex);
    }
  }
  sendMsg(mAudioHandler,MSG_PERSIST_VOLUME,streamState.mStreamType,SENDMSG_REPLACE,0,0,streamState,PERSIST_DELAY);
}

Fixed version (ground truth):
private void setSystemVolume(VolumeStreamState streamState){
  setStreamVolumeIndex(streamState.mStreamType,streamState.mIndex);
  int numStreamTypes=AudioSystem.getNumStreamTypes();
  for (int streamType=numStreamTypes - 1; streamType >= 0; streamType--) {
    if (streamType != streamState.mStreamType && STREAM_VOLUME_ALIAS[streamType] == streamState.mStreamType) {
      setStreamVolumeIndex(streamType,mStreamStates[streamType].mIndex);
    }
  }
  sendMsg(mAudioHandler,MSG_PERSIST_VOLUME,streamState.mStreamType,SENDMSG_REPLACE,1,1,streamState,PERSIST_DELAY);
}
Program: 182388
Project: 182388
Buggy source:
@Override public void onChange(boolean selfChange){
  super.onChange(selfChange);
synchronized (mSettingsLock) {
    int ringerModeAffectedStreams=Settings.System.getInt(mContentResolver,Settings.System.MODE_RINGER_STREAMS_AFFECTED,0);
    if (ringerModeAffectedStreams != mRingerModeAffectedStreams) {
      mRingerModeAffectedStreams=ringerModeAffectedStreams;
      setRingerModeInt(getRingerMode(),false);
    }
    int notificationsUseRingVolume=Settings.System.getInt(mContentResolver,Settings.System.NOTIFICATIONS_USE_RING_VOLUME,1);
    if (notificationsUseRingVolume != mNotificationsUseRingVolume) {
      mNotificationsUseRingVolume=notificationsUseRingVolume;
      if (mNotificationsUseRingVolume == 1) {
        STREAM_VOLUME_ALIAS[AudioSystem.STREAM_NOTIFICATION]=AudioSystem.STREAM_RING;
        mStreamStates[AudioSystem.STREAM_NOTIFICATION].setVolumeIndexSettingName(System.VOLUME_SETTINGS[AudioSystem.STREAM_RING]);
      }
 else {
        STREAM_VOLUME_ALIAS[AudioSystem.STREAM_NOTIFICATION]=AudioSystem.STREAM_NOTIFICATION;
        mStreamStates[AudioSystem.STREAM_NOTIFICATION].setVolumeIndexSettingName(System.VOLUME_SETTINGS[AudioSystem.STREAM_NOTIFICATION]);
        sendMsg(mAudioHandler,MSG_PERSIST_VOLUME,AudioSystem.STREAM_NOTIFICATION,SENDMSG_REPLACE,0,0,mStreamStates[AudioSystem.STREAM_NOTIFICATION],0);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onChange(boolean selfChange){
  super.onChange(selfChange);
synchronized (mSettingsLock) {
    int ringerModeAffectedStreams=Settings.System.getInt(mContentResolver,Settings.System.MODE_RINGER_STREAMS_AFFECTED,0);
    if (ringerModeAffectedStreams != mRingerModeAffectedStreams) {
      mRingerModeAffectedStreams=ringerModeAffectedStreams;
      setRingerModeInt(getRingerMode(),false);
    }
    int notificationsUseRingVolume=Settings.System.getInt(mContentResolver,Settings.System.NOTIFICATIONS_USE_RING_VOLUME,1);
    if (notificationsUseRingVolume != mNotificationsUseRingVolume) {
      mNotificationsUseRingVolume=notificationsUseRingVolume;
      if (mNotificationsUseRingVolume == 1) {
        STREAM_VOLUME_ALIAS[AudioSystem.STREAM_NOTIFICATION]=AudioSystem.STREAM_RING;
        mStreamStates[AudioSystem.STREAM_NOTIFICATION].setVolumeIndexSettingName(System.VOLUME_SETTINGS[AudioSystem.STREAM_RING]);
      }
 else {
        STREAM_VOLUME_ALIAS[AudioSystem.STREAM_NOTIFICATION]=AudioSystem.STREAM_NOTIFICATION;
        mStreamStates[AudioSystem.STREAM_NOTIFICATION].setVolumeIndexSettingName(System.VOLUME_SETTINGS[AudioSystem.STREAM_NOTIFICATION]);
        sendMsg(mAudioHandler,MSG_PERSIST_VOLUME,AudioSystem.STREAM_NOTIFICATION,SENDMSG_REPLACE,1,1,mStreamStates[AudioSystem.STREAM_NOTIFICATION],0);
      }
    }
  }
}
Program: 182389
Project: 182389
Buggy source:
/** 
 * Sets the stream state's index, and posts a message to set system volume. This will not call out to the UI. Assumes a valid stream type.
 * @param streamType Type of the stream
 * @param index Desired volume index of the stream
 * @param force If true, set the volume even if the desired volume is sameas the current volume.
 * @param lastAudible If true, stores new index as last audible one
 */
private void setStreamVolumeInt(int streamType,int index,boolean force,boolean lastAudible){
  VolumeStreamState streamState=mStreamStates[streamType];
  if (streamState.setIndex(index,lastAudible) || force) {
    if (streamState.muteCount() == 0) {
      sendMsg(mAudioHandler,MSG_SET_SYSTEM_VOLUME,streamType,SENDMSG_NOOP,0,0,streamState,0);
    }
  }
}

Fixed version (ground truth):
/** 
 * Sets the stream state's index, and posts a message to set system volume. This will not call out to the UI. Assumes a valid stream type.
 * @param streamType Type of the stream
 * @param index Desired volume index of the stream
 * @param force If true, set the volume even if the desired volume is sameas the current volume.
 * @param lastAudible If true, stores new index as last audible one
 */
private void setStreamVolumeInt(int streamType,int index,boolean force,boolean lastAudible){
  VolumeStreamState streamState=mStreamStates[streamType];
  if (streamState.setIndex(index,lastAudible) || force) {
    if (streamState.muteCount() == 0 && (mRingerMode == AudioManager.RINGER_MODE_NORMAL || !isStreamAffectedByRingerMode(streamType) || index == 0)) {
      sendMsg(mAudioHandler,MSG_SET_SYSTEM_VOLUME,streamType,SENDMSG_NOOP,0,0,streamState,0);
    }
 else {
      sendMsg(mAudioHandler,MSG_PERSIST_VOLUME,streamType,SENDMSG_REPLACE,0,1,streamState,PERSIST_DELAY);
    }
  }
}
Program: 182390
Project: 182390
Buggy source:
private void setRingerModeInt(int ringerMode,boolean persist){
  mRingerMode=ringerMode;
  int numStreamTypes=AudioSystem.getNumStreamTypes();
  if (mRingerMode == AudioManager.RINGER_MODE_NORMAL) {
    for (int streamType=numStreamTypes - 1; streamType >= 0; streamType--) {
      if (!isStreamAffectedByRingerMode(streamType))       continue;
      setStreamVolumeInt(streamType,mStreamStates[streamType].mLastAudibleIndex,false,false);
    }
  }
 else {
    for (int streamType=numStreamTypes - 1; streamType >= 0; streamType--) {
      if (isStreamAffectedByRingerMode(streamType)) {
        setStreamVolumeInt(streamType,0,false,false);
      }
 else {
        setStreamVolumeInt(streamType,mStreamStates[streamType].mLastAudibleIndex,false,false);
      }
    }
  }
  if (persist) {
    sendMsg(mAudioHandler,MSG_PERSIST_RINGER_MODE,SHARED_MSG,SENDMSG_REPLACE,0,0,null,PERSIST_DELAY);
  }
}

Fixed version (ground truth):
private void setRingerModeInt(int ringerMode,boolean persist){
  mRingerMode=ringerMode;
  int numStreamTypes=AudioSystem.getNumStreamTypes();
  if (mRingerMode == AudioManager.RINGER_MODE_NORMAL) {
    for (int streamType=numStreamTypes - 1; streamType >= 0; streamType--) {
      if (!isStreamAffectedByRingerMode(streamType))       continue;
      setStreamVolumeInt(streamType,mStreamStates[streamType].mLastAudibleIndex,true,false);
    }
  }
 else {
    for (int streamType=numStreamTypes - 1; streamType >= 0; streamType--) {
      if (isStreamAffectedByRingerMode(streamType)) {
        setStreamVolumeInt(streamType,0,false,false);
      }
 else {
        setStreamVolumeInt(streamType,mStreamStates[streamType].mLastAudibleIndex,true,false);
      }
    }
  }
  if (persist) {
    sendMsg(mAudioHandler,MSG_PERSIST_RINGER_MODE,SHARED_MSG,SENDMSG_REPLACE,0,0,null,PERSIST_DELAY);
  }
}
Program: 182391
Project: 182391
Buggy source:
private void persistVolume(VolumeStreamState streamState){
  System.putInt(mContentResolver,streamState.mVolumeIndexSettingName,(streamState.mIndex + 5) / 10);
  System.putInt(mContentResolver,streamState.mLastAudibleVolumeIndexSettingName,(streamState.mLastAudibleIndex + 5) / 10);
}

Fixed version (ground truth):
private void persistVolume(VolumeStreamState streamState,boolean current,boolean lastAudible){
  if (current) {
    System.putInt(mContentResolver,streamState.mVolumeIndexSettingName,(streamState.mIndex + 5) / 10);
  }
  if (lastAudible) {
    System.putInt(mContentResolver,streamState.mLastAudibleVolumeIndexSettingName,(streamState.mLastAudibleIndex + 5) / 10);
  }
}
Program: 182393
Project: 182393
Buggy source:
public boolean isUsbRNDISStarted() throws IllegalStateException {
  mContext.enforceCallingOrSelfPermission(android.Manifest.permission.ACCESS_NETWORK_STATE,"String_Node_Str");
  ArrayList<String> rsp=mConnector.doCommand("String_Node_Str");
  for (  String line : rsp) {
    String[] tok=line.split("String_Node_Str");
    int code=Integer.parseInt(tok[0]);
    if (code == NetdResponseCode.UsbRNDISStatusResult) {
      if (tok[2].equals("String_Node_Str"))       return true;
      return false;
    }
 else {
      throw new IllegalStateException(String.format("String_Node_Str",code));
    }
  }
  throw new IllegalStateException("String_Node_Str");
}

Fixed version (ground truth):
public boolean isUsbRNDISStarted() throws IllegalStateException {
  mContext.enforceCallingOrSelfPermission(android.Manifest.permission.ACCESS_NETWORK_STATE,"String_Node_Str");
  ArrayList<String> rsp=mConnector.doCommand("String_Node_Str");
  for (  String line : rsp) {
    String[] tok=line.split("String_Node_Str");
    int code=Integer.parseInt(tok[0]);
    if (code == NetdResponseCode.UsbRNDISStatusResult) {
      if (tok[3].equals("String_Node_Str"))       return true;
      return false;
    }
 else {
      throw new IllegalStateException(String.format("String_Node_Str",code));
    }
  }
  throw new IllegalStateException("String_Node_Str");
}
Program: 182394
Project: 182394
Buggy source:
public boolean isUsbRNDISStarted() throws IllegalStateException {
  mContext.enforceCallingOrSelfPermission(android.Manifest.permission.ACCESS_NETWORK_STATE,"String_Node_Str");
  ArrayList<String> rsp=mConnector.doCommand("String_Node_Str");
  for (  String line : rsp) {
    String[] tok=line.split("String_Node_Str");
    int code=Integer.parseInt(tok[0]);
    if (code == NetdResponseCode.UsbRNDISStatusResult) {
      if (tok[2].equals("String_Node_Str"))       return true;
      return false;
    }
 else {
      throw new IllegalStateException(String.format("String_Node_Str",code));
    }
  }
  throw new IllegalStateException("String_Node_Str");
}

Fixed version (ground truth):
public boolean isUsbRNDISStarted() throws IllegalStateException {
  mContext.enforceCallingOrSelfPermission(android.Manifest.permission.ACCESS_NETWORK_STATE,"String_Node_Str");
  ArrayList<String> rsp=mConnector.doCommand("String_Node_Str");
  for (  String line : rsp) {
    String[] tok=line.split("String_Node_Str");
    int code=Integer.parseInt(tok[0]);
    if (code == NetdResponseCode.UsbRNDISStatusResult) {
      if (tok[3].equals("String_Node_Str"))       return true;
      return false;
    }
 else {
      throw new IllegalStateException(String.format("String_Node_Str",code));
    }
  }
  throw new IllegalStateException("String_Node_Str");
}
Program: 182396
Project: 182396
Buggy source:
/** 
 * Sets the final position (Y) for this scroller.
 * @param newY The new Y offset as an absolute distance from the origin.
 * @see #extendDuration(int)
 * @see #setFinalX(int)
 */
public void setFinalY(int newY){
  if (mScrollMode == MODE_DEFAULT) {
    mDefaultScroller.setFinalY(newY);
  }
}

Fixed version (ground truth):
/** 
 * Sets the final position (Y) for this scroller.
 * @param newY The new Y offset as an absolute distance from the origin.
 * @see #extendDuration(int)
 * @see #setFinalX(int)
 */
public void setFinalY(int newY){
  if (mScrollMode == MODE_DEFAULT) {
    if (newY < mMinimumY) {
      mMinimumY=newY;
    }
    if (newY > mMaximumY) {
      mMaximumY=newY;
    }
    mDefaultScroller.setFinalY(newY);
  }
}
Program: 182397
Project: 182397
Buggy source:
/** 
 * Sets the final position (X) for this scroller.
 * @param newX The new X offset as an absolute distance from the origin.
 * @see #extendDuration(int)
 * @see #setFinalY(int)
 */
public void setFinalX(int newX){
  if (mScrollMode == MODE_DEFAULT) {
    mDefaultScroller.setFinalX(newX);
  }
}

Fixed version (ground truth):
/** 
 * Sets the final position (X) for this scroller.
 * @param newX The new X offset as an absolute distance from the origin.
 * @see #extendDuration(int)
 * @see #setFinalY(int)
 */
public void setFinalX(int newX){
  if (mScrollMode == MODE_DEFAULT) {
    if (newX < mMinimumX) {
      mMinimumX=newX;
    }
    if (newX > mMaximumX) {
      mMaximumX=newX;
    }
    mDefaultScroller.setFinalX(newX);
  }
}
Program: 182399
Project: 182399
Buggy source:
private void setSystemVolume(VolumeStreamState streamState){
  setStreamVolumeIndex(streamState.mStreamType,streamState.mIndex);
  int numStreamTypes=AudioSystem.getNumStreamTypes();
  for (int streamType=numStreamTypes - 1; streamType >= 0; streamType--) {
    if (streamType != streamState.mStreamType && STREAM_VOLUME_ALIAS[streamType] == streamState.mStreamType) {
      setStreamVolumeIndex(streamType,mStreamStates[streamType].mIndex);
    }
  }
  sendMsg(mAudioHandler,MSG_PERSIST_VOLUME,streamState.mStreamType,SENDMSG_REPLACE,0,0,streamState,PERSIST_DELAY);
}

Fixed version (ground truth):
private void setSystemVolume(VolumeStreamState streamState){
  setStreamVolumeIndex(streamState.mStreamType,streamState.mIndex);
  int numStreamTypes=AudioSystem.getNumStreamTypes();
  for (int streamType=numStreamTypes - 1; streamType >= 0; streamType--) {
    if (streamType != streamState.mStreamType && STREAM_VOLUME_ALIAS[streamType] == streamState.mStreamType) {
      setStreamVolumeIndex(streamType,mStreamStates[streamType].mIndex);
    }
  }
  sendMsg(mAudioHandler,MSG_PERSIST_VOLUME,streamState.mStreamType,SENDMSG_REPLACE,1,1,streamState,PERSIST_DELAY);
}
Program: 182400
Project: 182400
Buggy source:
@Override public void onChange(boolean selfChange){
  super.onChange(selfChange);
synchronized (mSettingsLock) {
    int ringerModeAffectedStreams=Settings.System.getInt(mContentResolver,Settings.System.MODE_RINGER_STREAMS_AFFECTED,0);
    if (ringerModeAffectedStreams != mRingerModeAffectedStreams) {
      mRingerModeAffectedStreams=ringerModeAffectedStreams;
      setRingerModeInt(getRingerMode(),false);
    }
    int notificationsUseRingVolume=Settings.System.getInt(mContentResolver,Settings.System.NOTIFICATIONS_USE_RING_VOLUME,1);
    if (notificationsUseRingVolume != mNotificationsUseRingVolume) {
      mNotificationsUseRingVolume=notificationsUseRingVolume;
      if (mNotificationsUseRingVolume == 1) {
        STREAM_VOLUME_ALIAS[AudioSystem.STREAM_NOTIFICATION]=AudioSystem.STREAM_RING;
        mStreamStates[AudioSystem.STREAM_NOTIFICATION].setVolumeIndexSettingName(System.VOLUME_SETTINGS[AudioSystem.STREAM_RING]);
      }
 else {
        STREAM_VOLUME_ALIAS[AudioSystem.STREAM_NOTIFICATION]=AudioSystem.STREAM_NOTIFICATION;
        mStreamStates[AudioSystem.STREAM_NOTIFICATION].setVolumeIndexSettingName(System.VOLUME_SETTINGS[AudioSystem.STREAM_NOTIFICATION]);
        sendMsg(mAudioHandler,MSG_PERSIST_VOLUME,AudioSystem.STREAM_NOTIFICATION,SENDMSG_REPLACE,0,0,mStreamStates[AudioSystem.STREAM_NOTIFICATION],0);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onChange(boolean selfChange){
  super.onChange(selfChange);
synchronized (mSettingsLock) {
    int ringerModeAffectedStreams=Settings.System.getInt(mContentResolver,Settings.System.MODE_RINGER_STREAMS_AFFECTED,0);
    if (ringerModeAffectedStreams != mRingerModeAffectedStreams) {
      mRingerModeAffectedStreams=ringerModeAffectedStreams;
      setRingerModeInt(getRingerMode(),false);
    }
    int notificationsUseRingVolume=Settings.System.getInt(mContentResolver,Settings.System.NOTIFICATIONS_USE_RING_VOLUME,1);
    if (notificationsUseRingVolume != mNotificationsUseRingVolume) {
      mNotificationsUseRingVolume=notificationsUseRingVolume;
      if (mNotificationsUseRingVolume == 1) {
        STREAM_VOLUME_ALIAS[AudioSystem.STREAM_NOTIFICATION]=AudioSystem.STREAM_RING;
        mStreamStates[AudioSystem.STREAM_NOTIFICATION].setVolumeIndexSettingName(System.VOLUME_SETTINGS[AudioSystem.STREAM_RING]);
      }
 else {
        STREAM_VOLUME_ALIAS[AudioSystem.STREAM_NOTIFICATION]=AudioSystem.STREAM_NOTIFICATION;
        mStreamStates[AudioSystem.STREAM_NOTIFICATION].setVolumeIndexSettingName(System.VOLUME_SETTINGS[AudioSystem.STREAM_NOTIFICATION]);
        sendMsg(mAudioHandler,MSG_PERSIST_VOLUME,AudioSystem.STREAM_NOTIFICATION,SENDMSG_REPLACE,1,1,mStreamStates[AudioSystem.STREAM_NOTIFICATION],0);
      }
    }
  }
}
Program: 182401
Project: 182401
Buggy source:
/** 
 * Sets the stream state's index, and posts a message to set system volume. This will not call out to the UI. Assumes a valid stream type.
 * @param streamType Type of the stream
 * @param index Desired volume index of the stream
 * @param force If true, set the volume even if the desired volume is sameas the current volume.
 * @param lastAudible If true, stores new index as last audible one
 */
private void setStreamVolumeInt(int streamType,int index,boolean force,boolean lastAudible){
  VolumeStreamState streamState=mStreamStates[streamType];
  if (streamState.setIndex(index,lastAudible) || force) {
    if (streamState.muteCount() == 0) {
      sendMsg(mAudioHandler,MSG_SET_SYSTEM_VOLUME,streamType,SENDMSG_NOOP,0,0,streamState,0);
    }
  }
}

Fixed version (ground truth):
/** 
 * Sets the stream state's index, and posts a message to set system volume. This will not call out to the UI. Assumes a valid stream type.
 * @param streamType Type of the stream
 * @param index Desired volume index of the stream
 * @param force If true, set the volume even if the desired volume is sameas the current volume.
 * @param lastAudible If true, stores new index as last audible one
 */
private void setStreamVolumeInt(int streamType,int index,boolean force,boolean lastAudible){
  VolumeStreamState streamState=mStreamStates[streamType];
  if (streamState.setIndex(index,lastAudible) || force) {
    if (streamState.muteCount() == 0 && (mRingerMode == AudioManager.RINGER_MODE_NORMAL || !isStreamAffectedByRingerMode(streamType) || index == 0)) {
      sendMsg(mAudioHandler,MSG_SET_SYSTEM_VOLUME,streamType,SENDMSG_NOOP,0,0,streamState,0);
    }
 else {
      sendMsg(mAudioHandler,MSG_PERSIST_VOLUME,streamType,SENDMSG_REPLACE,0,1,streamState,PERSIST_DELAY);
    }
  }
}
Program: 182402
Project: 182402
Buggy source:
private void setRingerModeInt(int ringerMode,boolean persist){
  mRingerMode=ringerMode;
  int numStreamTypes=AudioSystem.getNumStreamTypes();
  if (mRingerMode == AudioManager.RINGER_MODE_NORMAL) {
    for (int streamType=numStreamTypes - 1; streamType >= 0; streamType--) {
      if (!isStreamAffectedByRingerMode(streamType))       continue;
      setStreamVolumeInt(streamType,mStreamStates[streamType].mLastAudibleIndex,false,false);
    }
  }
 else {
    for (int streamType=numStreamTypes - 1; streamType >= 0; streamType--) {
      if (isStreamAffectedByRingerMode(streamType)) {
        setStreamVolumeInt(streamType,0,false,false);
      }
 else {
        setStreamVolumeInt(streamType,mStreamStates[streamType].mLastAudibleIndex,false,false);
      }
    }
  }
  if (persist) {
    sendMsg(mAudioHandler,MSG_PERSIST_RINGER_MODE,SHARED_MSG,SENDMSG_REPLACE,0,0,null,PERSIST_DELAY);
  }
}

Fixed version (ground truth):
private void setRingerModeInt(int ringerMode,boolean persist){
  mRingerMode=ringerMode;
  int numStreamTypes=AudioSystem.getNumStreamTypes();
  if (mRingerMode == AudioManager.RINGER_MODE_NORMAL) {
    for (int streamType=numStreamTypes - 1; streamType >= 0; streamType--) {
      if (!isStreamAffectedByRingerMode(streamType))       continue;
      setStreamVolumeInt(streamType,mStreamStates[streamType].mLastAudibleIndex,true,false);
    }
  }
 else {
    for (int streamType=numStreamTypes - 1; streamType >= 0; streamType--) {
      if (isStreamAffectedByRingerMode(streamType)) {
        setStreamVolumeInt(streamType,0,false,false);
      }
 else {
        setStreamVolumeInt(streamType,mStreamStates[streamType].mLastAudibleIndex,true,false);
      }
    }
  }
  if (persist) {
    sendMsg(mAudioHandler,MSG_PERSIST_RINGER_MODE,SHARED_MSG,SENDMSG_REPLACE,0,0,null,PERSIST_DELAY);
  }
}
Program: 182403
Project: 182403
Buggy source:
private void persistVolume(VolumeStreamState streamState){
  System.putInt(mContentResolver,streamState.mVolumeIndexSettingName,(streamState.mIndex + 5) / 10);
  System.putInt(mContentResolver,streamState.mLastAudibleVolumeIndexSettingName,(streamState.mLastAudibleIndex + 5) / 10);
}

Fixed version (ground truth):
private void persistVolume(VolumeStreamState streamState,boolean current,boolean lastAudible){
  if (current) {
    System.putInt(mContentResolver,streamState.mVolumeIndexSettingName,(streamState.mIndex + 5) / 10);
  }
  if (lastAudible) {
    System.putInt(mContentResolver,streamState.mLastAudibleVolumeIndexSettingName,(streamState.mLastAudibleIndex + 5) / 10);
  }
}
Program: 182405
Project: 182405
Buggy source:
/** 
 * Sets the final position (Y) for this scroller.
 * @param newY The new Y offset as an absolute distance from the origin.
 * @see #extendDuration(int)
 * @see #setFinalX(int)
 */
public void setFinalY(int newY){
  if (mScrollMode == MODE_DEFAULT) {
    mDefaultScroller.setFinalY(newY);
  }
}

Fixed version (ground truth):
/** 
 * Sets the final position (Y) for this scroller.
 * @param newY The new Y offset as an absolute distance from the origin.
 * @see #extendDuration(int)
 * @see #setFinalX(int)
 */
public void setFinalY(int newY){
  if (mScrollMode == MODE_DEFAULT) {
    if (newY < mMinimumY) {
      mMinimumY=newY;
    }
    if (newY > mMaximumY) {
      mMaximumY=newY;
    }
    mDefaultScroller.setFinalY(newY);
  }
}
Program: 182406
Project: 182406
Buggy source:
/** 
 * Sets the final position (X) for this scroller.
 * @param newX The new X offset as an absolute distance from the origin.
 * @see #extendDuration(int)
 * @see #setFinalY(int)
 */
public void setFinalX(int newX){
  if (mScrollMode == MODE_DEFAULT) {
    mDefaultScroller.setFinalX(newX);
  }
}

Fixed version (ground truth):
/** 
 * Sets the final position (X) for this scroller.
 * @param newX The new X offset as an absolute distance from the origin.
 * @see #extendDuration(int)
 * @see #setFinalY(int)
 */
public void setFinalX(int newX){
  if (mScrollMode == MODE_DEFAULT) {
    if (newX < mMinimumX) {
      mMinimumX=newX;
    }
    if (newX > mMaximumX) {
      mMaximumX=newX;
    }
    mDefaultScroller.setFinalX(newX);
  }
}
Program: 182409
Project: 182409
Buggy source:
/** 
 * Have the surface flinger show a surface, robustly dealing with error conditions.  In particular, if there is not enough memory to show the surface, then we will try to get rid of other surfaces in order to succeed.
 * @return Returns true if the surface was successfully shown.
 */
boolean showSurfaceRobustlyLocked(WindowState win){
  try {
    if (win.mSurface != null) {
      win.mSurface.show();
      if (win.mTurnOnScreen) {
        win.mTurnOnScreen=false;
        mTurnOnScreen=true;
      }
    }
    return true;
  }
 catch (  RuntimeException e) {
    Slog.w(TAG,"String_Node_Str" + win.mSurface + "String_Node_Str"+ win);
  }
  reclaimSomeSurfaceMemoryLocked(win,"String_Node_Str");
  return false;
}

Fixed version (ground truth):
/** 
 * Have the surface flinger show a surface, robustly dealing with error conditions.  In particular, if there is not enough memory to show the surface, then we will try to get rid of other surfaces in order to succeed.
 * @return Returns true if the surface was successfully shown.
 */
boolean showSurfaceRobustlyLocked(WindowState win){
  try {
    if (win.mSurface != null) {
      win.mSurface.show();
      if (win.mTurnOnScreen) {
        if (DEBUG_VISIBILITY)         Slog.v(TAG,"String_Node_Str" + win);
        win.mTurnOnScreen=false;
        mTurnOnScreen=true;
      }
    }
    return true;
  }
 catch (  RuntimeException e) {
    Slog.w(TAG,"String_Node_Str" + win.mSurface + "String_Node_Str"+ win);
  }
  reclaimSomeSurfaceMemoryLocked(win,"String_Node_Str");
  return false;
}
Program: 182410
Project: 182410
Buggy source:
public void prepareAppTransition(int transit){
  if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,"String_Node_Str")) {
    throw new SecurityException("String_Node_Str");
  }
synchronized (mWindowMap) {
    if (DEBUG_APP_TRANSITIONS)     Slog.v(TAG,"String_Node_Str" + transit + "String_Node_Str"+ mNextAppTransition);
    if (!mDisplayFrozen) {
      if (mNextAppTransition == WindowManagerPolicy.TRANSIT_UNSET || mNextAppTransition == WindowManagerPolicy.TRANSIT_NONE) {
        mNextAppTransition=transit;
      }
 else       if (transit == WindowManagerPolicy.TRANSIT_TASK_OPEN && mNextAppTransition == WindowManagerPolicy.TRANSIT_TASK_CLOSE) {
        mNextAppTransition=transit;
      }
 else       if (transit == WindowManagerPolicy.TRANSIT_ACTIVITY_OPEN && mNextAppTransition == WindowManagerPolicy.TRANSIT_ACTIVITY_CLOSE) {
        mNextAppTransition=transit;
      }
      mAppTransitionReady=false;
      mAppTransitionTimeout=false;
      mStartingIconInTransition=false;
      mSkipAppTransitionAnimation=false;
      mH.removeMessages(H.APP_TRANSITION_TIMEOUT);
      mH.sendMessageDelayed(mH.obtainMessage(H.APP_TRANSITION_TIMEOUT),5000);
    }
  }
}

Fixed version (ground truth):
public void prepareAppTransition(int transit){
  if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,"String_Node_Str")) {
    throw new SecurityException("String_Node_Str");
  }
synchronized (mWindowMap) {
    if (DEBUG_APP_TRANSITIONS)     Slog.v(TAG,"String_Node_Str" + transit + "String_Node_Str"+ mNextAppTransition);
    if (!mDisplayFrozen && mPolicy.isScreenOn()) {
      if (mNextAppTransition == WindowManagerPolicy.TRANSIT_UNSET || mNextAppTransition == WindowManagerPolicy.TRANSIT_NONE) {
        mNextAppTransition=transit;
      }
 else       if (transit == WindowManagerPolicy.TRANSIT_TASK_OPEN && mNextAppTransition == WindowManagerPolicy.TRANSIT_TASK_CLOSE) {
        mNextAppTransition=transit;
      }
 else       if (transit == WindowManagerPolicy.TRANSIT_ACTIVITY_OPEN && mNextAppTransition == WindowManagerPolicy.TRANSIT_ACTIVITY_CLOSE) {
        mNextAppTransition=transit;
      }
      mAppTransitionReady=false;
      mAppTransitionTimeout=false;
      mStartingIconInTransition=false;
      mSkipAppTransitionAnimation=false;
      mH.removeMessages(H.APP_TRANSITION_TIMEOUT);
      mH.sendMessageDelayed(mH.obtainMessage(H.APP_TRANSITION_TIMEOUT),5000);
    }
  }
}
Program: 182412
Project: 182412
Buggy source:
boolean hideLw(boolean doAnimation,boolean requestAnim){
  boolean current=doAnimation ? mPolicyVisibilityAfterAnim : mPolicyVisibility;
  if (!current) {
    return false;
  }
  if (doAnimation) {
    applyAnimationLocked(this,WindowManagerPolicy.TRANSIT_EXIT,false);
    if (mAnimation == null) {
      doAnimation=false;
    }
  }
  if (doAnimation) {
    mPolicyVisibilityAfterAnim=false;
  }
 else {
    mPolicyVisibilityAfterAnim=false;
    mPolicyVisibility=false;
    enableScreenIfNeededLocked();
  }
  if (requestAnim) {
    requestAnimationLocked(0);
  }
  return true;
}

Fixed version (ground truth):
boolean hideLw(boolean doAnimation,boolean requestAnim){
  boolean current=doAnimation ? mPolicyVisibilityAfterAnim : mPolicyVisibility;
  if (!current) {
    return false;
  }
  if (doAnimation) {
    applyAnimationLocked(this,WindowManagerPolicy.TRANSIT_EXIT,false);
    if (mAnimation == null) {
      doAnimation=false;
    }
  }
  if (doAnimation) {
    mPolicyVisibilityAfterAnim=false;
  }
 else {
    if (DEBUG_VISIBILITY)     Slog.v(TAG,"String_Node_Str" + this);
    mPolicyVisibilityAfterAnim=false;
    mPolicyVisibility=false;
    enableScreenIfNeededLocked();
  }
  if (requestAnim) {
    requestAnimationLocked(0);
  }
  return true;
}
Program: 182413
Project: 182413
Buggy source:
boolean showLw(boolean doAnimation,boolean requestAnim){
  if (mPolicyVisibility && mPolicyVisibilityAfterAnim) {
    return false;
  }
  mPolicyVisibility=true;
  mPolicyVisibilityAfterAnim=true;
  if (doAnimation) {
    applyAnimationLocked(this,WindowManagerPolicy.TRANSIT_ENTER,true);
  }
  if (requestAnim) {
    requestAnimationLocked(0);
  }
  return true;
}

Fixed version (ground truth):
boolean showLw(boolean doAnimation,boolean requestAnim){
  if (mPolicyVisibility && mPolicyVisibilityAfterAnim) {
    return false;
  }
  if (DEBUG_VISIBILITY)   Slog.v(TAG,"String_Node_Str" + this);
  mPolicyVisibility=true;
  mPolicyVisibilityAfterAnim=true;
  if (doAnimation) {
    applyAnimationLocked(this,WindowManagerPolicy.TRANSIT_ENTER,true);
  }
  if (requestAnim) {
    requestAnimationLocked(0);
  }
  return true;
}
Program: 182414
Project: 182414
Buggy source:
public void startAppFreezingScreen(IBinder token,int configChanges){
  if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,"String_Node_Str")) {
    throw new SecurityException("String_Node_Str");
  }
synchronized (mWindowMap) {
    if (configChanges == 0 && !mDisplayFrozen) {
      if (DEBUG_ORIENTATION)       Slog.v(TAG,"String_Node_Str" + token);
      return;
    }
    AppWindowToken wtoken=findAppWindowToken(token);
    if (wtoken == null || wtoken.appToken == null) {
      Slog.w(TAG,"String_Node_Str" + wtoken);
      return;
    }
    final long origId=Binder.clearCallingIdentity();
    startAppFreezingScreenLocked(wtoken,configChanges);
    Binder.restoreCallingIdentity(origId);
  }
}

Fixed version (ground truth):
public void startAppFreezingScreen(IBinder token,int configChanges){
  if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,"String_Node_Str")) {
    throw new SecurityException("String_Node_Str");
  }
synchronized (mWindowMap) {
    if (configChanges == 0 && !mDisplayFrozen && mPolicy.isScreenOn()) {
      if (DEBUG_ORIENTATION)       Slog.v(TAG,"String_Node_Str" + token);
      return;
    }
    AppWindowToken wtoken=findAppWindowToken(token);
    if (wtoken == null || wtoken.appToken == null) {
      Slog.w(TAG,"String_Node_Str" + wtoken);
      return;
    }
    final long origId=Binder.clearCallingIdentity();
    startAppFreezingScreenLocked(wtoken,configChanges);
    Binder.restoreCallingIdentity(origId);
  }
}
Program: 182417
Project: 182417
Buggy source:
/** 
 * Have the surface flinger show a surface, robustly dealing with error conditions.  In particular, if there is not enough memory to show the surface, then we will try to get rid of other surfaces in order to succeed.
 * @return Returns true if the surface was successfully shown.
 */
boolean showSurfaceRobustlyLocked(WindowState win){
  try {
    if (win.mSurface != null) {
      win.mSurface.show();
      if (win.mTurnOnScreen) {
        win.mTurnOnScreen=false;
        mTurnOnScreen=true;
      }
    }
    return true;
  }
 catch (  RuntimeException e) {
    Slog.w(TAG,"String_Node_Str" + win.mSurface + "String_Node_Str"+ win);
  }
  reclaimSomeSurfaceMemoryLocked(win,"String_Node_Str");
  return false;
}

Fixed version (ground truth):
/** 
 * Have the surface flinger show a surface, robustly dealing with error conditions.  In particular, if there is not enough memory to show the surface, then we will try to get rid of other surfaces in order to succeed.
 * @return Returns true if the surface was successfully shown.
 */
boolean showSurfaceRobustlyLocked(WindowState win){
  try {
    if (win.mSurface != null) {
      win.mSurface.show();
      if (win.mTurnOnScreen) {
        if (DEBUG_VISIBILITY)         Slog.v(TAG,"String_Node_Str" + win);
        win.mTurnOnScreen=false;
        mTurnOnScreen=true;
      }
    }
    return true;
  }
 catch (  RuntimeException e) {
    Slog.w(TAG,"String_Node_Str" + win.mSurface + "String_Node_Str"+ win);
  }
  reclaimSomeSurfaceMemoryLocked(win,"String_Node_Str");
  return false;
}
Program: 182418
Project: 182418
Buggy source:
public void prepareAppTransition(int transit){
  if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,"String_Node_Str")) {
    throw new SecurityException("String_Node_Str");
  }
synchronized (mWindowMap) {
    if (DEBUG_APP_TRANSITIONS)     Slog.v(TAG,"String_Node_Str" + transit + "String_Node_Str"+ mNextAppTransition);
    if (!mDisplayFrozen) {
      if (mNextAppTransition == WindowManagerPolicy.TRANSIT_UNSET || mNextAppTransition == WindowManagerPolicy.TRANSIT_NONE) {
        mNextAppTransition=transit;
      }
 else       if (transit == WindowManagerPolicy.TRANSIT_TASK_OPEN && mNextAppTransition == WindowManagerPolicy.TRANSIT_TASK_CLOSE) {
        mNextAppTransition=transit;
      }
 else       if (transit == WindowManagerPolicy.TRANSIT_ACTIVITY_OPEN && mNextAppTransition == WindowManagerPolicy.TRANSIT_ACTIVITY_CLOSE) {
        mNextAppTransition=transit;
      }
      mAppTransitionReady=false;
      mAppTransitionTimeout=false;
      mStartingIconInTransition=false;
      mSkipAppTransitionAnimation=false;
      mH.removeMessages(H.APP_TRANSITION_TIMEOUT);
      mH.sendMessageDelayed(mH.obtainMessage(H.APP_TRANSITION_TIMEOUT),5000);
    }
  }
}

Fixed version (ground truth):
public void prepareAppTransition(int transit){
  if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,"String_Node_Str")) {
    throw new SecurityException("String_Node_Str");
  }
synchronized (mWindowMap) {
    if (DEBUG_APP_TRANSITIONS)     Slog.v(TAG,"String_Node_Str" + transit + "String_Node_Str"+ mNextAppTransition);
    if (!mDisplayFrozen && mPolicy.isScreenOn()) {
      if (mNextAppTransition == WindowManagerPolicy.TRANSIT_UNSET || mNextAppTransition == WindowManagerPolicy.TRANSIT_NONE) {
        mNextAppTransition=transit;
      }
 else       if (transit == WindowManagerPolicy.TRANSIT_TASK_OPEN && mNextAppTransition == WindowManagerPolicy.TRANSIT_TASK_CLOSE) {
        mNextAppTransition=transit;
      }
 else       if (transit == WindowManagerPolicy.TRANSIT_ACTIVITY_OPEN && mNextAppTransition == WindowManagerPolicy.TRANSIT_ACTIVITY_CLOSE) {
        mNextAppTransition=transit;
      }
      mAppTransitionReady=false;
      mAppTransitionTimeout=false;
      mStartingIconInTransition=false;
      mSkipAppTransitionAnimation=false;
      mH.removeMessages(H.APP_TRANSITION_TIMEOUT);
      mH.sendMessageDelayed(mH.obtainMessage(H.APP_TRANSITION_TIMEOUT),5000);
    }
  }
}
Program: 182420
Project: 182420
Buggy source:
boolean hideLw(boolean doAnimation,boolean requestAnim){
  boolean current=doAnimation ? mPolicyVisibilityAfterAnim : mPolicyVisibility;
  if (!current) {
    return false;
  }
  if (doAnimation) {
    applyAnimationLocked(this,WindowManagerPolicy.TRANSIT_EXIT,false);
    if (mAnimation == null) {
      doAnimation=false;
    }
  }
  if (doAnimation) {
    mPolicyVisibilityAfterAnim=false;
  }
 else {
    mPolicyVisibilityAfterAnim=false;
    mPolicyVisibility=false;
    enableScreenIfNeededLocked();
  }
  if (requestAnim) {
    requestAnimationLocked(0);
  }
  return true;
}

Fixed version (ground truth):
boolean hideLw(boolean doAnimation,boolean requestAnim){
  boolean current=doAnimation ? mPolicyVisibilityAfterAnim : mPolicyVisibility;
  if (!current) {
    return false;
  }
  if (doAnimation) {
    applyAnimationLocked(this,WindowManagerPolicy.TRANSIT_EXIT,false);
    if (mAnimation == null) {
      doAnimation=false;
    }
  }
  if (doAnimation) {
    mPolicyVisibilityAfterAnim=false;
  }
 else {
    if (DEBUG_VISIBILITY)     Slog.v(TAG,"String_Node_Str" + this);
    mPolicyVisibilityAfterAnim=false;
    mPolicyVisibility=false;
    enableScreenIfNeededLocked();
  }
  if (requestAnim) {
    requestAnimationLocked(0);
  }
  return true;
}
Program: 182421
Project: 182421
Buggy source:
boolean showLw(boolean doAnimation,boolean requestAnim){
  if (mPolicyVisibility && mPolicyVisibilityAfterAnim) {
    return false;
  }
  mPolicyVisibility=true;
  mPolicyVisibilityAfterAnim=true;
  if (doAnimation) {
    applyAnimationLocked(this,WindowManagerPolicy.TRANSIT_ENTER,true);
  }
  if (requestAnim) {
    requestAnimationLocked(0);
  }
  return true;
}

Fixed version (ground truth):
boolean showLw(boolean doAnimation,boolean requestAnim){
  if (mPolicyVisibility && mPolicyVisibilityAfterAnim) {
    return false;
  }
  if (DEBUG_VISIBILITY)   Slog.v(TAG,"String_Node_Str" + this);
  mPolicyVisibility=true;
  mPolicyVisibilityAfterAnim=true;
  if (doAnimation) {
    applyAnimationLocked(this,WindowManagerPolicy.TRANSIT_ENTER,true);
  }
  if (requestAnim) {
    requestAnimationLocked(0);
  }
  return true;
}
Program: 182422
Project: 182422
Buggy source:
public void startAppFreezingScreen(IBinder token,int configChanges){
  if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,"String_Node_Str")) {
    throw new SecurityException("String_Node_Str");
  }
synchronized (mWindowMap) {
    if (configChanges == 0 && !mDisplayFrozen) {
      if (DEBUG_ORIENTATION)       Slog.v(TAG,"String_Node_Str" + token);
      return;
    }
    AppWindowToken wtoken=findAppWindowToken(token);
    if (wtoken == null || wtoken.appToken == null) {
      Slog.w(TAG,"String_Node_Str" + wtoken);
      return;
    }
    final long origId=Binder.clearCallingIdentity();
    startAppFreezingScreenLocked(wtoken,configChanges);
    Binder.restoreCallingIdentity(origId);
  }
}

Fixed version (ground truth):
public void startAppFreezingScreen(IBinder token,int configChanges){
  if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,"String_Node_Str")) {
    throw new SecurityException("String_Node_Str");
  }
synchronized (mWindowMap) {
    if (configChanges == 0 && !mDisplayFrozen && mPolicy.isScreenOn()) {
      if (DEBUG_ORIENTATION)       Slog.v(TAG,"String_Node_Str" + token);
      return;
    }
    AppWindowToken wtoken=findAppWindowToken(token);
    if (wtoken == null || wtoken.appToken == null) {
      Slog.w(TAG,"String_Node_Str" + wtoken);
      return;
    }
    final long origId=Binder.clearCallingIdentity();
    startAppFreezingScreenLocked(wtoken,configChanges);
    Binder.restoreCallingIdentity(origId);
  }
}
Program: 182423
Project: 182423
Buggy source:
private void commitHeaders(){
  if (mIsMainPageLoader && sCertificateTypeMap.containsKey(mMimeType)) {
    return;
  }
  int nativeResponse=createNativeResponse();
  nativeReceivedResponse(nativeResponse);
}

Fixed version (ground truth):
private void commitHeaders(){
  if (mIsMainPageLoader && sCertificateTypeMap.containsKey(mMimeType)) {
    return;
  }
  if (mAuthHeader != null)   return;
  int nativeResponse=createNativeResponse();
  nativeReceivedResponse(nativeResponse);
}
Program: 182424
Project: 182424
Buggy source:
private void commitHeaders(){
  if (mIsMainPageLoader && sCertificateTypeMap.containsKey(mMimeType)) {
    return;
  }
  int nativeResponse=createNativeResponse();
  nativeReceivedResponse(nativeResponse);
}

Fixed version (ground truth):
private void commitHeaders(){
  if (mIsMainPageLoader && sCertificateTypeMap.containsKey(mMimeType)) {
    return;
  }
  if (mAuthHeader != null)   return;
  int nativeResponse=createNativeResponse();
  nativeReceivedResponse(nativeResponse);
}
Program: 182425
Project: 182425
Buggy source:
private void commitHeaders(){
  if (mIsMainPageLoader && sCertificateTypeMap.containsKey(mMimeType)) {
    return;
  }
  int nativeResponse=createNativeResponse();
  nativeReceivedResponse(nativeResponse);
}

Fixed version (ground truth):
private void commitHeaders(){
  if (mIsMainPageLoader && sCertificateTypeMap.containsKey(mMimeType)) {
    return;
  }
  if (mAuthHeader != null)   return;
  int nativeResponse=createNativeResponse();
  nativeReceivedResponse(nativeResponse);
}
Program: 182426
Project: 182426
Buggy source:
private void commitHeaders(){
  if (mIsMainPageLoader && sCertificateTypeMap.containsKey(mMimeType)) {
    return;
  }
  int nativeResponse=createNativeResponse();
  nativeReceivedResponse(nativeResponse);
}

Fixed version (ground truth):
private void commitHeaders(){
  if (mIsMainPageLoader && sCertificateTypeMap.containsKey(mMimeType)) {
    return;
  }
  if (mAuthHeader != null)   return;
  int nativeResponse=createNativeResponse();
  nativeReceivedResponse(nativeResponse);
}
Program: 182429
Project: 182429
Buggy source:
private int setEngine(String enginePackageName){
  String soFilename="String_Node_Str";
  if (enginePackageName.equals("String_Node_Str")) {
    soFilename="String_Node_Str";
  }
 else {
    Intent intent=new Intent("String_Node_Str");
    intent.setPackage(enginePackageName);
    ResolveInfo[] enginesArray=new ResolveInfo[0];
    PackageManager pm=getPackageManager();
    List<ResolveInfo> resolveInfos=pm.queryIntentActivities(intent,0);
    if ((resolveInfos == null) || resolveInfos.isEmpty()) {
      Log.e(SERVICE_TAG,"String_Node_Str" + enginePackageName);
      return TextToSpeech.ERROR;
    }
    enginesArray=resolveInfos.toArray(enginesArray);
    ActivityInfo aInfo=enginesArray[0].activityInfo;
    soFilename=aInfo.name.replace(aInfo.packageName + "String_Node_Str","String_Node_Str") + "String_Node_Str";
    soFilename=soFilename.toLowerCase();
    soFilename="String_Node_Str" + aInfo.packageName + "String_Node_Str"+ soFilename;
  }
  if (currentSpeechEngineSOFile.equals(soFilename)) {
    return TextToSpeech.SUCCESS;
  }
  File f=new File(soFilename);
  if (!f.exists()) {
    Log.e(SERVICE_TAG,"String_Node_Str" + soFilename);
    return TextToSpeech.ERROR;
  }
  if (sNativeSynth != null) {
    sNativeSynth.stopSync();
    sNativeSynth.shutdown();
    sNativeSynth=null;
  }
  sNativeSynth=new SynthProxy(soFilename);
  currentSpeechEngineSOFile=soFilename;
  return TextToSpeech.SUCCESS;
}

Fixed version (ground truth):
private int setEngine(String enginePackageName){
  String soFilename="String_Node_Str";
  if (isDefaultEnforced()) {
    enginePackageName=getDefaultEngine();
  }
  if (enginePackageName.equals("String_Node_Str")) {
    soFilename="String_Node_Str";
  }
 else {
    Intent intent=new Intent("String_Node_Str");
    intent.setPackage(enginePackageName);
    ResolveInfo[] enginesArray=new ResolveInfo[0];
    PackageManager pm=getPackageManager();
    List<ResolveInfo> resolveInfos=pm.queryIntentActivities(intent,0);
    if ((resolveInfos == null) || resolveInfos.isEmpty()) {
      Log.e(SERVICE_TAG,"String_Node_Str" + enginePackageName);
      return TextToSpeech.ERROR;
    }
    enginesArray=resolveInfos.toArray(enginesArray);
    ActivityInfo aInfo=enginesArray[0].activityInfo;
    soFilename=aInfo.name.replace(aInfo.packageName + "String_Node_Str","String_Node_Str") + "String_Node_Str";
    soFilename=soFilename.toLowerCase();
    soFilename="String_Node_Str" + aInfo.packageName + "String_Node_Str"+ soFilename;
  }
  if (currentSpeechEngineSOFile.equals(soFilename)) {
    return TextToSpeech.SUCCESS;
  }
  File f=new File(soFilename);
  if (!f.exists()) {
    Log.e(SERVICE_TAG,"String_Node_Str" + soFilename);
    return TextToSpeech.ERROR;
  }
  if (sNativeSynth != null) {
    sNativeSynth.stopSync();
    sNativeSynth.shutdown();
    sNativeSynth=null;
  }
  sNativeSynth=new SynthProxy(soFilename);
  currentSpeechEngineSOFile=soFilename;
  return TextToSpeech.SUCCESS;
}
Program: 182434
Project: 182434
Buggy source:
private int setEngine(String enginePackageName){
  String soFilename="String_Node_Str";
  if (enginePackageName.equals("String_Node_Str")) {
    soFilename="String_Node_Str";
  }
 else {
    Intent intent=new Intent("String_Node_Str");
    intent.setPackage(enginePackageName);
    ResolveInfo[] enginesArray=new ResolveInfo[0];
    PackageManager pm=getPackageManager();
    List<ResolveInfo> resolveInfos=pm.queryIntentActivities(intent,0);
    if ((resolveInfos == null) || resolveInfos.isEmpty()) {
      Log.e(SERVICE_TAG,"String_Node_Str" + enginePackageName);
      return TextToSpeech.ERROR;
    }
    enginesArray=resolveInfos.toArray(enginesArray);
    ActivityInfo aInfo=enginesArray[0].activityInfo;
    soFilename=aInfo.name.replace(aInfo.packageName + "String_Node_Str","String_Node_Str") + "String_Node_Str";
    soFilename=soFilename.toLowerCase();
    soFilename="String_Node_Str" + aInfo.packageName + "String_Node_Str"+ soFilename;
  }
  if (currentSpeechEngineSOFile.equals(soFilename)) {
    return TextToSpeech.SUCCESS;
  }
  File f=new File(soFilename);
  if (!f.exists()) {
    Log.e(SERVICE_TAG,"String_Node_Str" + soFilename);
    return TextToSpeech.ERROR;
  }
  if (sNativeSynth != null) {
    sNativeSynth.stopSync();
    sNativeSynth.shutdown();
    sNativeSynth=null;
  }
  sNativeSynth=new SynthProxy(soFilename);
  currentSpeechEngineSOFile=soFilename;
  return TextToSpeech.SUCCESS;
}

Fixed version (ground truth):
private int setEngine(String enginePackageName){
  String soFilename="String_Node_Str";
  if (isDefaultEnforced()) {
    enginePackageName=getDefaultEngine();
  }
  if (enginePackageName.equals("String_Node_Str")) {
    soFilename="String_Node_Str";
  }
 else {
    Intent intent=new Intent("String_Node_Str");
    intent.setPackage(enginePackageName);
    ResolveInfo[] enginesArray=new ResolveInfo[0];
    PackageManager pm=getPackageManager();
    List<ResolveInfo> resolveInfos=pm.queryIntentActivities(intent,0);
    if ((resolveInfos == null) || resolveInfos.isEmpty()) {
      Log.e(SERVICE_TAG,"String_Node_Str" + enginePackageName);
      return TextToSpeech.ERROR;
    }
    enginesArray=resolveInfos.toArray(enginesArray);
    ActivityInfo aInfo=enginesArray[0].activityInfo;
    soFilename=aInfo.name.replace(aInfo.packageName + "String_Node_Str","String_Node_Str") + "String_Node_Str";
    soFilename=soFilename.toLowerCase();
    soFilename="String_Node_Str" + aInfo.packageName + "String_Node_Str"+ soFilename;
  }
  if (currentSpeechEngineSOFile.equals(soFilename)) {
    return TextToSpeech.SUCCESS;
  }
  File f=new File(soFilename);
  if (!f.exists()) {
    Log.e(SERVICE_TAG,"String_Node_Str" + soFilename);
    return TextToSpeech.ERROR;
  }
  if (sNativeSynth != null) {
    sNativeSynth.stopSync();
    sNativeSynth.shutdown();
    sNativeSynth=null;
  }
  sNativeSynth=new SynthProxy(soFilename);
  currentSpeechEngineSOFile=soFilename;
  return TextToSpeech.SUCCESS;
}