nus-yam/ex-repair huggingface dataset:
Program: 22146
Project: 22146
Buggy source:
/** 
 * TODO document for SDK Abandon audio focus.
 * @return {@link #AUDIOFOCUS_REQUEST_FAILED} or {@link #AUDIOFOCUS_REQUEST_GRANTED}
 */
public int abandonAudioFocus(OnAudioFocusChangeListener l){
  int status=AUDIOFOCUS_REQUEST_FAILED;
  registerAudioFocusListener(l);
  IAudioService service=getService();
  try {
    status=service.abandonAudioFocus(mAudioFocusDispatcher,getIdForAudioFocusListener(l));
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str" + e);
  }
  return status;
}

Fixed version (ground truth):
/** 
 * TODO document for SDK Abandon audio focus.
 * @return {@link #AUDIOFOCUS_REQUEST_FAILED} or {@link #AUDIOFOCUS_REQUEST_GRANTED}
 */
public int abandonAudioFocus(OnAudioFocusChangeListener l){
  int status=AUDIOFOCUS_REQUEST_FAILED;
  unregisterAudioFocusListener(l);
  IAudioService service=getService();
  try {
    status=service.abandonAudioFocus(mAudioFocusDispatcher,getIdForAudioFocusListener(l));
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str" + e);
  }
  return status;
}
Program: 22147
Project: 22147
Buggy source:
/** 
 * Register a listener for audio focus updates.
 */
public void registerAudioFocusListener(OnAudioFocusChangeListener l){
synchronized (mFocusListenerLock) {
    if (mAudioFocusIdListenerMap.containsKey(getIdForAudioFocusListener(l))) {
      return;
    }
    mAudioFocusIdListenerMap.put(getIdForAudioFocusListener(l),l);
  }
}

Fixed version (ground truth):
/** 
 * TODO hide
 */
public void registerAudioFocusListener(OnAudioFocusChangeListener l){
synchronized (mFocusListenerLock) {
    if (mAudioFocusIdListenerMap.containsKey(getIdForAudioFocusListener(l))) {
      return;
    }
    mAudioFocusIdListenerMap.put(getIdForAudioFocusListener(l),l);
  }
}
Program: 22148
Project: 22148
Buggy source:
/** 
 * TODO document for SDK
 */
public void unregisterAudioFocusListener(OnAudioFocusChangeListener l){
  IAudioService service=getService();
  try {
    service.unregisterAudioFocusClient(getIdForAudioFocusListener(l));
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str" + e);
  }
synchronized (mFocusListenerLock) {
    mAudioFocusIdListenerMap.remove(getIdForAudioFocusListener(l));
  }
}

Fixed version (ground truth):
/** 
 * TODO hide
 */
public void unregisterAudioFocusListener(OnAudioFocusChangeListener l){
synchronized (mFocusListenerLock) {
    mAudioFocusIdListenerMap.remove(getIdForAudioFocusListener(l));
  }
}
Program: 22149
Project: 22149
Buggy source:
/** 
 * @see AudioManager#abandonAudioFocus(IAudioFocusDispatcher) 
 */
public int abandonAudioFocus(IAudioFocusDispatcher fl,String clientId){
  Log.i(TAG,"String_Node_Str" + clientId);
synchronized (mFocusStack) {
    removeFocusStackEntry(clientId,true);
  }
  return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
}

Fixed version (ground truth):
/** 
 * @see AudioManager#abandonAudioFocus(IAudioFocusDispatcher) 
 */
public int abandonAudioFocus(IAudioFocusDispatcher fl,String clientId){
  Log.i(TAG,"String_Node_Str" + clientId);
  try {
synchronized (mAudioFocusLock) {
      removeFocusStackEntry(clientId,true);
    }
  }
 catch (  java.util.ConcurrentModificationException cme) {
    Log.e(TAG,"String_Node_Str" + cme);
    cme.printStackTrace();
  }
  return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
}
Program: 22150
Project: 22150
Buggy source:
public void binderDied(){
synchronized (mFocusStack) {
    Log.w(TAG,"String_Node_Str");
    removeFocusStackEntryForClient(mCb);
  }
}

Fixed version (ground truth):
public void binderDied(){
synchronized (mAudioFocusLock) {
    Log.w(TAG,"String_Node_Str");
    removeFocusStackEntryForClient(mCb);
  }
}
Program: 22151
Project: 22151
Buggy source:
public void unregisterAudioFocusClient(String clientId){
synchronized (mFocusStack) {
    removeFocusStackEntry(clientId,false);
  }
}

Fixed version (ground truth):
public void unregisterAudioFocusClient(String clientId){
synchronized (mAudioFocusLock) {
    removeFocusStackEntry(clientId,false);
  }
}
Program: 22153
Project: 22153
Buggy source:
/** 
 * Helper function: Display in the log the current entries in the audio focus stack
 */
private void dumpFocusStack(PrintWriter pw){
  pw.println("String_Node_Str");
synchronized (mFocusStack) {
    Iterator<FocusStackEntry> stackIterator=mFocusStack.iterator();
    while (stackIterator.hasNext()) {
      FocusStackEntry fse=stackIterator.next();
      pw.println("String_Node_Str" + fse.mSourceRef + "String_Node_Str"+ fse.mClientId+ "String_Node_Str"+ fse.mFocusChangeType);
    }
  }
}

Fixed version (ground truth):
/** 
 * Helper function: Display in the log the current entries in the audio focus stack
 */
private void dumpFocusStack(PrintWriter pw){
  pw.println("String_Node_Str");
synchronized (mAudioFocusLock) {
    Iterator<FocusStackEntry> stackIterator=mFocusStack.iterator();
    while (stackIterator.hasNext()) {
      FocusStackEntry fse=stackIterator.next();
      pw.println("String_Node_Str" + fse.mSourceRef + "String_Node_Str"+ fse.mClientId+ "String_Node_Str"+ fse.mFocusChangeType);
    }
  }
}
Program: 22155
Project: 22155
Buggy source:
/** 
 * TODO document for SDK Abandon audio focus.
 * @return {@link #AUDIOFOCUS_REQUEST_FAILED} or {@link #AUDIOFOCUS_REQUEST_GRANTED}
 */
public int abandonAudioFocus(OnAudioFocusChangeListener l){
  int status=AUDIOFOCUS_REQUEST_FAILED;
  registerAudioFocusListener(l);
  IAudioService service=getService();
  try {
    status=service.abandonAudioFocus(mAudioFocusDispatcher,getIdForAudioFocusListener(l));
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str" + e);
  }
  return status;
}

