nus-yam/ex-repair huggingface dataset:
Program: 42524
Project: 42524
Buggy source:
/** 
 * Updates the state of each service by starting (or keeping running) enabled ones and stopping the rest.
 * @param installedServices All installed {@link AccessibilityService}s.
 * @param enabledServices The {@link ComponentName}s of the enabled services.
 */
private void updateServicesStateLocked(List<ServiceInfo> installedServices,Set<ComponentName> enabledServices){
  Map<ComponentName,Service> componentNameToServiceMap=mComponentNameToServiceMap;
  List<Service> services=mServices;
  for (int i=0, count=installedServices.size(); i < count; i++) {
    ServiceInfo intalledService=installedServices.get(i);
    ComponentName componentName=new ComponentName(intalledService.packageName,intalledService.name);
    Service service=componentNameToServiceMap.get(componentName);
    if (enabledServices.contains(componentName)) {
      if (service == null) {
        new Service(componentName).bind();
      }
    }
 else {
      if (service != null) {
        service.unbind();
        componentNameToServiceMap.remove(componentName);
        services.remove(service);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Updates the state of each service by starting (or keeping running) enabled ones and stopping the rest.
 * @param installedServices All installed {@link AccessibilityService}s.
 * @param enabledServices The {@link ComponentName}s of the enabled services.
 */
private void updateServicesStateLocked(List<ServiceInfo> installedServices,Set<ComponentName> enabledServices){
  Map<ComponentName,Service> componentNameToServiceMap=mComponentNameToServiceMap;
  List<Service> services=mServices;
  boolean isEnabled=mIsEnabled;
  for (int i=0, count=installedServices.size(); i < count; i++) {
    ServiceInfo intalledService=installedServices.get(i);
    ComponentName componentName=new ComponentName(intalledService.packageName,intalledService.name);
    Service service=componentNameToServiceMap.get(componentName);
    if (isEnabled && enabledServices.contains(componentName)) {
      if (service == null) {
        new Service(componentName).bind();
      }
    }
 else {
      if (service != null) {
        service.unbind();
        componentNameToServiceMap.remove(componentName);
        services.remove(service);
      }
    }
  }
}
Program: 42525
Project: 42525
Buggy source:
/** 
 * Notifies a service for a scheduled event given the event type.
 * @param service The service.
 * @param eventType The type of the event to dispatch.
 */
private void notifyEventListenerLocked(Service service,int eventType){
  IEventListener listener=service.mServiceInterface;
  AccessibilityEvent event=service.mPendingEvents.get(eventType);
  try {
    listener.onAccessibilityEvent(event);
    if (LOGV) {
      Log.i(LOG_TAG,"String_Node_Str" + event + "String_Node_Str"+ listener);
    }
  }
 catch (  RemoteException re) {
    if (re instanceof DeadObjectException) {
      Log.w(LOG_TAG,"String_Node_Str" + service.mService + "String_Node_Str");
synchronized (mLock) {
        removeDeadServiceLocked(service);
      }
    }
 else {
      Log.e(LOG_TAG,"String_Node_Str" + event + "String_Node_Str"+ service.mService,re);
    }
  }
}

Fixed version (ground truth):
/** 
 * Notifies a service for a scheduled event given the event type.
 * @param service The service.
 * @param eventType The type of the event to dispatch.
 */
private void notifyEventListenerLocked(Service service,int eventType){
  IEventListener listener=service.mServiceInterface;
  AccessibilityEvent event=service.mPendingEvents.get(eventType);
  try {
    listener.onAccessibilityEvent(event);
    if (Config.DEBUG) {
      Log.i(LOG_TAG,"String_Node_Str" + event + "String_Node_Str"+ listener);
    }
  }
 catch (  RemoteException re) {
    if (re instanceof DeadObjectException) {
      Log.w(LOG_TAG,"String_Node_Str" + service.mService + "String_Node_Str");
synchronized (mLock) {
        removeDeadServiceLocked(service);
      }
    }
 else {
      Log.e(LOG_TAG,"String_Node_Str" + event + "String_Node_Str"+ service.mService,re);
    }
  }
}
Program: 42526
Project: 42526
Buggy source:
public void writeToParcel(Parcel parcel,int flags){
  parcel.writeInt(eventTypes);
  parcel.writeStringArray(packageNames);
  parcel.writeInt(feedbackType);
  parcel.writeLong(notificationTimeout);
  parcel.writeInt(flags);
}

Fixed version (ground truth):
public void writeToParcel(Parcel parcel,int flagz){
  parcel.writeInt(eventTypes);
  parcel.writeStringArray(packageNames);
  parcel.writeInt(feedbackType);
  parcel.writeLong(notificationTimeout);
  parcel.writeInt(flags);
}
Program: 42527
Project: 42527
Buggy source:
/** 
 * @see AudioManager#adjustStreamVolume(int,int,int) 
 */
public void adjustStreamVolume(int streamType,int direction,int flags){
  ensureValidDirection(direction);
  ensureValidStreamType(streamType);
  VolumeStreamState streamState=mStreamStates[STREAM_VOLUME_ALIAS[streamType]];
  final int oldIndex=streamState.mIndex;
  boolean adjustVolume=true;
  if ((flags & AudioManager.FLAG_ALLOW_RINGER_MODES) != 0 || streamType == AudioSystem.STREAM_RING) {
    adjustVolume=checkForRingerModeChange(oldIndex,direction);
  }
  if (adjustVolume && streamState.adjustIndex(direction)) {
    if (streamState.muteCount() == 0) {
      sendMsg(mAudioHandler,MSG_SET_SYSTEM_VOLUME,STREAM_VOLUME_ALIAS[streamType],SENDMSG_NOOP,0,0,streamState,0);
    }
  }
  mVolumePanel.postVolumeChanged(streamType,flags);
  sendVolumeUpdate(streamType);
}

Fixed version (ground truth):
/** 
 * @see AudioManager#adjustStreamVolume(int,int,int) 
 */
public void adjustStreamVolume(int streamType,int direction,int flags){
  ensureValidDirection(direction);
  ensureValidStreamType(streamType);
  VolumeStreamState streamState=mStreamStates[STREAM_VOLUME_ALIAS[streamType]];
  final int oldIndex=streamState.mIndex;
  boolean adjustVolume=true;
  if ((flags & AudioManager.FLAG_ALLOW_RINGER_MODES) != 0 || streamType == AudioSystem.STREAM_RING) {
    adjustVolume=checkForRingerModeChange(oldIndex,direction);
  }
  if (adjustVolume && streamState.adjustIndex(direction)) {
    if (streamState.muteCount() == 0) {
      sendMsg(mAudioHandler,MSG_SET_SYSTEM_VOLUME,STREAM_VOLUME_ALIAS[streamType],SENDMSG_NOOP,0,0,streamState,0);
    }
  }
  mVolumePanel.postVolumeChanged(streamType,flags);
  sendVolumeUpdate(streamType,oldIndex,streamState.mIndex);
}
Program: 42528
Project: 42528
Buggy source:
private void sendVolumeUpdate(int streamType){
  Intent intent=new Intent(AudioManager.VOLUME_CHANGED_ACTION);
  intent.putExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE,streamType);
  intent.putExtra(AudioManager.EXTRA_VOLUME_STREAM_VALUE,getStreamVolume(streamType));
  if (streamType == AudioSystem.STREAM_BLUETOOTH_SCO) {
    mContext.sendBroadcast(intent);
  }
}

Fixed version (ground truth):
private void sendVolumeUpdate(int streamType,int oldIndex,int index){
  oldIndex=(oldIndex + 5) / 10;
  index=(index + 5) / 10;
  Intent intent=new Intent(AudioManager.VOLUME_CHANGED_ACTION);
  intent.putExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE,streamType);
  intent.putExtra(AudioManager.EXTRA_VOLUME_STREAM_VALUE,index);
  intent.putExtra(AudioManager.EXTRA_PREV_VOLUME_STREAM_VALUE,oldIndex);
  mContext.sendBroadcast(intent);
}
Program: 42529
Project: 42529
Buggy source:
/** 
 * @see AudioManager#setStreamVolume(int,int,int) 
 */
public void setStreamVolume(int streamType,int index,int flags){
  ensureValidStreamType(streamType);
  index=rescaleIndex(index * 10,streamType,STREAM_VOLUME_ALIAS[streamType]);
  setStreamVolumeInt(STREAM_VOLUME_ALIAS[streamType],index,false,true);
  mVolumePanel.postVolumeChanged(streamType,flags);
  sendVolumeUpdate(streamType);
}

Fixed version (ground truth):
/** 
 * @see AudioManager#setStreamVolume(int,int,int) 
 */
public void setStreamVolume(int streamType,int index,int flags){
  ensureValidStreamType(streamType);
  final int oldIndex=mStreamStates[STREAM_VOLUME_ALIAS[streamType]].mIndex;
  index=rescaleIndex(index * 10,streamType,STREAM_VOLUME_ALIAS[streamType]);
  setStreamVolumeInt(STREAM_VOLUME_ALIAS[streamType],index,false,true);
  mVolumePanel.postVolumeChanged(streamType,flags);
  sendVolumeUpdate(streamType,oldIndex,index);
}
Program: 42530
Project: 42530
Buggy source:
/** 
 * @see AudioManager#adjustStreamVolume(int,int,int) 
 */
public void adjustStreamVolume(int streamType,int direction,int flags){
  ensureValidDirection(direction);
  ensureValidStreamType(streamType);
  VolumeStreamState streamState=mStreamStates[STREAM_VOLUME_ALIAS[streamType]];
  final int oldIndex=streamState.mIndex;
  boolean adjustVolume=true;
  if ((flags & AudioManager.FLAG_ALLOW_RINGER_MODES) != 0 || streamType == AudioSystem.STREAM_RING) {
    adjustVolume=checkForRingerModeChange(oldIndex,direction);
  }
  if (adjustVolume && streamState.adjustIndex(direction)) {
    if (streamState.muteCount() == 0) {
      sendMsg(mAudioHandler,MSG_SET_SYSTEM_VOLUME,STREAM_VOLUME_ALIAS[streamType],SENDMSG_NOOP,0,0,streamState,0);
    }
  }
  mVolumePanel.postVolumeChanged(streamType,flags);
  sendVolumeUpdate(streamType);
}

Fixed version (ground truth):
/** 
 * @see AudioManager#adjustStreamVolume(int,int,int) 
 */
public void adjustStreamVolume(int streamType,int direction,int flags){
  ensureValidDirection(direction);
  ensureValidStreamType(streamType);
  VolumeStreamState streamState=mStreamStates[STREAM_VOLUME_ALIAS[streamType]];
  final int oldIndex=streamState.mIndex;
  boolean adjustVolume=true;
  if ((flags & AudioManager.FLAG_ALLOW_RINGER_MODES) != 0 || streamType == AudioSystem.STREAM_RING) {
    adjustVolume=checkForRingerModeChange(oldIndex,direction);
  }
  if (adjustVolume && streamState.adjustIndex(direction)) {
    if (streamState.muteCount() == 0) {
      sendMsg(mAudioHandler,MSG_SET_SYSTEM_VOLUME,STREAM_VOLUME_ALIAS[streamType],SENDMSG_NOOP,0,0,streamState,0);
    }
  }
  mVolumePanel.postVolumeChanged(streamType,flags);
  sendVolumeUpdate(streamType,oldIndex,streamState.mIndex);
}
Program: 42531
Project: 42531
Buggy source:
private void sendVolumeUpdate(int streamType){
  Intent intent=new Intent(AudioManager.VOLUME_CHANGED_ACTION);
  intent.putExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE,streamType);
  intent.putExtra(AudioManager.EXTRA_VOLUME_STREAM_VALUE,getStreamVolume(streamType));
  if (streamType == AudioSystem.STREAM_BLUETOOTH_SCO) {
    mContext.sendBroadcast(intent);
  }
}

Fixed version (ground truth):
private void sendVolumeUpdate(int streamType,int oldIndex,int index){
  oldIndex=(oldIndex + 5) / 10;
  index=(index + 5) / 10;
  Intent intent=new Intent(AudioManager.VOLUME_CHANGED_ACTION);
  intent.putExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE,streamType);
  intent.putExtra(AudioManager.EXTRA_VOLUME_STREAM_VALUE,index);
  intent.putExtra(AudioManager.EXTRA_PREV_VOLUME_STREAM_VALUE,oldIndex);
  mContext.sendBroadcast(intent);
}
Program: 42532
Project: 42532
Buggy source:
/** 
 * @see AudioManager#setStreamVolume(int,int,int) 
 */
public void setStreamVolume(int streamType,int index,int flags){
  ensureValidStreamType(streamType);
  index=rescaleIndex(index * 10,streamType,STREAM_VOLUME_ALIAS[streamType]);
  setStreamVolumeInt(STREAM_VOLUME_ALIAS[streamType],index,false,true);
  mVolumePanel.postVolumeChanged(streamType,flags);
  sendVolumeUpdate(streamType);
}

Fixed version (ground truth):
/** 
 * @see AudioManager#setStreamVolume(int,int,int) 
 */
public void setStreamVolume(int streamType,int index,int flags){
  ensureValidStreamType(streamType);
  final int oldIndex=mStreamStates[STREAM_VOLUME_ALIAS[streamType]].mIndex;
  index=rescaleIndex(index * 10,streamType,STREAM_VOLUME_ALIAS[streamType]);
  setStreamVolumeInt(STREAM_VOLUME_ALIAS[streamType],index,false,true);
  mVolumePanel.postVolumeChanged(streamType,flags);
  sendVolumeUpdate(streamType,oldIndex,index);
}
Program: 42533
Project: 42533
Buggy source:
/** 
 * Checks whether a speech recognition service is available on the system. If this method returns   {@code false},   {@link RecognitionManager#createRecognitionManager(Context)} willfail.
 * @param context with which {@code RecognitionManager} will be created
 * @return {@code true} if recognition is available, {@code false} otherwise
 */