Fixed version (ground truth):
/** 
 * TODO document for SDK Abandon audio focus.
 * @return {@link #AUDIOFOCUS_REQUEST_FAILED} or {@link #AUDIOFOCUS_REQUEST_GRANTED}
 */
public int abandonAudioFocus(OnAudioFocusChangeListener l){
  int status=AUDIOFOCUS_REQUEST_FAILED;
  unregisterAudioFocusListener(l);
  IAudioService service=getService();
  try {
    status=service.abandonAudioFocus(mAudioFocusDispatcher,getIdForAudioFocusListener(l));
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str" + e);
  }
  return status;
}
Program: 22156
Project: 22156
Buggy source:
/** 
 * Register a listener for audio focus updates.
 */
public void registerAudioFocusListener(OnAudioFocusChangeListener l){
synchronized (mFocusListenerLock) {
    if (mAudioFocusIdListenerMap.containsKey(getIdForAudioFocusListener(l))) {
      return;
    }
    mAudioFocusIdListenerMap.put(getIdForAudioFocusListener(l),l);
  }
}

Fixed version (ground truth):
/** 
 * TODO hide
 */
public void registerAudioFocusListener(OnAudioFocusChangeListener l){
synchronized (mFocusListenerLock) {
    if (mAudioFocusIdListenerMap.containsKey(getIdForAudioFocusListener(l))) {
      return;
    }
    mAudioFocusIdListenerMap.put(getIdForAudioFocusListener(l),l);
  }
}
Program: 22157
Project: 22157
Buggy source:
/** 
 * TODO document for SDK
 */
public void unregisterAudioFocusListener(OnAudioFocusChangeListener l){
  IAudioService service=getService();
  try {
    service.unregisterAudioFocusClient(getIdForAudioFocusListener(l));
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str" + e);
  }
synchronized (mFocusListenerLock) {
    mAudioFocusIdListenerMap.remove(getIdForAudioFocusListener(l));
  }
}

Fixed version (ground truth):
/** 
 * TODO hide
 */
public void unregisterAudioFocusListener(OnAudioFocusChangeListener l){
synchronized (mFocusListenerLock) {
    mAudioFocusIdListenerMap.remove(getIdForAudioFocusListener(l));
  }
}
Program: 22158
Project: 22158
Buggy source:
/** 
 * @see AudioManager#abandonAudioFocus(IAudioFocusDispatcher) 
 */
public int abandonAudioFocus(IAudioFocusDispatcher fl,String clientId){
  Log.i(TAG,"String_Node_Str" + clientId);
synchronized (mFocusStack) {
    removeFocusStackEntry(clientId,true);
  }
  return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
}

Fixed version (ground truth):
/** 
 * @see AudioManager#abandonAudioFocus(IAudioFocusDispatcher) 
 */
public int abandonAudioFocus(IAudioFocusDispatcher fl,String clientId){
  Log.i(TAG,"String_Node_Str" + clientId);
  try {
synchronized (mAudioFocusLock) {
      removeFocusStackEntry(clientId,true);
    }
  }
 catch (  java.util.ConcurrentModificationException cme) {
    Log.e(TAG,"String_Node_Str" + cme);
    cme.printStackTrace();
  }
  return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
}
Program: 22159
Project: 22159
Buggy source:
public void binderDied(){
synchronized (mFocusStack) {
    Log.w(TAG,"String_Node_Str");
    removeFocusStackEntryForClient(mCb);
  }
}

Fixed version (ground truth):
public void binderDied(){
synchronized (mAudioFocusLock) {
    Log.w(TAG,"String_Node_Str");
    removeFocusStackEntryForClient(mCb);
  }
}
Program: 22160
Project: 22160
Buggy source:
public void unregisterAudioFocusClient(String clientId){
synchronized (mFocusStack) {
    removeFocusStackEntry(clientId,false);
  }
}

Fixed version (ground truth):
public void unregisterAudioFocusClient(String clientId){
synchronized (mAudioFocusLock) {
    removeFocusStackEntry(clientId,false);
  }
}
Program: 22162
Project: 22162
Buggy source:
/** 
 * Helper function: Display in the log the current entries in the audio focus stack
 */
private void dumpFocusStack(PrintWriter pw){
  pw.println("String_Node_Str");
synchronized (mFocusStack) {
    Iterator<FocusStackEntry> stackIterator=mFocusStack.iterator();
    while (stackIterator.hasNext()) {
      FocusStackEntry fse=stackIterator.next();
      pw.println("String_Node_Str" + fse.mSourceRef + "String_Node_Str"+ fse.mClientId+ "String_Node_Str"+ fse.mFocusChangeType);
    }
  }
}

Fixed version (ground truth):
/** 
 * Helper function: Display in the log the current entries in the audio focus stack
 */
private void dumpFocusStack(PrintWriter pw){
  pw.println("String_Node_Str");
synchronized (mAudioFocusLock) {
    Iterator<FocusStackEntry> stackIterator=mFocusStack.iterator();
    while (stackIterator.hasNext()) {
      FocusStackEntry fse=stackIterator.next();
      pw.println("String_Node_Str" + fse.mSourceRef + "String_Node_Str"+ fse.mClientId+ "String_Node_Str"+ fse.mFocusChangeType);
    }
  }
}
Program: 22164
Project: 22164
Buggy source:
/** 
 * Searches the query string for the first value with the given key.
 * @param key which will be encoded
 * @throws UnsupportedOperationException if this isn't a hierarchical URI
 * @throws NullPointerException if key is null
 * @return the decoded value or null if no parameter is found
 */
public String getQueryParameter(String key){
  if (isOpaque()) {
    throw new UnsupportedOperationException(NOT_HIERARCHICAL);
  }
  if (key == null) {
    throw new NullPointerException("String_Node_Str");
  }
  final String query=getEncodedQuery();
  if (query == null) {
    return null;
  }
  final String encodedKey=encode(key,null);
  final int encodedKeyLength=encodedKey.length();
  int encodedKeySearchIndex=0;
  final int encodedKeySearchEnd=query.length() - (encodedKeyLength + 1);
  while (encodedKeySearchIndex <= encodedKeySearchEnd) {
    int keyIndex=query.indexOf(encodedKey,encodedKeySearchIndex);
    if (keyIndex == -1) {
      break;
    }
    final int equalsIndex=keyIndex + encodedKeyLength;
    if (query.charAt(equalsIndex) != '=') {
      encodedKeySearchIndex=equalsIndex + 1;
      continue;
    }
    if (keyIndex == 0 || query.charAt(keyIndex - 1) == '&') {
      int end=query.indexOf('&',equalsIndex);
      if (end == -1) {
        end=query.length();
      }
      return decode(query.substring(equalsIndex + 1,end));
    }
 else {
      encodedKeySearchIndex=equalsIndex + 1;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Searches the query string for the first value with the given key.
 * @param key which will be encoded
 * @throws UnsupportedOperationException if this isn't a hierarchical URI
 * @throws NullPointerException if key is null
 * @return the decoded value or null if no parameter is found
 */
public String getQueryParameter(String key){
  if (isOpaque()) {
    throw new UnsupportedOperationException(NOT_HIERARCHICAL);
  }
  if (key == null) {
    throw new NullPointerException("String_Node_Str");
  }
  final String query=getEncodedQuery();
  if (query == null) {
    return null;
  }
  final String encodedKey=encode(key,null);
  final int encodedKeyLength=encodedKey.length();
  int encodedKeySearchIndex=0;
  final int encodedKeySearchEnd=query.length() - (encodedKeyLength + 1);
  while (encodedKeySearchIndex <= encodedKeySearchEnd) {
    int keyIndex=query.indexOf(encodedKey,encodedKeySearchIndex);
    if (keyIndex == -1) {
      break;
    }
    final int equalsIndex=keyIndex + encodedKeyLength;
    if (equalsIndex >= query.length()) {
      break;
    }
    if (query.charAt(equalsIndex) != '=') {
      encodedKeySearchIndex=equalsIndex + 1;
      continue;
    }
    if (keyIndex == 0 || query.charAt(keyIndex - 1) == '&') {
      int end=query.indexOf('&',equalsIndex);
      if (end == -1) {
        end=query.length();
      }
      return decode(query.substring(equalsIndex + 1,end));
    }
 else {
      encodedKeySearchIndex=equalsIndex + 1;
    }
  }
  return null;
}
Program: 22167
Project: 22167
Buggy source:
/** 
 * TODO document for SDK Abandon audio focus.
 * @return {@link #AUDIOFOCUS_REQUEST_FAILED} or {@link #AUDIOFOCUS_REQUEST_GRANTED}
 */
public int abandonAudioFocus(OnAudioFocusChangeListener l){
  int status=AUDIOFOCUS_REQUEST_FAILED;
  registerAudioFocusListener(l);
  IAudioService service=getService();
  try {
    status=service.abandonAudioFocus(mAudioFocusDispatcher,getIdForAudioFocusListener(l));
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str" + e);
  }
  return status;
}

Fixed version (ground truth):
/** 
 * TODO document for SDK Abandon audio focus.
 * @return {@link #AUDIOFOCUS_REQUEST_FAILED} or {@link #AUDIOFOCUS_REQUEST_GRANTED}
 */
public int abandonAudioFocus(OnAudioFocusChangeListener l){
  int status=AUDIOFOCUS_REQUEST_FAILED;
  unregisterAudioFocusListener(l);
  IAudioService service=getService();
  try {
    status=service.abandonAudioFocus(mAudioFocusDispatcher,getIdForAudioFocusListener(l));
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str" + e);
  }
  return status;
}
Program: 22168
Project: 22168
Buggy source:
/** 
 * Register a listener for audio focus updates.
 */
public void registerAudioFocusListener(OnAudioFocusChangeListener l){
synchronized (mFocusListenerLock) {
    if (mAudioFocusIdListenerMap.containsKey(getIdForAudioFocusListener(l))) {
      return;
    }
    mAudioFocusIdListenerMap.put(getIdForAudioFocusListener(l),l);
  }
}

Fixed version (ground truth):
/** 
 * TODO hide
 */
public void registerAudioFocusListener(OnAudioFocusChangeListener l){
synchronized (mFocusListenerLock) {
    if (mAudioFocusIdListenerMap.containsKey(getIdForAudioFocusListener(l))) {
      return;
    }
    mAudioFocusIdListenerMap.put(getIdForAudioFocusListener(l),l);
  }
}
Program: 22169
Project: 22169
Buggy source:
/** 
 * TODO document for SDK
 */
public void unregisterAudioFocusListener(OnAudioFocusChangeListener l){
  IAudioService service=getService();
  try {
    service.unregisterAudioFocusClient(getIdForAudioFocusListener(l));
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str" + e);
  }
synchronized (mFocusListenerLock) {
    mAudioFocusIdListenerMap.remove(getIdForAudioFocusListener(l));
  }
}

Fixed version (ground truth):
/** 
 * TODO hide
 */
public void unregisterAudioFocusListener(OnAudioFocusChangeListener l){
synchronized (mFocusListenerLock) {
    mAudioFocusIdListenerMap.remove(getIdForAudioFocusListener(l));
  }
}
Program: 22170
Project: 22170
Buggy source:
/** 
 * @see AudioManager#abandonAudioFocus(IAudioFocusDispatcher) 
 */
public int abandonAudioFocus(IAudioFocusDispatcher fl,String clientId){
  Log.i(TAG,"String_Node_Str" + clientId);
synchronized (mFocusStack) {
    removeFocusStackEntry(clientId,true);
  }
  return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
}

Fixed version (ground truth):
/** 
 * @see AudioManager#abandonAudioFocus(IAudioFocusDispatcher) 
 */
public int abandonAudioFocus(IAudioFocusDispatcher fl,String clientId){
  Log.i(TAG,"String_Node_Str" + clientId);
  try {
synchronized (mAudioFocusLock) {
      removeFocusStackEntry(clientId,true);
    }
  }
 catch (  java.util.ConcurrentModificationException cme) {
    Log.e(TAG,"String_Node_Str" + cme);
    cme.printStackTrace();
  }
  return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
}
Program: 22171
Project: 22171
Buggy source:
public void binderDied(){
synchronized (mFocusStack) {
    Log.w(TAG,"String_Node_Str");
    removeFocusStackEntryForClient(mCb);
  }
}

Fixed version (ground truth):
public void binderDied(){
synchronized (mAudioFocusLock) {
    Log.w(TAG,"String_Node_Str");
    removeFocusStackEntryForClient(mCb);
  }
}
Program: 22172
Project: 22172
Buggy source:
public void unregisterAudioFocusClient(String clientId){
synchronized (mFocusStack) {
    removeFocusStackEntry(clientId,false);
  }
}

Fixed version (ground truth):
public void unregisterAudioFocusClient(String clientId){
synchronized (mAudioFocusLock) {
    removeFocusStackEntry(clientId,false);
  }
}
Program: 22174
Project: 22174
Buggy source:
/** 
 * Helper function: Display in the log the current entries in the audio focus stack
 */
private void dumpFocusStack(PrintWriter pw){
  pw.println("String_Node_Str");
synchronized (mFocusStack) {
    Iterator<FocusStackEntry> stackIterator=mFocusStack.iterator();
    while (stackIterator.hasNext()) {
      FocusStackEntry fse=stackIterator.next();
      pw.println("String_Node_Str" + fse.mSourceRef + "String_Node_Str"+ fse.mClientId+ "String_Node_Str"+ fse.mFocusChangeType);
    }
  }
}

Fixed version (ground truth):
/** 
 * Helper function: Display in the log the current entries in the audio focus stack
 */
private void dumpFocusStack(PrintWriter pw){
  pw.println("String_Node_Str");
synchronized (mAudioFocusLock) {
    Iterator<FocusStackEntry> stackIterator=mFocusStack.iterator();
    while (stackIterator.hasNext()) {
      FocusStackEntry fse=stackIterator.next();
      pw.println("String_Node_Str" + fse.mSourceRef + "String_Node_Str"+ fse.mClientId+ "String_Node_Str"+ fse.mFocusChangeType);
    }
  }
}
Program: 22175
Project: 22175
Buggy source:
/** 
 * TODO document for SDK Abandon audio focus.
 * @return {@link #AUDIOFOCUS_REQUEST_FAILED} or {@link #AUDIOFOCUS_REQUEST_GRANTED}
 */
public int abandonAudioFocus(OnAudioFocusChangeListener l){
  int status=AUDIOFOCUS_REQUEST_FAILED;
  registerAudioFocusListener(l);
  IAudioService service=getService();
  try {
    status=service.abandonAudioFocus(mAudioFocusDispatcher,getIdForAudioFocusListener(l));
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str" + e);
  }
  return status;
}

Fixed version (ground truth):
/** 
 * TODO document for SDK Abandon audio focus.
 * @return {@link #AUDIOFOCUS_REQUEST_FAILED} or {@link #AUDIOFOCUS_REQUEST_GRANTED}
 */
public int abandonAudioFocus(OnAudioFocusChangeListener l){
  int status=AUDIOFOCUS_REQUEST_FAILED;
  unregisterAudioFocusListener(l);
  IAudioService service=getService();
  try {
    status=service.abandonAudioFocus(mAudioFocusDispatcher,getIdForAudioFocusListener(l));
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str" + e);
  }
  return status;
}
Program: 22176
Project: 22176
Buggy source:
/** 
 * Register a listener for audio focus updates.
 */
public void registerAudioFocusListener(OnAudioFocusChangeListener l){
synchronized (mFocusListenerLock) {
    if (mAudioFocusIdListenerMap.containsKey(getIdForAudioFocusListener(l))) {
      return;
    }
    mAudioFocusIdListenerMap.put(getIdForAudioFocusListener(l),l);
  }
}

Fixed version (ground truth):
/** 
 * TODO hide
 */
public void registerAudioFocusListener(OnAudioFocusChangeListener l){
synchronized (mFocusListenerLock) {
    if (mAudioFocusIdListenerMap.containsKey(getIdForAudioFocusListener(l))) {
      return;
    }
    mAudioFocusIdListenerMap.put(getIdForAudioFocusListener(l),l);
  }
}
Program: 22177
Project: 22177
Buggy source:
/** 
 * TODO document for SDK
 */
public void unregisterAudioFocusListener(OnAudioFocusChangeListener l){
  IAudioService service=getService();
  try {
    service.unregisterAudioFocusClient(getIdForAudioFocusListener(l));
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str" + e);
  }
synchronized (mFocusListenerLock) {
    mAudioFocusIdListenerMap.remove(getIdForAudioFocusListener(l));
  }
}

Fixed version (ground truth):
/** 
 * TODO hide
 */
public void unregisterAudioFocusListener(OnAudioFocusChangeListener l){
synchronized (mFocusListenerLock) {
    mAudioFocusIdListenerMap.remove(getIdForAudioFocusListener(l));
  }
}
Program: 22178
Project: 22178
Buggy source:
/** 
 * @see AudioManager#abandonAudioFocus(IAudioFocusDispatcher) 
 */
public int abandonAudioFocus(IAudioFocusDispatcher fl,String clientId){
  Log.i(TAG,"String_Node_Str" + clientId);
synchronized (mFocusStack) {
    removeFocusStackEntry(clientId,true);
  }
  return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
}

Fixed version (ground truth):
/** 
 * @see AudioManager#abandonAudioFocus(IAudioFocusDispatcher) 
 */
public int abandonAudioFocus(IAudioFocusDispatcher fl,String clientId){
  Log.i(TAG,"String_Node_Str" + clientId);
  try {
synchronized (mAudioFocusLock) {
      removeFocusStackEntry(clientId,true);
    }
  }
 catch (  java.util.ConcurrentModificationException cme) {
    Log.e(TAG,"String_Node_Str" + cme);
    cme.printStackTrace();
  }
  return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
}
Program: 22179
Project: 22179
Buggy source:
public void binderDied(){
synchronized (mFocusStack) {
    Log.w(TAG,"String_Node_Str");
    removeFocusStackEntryForClient(mCb);
  }
}

Fixed version (ground truth):
public void binderDied(){
synchronized (mAudioFocusLock) {
    Log.w(TAG,"String_Node_Str");
    removeFocusStackEntryForClient(mCb);
  }
}
Program: 22180
Project: 22180
Buggy source:
public void unregisterAudioFocusClient(String clientId){
synchronized (mFocusStack) {
    removeFocusStackEntry(clientId,false);
  }
}

Fixed version (ground truth):
public void unregisterAudioFocusClient(String clientId){
synchronized (mAudioFocusLock) {
    removeFocusStackEntry(clientId,false);
  }
}
Program: 22182
Project: 22182
Buggy source:
/** 
 * Helper function: Display in the log the current entries in the audio focus stack
 */
private void dumpFocusStack(PrintWriter pw){
  pw.println("String_Node_Str");
synchronized (mFocusStack) {
    Iterator<FocusStackEntry> stackIterator=mFocusStack.iterator();
    while (stackIterator.hasNext()) {
      FocusStackEntry fse=stackIterator.next();
      pw.println("String_Node_Str" + fse.mSourceRef + "String_Node_Str"+ fse.mClientId+ "String_Node_Str"+ fse.mFocusChangeType);
    }
  }
}

Fixed version (ground truth):
/** 
 * Helper function: Display in the log the current entries in the audio focus stack
 */
private void dumpFocusStack(PrintWriter pw){
  pw.println("String_Node_Str");
synchronized (mAudioFocusLock) {
    Iterator<FocusStackEntry> stackIterator=mFocusStack.iterator();
    while (stackIterator.hasNext()) {
      FocusStackEntry fse=stackIterator.next();
      pw.println("String_Node_Str" + fse.mSourceRef + "String_Node_Str"+ fse.mClientId+ "String_Node_Str"+ fse.mFocusChangeType);
    }
  }
}
Program: 22183
Project: 22183
Buggy source:
/** 
 * Searches the query string for the first value with the given key.
 * @param key which will be encoded
 * @throws UnsupportedOperationException if this isn't a hierarchical URI
 * @throws NullPointerException if key is null
 * @return the decoded value or null if no parameter is found
 */
public String getQueryParameter(String key){
  if (isOpaque()) {
    throw new UnsupportedOperationException(NOT_HIERARCHICAL);
  }
  if (key == null) {
    throw new NullPointerException("String_Node_Str");
  }
  final String query=getEncodedQuery();
  if (query == null) {
    return null;
  }
  final String encodedKey=encode(key,null);
  final int encodedKeyLength=encodedKey.length();
  int encodedKeySearchIndex=0;
  final int encodedKeySearchEnd=query.length() - (encodedKeyLength + 1);
  while (encodedKeySearchIndex <= encodedKeySearchEnd) {
    int keyIndex=query.indexOf(encodedKey,encodedKeySearchIndex);
    if (keyIndex == -1) {
      break;
    }
    final int equalsIndex=keyIndex + encodedKeyLength;
    if (query.charAt(equalsIndex) != '=') {
      encodedKeySearchIndex=equalsIndex + 1;
      continue;
    }
    if (keyIndex == 0 || query.charAt(keyIndex - 1) == '&') {
      int end=query.indexOf('&',equalsIndex);
      if (end == -1) {
        end=query.length();
      }
      return decode(query.substring(equalsIndex + 1,end));
    }
 else {
      encodedKeySearchIndex=equalsIndex + 1;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Searches the query string for the first value with the given key.
 * @param key which will be encoded
 * @throws UnsupportedOperationException if this isn't a hierarchical URI
 * @throws NullPointerException if key is null
 * @return the decoded value or null if no parameter is found
 */
public String getQueryParameter(String key){
  if (isOpaque()) {
    throw new UnsupportedOperationException(NOT_HIERARCHICAL);
  }
  if (key == null) {
    throw new NullPointerException("String_Node_Str");
  }
  final String query=getEncodedQuery();
  if (query == null) {
    return null;
  }
  final String encodedKey=encode(key,null);
  final int encodedKeyLength=encodedKey.length();
  int encodedKeySearchIndex=0;
  final int encodedKeySearchEnd=query.length() - (encodedKeyLength + 1);
  while (encodedKeySearchIndex <= encodedKeySearchEnd) {
    int keyIndex=query.indexOf(encodedKey,encodedKeySearchIndex);
    if (keyIndex == -1) {
      break;
    }
    final int equalsIndex=keyIndex + encodedKeyLength;
    if (equalsIndex >= query.length()) {
      break;
    }
    if (query.charAt(equalsIndex) != '=') {
      encodedKeySearchIndex=equalsIndex + 1;
      continue;
    }
    if (keyIndex == 0 || query.charAt(keyIndex - 1) == '&') {
      int end=query.indexOf('&',equalsIndex);
      if (end == -1) {
        end=query.length();
      }
      return decode(query.substring(equalsIndex + 1,end));
    }
 else {
      encodedKeySearchIndex=equalsIndex + 1;
    }
  }
  return null;
}
Program: 22185
Project: 22185
Buggy source:
/** 
 * Searches the query string for the first value with the given key.
 * @param key which will be encoded
 * @throws UnsupportedOperationException if this isn't a hierarchical URI
 * @throws NullPointerException if key is null
 * @return the decoded value or null if no parameter is found
 */
public String getQueryParameter(String key){
  if (isOpaque()) {
    throw new UnsupportedOperationException(NOT_HIERARCHICAL);
  }
  if (key == null) {
    throw new NullPointerException("String_Node_Str");
  }
  final String query=getEncodedQuery();
  if (query == null) {
    return null;
  }
  final String encodedKey=encode(key,null);
  final int encodedKeyLength=encodedKey.length();
  int encodedKeySearchIndex=0;
  final int encodedKeySearchEnd=query.length() - (encodedKeyLength + 1);
  while (encodedKeySearchIndex <= encodedKeySearchEnd) {
    int keyIndex=query.indexOf(encodedKey,encodedKeySearchIndex);
    if (keyIndex == -1) {
      break;
    }
    final int equalsIndex=keyIndex + encodedKeyLength;
    if (query.charAt(equalsIndex) != '=') {
      encodedKeySearchIndex=equalsIndex + 1;
      continue;
    }
    if (keyIndex == 0 || query.charAt(keyIndex - 1) == '&') {
      int end=query.indexOf('&',equalsIndex);
      if (end == -1) {
        end=query.length();
      }
      return decode(query.substring(equalsIndex + 1,end));
    }
 else {
      encodedKeySearchIndex=equalsIndex + 1;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Searches the query string for the first value with the given key.
 * @param key which will be encoded
 * @throws UnsupportedOperationException if this isn't a hierarchical URI
 * @throws NullPointerException if key is null
 * @return the decoded value or null if no parameter is found
 */
public String getQueryParameter(String key){
  if (isOpaque()) {
    throw new UnsupportedOperationException(NOT_HIERARCHICAL);
  }
  if (key == null) {
    throw new NullPointerException("String_Node_Str");
  }
  final String query=getEncodedQuery();
  if (query == null) {
    return null;
  }
  final String encodedKey=encode(key,null);
  final int encodedKeyLength=encodedKey.length();
  int encodedKeySearchIndex=0;
  final int encodedKeySearchEnd=query.length() - (encodedKeyLength + 1);
  while (encodedKeySearchIndex <= encodedKeySearchEnd) {
    int keyIndex=query.indexOf(encodedKey,encodedKeySearchIndex);
    if (keyIndex == -1) {
      break;
    }
    final int equalsIndex=keyIndex + encodedKeyLength;
    if (equalsIndex >= query.length()) {
      break;
    }
    if (query.charAt(equalsIndex) != '=') {
      encodedKeySearchIndex=equalsIndex + 1;
      continue;
    }
    if (keyIndex == 0 || query.charAt(keyIndex - 1) == '&') {
      int end=query.indexOf('&',equalsIndex);
      if (end == -1) {
        end=query.length();
      }
      return decode(query.substring(equalsIndex + 1,end));
    }
 else {
      encodedKeySearchIndex=equalsIndex + 1;
    }
  }
  return null;
}
Program: 22187
Project: 22187
Buggy source:
/** 
 * Searches the query string for the first value with the given key.
 * @param key which will be encoded
 * @throws UnsupportedOperationException if this isn't a hierarchical URI
 * @throws NullPointerException if key is null
 * @return the decoded value or null if no parameter is found
 */
public String getQueryParameter(String key){
  if (isOpaque()) {
    throw new UnsupportedOperationException(NOT_HIERARCHICAL);
  }
  if (key == null) {
    throw new NullPointerException("String_Node_Str");
  }
  final String query=getEncodedQuery();
  if (query == null) {
    return null;
  }
  final String encodedKey=encode(key,null);
  final int encodedKeyLength=encodedKey.length();
  int encodedKeySearchIndex=0;
  final int encodedKeySearchEnd=query.length() - (encodedKeyLength + 1);
  while (encodedKeySearchIndex <= encodedKeySearchEnd) {
    int keyIndex=query.indexOf(encodedKey,encodedKeySearchIndex);
    if (keyIndex == -1) {
      break;
    }
    final int equalsIndex=keyIndex + encodedKeyLength;
    if (query.charAt(equalsIndex) != '=') {
      encodedKeySearchIndex=equalsIndex + 1;
      continue;
    }
    if (keyIndex == 0 || query.charAt(keyIndex - 1) == '&') {
      int end=query.indexOf('&',equalsIndex);
      if (end == -1) {
        end=query.length();
      }
      return decode(query.substring(equalsIndex + 1,end));
    }
 else {
      encodedKeySearchIndex=equalsIndex + 1;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Searches the query string for the first value with the given key.
 * @param key which will be encoded
 * @throws UnsupportedOperationException if this isn't a hierarchical URI
 * @throws NullPointerException if key is null
 * @return the decoded value or null if no parameter is found
 */
public String getQueryParameter(String key){
  if (isOpaque()) {
    throw new UnsupportedOperationException(NOT_HIERARCHICAL);
  }
  if (key == null) {
    throw new NullPointerException("String_Node_Str");
  }
  final String query=getEncodedQuery();
  if (query == null) {
    return null;
  }
  final String encodedKey=encode(key,null);
  final int encodedKeyLength=encodedKey.length();
  int encodedKeySearchIndex=0;
  final int encodedKeySearchEnd=query.length() - (encodedKeyLength + 1);
  while (encodedKeySearchIndex <= encodedKeySearchEnd) {
    int keyIndex=query.indexOf(encodedKey,encodedKeySearchIndex);
    if (keyIndex == -1) {
      break;
    }
    final int equalsIndex=keyIndex + encodedKeyLength;
    if (equalsIndex >= query.length()) {
      break;
    }
    if (query.charAt(equalsIndex) != '=') {
      encodedKeySearchIndex=equalsIndex + 1;
      continue;
    }
    if (keyIndex == 0 || query.charAt(keyIndex - 1) == '&') {
      int end=query.indexOf('&',equalsIndex);
      if (end == -1) {
        end=query.length();
      }
      return decode(query.substring(equalsIndex + 1,end));
    }
 else {
      encodedKeySearchIndex=equalsIndex + 1;
    }
  }
  return null;
}
Program: 22189
Project: 22189
Buggy source:
/** 
 * {@inheritDoc}
 */
public void playSoundEffect(int effectId){
  checkThread();
  final AudioManager audioManager=getAudioManager();
switch (effectId) {
case SoundEffectConstants.CLICK:
    audioManager.playSoundEffect(AudioManager.FX_KEY_CLICK);
  return;
case SoundEffectConstants.NAVIGATION_DOWN:
audioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_DOWN);
return;
case SoundEffectConstants.NAVIGATION_LEFT:
audioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_LEFT);
return;
case SoundEffectConstants.NAVIGATION_RIGHT:
audioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_RIGHT);
return;
case SoundEffectConstants.NAVIGATION_UP:
audioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_UP);
return;
default :
throw new IllegalArgumentException("String_Node_Str" + effectId + "String_Node_Str"+ SoundEffectConstants.class.getCanonicalName());
}
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void playSoundEffect(int effectId){
  checkThread();
  try {
    final AudioManager audioManager=getAudioManager();
switch (effectId) {
case SoundEffectConstants.CLICK:
      audioManager.playSoundEffect(AudioManager.FX_KEY_CLICK);
    return;
case SoundEffectConstants.NAVIGATION_DOWN:
  audioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_DOWN);
return;
case SoundEffectConstants.NAVIGATION_LEFT:
audioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_LEFT);
return;
case SoundEffectConstants.NAVIGATION_RIGHT:
audioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_RIGHT);
return;
case SoundEffectConstants.NAVIGATION_UP:
audioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_UP);
return;
default :
throw new IllegalArgumentException("String_Node_Str" + effectId + "String_Node_Str"+ SoundEffectConstants.class.getCanonicalName());
}
}
 catch (IllegalStateException e) {
Log.e(TAG,"String_Node_Str" + e);
e.printStackTrace();
}
}
Program: 22190
Project: 22190
Buggy source:
/** 
 * {@inheritDoc}
 */
public void playSoundEffect(int effectId){
  checkThread();
  final AudioManager audioManager=getAudioManager();
switch (effectId) {
case SoundEffectConstants.CLICK:
    audioManager.playSoundEffect(AudioManager.FX_KEY_CLICK);
  return;
case SoundEffectConstants.NAVIGATION_DOWN:
audioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_DOWN);
return;
case SoundEffectConstants.NAVIGATION_LEFT:
audioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_LEFT);
return;
case SoundEffectConstants.NAVIGATION_RIGHT:
audioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_RIGHT);
return;
case SoundEffectConstants.NAVIGATION_UP:
audioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_UP);
return;
default :
throw new IllegalArgumentException("String_Node_Str" + effectId + "String_Node_Str"+ SoundEffectConstants.class.getCanonicalName());
}
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void playSoundEffect(int effectId){
  checkThread();
  try {
    final AudioManager audioManager=getAudioManager();
switch (effectId) {
case SoundEffectConstants.CLICK:
      audioManager.playSoundEffect(AudioManager.FX_KEY_CLICK);
    return;
case SoundEffectConstants.NAVIGATION_DOWN:
  audioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_DOWN);
return;
case SoundEffectConstants.NAVIGATION_LEFT:
audioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_LEFT);
return;
case SoundEffectConstants.NAVIGATION_RIGHT:
audioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_RIGHT);
return;
case SoundEffectConstants.NAVIGATION_UP:
audioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_UP);
return;
default :
throw new IllegalArgumentException("String_Node_Str" + effectId + "String_Node_Str"+ SoundEffectConstants.class.getCanonicalName());
}
}
 catch (IllegalStateException e) {
Log.e(TAG,"String_Node_Str" + e);
e.printStackTrace();
}
}
Program: 22191
Project: 22191
Buggy source:
/** 
 * {@inheritDoc}
 */