public static boolean isRecognitionAvailable(final Context context){
  final List<ResolveInfo> list=context.getPackageManager().queryIntentServices(new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH),0);
  return list != null && list.size() != 0;
}

Fixed version (ground truth):
/** 
 * Checks whether a speech recognition service is available on the system. If this method returns   {@code false},   {@link RecognitionManager#createRecognitionManager(Context)} willfail.
 * @param context with which {@code RecognitionManager} will be created
 * @return {@code true} if recognition is available, {@code false} otherwise
 */
public static boolean isRecognitionAvailable(final Context context){
  final List<ResolveInfo> list=context.getPackageManager().queryIntentServices(new Intent(RecognitionService.SERVICE_INTERFACE),0);
  return list != null && list.size() != 0;
}
Program: 42534
Project: 42534
Buggy source:
/** 
 * Checks whether audio routing to the wired headset is on or off.
 * @return true if audio is being routed to/from wired headset;false if otherwise
 */
public boolean isWiredHeadsetOn(){
  if (AudioSystem.getDeviceConnectionState(AudioSystem.DEVICE_OUT_WIRED_HEADSET,"String_Node_Str") == AudioSystem.DEVICE_STATE_UNAVAILABLE) {
    return false;
  }
 else {
    return true;
  }
}

Fixed version (ground truth):
/** 
 * Checks whether audio routing to the wired headset is on or off.
 * @return true if audio is being routed to/from wired headset;false if otherwise
 */
public boolean isWiredHeadsetOn(){
  if (AudioSystem.getDeviceConnectionState(AudioSystem.DEVICE_OUT_WIRED_HEADSET,"String_Node_Str") == AudioSystem.DEVICE_STATE_UNAVAILABLE && AudioSystem.getDeviceConnectionState(AudioSystem.DEVICE_OUT_WIRED_HEADPHONE,"String_Node_Str") == AudioSystem.DEVICE_STATE_UNAVAILABLE) {
    return false;
  }
 else {
    return true;
  }
}
Program: 42536
Project: 42536
Buggy source:
/** 
 * Checks whether audio routing to the wired headset is on or off.
 * @return true if audio is being routed to/from wired headset;false if otherwise
 */
public boolean isWiredHeadsetOn(){
  if (AudioSystem.getDeviceConnectionState(AudioSystem.DEVICE_OUT_WIRED_HEADSET,"String_Node_Str") == AudioSystem.DEVICE_STATE_UNAVAILABLE) {
    return false;
  }
 else {
    return true;
  }
}

Fixed version (ground truth):
/** 
 * Checks whether audio routing to the wired headset is on or off.
 * @return true if audio is being routed to/from wired headset;false if otherwise
 */
public boolean isWiredHeadsetOn(){
  if (AudioSystem.getDeviceConnectionState(AudioSystem.DEVICE_OUT_WIRED_HEADSET,"String_Node_Str") == AudioSystem.DEVICE_STATE_UNAVAILABLE && AudioSystem.getDeviceConnectionState(AudioSystem.DEVICE_OUT_WIRED_HEADPHONE,"String_Node_Str") == AudioSystem.DEVICE_STATE_UNAVAILABLE) {
    return false;
  }
 else {
    return true;
  }
}
Program: 42538
Project: 42538
Buggy source:
/** 
 * Checks whether a speech recognition service is available on the system. If this method returns   {@code false},   {@link RecognitionManager#createRecognitionManager(Context)} willfail.
 * @param context with which {@code RecognitionManager} will be created
 * @return {@code true} if recognition is available, {@code false} otherwise
 */
public static boolean isRecognitionAvailable(final Context context){
  final List<ResolveInfo> list=context.getPackageManager().queryIntentServices(new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH),0);
  return list != null && list.size() != 0;
}

Fixed version (ground truth):
/** 
 * Checks whether a speech recognition service is available on the system. If this method returns   {@code false},   {@link RecognitionManager#createRecognitionManager(Context)} willfail.
 * @param context with which {@code RecognitionManager} will be created
 * @return {@code true} if recognition is available, {@code false} otherwise
 */
public static boolean isRecognitionAvailable(final Context context){
  final List<ResolveInfo> list=context.getPackageManager().queryIntentServices(new Intent(RecognitionService.SERVICE_INTERFACE),0);
  return list != null && list.size() != 0;
}
Program: 42539
Project: 42539
Buggy source:
public void testBasicAccess() throws Exception {
  try {
    byte[] newKey=mSysKeyStore.generateNewKey(128,"String_Node_Str",keyName);
    assertNotNull(newKey);
    byte[] recKey=mSysKeyStore.retrieveKey(keyName);
    assertEquals(newKey.length,recKey.length);
    for (int i=0; i < newKey.length; i++) {
      assertEquals(newKey[i],recKey[i]);
    }
    mSysKeyStore.deleteKey(keyName);
    byte[] nullKey=mSysKeyStore.retrieveKey(keyName);
    assertNull(nullKey);
    String newKeyStr=mSysKeyStore.generateNewKeyHexString(128,"String_Node_Str",keyName2);
    assertNotNull(newKeyStr);
    String recKeyStr=mSysKeyStore.retrieveKeyHexString(keyName2);
    assertEquals(newKeyStr,recKeyStr);
    mSysKeyStore.deleteKey(keyName2);
    String nullKey2=mSysKeyStore.retrieveKeyHexString(keyName);
    assertNull(nullKey2);
  }
 catch (  Exception e) {
    fail();
  }
}

Fixed version (ground truth):
public void testBasicAccess() throws Exception {
  try {
    byte[] newKey=mSysKeyStore.generateNewKey(128,"String_Node_Str",keyName);
    assertNotNull(newKey);
    byte[] recKey=mSysKeyStore.retrieveKey(keyName);
    assertEquals(newKey.length,recKey.length);
    for (int i=0; i < newKey.length; i++) {
      assertEquals(newKey[i],recKey[i]);
    }
    mSysKeyStore.deleteKey(keyName);
    byte[] nullKey=mSysKeyStore.retrieveKey(keyName);
    assertNull(nullKey);
    String newKeyStr=mSysKeyStore.generateNewKeyHexString(128,"String_Node_Str",keyName2);
    assertNotNull(newKeyStr);
    String recKeyStr=mSysKeyStore.retrieveKeyHexString(keyName2);
    assertEquals(newKeyStr,recKeyStr);
    mSysKeyStore.deleteKey(keyName2);
    String nullKey2=mSysKeyStore.retrieveKeyHexString(keyName2);
    assertNull(nullKey2);
  }
 catch (  Exception e) {
    fail();
  }
}
Program: 42540
Project: 42540
Buggy source:
public void testBasicAccess() throws Exception {
  try {
    byte[] newKey=mSysKeyStore.generateNewKey(128,"String_Node_Str",keyName);
    assertNotNull(newKey);
    byte[] recKey=mSysKeyStore.retrieveKey(keyName);
    assertEquals(newKey.length,recKey.length);
    for (int i=0; i < newKey.length; i++) {
      assertEquals(newKey[i],recKey[i]);
    }
    mSysKeyStore.deleteKey(keyName);
    byte[] nullKey=mSysKeyStore.retrieveKey(keyName);
    assertNull(nullKey);
    String newKeyStr=mSysKeyStore.generateNewKeyHexString(128,"String_Node_Str",keyName2);
    assertNotNull(newKeyStr);
    String recKeyStr=mSysKeyStore.retrieveKeyHexString(keyName2);
    assertEquals(newKeyStr,recKeyStr);
    mSysKeyStore.deleteKey(keyName2);
    String nullKey2=mSysKeyStore.retrieveKeyHexString(keyName);
    assertNull(nullKey2);
  }
 catch (  Exception e) {
    fail();
  }
}

Fixed version (ground truth):
public void testBasicAccess() throws Exception {
  try {
    byte[] newKey=mSysKeyStore.generateNewKey(128,"String_Node_Str",keyName);
    assertNotNull(newKey);
    byte[] recKey=mSysKeyStore.retrieveKey(keyName);
    assertEquals(newKey.length,recKey.length);
    for (int i=0; i < newKey.length; i++) {
      assertEquals(newKey[i],recKey[i]);
    }
    mSysKeyStore.deleteKey(keyName);
    byte[] nullKey=mSysKeyStore.retrieveKey(keyName);
    assertNull(nullKey);
    String newKeyStr=mSysKeyStore.generateNewKeyHexString(128,"String_Node_Str",keyName2);
    assertNotNull(newKeyStr);
    String recKeyStr=mSysKeyStore.retrieveKeyHexString(keyName2);
    assertEquals(newKeyStr,recKeyStr);
    mSysKeyStore.deleteKey(keyName2);
    String nullKey2=mSysKeyStore.retrieveKeyHexString(keyName2);
    assertNull(nullKey2);
  }
 catch (  Exception e) {
    fail();
  }
}
Program: 42541
Project: 42541
Buggy source:
final void recreateStringBlocks(){
synchronized (mSync) {
    makeStringBlocks(true);
  }
}

Fixed version (ground truth):
final void recreateStringBlocks(){
synchronized (this) {
    makeStringBlocks(true);
  }
}
Program: 42545
Project: 42545
Buggy source:
/** 
 * Cancels the speech recognition. Please note that  {@link #setRecognitionListener(RecognitionListener)} must be called beforehand, otherwise a{@link RuntimeException} will be thrown.
 */
public void cancel(){
  checkIsCalledFromMainThread();
  checkIsCommandAllowed();
  putMessage(Message.obtain(mHandler,MSG_CANCEL));
}

Fixed version (ground truth):
/** 
 * Cancels the speech recognition. Please note that  {@link #setRecognitionListener(RecognitionListener)} must be called beforehand, otherwise a{@link RuntimeException} will be thrown.
 */
public void cancel(){
  checkIsCalledFromMainThread();
  putMessage(Message.obtain(mHandler,MSG_CANCEL));
}
Program: 42546
Project: 42546
Buggy source:
/** 
 * Starts listening for speech. Please note that  {@link #setRecognitionListener(RecognitionListener)} must be called beforehand, otherwise a{@link RuntimeException} will be thrown.
 * @param recognizerIntent contains parameters for the recognition to be performed. The intentmay also contain optional extras, see  {@link RecognizerIntent}. If these values are not set explicitly, default values will be used by the recognizer.
 */
public void startListening(final Intent recognizerIntent){
  if (recognizerIntent == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  checkIsCalledFromMainThread();
  checkIsCommandAllowed();
  if (mConnection == null) {
    mConnection=new Connection();
    if (!mContext.bindService(new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH),mConnection,Context.BIND_AUTO_CREATE)) {
      Log.e(TAG,"String_Node_Str");
      mConnection=null;
      mService=null;
      mListener.onError(ERROR_CLIENT);
      return;
    }
  }
  putMessage(Message.obtain(mHandler,MSG_START,recognizerIntent));
}

Fixed version (ground truth):
/** 
 * Starts listening for speech. Please note that  {@link #setRecognitionListener(RecognitionListener)} must be called beforehand, otherwise a{@link RuntimeException} will be thrown.
 * @param recognizerIntent contains parameters for the recognition to be performed. The intentmay also contain optional extras, see  {@link RecognizerIntent}. If these values are not set explicitly, default values will be used by the recognizer.
 */
public void startListening(final Intent recognizerIntent){
  if (recognizerIntent == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  checkIsCalledFromMainThread();
  if (mConnection == null) {
    mConnection=new Connection();
    if (!mContext.bindService(new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH),mConnection,Context.BIND_AUTO_CREATE)) {
      Log.e(TAG,"String_Node_Str");
      mConnection=null;
      mService=null;
      mListener.onError(ERROR_CLIENT);
      return;
    }
  }
  putMessage(Message.obtain(mHandler,MSG_START,recognizerIntent));
}
Program: 42547
Project: 42547
Buggy source:
/** 
 * sends the actual message to the service 
 */
private void handleStopMessage(){
  try {
    mService.stopListening(mListener);
    if (DBG)     Log.d(TAG,"String_Node_Str");
  }
 catch (  final RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
    mListener.onError(ERROR_CLIENT);
  }
}

Fixed version (ground truth):
/** 
 * sends the actual message to the service 
 */
private void handleStopMessage(){
  if (!checkOpenConnection()) {
    return;
  }
  try {
    mService.stopListening(mListener);
    if (DBG)     Log.d(TAG,"String_Node_Str");
  }
 catch (  final RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
    mListener.onError(ERROR_CLIENT);
  }
}
Program: 42548
Project: 42548
Buggy source:
/** 
 * sends the actual message to the service 
 */