public void playSoundEffect(int effectId){
  checkThread();
  final AudioManager audioManager=getAudioManager();
switch (effectId) {
case SoundEffectConstants.CLICK:
    audioManager.playSoundEffect(AudioManager.FX_KEY_CLICK);
  return;
case SoundEffectConstants.NAVIGATION_DOWN:
audioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_DOWN);
return;
case SoundEffectConstants.NAVIGATION_LEFT:
audioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_LEFT);
return;
case SoundEffectConstants.NAVIGATION_RIGHT:
audioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_RIGHT);
return;
case SoundEffectConstants.NAVIGATION_UP:
audioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_UP);
return;
default :
throw new IllegalArgumentException("String_Node_Str" + effectId + "String_Node_Str"+ SoundEffectConstants.class.getCanonicalName());
}
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void playSoundEffect(int effectId){
  checkThread();
  try {
    final AudioManager audioManager=getAudioManager();
switch (effectId) {
case SoundEffectConstants.CLICK:
      audioManager.playSoundEffect(AudioManager.FX_KEY_CLICK);
    return;
case SoundEffectConstants.NAVIGATION_DOWN:
  audioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_DOWN);
return;
case SoundEffectConstants.NAVIGATION_LEFT:
audioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_LEFT);
return;
case SoundEffectConstants.NAVIGATION_RIGHT:
audioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_RIGHT);
return;
case SoundEffectConstants.NAVIGATION_UP:
audioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_UP);
return;
default :
throw new IllegalArgumentException("String_Node_Str" + effectId + "String_Node_Str"+ SoundEffectConstants.class.getCanonicalName());
}
}
 catch (IllegalStateException e) {
Log.e(TAG,"String_Node_Str" + e);
e.printStackTrace();
}
}
Program: 22192
Project: 22192
Buggy source:
/** 
 * {@inheritDoc}
 */
public void playSoundEffect(int effectId){
  checkThread();
  final AudioManager audioManager=getAudioManager();
switch (effectId) {
case SoundEffectConstants.CLICK:
    audioManager.playSoundEffect(AudioManager.FX_KEY_CLICK);
  return;
case SoundEffectConstants.NAVIGATION_DOWN:
audioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_DOWN);
return;
case SoundEffectConstants.NAVIGATION_LEFT:
audioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_LEFT);
return;
case SoundEffectConstants.NAVIGATION_RIGHT:
audioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_RIGHT);
return;
case SoundEffectConstants.NAVIGATION_UP:
audioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_UP);
return;
default :
throw new IllegalArgumentException("String_Node_Str" + effectId + "String_Node_Str"+ SoundEffectConstants.class.getCanonicalName());
}
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void playSoundEffect(int effectId){
  checkThread();
  try {
    final AudioManager audioManager=getAudioManager();
switch (effectId) {
case SoundEffectConstants.CLICK:
      audioManager.playSoundEffect(AudioManager.FX_KEY_CLICK);
    return;
case SoundEffectConstants.NAVIGATION_DOWN:
  audioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_DOWN);
return;
case SoundEffectConstants.NAVIGATION_LEFT:
audioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_LEFT);
return;
case SoundEffectConstants.NAVIGATION_RIGHT:
audioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_RIGHT);
return;
case SoundEffectConstants.NAVIGATION_UP:
audioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_UP);
return;
default :
throw new IllegalArgumentException("String_Node_Str" + effectId + "String_Node_Str"+ SoundEffectConstants.class.getCanonicalName());
}
}
 catch (IllegalStateException e) {
Log.e(TAG,"String_Node_Str" + e);
e.printStackTrace();
}
}
Program: 22196
Project: 22196
Buggy source:
private void putCachedString(ResourceName name,CharSequence cs){
  establishPackageRemovedReceiver();
synchronized (sSync) {
    sStringCache.put(name,new WeakReference<CharSequence>(cs));
  }
}