private void handleCancelMessage(){
  try {
    mService.cancel(mListener);
    if (DBG)     Log.d(TAG,"String_Node_Str");
  }
 catch (  final RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
    mListener.onError(ERROR_CLIENT);
  }
}

Fixed version (ground truth):
/** 
 * sends the actual message to the service 
 */
private void handleCancelMessage(){
  if (!checkOpenConnection()) {
    return;
  }
  try {
    mService.cancel(mListener);
    if (DBG)     Log.d(TAG,"String_Node_Str");
  }
 catch (  final RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
    mListener.onError(ERROR_CLIENT);
  }
}
Program: 42549
Project: 42549
Buggy source:
/** 
 * Stops listening for speech. Speech captured so far will be recognized as if the user had stopped speaking at this point. Note that in the default case, this does not need to be called, as the speech endpointer will automatically stop the recognizer listening when it determines speech has completed. However, you can manipulate endpointer parameters directly using the intent extras defined in   {@link RecognizerIntent}, in which case you may sometimes want to manually call this method to stop listening sooner. Please note that  {@link #setRecognitionListener(RecognitionListener)} must be called beforehand, otherwise a{@link RuntimeException} will be thrown.
 */
public void stopListening(){
  checkIsCalledFromMainThread();
  checkIsCommandAllowed();
  putMessage(Message.obtain(mHandler,MSG_STOP));
}

Fixed version (ground truth):
/** 
 * Stops listening for speech. Speech captured so far will be recognized as if the user had stopped speaking at this point. Note that in the default case, this does not need to be called, as the speech endpointer will automatically stop the recognizer listening when it determines speech has completed. However, you can manipulate endpointer parameters directly using the intent extras defined in   {@link RecognizerIntent}, in which case you may sometimes want to manually call this method to stop listening sooner. Please note that  {@link #setRecognitionListener(RecognitionListener)} must be called beforehand, otherwise a{@link RuntimeException} will be thrown.
 */
public void stopListening(){
  checkIsCalledFromMainThread();
  putMessage(Message.obtain(mHandler,MSG_STOP));
}
Program: 42550
Project: 42550
Buggy source:
/** 
 * sends the actual message to the service 
 */
private void handleStartListening(Intent recognizerIntent){
  try {
    mService.startListening(recognizerIntent,mListener);
    if (DBG)     Log.d(TAG,"String_Node_Str");
  }
 catch (  final RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
    mListener.onError(ERROR_CLIENT);
  }
}

Fixed version (ground truth):
/** 
 * sends the actual message to the service 
 */
private void handleStartListening(Intent recognizerIntent){
  if (!checkOpenConnection()) {
    return;
  }
  try {
    mService.startListening(recognizerIntent,mListener);
    if (DBG)     Log.d(TAG,"String_Node_Str");
  }
 catch (  final RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
    mListener.onError(ERROR_CLIENT);
  }
}
Program: 42554
Project: 42554
Buggy source:
/** 
 * Cancels the speech recognition. Please note that  {@link #setRecognitionListener(RecognitionListener)} must be called beforehand, otherwise a{@link RuntimeException} will be thrown.
 */
public void cancel(){
  checkIsCalledFromMainThread();
  checkIsCommandAllowed();
  putMessage(Message.obtain(mHandler,MSG_CANCEL));
}

Fixed version (ground truth):
/** 
 * Cancels the speech recognition. Please note that  {@link #setRecognitionListener(RecognitionListener)} must be called beforehand, otherwise a{@link RuntimeException} will be thrown.
 */
public void cancel(){
  checkIsCalledFromMainThread();
  putMessage(Message.obtain(mHandler,MSG_CANCEL));
}
Program: 42555
Project: 42555
Buggy source:
/** 
 * Starts listening for speech. Please note that  {@link #setRecognitionListener(RecognitionListener)} must be called beforehand, otherwise a{@link RuntimeException} will be thrown.
 * @param recognizerIntent contains parameters for the recognition to be performed. The intentmay also contain optional extras, see  {@link RecognizerIntent}. If these values are not set explicitly, default values will be used by the recognizer.
 */
public void startListening(final Intent recognizerIntent){
  if (recognizerIntent == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  checkIsCalledFromMainThread();
  checkIsCommandAllowed();
  if (mConnection == null) {
    mConnection=new Connection();
    if (!mContext.bindService(new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH),mConnection,Context.BIND_AUTO_CREATE)) {
      Log.e(TAG,"String_Node_Str");
      mConnection=null;
      mService=null;
      mListener.onError(ERROR_CLIENT);
      return;
    }
  }
  putMessage(Message.obtain(mHandler,MSG_START,recognizerIntent));
}

Fixed version (ground truth):
/** 
 * Starts listening for speech. Please note that  {@link #setRecognitionListener(RecognitionListener)} must be called beforehand, otherwise a{@link RuntimeException} will be thrown.
 * @param recognizerIntent contains parameters for the recognition to be performed. The intentmay also contain optional extras, see  {@link RecognizerIntent}. If these values are not set explicitly, default values will be used by the recognizer.
 */
public void startListening(final Intent recognizerIntent){
  if (recognizerIntent == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  checkIsCalledFromMainThread();
  if (mConnection == null) {
    mConnection=new Connection();
    if (!mContext.bindService(new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH),mConnection,Context.BIND_AUTO_CREATE)) {
      Log.e(TAG,"String_Node_Str");
      mConnection=null;
      mService=null;
      mListener.onError(ERROR_CLIENT);
      return;
    }
  }
  putMessage(Message.obtain(mHandler,MSG_START,recognizerIntent));
}
Program: 42556
Project: 42556
Buggy source:
/** 
 * sends the actual message to the service 
 */
private void handleStopMessage(){
  try {
    mService.stopListening(mListener);
    if (DBG)     Log.d(TAG,"String_Node_Str");
  }
 catch (  final RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
    mListener.onError(ERROR_CLIENT);
  }
}

Fixed version (ground truth):
/** 
 * sends the actual message to the service 
 */
private void handleStopMessage(){
  if (!checkOpenConnection()) {
    return;
  }
  try {
    mService.stopListening(mListener);
    if (DBG)     Log.d(TAG,"String_Node_Str");
  }
 catch (  final RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
    mListener.onError(ERROR_CLIENT);
  }
}
Program: 42557
Project: 42557
Buggy source:
/** 
 * sends the actual message to the service 
 */
private void handleCancelMessage(){
  try {
    mService.cancel(mListener);
    if (DBG)     Log.d(TAG,"String_Node_Str");
  }
 catch (  final RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
    mListener.onError(ERROR_CLIENT);
  }
}

Fixed version (ground truth):
/** 
 * sends the actual message to the service 
 */
private void handleCancelMessage(){
  if (!checkOpenConnection()) {
    return;
  }
  try {
    mService.cancel(mListener);
    if (DBG)     Log.d(TAG,"String_Node_Str");
  }
 catch (  final RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
    mListener.onError(ERROR_CLIENT);
  }
}
Program: 42558
Project: 42558
Buggy source:
/** 
 * Stops listening for speech. Speech captured so far will be recognized as if the user had stopped speaking at this point. Note that in the default case, this does not need to be called, as the speech endpointer will automatically stop the recognizer listening when it determines speech has completed. However, you can manipulate endpointer parameters directly using the intent extras defined in   {@link RecognizerIntent}, in which case you may sometimes want to manually call this method to stop listening sooner. Please note that  {@link #setRecognitionListener(RecognitionListener)} must be called beforehand, otherwise a{@link RuntimeException} will be thrown.
 */
public void stopListening(){
  checkIsCalledFromMainThread();
  checkIsCommandAllowed();
  putMessage(Message.obtain(mHandler,MSG_STOP));
}

Fixed version (ground truth):
/** 
 * Stops listening for speech. Speech captured so far will be recognized as if the user had stopped speaking at this point. Note that in the default case, this does not need to be called, as the speech endpointer will automatically stop the recognizer listening when it determines speech has completed. However, you can manipulate endpointer parameters directly using the intent extras defined in   {@link RecognizerIntent}, in which case you may sometimes want to manually call this method to stop listening sooner. Please note that  {@link #setRecognitionListener(RecognitionListener)} must be called beforehand, otherwise a{@link RuntimeException} will be thrown.
 */
public void stopListening(){
  checkIsCalledFromMainThread();
  putMessage(Message.obtain(mHandler,MSG_STOP));
}
Program: 42559
Project: 42559
Buggy source:
/** 
 * sends the actual message to the service 
 */
private void handleStartListening(Intent recognizerIntent){
  try {
    mService.startListening(recognizerIntent,mListener);
    if (DBG)     Log.d(TAG,"String_Node_Str");
  }
 catch (  final RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
    mListener.onError(ERROR_CLIENT);
  }
}

Fixed version (ground truth):
/** 
 * sends the actual message to the service 
 */