Fixed version (ground truth):
private void putCachedString(ResourceName name,CharSequence cs){
synchronized (sSync) {
    sStringCache.put(name,new WeakReference<CharSequence>(cs));
  }
}
Program: 22197
Project: 22197
Buggy source:
private void putCachedIcon(ResourceName name,Drawable dr){
  establishPackageRemovedReceiver();
synchronized (sSync) {
    sIconCache.put(name,new WeakReference<Drawable>(dr));
    if (DEBUG_ICONS)     Log.v(TAG,"String_Node_Str" + name + "String_Node_Str"+ dr);
  }
}

Fixed version (ground truth):
private void putCachedIcon(ResourceName name,Drawable dr){
synchronized (sSync) {
    sIconCache.put(name,new WeakReference<Drawable>(dr));
    if (DEBUG_ICONS)     Log.v(TAG,"String_Node_Str" + name + "String_Node_Str"+ dr);
  }
}
Program: 22199
Project: 22199
Buggy source:
/** 
 * Invokes the item by calling various listeners or callbacks.
 * @return true if the invocation was handled, false otherwise
 */
public boolean invoke(){
  if (mClickListener != null && mClickListener.onMenuItemClick(this)) {
    return true;
  }
  MenuBuilder.Callback callback=mMenu.getCallback();
  if (callback != null && callback.onMenuItemSelected(mMenu.getRootMenu(),this)) {
    return true;
  }
  if (mItemCallback != null) {
    mItemCallback.run();
    return true;
  }
  if (mIntent != null) {
    mMenu.getContext().startActivity(mIntent);
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Invokes the item by calling various listeners or callbacks.
 * @return true if the invocation was handled, false otherwise
 */
public boolean invoke(){
  if (mClickListener != null && mClickListener.onMenuItemClick(this)) {
    return true;
  }
  MenuBuilder.Callback callback=mMenu.getCallback();
  if (callback != null && callback.onMenuItemSelected(mMenu.getRootMenu(),this)) {
    return true;
  }
  if (mItemCallback != null) {
    mItemCallback.run();
    return true;
  }
  if (mIntent != null) {
    try {
      mMenu.getContext().startActivity(mIntent);
      return true;
    }
 catch (    ActivityNotFoundException e) {
      Log.e(TAG,"String_Node_Str",e);
    }
  }
  return false;
}
Program: 22203
Project: 22203
Buggy source:
private void putCachedString(ResourceName name,CharSequence cs){
  establishPackageRemovedReceiver();
synchronized (sSync) {
    sStringCache.put(name,new WeakReference<CharSequence>(cs));
  }
}

Fixed version (ground truth):
private void putCachedString(ResourceName name,CharSequence cs){
synchronized (sSync) {
    sStringCache.put(name,new WeakReference<CharSequence>(cs));
  }
}
Program: 22204
Project: 22204
Buggy source:
private void putCachedIcon(ResourceName name,Drawable dr){
  establishPackageRemovedReceiver();
synchronized (sSync) {
    sIconCache.put(name,new WeakReference<Drawable>(dr));
    if (DEBUG_ICONS)     Log.v(TAG,"String_Node_Str" + name + "String_Node_Str"+ dr);
  }
}

Fixed version (ground truth):
private void putCachedIcon(ResourceName name,Drawable dr){
synchronized (sSync) {
    sIconCache.put(name,new WeakReference<Drawable>(dr));
    if (DEBUG_ICONS)     Log.v(TAG,"String_Node_Str" + name + "String_Node_Str"+ dr);
  }
}
Program: 22209
Project: 22209
Buggy source:
private void putCachedString(ResourceName name,CharSequence cs){
  establishPackageRemovedReceiver();
synchronized (sSync) {
    sStringCache.put(name,new WeakReference<CharSequence>(cs));
  }
}

Fixed version (ground truth):
private void putCachedString(ResourceName name,CharSequence cs){
synchronized (sSync) {
    sStringCache.put(name,new WeakReference<CharSequence>(cs));
  }
}
Program: 22210
Project: 22210
Buggy source:
private void putCachedIcon(ResourceName name,Drawable dr){
  establishPackageRemovedReceiver();
synchronized (sSync) {
    sIconCache.put(name,new WeakReference<Drawable>(dr));
    if (DEBUG_ICONS)     Log.v(TAG,"String_Node_Str" + name + "String_Node_Str"+ dr);
  }
}

Fixed version (ground truth):
private void putCachedIcon(ResourceName name,Drawable dr){
synchronized (sSync) {
    sIconCache.put(name,new WeakReference<Drawable>(dr));
    if (DEBUG_ICONS)     Log.v(TAG,"String_Node_Str" + name + "String_Node_Str"+ dr);
  }
}
Program: 22215
Project: 22215
Buggy source:
private void putCachedString(ResourceName name,CharSequence cs){
  establishPackageRemovedReceiver();
synchronized (sSync) {
    sStringCache.put(name,new WeakReference<CharSequence>(cs));
  }
}

Fixed version (ground truth):
private void putCachedString(ResourceName name,CharSequence cs){
synchronized (sSync) {
    sStringCache.put(name,new WeakReference<CharSequence>(cs));
  }
}
Program: 22216
Project: 22216
Buggy source:
private void putCachedIcon(ResourceName name,Drawable dr){
  establishPackageRemovedReceiver();
synchronized (sSync) {
    sIconCache.put(name,new WeakReference<Drawable>(dr));
    if (DEBUG_ICONS)     Log.v(TAG,"String_Node_Str" + name + "String_Node_Str"+ dr);
  }
}

Fixed version (ground truth):
private void putCachedIcon(ResourceName name,Drawable dr){
synchronized (sSync) {
    sIconCache.put(name,new WeakReference<Drawable>(dr));
    if (DEBUG_ICONS)     Log.v(TAG,"String_Node_Str" + name + "String_Node_Str"+ dr);
  }
}
Program: 22218
Project: 22218
Buggy source:
/** 
 * Invokes the item by calling various listeners or callbacks.
 * @return true if the invocation was handled, false otherwise
 */
public boolean invoke(){
  if (mClickListener != null && mClickListener.onMenuItemClick(this)) {
    return true;
  }
  MenuBuilder.Callback callback=mMenu.getCallback();
  if (callback != null && callback.onMenuItemSelected(mMenu.getRootMenu(),this)) {
    return true;
  }
  if (mItemCallback != null) {
    mItemCallback.run();
    return true;
  }
  if (mIntent != null) {
    mMenu.getContext().startActivity(mIntent);
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Invokes the item by calling various listeners or callbacks.
 * @return true if the invocation was handled, false otherwise
 */
public boolean invoke(){
  if (mClickListener != null && mClickListener.onMenuItemClick(this)) {
    return true;
  }
  MenuBuilder.Callback callback=mMenu.getCallback();
  if (callback != null && callback.onMenuItemSelected(mMenu.getRootMenu(),this)) {
    return true;
  }
  if (mItemCallback != null) {
    mItemCallback.run();
    return true;
  }
  if (mIntent != null) {
    try {
      mMenu.getContext().startActivity(mIntent);
      return true;
    }
 catch (    ActivityNotFoundException e) {
      Log.e(TAG,"String_Node_Str",e);
    }
  }
  return false;
}
Program: 22219
Project: 22219
Buggy source:
/** 
 * Invokes the item by calling various listeners or callbacks.
 * @return true if the invocation was handled, false otherwise
 */
public boolean invoke(){
  if (mClickListener != null && mClickListener.onMenuItemClick(this)) {
    return true;
  }
  MenuBuilder.Callback callback=mMenu.getCallback();
  if (callback != null && callback.onMenuItemSelected(mMenu.getRootMenu(),this)) {
    return true;
  }
  if (mItemCallback != null) {
    mItemCallback.run();
    return true;
  }
  if (mIntent != null) {
    mMenu.getContext().startActivity(mIntent);
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Invokes the item by calling various listeners or callbacks.
 * @return true if the invocation was handled, false otherwise
 */
public boolean invoke(){
  if (mClickListener != null && mClickListener.onMenuItemClick(this)) {
    return true;
  }
  MenuBuilder.Callback callback=mMenu.getCallback();
  if (callback != null && callback.onMenuItemSelected(mMenu.getRootMenu(),this)) {
    return true;
  }
  if (mItemCallback != null) {
    mItemCallback.run();
    return true;
  }
  if (mIntent != null) {
    try {
      mMenu.getContext().startActivity(mIntent);
      return true;
    }
 catch (    ActivityNotFoundException e) {
      Log.e(TAG,"String_Node_Str",e);
    }
  }
  return false;
}
Program: 22220
Project: 22220
Buggy source:
@Override protected void onRestoreInstanceState(Parcelable state){
  SavedState ss=(SavedState)state;
  super.onRestoreInstanceState(ss.getSuperState());
  mYear=ss.getYear();
  mMonth=ss.getMonth();
  mDay=ss.getDay();
}

Fixed version (ground truth):
@Override protected void onRestoreInstanceState(Parcelable state){
  SavedState ss=(SavedState)state;
  super.onRestoreInstanceState(ss.getSuperState());
  mYear=ss.getYear();
  mMonth=ss.getMonth();
  mDay=ss.getDay();
  updateSpinners();
}