private void handleStartListening(Intent recognizerIntent){
  if (!checkOpenConnection()) {
    return;
  }
  try {
    mService.startListening(recognizerIntent,mListener);
    if (DBG)     Log.d(TAG,"String_Node_Str");
  }
 catch (  final RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
    mListener.onError(ERROR_CLIENT);
  }
}
Program: 42561
Project: 42561
Buggy source:
private boolean startScrollIfNeeded(int deltaY){
  final int distance=Math.abs(deltaY);
  if (distance > mTouchSlop) {
    createScrollingCache();
    mTouchMode=TOUCH_MODE_SCROLL;
    mMotionCorrection=deltaY;
    final Handler handler=getHandler();
    if (handler != null) {
      handler.removeCallbacks(mPendingCheckForLongPress);
    }
    setPressed(false);
    View motionView=getChildAt(mMotionPosition - mFirstPosition);
    if (motionView != null) {
      motionView.setPressed(false);
    }
    reportScrollStateChange(OnScrollListener.SCROLL_STATE_TOUCH_SCROLL);
    requestDisallowInterceptTouchEvent(true);
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean startScrollIfNeeded(int deltaY){
  final int distance=Math.abs(deltaY);
  final boolean overscroll=mScrollY != 0;
  if (overscroll || distance > mTouchSlop) {
    createScrollingCache();
    mTouchMode=overscroll ? TOUCH_MODE_OVERSCROLL : TOUCH_MODE_SCROLL;
    mMotionCorrection=deltaY;
    final Handler handler=getHandler();
    if (handler != null) {
      handler.removeCallbacks(mPendingCheckForLongPress);
    }
    setPressed(false);
    View motionView=getChildAt(mMotionPosition - mFirstPosition);
    if (motionView != null) {
      motionView.setPressed(false);
    }
    reportScrollStateChange(OnScrollListener.SCROLL_STATE_TOUCH_SCROLL);
    requestDisallowInterceptTouchEvent(true);
    return true;
  }
  return false;
}
Program: 42562
Project: 42562
Buggy source:
private boolean springback(int startX,int startY,int minX,int maxX,int minY,int maxY,Scroller scroller){
  int xoff=0;
  int yoff=0;
  if (startX < minX) {
    xoff=minX - startX;
  }
 else   if (startX > maxX) {
    xoff=maxX - startX;
  }
  if (startY < minY) {
    yoff=minY - startY;
  }
 else   if (startY > maxY) {
    yoff=maxY - startY;
  }
  if (xoff != 0 || yoff != 0) {
    scroller.startScroll(startX,startY,xoff,yoff,SPRINGBACK_DURATION);
    mCurrScroller.abortAnimation();
    mCurrScroller=scroller;
    mScrollMode=MODE_SPRINGBACK;
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean springback(int startX,int startY,int minX,int maxX,int minY,int maxY,Scroller scroller){
  int xoff=0;
  int yoff=0;
  if (startX < minX) {
    xoff=minX - startX;
  }
 else   if (startX > maxX) {
    xoff=maxX - startX;
  }
  if (startY < minY) {
    yoff=minY - startY;
  }
 else   if (startY > maxY) {
    yoff=maxY - startY;
  }
  if (xoff != 0 || yoff != 0) {
    mCurrScroller.abortAnimation();
    scroller.startScroll(startX,startY,xoff,yoff,SPRINGBACK_DURATION);
    mCurrScroller=scroller;
    mScrollMode=MODE_SPRINGBACK;
    return true;
  }
  return false;
}
Program: 42563
Project: 42563
Buggy source:
private void overfling(int startx,int starty,float xvel,float yvel){
  Scroller scroller=mDecelScroller;
  final float durationSecs=(OVERFLING_DURATION / 1000.f);
  int dx=(int)(xvel * durationSecs) / 8;
  int dy=(int)(yvel * durationSecs) / 8;
  scroller.startScroll(startx,starty,dx,dy,OVERFLING_DURATION);
  mCurrScroller.abortAnimation();
  mCurrScroller=scroller;
  mScrollMode=MODE_OVERFLING;
}

Fixed version (ground truth):
private void overfling(int startx,int starty,float xvel,float yvel){
  Scroller scroller=mDecelScroller;
  final float durationSecs=(OVERFLING_DURATION / 1000.f);
  int dx=(int)(xvel * durationSecs) / 8;
  int dy=(int)(yvel * durationSecs) / 8;
  mCurrScroller.abortAnimation();
  scroller.startScroll(startx,starty,dx,dy,OVERFLING_DURATION);
  mCurrScroller=scroller;
  mScrollMode=MODE_OVERFLING;
}
Program: 42565
Project: 42565
Buggy source:
private boolean startScrollIfNeeded(int deltaY){
  final int distance=Math.abs(deltaY);
  if (distance > mTouchSlop) {
    createScrollingCache();
    mTouchMode=TOUCH_MODE_SCROLL;
    mMotionCorrection=deltaY;
    final Handler handler=getHandler();
    if (handler != null) {
      handler.removeCallbacks(mPendingCheckForLongPress);
    }
    setPressed(false);
    View motionView=getChildAt(mMotionPosition - mFirstPosition);
    if (motionView != null) {
      motionView.setPressed(false);
    }
    reportScrollStateChange(OnScrollListener.SCROLL_STATE_TOUCH_SCROLL);
    requestDisallowInterceptTouchEvent(true);
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean startScrollIfNeeded(int deltaY){
  final int distance=Math.abs(deltaY);
  final boolean overscroll=mScrollY != 0;
  if (overscroll || distance > mTouchSlop) {
    createScrollingCache();
    mTouchMode=overscroll ? TOUCH_MODE_OVERSCROLL : TOUCH_MODE_SCROLL;
    mMotionCorrection=deltaY;
    final Handler handler=getHandler();
    if (handler != null) {
      handler.removeCallbacks(mPendingCheckForLongPress);
    }
    setPressed(false);
    View motionView=getChildAt(mMotionPosition - mFirstPosition);
    if (motionView != null) {
      motionView.setPressed(false);
    }
    reportScrollStateChange(OnScrollListener.SCROLL_STATE_TOUCH_SCROLL);
    requestDisallowInterceptTouchEvent(true);
    return true;
  }
  return false;
}
Program: 42566
Project: 42566
Buggy source:
private boolean springback(int startX,int startY,int minX,int maxX,int minY,int maxY,Scroller scroller){
  int xoff=0;
  int yoff=0;
  if (startX < minX) {
    xoff=minX - startX;
  }
 else   if (startX > maxX) {
    xoff=maxX - startX;
  }
  if (startY < minY) {
    yoff=minY - startY;
  }
 else   if (startY > maxY) {
    yoff=maxY - startY;
  }
  if (xoff != 0 || yoff != 0) {
    scroller.startScroll(startX,startY,xoff,yoff,SPRINGBACK_DURATION);
    mCurrScroller.abortAnimation();
    mCurrScroller=scroller;
    mScrollMode=MODE_SPRINGBACK;
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean springback(int startX,int startY,int minX,int maxX,int minY,int maxY,Scroller scroller){
  int xoff=0;
  int yoff=0;
  if (startX < minX) {
    xoff=minX - startX;
  }
 else   if (startX > maxX) {
    xoff=maxX - startX;
  }
  if (startY < minY) {
    yoff=minY - startY;
  }
 else   if (startY > maxY) {
    yoff=maxY - startY;
  }
  if (xoff != 0 || yoff != 0) {
    mCurrScroller.abortAnimation();
    scroller.startScroll(startX,startY,xoff,yoff,SPRINGBACK_DURATION);
    mCurrScroller=scroller;
    mScrollMode=MODE_SPRINGBACK;
    return true;
  }
  return false;
}
Program: 42567
Project: 42567
Buggy source:
private void overfling(int startx,int starty,float xvel,float yvel){
  Scroller scroller=mDecelScroller;
  final float durationSecs=(OVERFLING_DURATION / 1000.f);
  int dx=(int)(xvel * durationSecs) / 8;
  int dy=(int)(yvel * durationSecs) / 8;
  scroller.startScroll(startx,starty,dx,dy,OVERFLING_DURATION);
  mCurrScroller.abortAnimation();
  mCurrScroller=scroller;
  mScrollMode=MODE_OVERFLING;
}

Fixed version (ground truth):
private void overfling(int startx,int starty,float xvel,float yvel){
  Scroller scroller=mDecelScroller;
  final float durationSecs=(OVERFLING_DURATION / 1000.f);
  int dx=(int)(xvel * durationSecs) / 8;
  int dy=(int)(yvel * durationSecs) / 8;
  mCurrScroller.abortAnimation();
  scroller.startScroll(startx,starty,dx,dy,OVERFLING_DURATION);
  mCurrScroller=scroller;
  mScrollMode=MODE_OVERFLING;
}
Program: 42569
Project: 42569
Buggy source:
void addProvidersForPackageLocked(String pkgName){
  Intent intent=new Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
  List<ResolveInfo> broadcastReceivers=mPackageManager.queryBroadcastReceivers(intent,PackageManager.GET_META_DATA);
  final int N=broadcastReceivers.size();
  for (int i=0; i < N; i++) {
    ResolveInfo ri=broadcastReceivers.get(i);
    ActivityInfo ai=ri.activityInfo;
    if (pkgName.equals(ai.packageName)) {
      addProviderLocked(ri);
    }
  }
}

Fixed version (ground truth):
void addProvidersForPackageLocked(String pkgName){
  Intent intent=new Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
  intent.setPackage(pkgName);
  List<ResolveInfo> broadcastReceivers=mPackageManager.queryBroadcastReceivers(intent,PackageManager.GET_META_DATA);
  final int N=broadcastReceivers.size();
  for (int i=0; i < N; i++) {
    ResolveInfo ri=broadcastReceivers.get(i);
    ActivityInfo ai=ri.activityInfo;
    if (pkgName.equals(ai.packageName)) {
      addProviderLocked(ri);
    }
  }
}
Program: 42570
Project: 42570
Buggy source:
public void onClick(View v){
  if (mSearchable == null) {
    return;
  }
  try {
    ((SearchManager)getContext().getSystemService(Context.SEARCH_SERVICE)).stopSearch();
    if (mSearchable.getVoiceSearchLaunchWebSearch()) {
      getContext().startActivity(mVoiceWebSearchIntent);
    }
 else     if (mSearchable.getVoiceSearchLaunchRecognizer()) {
      Intent appSearchIntent=createVoiceAppSearchIntent(mVoiceAppSearchIntent);
      getContext().startActivity(appSearchIntent);
    }
  }
 catch (  ActivityNotFoundException e) {
    Log.w(LOG_TAG,"String_Node_Str");
  }
}

Fixed version (ground truth):
public void onClick(View v){
  if (mSearchable == null) {
    return;
  }
  SearchableInfo searchable=mSearchable;
  cancel();
  try {
    if (searchable.getVoiceSearchLaunchWebSearch()) {
      getContext().startActivity(mVoiceWebSearchIntent);
    }
 else     if (searchable.getVoiceSearchLaunchRecognizer()) {
      Intent appSearchIntent=createVoiceAppSearchIntent(mVoiceAppSearchIntent);
      getContext().startActivity(appSearchIntent);
    }
  }
 catch (  ActivityNotFoundException e) {
    Log.w(LOG_TAG,"String_Node_Str");
  }
}
Program: 42572
Project: 42572
Buggy source:
void addProvidersForPackageLocked(String pkgName){
  Intent intent=new Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
  List<ResolveInfo> broadcastReceivers=mPackageManager.queryBroadcastReceivers(intent,PackageManager.GET_META_DATA);
  final int N=broadcastReceivers.size();
  for (int i=0; i < N; i++) {
    ResolveInfo ri=broadcastReceivers.get(i);
    ActivityInfo ai=ri.activityInfo;
    if (pkgName.equals(ai.packageName)) {
      addProviderLocked(ri);
    }
  }
}

Fixed version (ground truth):
void addProvidersForPackageLocked(String pkgName){
  Intent intent=new Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
  intent.setPackage(pkgName);
  List<ResolveInfo> broadcastReceivers=mPackageManager.queryBroadcastReceivers(intent,PackageManager.GET_META_DATA);
  final int N=broadcastReceivers.size();
  for (int i=0; i < N; i++) {
    ResolveInfo ri=broadcastReceivers.get(i);
    ActivityInfo ai=ri.activityInfo;
    if (pkgName.equals(ai.packageName)) {
      addProviderLocked(ri);
    }
  }
}
Program: 42573
Project: 42573
Buggy source:
private DateFormat getDateFormat(){
  String format=Settings.System.getString(getContext().getContentResolver(),Settings.System.DATE_FORMAT);
  if ("String_Node_Str".equals(format)) {
    return DateFormat.getDateInstance(DateFormat.SHORT);
  }
 else {
    return new SimpleDateFormat(format);
  }
}

Fixed version (ground truth):
private DateFormat getDateFormat(){
  String format=Settings.System.getString(getContext().getContentResolver(),Settings.System.DATE_FORMAT);
  if (format == null || "String_Node_Str".equals(format)) {
    return DateFormat.getDateInstance(DateFormat.SHORT);
  }
 else {
    return new SimpleDateFormat(format);
  }
}
Program: 42574
Project: 42574
Buggy source:
private DateFormat getDateFormat(){
  String format=Settings.System.getString(getContext().getContentResolver(),Settings.System.DATE_FORMAT);
  if ("String_Node_Str".equals(format)) {
    return DateFormat.getDateInstance(DateFormat.SHORT);
  }
 else {
    return new SimpleDateFormat(format);
  }
}

Fixed version (ground truth):
private DateFormat getDateFormat(){
  String format=Settings.System.getString(getContext().getContentResolver(),Settings.System.DATE_FORMAT);
  if (format == null || "String_Node_Str".equals(format)) {
    return DateFormat.getDateInstance(DateFormat.SHORT);
  }
 else {
    return new SimpleDateFormat(format);
  }
}
Program: 42575
Project: 42575
Buggy source:
public void onClick(View v){
  if (mSearchable == null) {
    return;
  }
  try {
    ((SearchManager)getContext().getSystemService(Context.SEARCH_SERVICE)).stopSearch();
    if (mSearchable.getVoiceSearchLaunchWebSearch()) {
      getContext().startActivity(mVoiceWebSearchIntent);
    }
 else     if (mSearchable.getVoiceSearchLaunchRecognizer()) {
      Intent appSearchIntent=createVoiceAppSearchIntent(mVoiceAppSearchIntent);
      getContext().startActivity(appSearchIntent);
    }
  }
 catch (  ActivityNotFoundException e) {
    Log.w(LOG_TAG,"String_Node_Str");
  }
}

Fixed version (ground truth):
public void onClick(View v){
  if (mSearchable == null) {
    return;
  }
  SearchableInfo searchable=mSearchable;
  cancel();
  try {
    if (searchable.getVoiceSearchLaunchWebSearch()) {
      getContext().startActivity(mVoiceWebSearchIntent);
    }
 else     if (searchable.getVoiceSearchLaunchRecognizer()) {
      Intent appSearchIntent=createVoiceAppSearchIntent(mVoiceAppSearchIntent);
      getContext().startActivity(appSearchIntent);
    }
  }
 catch (  ActivityNotFoundException e) {
    Log.w(LOG_TAG,"String_Node_Str");
  }
}
Program: 42576
Project: 42576
Buggy source:
protected void startPhotoQuery(long photoId,Uri lookupKey){
  mQueryHandler.startQuery(TOKEN_PHOTO_QUERY,lookupKey,ContentUris.withAppendedId(Data.CONTENT_URI,photoId),PhotoQuery.COLUMNS,null,null,null);
}

Fixed version (ground truth):
/** 
 * startPhotoQuery internal method to query contact photo by photo id and uri.
 * @param photoId the photo id.
 * @param lookupKey the lookup uri.
 * @param resetQueryHandler whether to use a new AsyncQueryHandler or not.
 */
protected void startPhotoQuery(long photoId,Uri lookupKey,boolean resetQueryHandler){
  if (resetQueryHandler) {
    resetAsyncQueryHandler();
  }
  mQueryHandler.startQuery(TOKEN_PHOTO_QUERY,lookupKey,ContentUris.withAppendedId(Data.CONTENT_URI,photoId),PhotoQuery.COLUMNS,null,null,null);
}
Program: 42577
Project: 42577
Buggy source:
private void startContactQuery(Uri contactUri){
  mQueryHandler.startQuery(TOKEN_CONTACT_INFO,null,contactUri,ContactQuery.COLUMNS,null,null,null);
}

Fixed version (ground truth):
/** 
 * startContactQuery internal method to query contact by Uri.
 * @param contactUri the contact uri
 * @param resetQueryHandler whether to use a new AsyncQueryHandler or not
 */
private void startContactQuery(Uri contactUri,boolean resetQueryHandler){
  if (resetQueryHandler) {
    resetAsyncQueryHandler();
  }
  mQueryHandler.startQuery(TOKEN_CONTACT_INFO,null,contactUri,ContactQuery.COLUMNS,null,null,null);
}
Program: 42578
Project: 42578
Buggy source:
/** 
 * Convenience method for binding all available data from an existing contact.
 * @param conatctUri a {Contacts.CONTENT_LOOKUP_URI} style URI.
 */
public void bindFromContactLookupUri(Uri contactLookupUri){
  mContactUri=contactLookupUri;
  startContactQuery(contactLookupUri);
}

Fixed version (ground truth):
/** 
 * Convenience method for binding all available data from an existing contact.
 * @param contactLookupUri a {Contacts.CONTENT_LOOKUP_URI} style URI.
 */
public void bindFromContactLookupUri(Uri contactLookupUri){
  bindFromContactUriInternal(contactLookupUri,true);
}