nus-yam/ex-repair huggingface dataset:
Program: 23613
Project: 23613
Buggy source:
/** 
 * Drop a content provider from a ProcessRecord's bookkeeping
 * @param cpr
 */
public void removeContentProvider(IApplicationThread caller,String name){
synchronized (this) {
    ContentProviderRecord cpr=(ContentProviderRecord)mProvidersByName.get(name);
    if (cpr == null) {
      if (DEBUG_PROVIDER)       Log.v(TAG,name + "String_Node_Str");
      return;
    }
    final ProcessRecord r=getRecordForAppLocked(caller);
    if (r == null) {
      throw new SecurityException("String_Node_Str" + caller + "String_Node_Str"+ name);
    }
    ContentProviderRecord localCpr=(ContentProviderRecord)mProvidersByClass.get(cpr.info.name);
    if (DEBUG_PROVIDER)     Log.v(TAG,"String_Node_Str" + r.info.processName + "String_Node_Str"+ localCpr.appInfo.processName);
    if (localCpr.app == r) {
      Log.w(TAG,"String_Node_Str" + cpr.info.name + "String_Node_Str"+ r.processName);
      return;
    }
 else {
      localCpr.clients.remove(r);
      r.conProviders.remove(localCpr);
    }
    updateOomAdjLocked();
  }
}

Fixed version (ground truth):
/** 
 * Drop a content provider from a ProcessRecord's bookkeeping
 * @param cpr
 */
public void removeContentProvider(IApplicationThread caller,String name){
synchronized (this) {
    ContentProviderRecord cpr=(ContentProviderRecord)mProvidersByName.get(name);
    if (cpr == null) {
      if (DEBUG_PROVIDER)       Log.v(TAG,name + "String_Node_Str");
      return;
    }
    final ProcessRecord r=getRecordForAppLocked(caller);
    if (r == null) {
      throw new SecurityException("String_Node_Str" + caller + "String_Node_Str"+ name);
    }
    ContentProviderRecord localCpr=(ContentProviderRecord)mProvidersByClass.get(cpr.info.name);
    if (DEBUG_PROVIDER)     Log.v(TAG,"String_Node_Str" + r.info.processName + "String_Node_Str"+ localCpr.appInfo.processName);
    if (localCpr.app == r) {
      Log.w(TAG,"String_Node_Str" + cpr.info.name + "String_Node_Str"+ r.processName);
      return;
    }
 else {
      Integer cnt=r.conProviders.get(localCpr);
      if (cnt == null || cnt.intValue() <= 1) {
        localCpr.clients.remove(r);
        r.conProviders.remove(localCpr);
      }
 else {
        r.conProviders.put(localCpr,new Integer(cnt.intValue() - 1));
      }
    }
    updateOomAdjLocked();
  }
}
Program: 23615
Project: 23615
Buggy source:
final void completeRemoveProvider(IContentProvider provider){
  IBinder jBinder=provider.asBinder();
synchronized (mProviderMap) {
    ProviderRefCount prc=mProviderRefCountMap.get(jBinder);
    if (prc != null && prc.count == 0) {
      mProviderRefCountMap.remove(jBinder);
      removeProviderLocked(provider);
    }
  }
}

Fixed version (ground truth):
final void completeRemoveProvider(IContentProvider provider){
  IBinder jBinder=provider.asBinder();
  String name=null;
synchronized (mProviderMap) {
    ProviderRefCount prc=mProviderRefCountMap.get(jBinder);
    if (prc != null && prc.count == 0) {
      mProviderRefCountMap.remove(jBinder);
      name=removeProviderLocked(provider);
    }
  }
  if (name != null) {
    try {
      if (localLOGV)       Log.v(TAG,"String_Node_Str" + "String_Node_Str" + name);
      ActivityManagerNative.getDefault().removeContentProvider(getApplicationThread(),name);
    }
 catch (    RemoteException e) {
    }
  }
}
Program: 23616
Project: 23616
Buggy source:
public final void removeProviderLocked(IContentProvider provider){
  if (provider == null) {
    return;
  }
  IBinder providerBinder=provider.asBinder();
  boolean amRemoveFlag=false;
  Iterator<ProviderRecord> iter=mProviderMap.values().iterator();
  while (iter.hasNext()) {
    ProviderRecord pr=iter.next();
    IBinder myBinder=pr.mProvider.asBinder();
    if (myBinder == providerBinder) {
      if (pr.mLocalProvider != null) {
        if (localLOGV)         Log.i(TAG,"String_Node_Str");
        return;
      }
      if (localLOGV)       Log.v(TAG,"String_Node_Str" + "String_Node_Str");
      myBinder.unlinkToDeath(pr,0);
      iter.remove();
      if (!amRemoveFlag) {
        try {
          if (localLOGV)           Log.v(TAG,"String_Node_Str" + "String_Node_Str" + pr.mName);
          ActivityManagerNative.getDefault().removeContentProvider(getApplicationThread(),pr.mName);
          amRemoveFlag=true;
        }
 catch (        RemoteException e) {
        }
      }
    }
  }
}

Fixed version (ground truth):
public final String removeProviderLocked(IContentProvider provider){
  if (provider == null) {
    return null;
  }
  IBinder providerBinder=provider.asBinder();
  String name=null;
  Iterator<ProviderRecord> iter=mProviderMap.values().iterator();
  while (iter.hasNext()) {
    ProviderRecord pr=iter.next();
    IBinder myBinder=pr.mProvider.asBinder();
    if (myBinder == providerBinder) {
      if (pr.mLocalProvider != null) {
        if (localLOGV)         Log.i(TAG,"String_Node_Str");
        return name;
      }
      if (localLOGV)       Log.v(TAG,"String_Node_Str" + "String_Node_Str");
      myBinder.unlinkToDeath(pr,0);
      iter.remove();
      if (name == null) {
        name=pr.mName;
      }
    }
  }
  return name;
}
Program: 23618
Project: 23618
Buggy source:
/** 
 * Drop a content provider from a ProcessRecord's bookkeeping
 * @param cpr
 */
public void removeContentProvider(IApplicationThread caller,String name){
synchronized (this) {
    ContentProviderRecord cpr=(ContentProviderRecord)mProvidersByName.get(name);
    if (cpr == null) {
      if (DEBUG_PROVIDER)       Log.v(TAG,name + "String_Node_Str");
      return;
    }
    final ProcessRecord r=getRecordForAppLocked(caller);
    if (r == null) {
      throw new SecurityException("String_Node_Str" + caller + "String_Node_Str"+ name);
    }
    ContentProviderRecord localCpr=(ContentProviderRecord)mProvidersByClass.get(cpr.info.name);
    if (DEBUG_PROVIDER)     Log.v(TAG,"String_Node_Str" + r.info.processName + "String_Node_Str"+ localCpr.appInfo.processName);
    if (localCpr.app == r) {
      Log.w(TAG,"String_Node_Str" + cpr.info.name + "String_Node_Str"+ r.processName);
      return;
    }
 else {
      localCpr.clients.remove(r);
      r.conProviders.remove(localCpr);
    }
    updateOomAdjLocked();
  }
}

Fixed version (ground truth):
/** 
 * Drop a content provider from a ProcessRecord's bookkeeping
 * @param cpr
 */
public void removeContentProvider(IApplicationThread caller,String name){
synchronized (this) {
    ContentProviderRecord cpr=(ContentProviderRecord)mProvidersByName.get(name);
    if (cpr == null) {
      if (DEBUG_PROVIDER)       Log.v(TAG,name + "String_Node_Str");
      return;
    }
    final ProcessRecord r=getRecordForAppLocked(caller);
    if (r == null) {
      throw new SecurityException("String_Node_Str" + caller + "String_Node_Str"+ name);
    }
    ContentProviderRecord localCpr=(ContentProviderRecord)mProvidersByClass.get(cpr.info.name);
    if (DEBUG_PROVIDER)     Log.v(TAG,"String_Node_Str" + r.info.processName + "String_Node_Str"+ localCpr.appInfo.processName);
    if (localCpr.app == r) {
      Log.w(TAG,"String_Node_Str" + cpr.info.name + "String_Node_Str"+ r.processName);
      return;
    }
 else {
      Integer cnt=r.conProviders.get(localCpr);
      if (cnt == null || cnt.intValue() <= 1) {
        localCpr.clients.remove(r);
        r.conProviders.remove(localCpr);
      }
 else {
        r.conProviders.put(localCpr,new Integer(cnt.intValue() - 1));
      }
    }
    updateOomAdjLocked();
  }
}
Program: 23620
Project: 23620
Buggy source:
private static String getTitle(Context context,Uri uri,boolean followSettingsUri){
  Cursor cursor=null;
  ContentResolver res=context.getContentResolver();
  String title=null;
  if (uri != null) {
    String authority=uri.getAuthority();
    if (Settings.AUTHORITY.equals(authority)) {
      if (followSettingsUri) {
        Uri actualUri=RingtoneManager.getActualDefaultRingtoneUri(context,RingtoneManager.getDefaultType(uri));
        String actualTitle=getTitle(context,actualUri,false);
        title=context.getString(com.android.internal.R.string.ringtone_default_with_actual,actualTitle);
      }
    }
 else {
      if (DrmStore.AUTHORITY.equals(authority)) {
        cursor=res.query(uri,DRM_COLUMNS,null,null,null);
      }
 else       if (MediaStore.AUTHORITY.equals(authority)) {
        cursor=res.query(uri,MEDIA_COLUMNS,null,null,null);
      }
      if (cursor != null && cursor.getCount() == 1) {
        cursor.moveToFirst();
        return cursor.getString(2);
      }
 else {
        title=uri.getLastPathSegment();
      }
    }
  }
  if (title == null) {
    title=context.getString(com.android.internal.R.string.ringtone_unknown);
    if (title == null) {
      title="String_Node_Str";
    }
  }
  return title;
}

Fixed version (ground truth):
private static String getTitle(Context context,Uri uri,boolean followSettingsUri){
  Cursor cursor=null;
  ContentResolver res=context.getContentResolver();
  String title=null;
  if (uri != null) {
    String authority=uri.getAuthority();
    if (Settings.AUTHORITY.equals(authority)) {
      if (followSettingsUri) {
        Uri actualUri=RingtoneManager.getActualDefaultRingtoneUri(context,RingtoneManager.getDefaultType(uri));
        String actualTitle=getTitle(context,actualUri,false);
        title=context.getString(com.android.internal.R.string.ringtone_default_with_actual,actualTitle);
      }
    }
 else {
      if (DrmStore.AUTHORITY.equals(authority)) {
        cursor=res.query(uri,DRM_COLUMNS,null,null,null);
      }
 else       if (MediaStore.AUTHORITY.equals(authority)) {
        cursor=res.query(uri,MEDIA_COLUMNS,null,null,null);
      }
      try {
        if (cursor != null && cursor.getCount() == 1) {
          cursor.moveToFirst();
          return cursor.getString(2);
        }
 else {
          title=uri.getLastPathSegment();
        }
      }
  finally {
        if (cursor != null) {
          cursor.close();
        }
      }
    }
  }
  if (title == null) {
    title=context.getString(com.android.internal.R.string.ringtone_unknown);
    if (title == null) {
      title="String_Node_Str";
    }
  }
  return title;
}
Program: 23621
Project: 23621
Buggy source:
public void destroy(){
  nContextDestroy(mContext);
  mContext=0;
  nDeviceDestroy(mDev);
  mDev=0;
}

Fixed version (ground truth):
public void destroy(){
  nContextDeinitToClient();
  mMessageThread.mRun=false;
  nContextDestroy(mContext);
  mContext=0;
  nDeviceDestroy(mDev);
  mDev=0;
}
Program: 23622
Project: 23622
Buggy source:
public RenderScript(Surface sur,boolean useDepth,boolean forceSW){
  mSurface=sur;
  mDev=nDeviceCreate();
  if (forceSW) {
    nDeviceSetConfig(mDev,0,1);
  }
  mContext=nContextCreate(mDev,mSurface,0,useDepth);
  Element.initPredefined(this);
}

Fixed version (ground truth):
public RenderScript(Surface sur,boolean useDepth,boolean forceSW){
  mSurface=sur;
  mDev=nDeviceCreate();
  if (forceSW) {
    nDeviceSetConfig(mDev,0,1);
  }
  mContext=nContextCreate(mDev,mSurface,0,useDepth);
  Element.initPredefined(this);
  mMessageThread=new MessageThread(this);
  mMessageThread.start();
}
Program: 23626
Project: 23626
Buggy source:
@Override public void handleMessage(Message msg){
synchronized (this) {
    updateKeyguardLocked();
    Log.d(TAG,"String_Node_Str" + mDockState);
    mPowerManager.userActivityWithForce(SystemClock.uptimeMillis(),false,true);
    Intent intent=new Intent(Intent.ACTION_DOCK_EVENT);
    intent.putExtra(Intent.EXTRA_DOCK_STATE,mDockState);
    mContext.sendStickyOrderedBroadcast(intent,mResultReceiver,null,Activity.RESULT_OK,null,null);
  }
}

Fixed version (ground truth):
@Override public void handleMessage(Message msg){
synchronized (this) {
    Log.i(TAG,"String_Node_Str" + mDockState);
    if (Settings.Secure.getInt(mContext.getContentResolver(),Settings.Secure.DEVICE_PROVISIONED,0) == 0) {
      Log.i(TAG,"String_Node_Str");
      return;
    }
    mPowerManager.userActivityWithForce(SystemClock.uptimeMillis(),false,true);
    Intent intent=new Intent(Intent.ACTION_DOCK_EVENT);
    intent.putExtra(Intent.EXTRA_DOCK_STATE,mDockState);
    mContext.sendStickyOrderedBroadcast(intent,mResultReceiver,null,Activity.RESULT_OK,null,null);
  }
}
Program: 23627
Project: 23627
Buggy source:
private static String getTitle(Context context,Uri uri,boolean followSettingsUri){
  Cursor cursor=null;
  ContentResolver res=context.getContentResolver();
  String title=null;
  if (uri != null) {
    String authority=uri.getAuthority();
    if (Settings.AUTHORITY.equals(authority)) {
      if (followSettingsUri) {
        Uri actualUri=RingtoneManager.getActualDefaultRingtoneUri(context,RingtoneManager.getDefaultType(uri));
        String actualTitle=getTitle(context,actualUri,false);
        title=context.getString(com.android.internal.R.string.ringtone_default_with_actual,actualTitle);
      }
    }
 else {
      if (DrmStore.AUTHORITY.equals(authority)) {
        cursor=res.query(uri,DRM_COLUMNS,null,null,null);
      }
 else       if (MediaStore.AUTHORITY.equals(authority)) {
        cursor=res.query(uri,MEDIA_COLUMNS,null,null,null);
      }
      if (cursor != null && cursor.getCount() == 1) {
        cursor.moveToFirst();
        return cursor.getString(2);
      }
 else {
        title=uri.getLastPathSegment();
      }
    }
  }
  if (title == null) {
    title=context.getString(com.android.internal.R.string.ringtone_unknown);
    if (title == null) {
      title="String_Node_Str";
    }
  }
  return title;
}

Fixed version (ground truth):
private static String getTitle(Context context,Uri uri,boolean followSettingsUri){
  Cursor cursor=null;
  ContentResolver res=context.getContentResolver();
  String title=null;
  if (uri != null) {
    String authority=uri.getAuthority();
    if (Settings.AUTHORITY.equals(authority)) {
      if (followSettingsUri) {
        Uri actualUri=RingtoneManager.getActualDefaultRingtoneUri(context,RingtoneManager.getDefaultType(uri));
        String actualTitle=getTitle(context,actualUri,false);
        title=context.getString(com.android.internal.R.string.ringtone_default_with_actual,actualTitle);
      }
    }
 else {
      if (DrmStore.AUTHORITY.equals(authority)) {
        cursor=res.query(uri,DRM_COLUMNS,null,null,null);
      }
 else       if (MediaStore.AUTHORITY.equals(authority)) {
        cursor=res.query(uri,MEDIA_COLUMNS,null,null,null);
      }
      try {
        if (cursor != null && cursor.getCount() == 1) {
          cursor.moveToFirst();
          return cursor.getString(2);
        }
 else {
          title=uri.getLastPathSegment();
        }
      }
  finally {
        if (cursor != null) {
          cursor.close();
        }
      }
    }
  }
  if (title == null) {
    title=context.getString(com.android.internal.R.string.ringtone_unknown);
    if (title == null) {
      title="String_Node_Str";
    }
  }
  return title;
}
Program: 23632
Project: 23632
Buggy source:
private boolean parseAllMetaData(Resources res,XmlPullParser parser,AttributeSet attrs,String tag,Component outInfo,String[] outError) throws XmlPullParserException, IOException {
  int outerDepth=parser.getDepth();
  int type;
  while ((type=parser.next()) != XmlPullParser.END_DOCUMENT && (type != XmlPullParser.END_TAG || parser.getDepth() > outerDepth)) {
    if (type == XmlPullParser.END_TAG || type == XmlPullParser.TEXT) {
      continue;
    }
    if (parser.getName().equals("String_Node_Str")) {
      if ((outInfo.metaData=parseMetaData(res,parser,attrs,outInfo.metaData,outError)) == null) {
        return false;
      }
    }
 else {
      if (!RIGID_PARSER) {
        Log.w(TAG,"String_Node_Str" + mArchiveSourcePath + "String_Node_Str");
        Log.w(TAG,"String_Node_Str" + tag + "String_Node_Str"+ parser.getName());
        XmlUtils.skipCurrentTag(parser);
        continue;
      }
      outError[0]="String_Node_Str" + tag + "String_Node_Str"+ parser.getName();
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean parseAllMetaData(Resources res,XmlPullParser parser,AttributeSet attrs,String tag,Component outInfo,String[] outError) throws XmlPullParserException, IOException {
  int outerDepth=parser.getDepth();
  int type;
  while ((type=parser.next()) != XmlPullParser.END_DOCUMENT && (type != XmlPullParser.END_TAG || parser.getDepth() > outerDepth)) {
    if (type == XmlPullParser.END_TAG || type == XmlPullParser.TEXT) {
      continue;
    }
    if (parser.getName().equals("String_Node_Str")) {
      if ((outInfo.metaData=parseMetaData(res,parser,attrs,outInfo.metaData,outError)) == null) {
        return false;
      }
    }
 else {
      if (!RIGID_PARSER) {
        Log.w(TAG,"String_Node_Str" + tag + "String_Node_Str"+ parser.getName()+ "String_Node_Str"+ mArchiveSourcePath+ "String_Node_Str"+ parser.getPositionDescription());
        XmlUtils.skipCurrentTag(parser);
        continue;
      }
      outError[0]="String_Node_Str" + tag + "String_Node_Str"+ parser.getName();
      return false;
    }
  }
  return true;
}
Program: 23637
Project: 23637
Buggy source:
/** 
 * Convenience function to retrieve the bookmarked Intent for a particular shortcut key.
 * @param cr The ContentResolver to query.
 * @param shortcut The shortcut key.
 * @return Intent The bookmarked URL, or null if there is no bookmarkmatching the given shortcut.
 */
public static Intent getIntentForShortcut(ContentResolver cr,char shortcut){
  Intent intent=null;
  Cursor c=cr.query(CONTENT_URI,sIntentProjection,sShortcutSelection,new String[]{String.valueOf((int)shortcut)},ORDERING);
  try {
    while (intent == null && c.moveToNext()) {
      try {
        String intentURI=c.getString(c.getColumnIndexOrThrow(INTENT));
        intent=Intent.getIntent(intentURI);
      }
 catch (      java.net.URISyntaxException e) {
      }
catch (      IllegalArgumentException e) {
        Log.e(TAG,"String_Node_Str",e);
      }
    }
  }
  finally {
    if (c != null)     c.close();
  }
  return intent;
}

Fixed version (ground truth):
/** 
 * Convenience function to retrieve the bookmarked Intent for a particular shortcut key.
 * @param cr The ContentResolver to query.
 * @param shortcut The shortcut key.
 * @return Intent The bookmarked URL, or null if there is no bookmarkmatching the given shortcut.
 */
public static Intent getIntentForShortcut(ContentResolver cr,char shortcut){
  Intent intent=null;
  Cursor c=cr.query(CONTENT_URI,sIntentProjection,sShortcutSelection,new String[]{String.valueOf((int)shortcut)},ORDERING);
  try {
    while (intent == null && c.moveToNext()) {
      try {
        String intentURI=c.getString(c.getColumnIndexOrThrow(INTENT));
        intent=Intent.getIntent(intentURI);
      }
 catch (      java.net.URISyntaxException e) {
      }
catch (      IllegalArgumentException e) {
        Log.w(TAG,"String_Node_Str",e);
      }
    }
  }
  finally {
    if (c != null)     c.close();
  }
  return intent;
}
Program: 23639
Project: 23639
Buggy source:
View createUnlockScreenFor(UnlockMode unlockMode){
  if (unlockMode == UnlockMode.Pattern) {
    return new UnlockScreen(mContext,mLockPatternUtils,mUpdateMonitor,mKeyguardScreenCallback,mUpdateMonitor.getFailedAttempts(),mEnableFallback);
  }
 else   if (unlockMode == UnlockMode.SimPin) {
    return new SimUnlockScreen(mContext,mUpdateMonitor,mKeyguardScreenCallback);
  }
 else   if (unlockMode == UnlockMode.Account) {
    try {
      return new AccountUnlockScreen(mContext,mKeyguardScreenCallback,mLockPatternUtils);
    }
 catch (    IllegalStateException e) {
      Log.i(TAG,"String_Node_Str" + "String_Node_Str");
      return createUnlockScreenFor(UnlockMode.Pattern);
    }
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + unlockMode);
  }
}

Fixed version (ground truth):
View createUnlockScreenFor(UnlockMode unlockMode){
  if (unlockMode == UnlockMode.Pattern) {
    UnlockScreen view=new UnlockScreen(mContext,mLockPatternUtils,mUpdateMonitor,mKeyguardScreenCallback,mUpdateMonitor.getFailedAttempts());
    view.setEnableFallback(mEnableFallback);
    return view;
  }
 else   if (unlockMode == UnlockMode.SimPin) {
    return new SimUnlockScreen(mContext,mUpdateMonitor,mKeyguardScreenCallback);
  }
 else   if (unlockMode == UnlockMode.Account) {
    try {
      return new AccountUnlockScreen(mContext,mKeyguardScreenCallback,mLockPatternUtils);
    }
 catch (    IllegalStateException e) {
      Log.i(TAG,"String_Node_Str" + "String_Node_Str");
      return createUnlockScreenFor(UnlockMode.Pattern);
    }
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + unlockMode);
  }
}
Program: 23643
Project: 23643
Buggy source:
/** 
 * Trigger a dialog that lists the various methods of interacting with the requested   {@link Contacts} entry. This may be based on available{@link Data} rows under that contact, and may also include socialstatus and presence details.
 * @param context The parent {@link Context} that may be used as theparent for this dialog.
 * @param target Specific {@link Rect} that this dialog should becentered around, in screen coordinates. In particular, if the dialog has a "callout" arrow, it will be pointed and centered around this  {@link Rect}.
 * @param lookupUri A {@link Contacts#CONTENT_LOOKUP_URI} style{@link Uri} that describes a specific contact to featurein this dialog.
 * @param mode Any of {@link #MODE_SMALL},   {@link #MODE_MEDIUM}, or  {@link #MODE_LARGE}, indicating the desired dialog size, when supported.
 * @param excludeMimes Optional list of {@link Data#MIMETYPE} MIME-typesto exclude when showing this dialog. For example, when already viewing the contact details card, this can be used to omit the details entry from the dialog.
 */
public static void showQuickContact(Context context,Rect target,Uri lookupUri,int mode,String[] excludeMimes){
  final Intent intent=new Intent(ACTION_QUICK_CONTACT);
  intent.setData(lookupUri);
  intent.putExtra(EXTRA_TARGET_RECT,target);
  intent.putExtra(EXTRA_MODE,mode);
  intent.putExtra(EXTRA_EXCLUDE_MIMES,excludeMimes);
  intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
  context.startActivity(intent);
}

Fixed version (ground truth):
/** 
 * Trigger a dialog that lists the various methods of interacting with the requested   {@link Contacts} entry. This may be based on available{@link Data} rows under that contact, and may also include socialstatus and presence details.
 * @param context The parent {@link Context} that may be used as theparent for this dialog.
 * @param target Specific {@link Rect} that this dialog should becentered around, in screen coordinates. In particular, if the dialog has a "callout" arrow, it will be pointed and centered around this  {@link Rect}.
 * @param lookupUri A {@link ContactsContract.Contacts#CONTENT_LOOKUP_URI} style{@link Uri} that describes a specific contact to featurein this dialog.
 * @param mode Any of {@link #MODE_SMALL},   {@link #MODE_MEDIUM}, or  {@link #MODE_LARGE}, indicating the desired dialog size, when supported.
 * @param excludeMimes Optional list of {@link Data#MIMETYPE} MIME-typesto exclude when showing this dialog. For example, when already viewing the contact details card, this can be used to omit the details entry from the dialog.
 */
public static void showQuickContact(Context context,Rect target,Uri lookupUri,int mode,String[] excludeMimes){
  final Intent intent=new Intent(ACTION_QUICK_CONTACT);
  intent.setData(lookupUri);
  intent.putExtra(EXTRA_TARGET_RECT,target);
  intent.putExtra(EXTRA_MODE,mode);
  intent.putExtra(EXTRA_EXCLUDE_MIMES,excludeMimes);
  intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
  context.startActivity(intent);
}
Program: 23644
Project: 23644
Buggy source:
public void saveMiniThumbToFile(byte[] data,long id,long magic) throws IOException {
  RandomAccessFile r=miniThumbDataFile();
  if (r == null)   return;
  long pos=id * BYTES_PER_MINTHUMB;
  FileLock lock=null;
  try {
    if (data != null) {
      if (data.length > BYTES_PER_MINTHUMB - HEADER_SIZE) {
        return;
      }
      mBuffer.clear();
      mBuffer.put((byte)1);
      mBuffer.putLong(magic);
      mBuffer.putInt(data.length);
      mBuffer.put(data);
      mBuffer.flip();
      lock=mChannel.lock(pos,BYTES_PER_MINTHUMB,false);
      mChannel.write(mBuffer,pos);
    }
  }
 catch (  IOException ex) {
    Log.e(TAG,"String_Node_Str" + id + "String_Node_Str",ex);
    throw ex;
  }
catch (  RuntimeException ex) {
    Log.e(TAG,"String_Node_Str" + id + "String_Node_Str"+ ex.getClass());
  }
 finally {
    try {
      if (lock != null)       lock.release();
    }
 catch (    IOException ex) {
    }
  }
}

Fixed version (ground truth):
public synchronized void saveMiniThumbToFile(byte[] data,long id,long magic) throws IOException {
  RandomAccessFile r=miniThumbDataFile();
  if (r == null)   return;
  long pos=id * BYTES_PER_MINTHUMB;
  FileLock lock=null;
  try {
    if (data != null) {
      if (data.length > BYTES_PER_MINTHUMB - HEADER_SIZE) {
        return;
      }
      mBuffer.clear();
      mBuffer.put((byte)1);
      mBuffer.putLong(magic);
      mBuffer.putInt(data.length);
      mBuffer.put(data);
      mBuffer.flip();
      lock=mChannel.lock(pos,BYTES_PER_MINTHUMB,false);
      mChannel.write(mBuffer,pos);
    }
  }
 catch (  IOException ex) {
    Log.e(TAG,"String_Node_Str" + id + "String_Node_Str",ex);
    throw ex;
  }
catch (  RuntimeException ex) {
    Log.e(TAG,"String_Node_Str" + id + "String_Node_Str"+ ex.getClass());
  }
 finally {
    try {
      if (lock != null)       lock.release();
    }
 catch (    IOException ex) {
    }
  }
}
Program: 23645
Project: 23645
Buggy source:
/** 
 * We store different types of thumbnails in different files. To remain backward compatibility, we should hashcode of content://media/external/images/media remains the same.
 */
public static synchronized void reset(){
  sThumbFiles.clear();
}

Fixed version (ground truth):
/** 
 * We store different types of thumbnails in different files. To remain backward compatibility, we should hashcode of content://media/external/images/media remains the same.
 */
public static synchronized void reset(){
  for (  MiniThumbFile file : sThumbFiles.values()) {
    file.deactivate();
  }
  sThumbFiles.clear();
}
Program: 23646
Project: 23646
Buggy source:
/** 
 * Gallery app can use this method to retrieve mini-thumbnail. Full size images share the same IDs with their corresponding thumbnails.
 * @param id the ID of the image (same of full size image).
 * @param data the buffer to store mini-thumbnail.
 */
public byte[] getMiniThumbFromFile(long id,byte[] data){
  RandomAccessFile r=miniThumbDataFile();
  if (r == null)   return null;
  long pos=id * BYTES_PER_MINTHUMB;
  FileLock lock=null;
  try {
    mBuffer.clear();
    lock=mChannel.lock(pos,BYTES_PER_MINTHUMB,true);
    int size=mChannel.read(mBuffer,pos);
    if (size > 1 + 8 + 4) {
      mBuffer.position(0);
      byte flag=mBuffer.get();
      long magic=mBuffer.getLong();
      int length=mBuffer.getInt();
      if (size >= 1 + 8 + 4+ length && data.length >= length) {
        mBuffer.get(data,0,length);
        return data;
      }
    }
  }
 catch (  IOException ex) {
    Log.w(TAG,"String_Node_Str" + id + "String_Node_Str"+ ex);
  }
catch (  RuntimeException ex) {
    Log.e(TAG,"String_Node_Str" + id + "String_Node_Str"+ ex.getClass());
  }
 finally {
    try {
      if (lock != null)       lock.release();
    }
 catch (    IOException ex) {
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Gallery app can use this method to retrieve mini-thumbnail. Full size images share the same IDs with their corresponding thumbnails.
 * @param id the ID of the image (same of full size image).
 * @param data the buffer to store mini-thumbnail.
 */
public synchronized byte[] getMiniThumbFromFile(long id,byte[] data){
  RandomAccessFile r=miniThumbDataFile();
  if (r == null)   return null;
  long pos=id * BYTES_PER_MINTHUMB;
  FileLock lock=null;
  try {
    mBuffer.clear();
    lock=mChannel.lock(pos,BYTES_PER_MINTHUMB,true);
    int size=mChannel.read(mBuffer,pos);
    if (size > 1 + 8 + 4) {
      mBuffer.position(0);
      byte flag=mBuffer.get();
      long magic=mBuffer.getLong();
      int length=mBuffer.getInt();
      if (size >= 1 + 8 + 4+ length && data.length >= length) {
        mBuffer.get(data,0,length);
        return data;
      }
    }
  }
 catch (  IOException ex) {
    Log.w(TAG,"String_Node_Str" + id + "String_Node_Str"+ ex);
  }
catch (  RuntimeException ex) {
    Log.e(TAG,"String_Node_Str" + id + "String_Node_Str"+ ex.getClass());
  }
 finally {
    try {
      if (lock != null)       lock.release();
    }
 catch (    IOException ex) {
    }
  }
  return null;
}
Program: 23647
Project: 23647
Buggy source:
public long getMagic(long id){
  RandomAccessFile r=miniThumbDataFile();
  if (r != null) {
    long pos=id * BYTES_PER_MINTHUMB;
    FileLock lock=null;
    try {
      mBuffer.clear();
      mBuffer.limit(1 + 8);
      lock=mChannel.lock(pos,1 + 8,true);
      if (mChannel.read(mBuffer,pos) == 9) {
        mBuffer.position(0);
        if (mBuffer.get() == 1) {
          return mBuffer.getLong();
        }
      }
    }
 catch (    IOException ex) {
      Log.v(TAG,"String_Node_Str",ex);
    }
catch (    RuntimeException ex) {
      Log.e(TAG,"String_Node_Str" + id + "String_Node_Str"+ ex.getClass());
    }
 finally {
      try {
        if (lock != null)         lock.release();
      }
 catch (      IOException ex) {
      }
    }
  }
  return 0;
}

Fixed version (ground truth):
public synchronized long getMagic(long id){
  RandomAccessFile r=miniThumbDataFile();
  if (r != null) {
    long pos=id * BYTES_PER_MINTHUMB;
    FileLock lock=null;
    try {
      mBuffer.clear();
      mBuffer.limit(1 + 8);
      lock=mChannel.lock(pos,1 + 8,true);
      if (mChannel.read(mBuffer,pos) == 9) {
        mBuffer.position(0);
        if (mBuffer.get() == 1) {
          return mBuffer.getLong();
        }
      }
    }
 catch (    IOException ex) {
      Log.v(TAG,"String_Node_Str",ex);
    }
catch (    RuntimeException ex) {
      Log.e(TAG,"String_Node_Str" + id + "String_Node_Str"+ ex.getClass());
    }
 finally {
      try {
        if (lock != null)         lock.release();
      }
 catch (      IOException ex) {
      }
    }
  }
  return 0;
}
Program: 23649
Project: 23649
Buggy source:
/** 
 * Once we know that we have asked an application to put an activity in the resumed state (either by launching it or explicitly telling it), this function updates the rest of our state to match that fact.
 */
private final void completeResumeLocked(HistoryRecord next){
  next.idle=false;
  next.results=null;
  next.newIntents=null;
  Message msg=mHandler.obtainMessage(IDLE_TIMEOUT_MSG);
  msg.obj=next;
  mHandler.sendMessageDelayed(msg,IDLE_TIMEOUT);
  if (false) {
    msg=mHandler.obtainMessage(IDLE_NOW_MSG);
    msg.obj=next;
    mHandler.sendMessage(msg);
  }
  reportResumedActivity(next);
  next.thumbnail=null;
  setFocusedActivityLocked(next);
  next.resumeKeyDispatchingLocked();
  ensureActivitiesVisibleLocked(null,0);
  mWindowManager.executeAppTransition();
  mNoAnimActivities.clear();
  if (next.app != null) {
synchronized (mProcessStatsThread) {
      next.cpuTimeAtResume=mProcessStats.getCpuTimeForPid(next.app.pid);
    }
  }
 else {
    next.cpuTimeAtResume=0;
  }
}

Fixed version (ground truth):
/** 
 * Once we know that we have asked an application to put an activity in the resumed state (either by launching it or explicitly telling it), this function updates the rest of our state to match that fact.
 */
private final void completeResumeLocked(HistoryRecord next){
  next.idle=false;
  next.results=null;
  next.newIntents=null;
  Message msg=mHandler.obtainMessage(IDLE_TIMEOUT_MSG);
  msg.obj=next;
  mHandler.sendMessageDelayed(msg,IDLE_TIMEOUT);
  if (false) {
    msg=mHandler.obtainMessage(IDLE_NOW_MSG);
    msg.obj=next;
    mHandler.sendMessage(msg);
  }
  reportResumedActivityLocked(next);
  next.thumbnail=null;
  setFocusedActivityLocked(next);
  next.resumeKeyDispatchingLocked();
  ensureActivitiesVisibleLocked(null,0);
  mWindowManager.executeAppTransition();
  mNoAnimActivities.clear();
  if (next.app != null) {
synchronized (mProcessStatsThread) {
      next.cpuTimeAtResume=mProcessStats.getCpuTimeForPid(next.app.pid);
    }
  }
 else {
    next.cpuTimeAtResume=0;
  }
}
Program: 23650
Project: 23650
Buggy source:
private final boolean relaunchActivityLocked(HistoryRecord r,int changes,boolean andResume){
  List<ResultInfo> results=null;
  List<Intent> newIntents=null;
  if (andResume) {
    results=r.results;
    newIntents=r.newIntents;
  }
  if (DEBUG_SWITCH)   Log.v(TAG,"String_Node_Str" + r + "String_Node_Str"+ results+ "String_Node_Str"+ newIntents+ "String_Node_Str"+ andResume);
  EventLog.writeEvent(andResume ? LOG_AM_RELAUNCH_RESUME_ACTIVITY : LOG_AM_RELAUNCH_ACTIVITY,System.identityHashCode(r),r.task.taskId,r.shortComponentName);
  r.startFreezingScreenLocked(r.app,0);
  try {
    if (DEBUG_SWITCH)     Log.i(TAG,"String_Node_Str" + r);
    r.app.thread.scheduleRelaunchActivity(r,results,newIntents,changes,!andResume);
  }
 catch (  RemoteException e) {
    return false;
  }
  if (andResume) {
    r.results=null;
    r.newIntents=null;
  }
  return true;
}

Fixed version (ground truth):
private final boolean relaunchActivityLocked(HistoryRecord r,int changes,boolean andResume){
  List<ResultInfo> results=null;
  List<Intent> newIntents=null;
  if (andResume) {
    results=r.results;
    newIntents=r.newIntents;
  }
  if (DEBUG_SWITCH)   Log.v(TAG,"String_Node_Str" + r + "String_Node_Str"+ results+ "String_Node_Str"+ newIntents+ "String_Node_Str"+ andResume);
  EventLog.writeEvent(andResume ? LOG_AM_RELAUNCH_RESUME_ACTIVITY : LOG_AM_RELAUNCH_ACTIVITY,System.identityHashCode(r),r.task.taskId,r.shortComponentName);
  r.startFreezingScreenLocked(r.app,0);
  try {
    if (DEBUG_SWITCH)     Log.i(TAG,"String_Node_Str" + r);
    r.app.thread.scheduleRelaunchActivity(r,results,newIntents,changes,!andResume);
  }
 catch (  RemoteException e) {
    return false;
  }
  if (andResume) {
    r.results=null;
    r.newIntents=null;
    reportResumedActivityLocked(r);
  }
  return true;
}
Program: 23655
Project: 23655
Buggy source:
private boolean parseAllMetaData(Resources res,XmlPullParser parser,AttributeSet attrs,String tag,Component outInfo,String[] outError) throws XmlPullParserException, IOException {
  int outerDepth=parser.getDepth();
  int type;
  while ((type=parser.next()) != XmlPullParser.END_DOCUMENT && (type != XmlPullParser.END_TAG || parser.getDepth() > outerDepth)) {
    if (type == XmlPullParser.END_TAG || type == XmlPullParser.TEXT) {
      continue;
    }
    if (parser.getName().equals("String_Node_Str")) {
      if ((outInfo.metaData=parseMetaData(res,parser,attrs,outInfo.metaData,outError)) == null) {
        return false;
      }
    }
 else {
      if (!RIGID_PARSER) {
        Log.w(TAG,"String_Node_Str" + mArchiveSourcePath + "String_Node_Str");
        Log.w(TAG,"String_Node_Str" + tag + "String_Node_Str"+ parser.getName());
        XmlUtils.skipCurrentTag(parser);
        continue;
      }
      outError[0]="String_Node_Str" + tag + "String_Node_Str"+ parser.getName();
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean parseAllMetaData(Resources res,XmlPullParser parser,AttributeSet attrs,String tag,Component outInfo,String[] outError) throws XmlPullParserException, IOException {
  int outerDepth=parser.getDepth();
  int type;
  while ((type=parser.next()) != XmlPullParser.END_DOCUMENT && (type != XmlPullParser.END_TAG || parser.getDepth() > outerDepth)) {
    if (type == XmlPullParser.END_TAG || type == XmlPullParser.TEXT) {
      continue;
    }
    if (parser.getName().equals("String_Node_Str")) {
      if ((outInfo.metaData=parseMetaData(res,parser,attrs,outInfo.metaData,outError)) == null) {
        return false;
      }
    }
 else {
      if (!RIGID_PARSER) {
        Log.w(TAG,"String_Node_Str" + tag + "String_Node_Str"+ parser.getName()+ "String_Node_Str"+ mArchiveSourcePath+ "String_Node_Str"+ parser.getPositionDescription());
        XmlUtils.skipCurrentTag(parser);
        continue;
      }
      outError[0]="String_Node_Str" + tag + "String_Node_Str"+ parser.getName();
      return false;
    }
  }
  return true;
}
Program: 23660
Project: 23660
Buggy source:
/** 
 * Convenience function to retrieve the bookmarked Intent for a particular shortcut key.
 * @param cr The ContentResolver to query.
 * @param shortcut The shortcut key.
 * @return Intent The bookmarked URL, or null if there is no bookmarkmatching the given shortcut.
 */
public static Intent getIntentForShortcut(ContentResolver cr,char shortcut){
  Intent intent=null;
  Cursor c=cr.query(CONTENT_URI,sIntentProjection,sShortcutSelection,new String[]{String.valueOf((int)shortcut)},ORDERING);
  try {
    while (intent == null && c.moveToNext()) {
      try {
        String intentURI=c.getString(c.getColumnIndexOrThrow(INTENT));
        intent=Intent.getIntent(intentURI);
      }
 catch (      java.net.URISyntaxException e) {
      }
catch (      IllegalArgumentException e) {
        Log.e(TAG,"String_Node_Str",e);
      }
    }
  }
  finally {
    if (c != null)     c.close();
  }
  return intent;
}

Fixed version (ground truth):
/** 
 * Convenience function to retrieve the bookmarked Intent for a particular shortcut key.
 * @param cr The ContentResolver to query.
 * @param shortcut The shortcut key.
 * @return Intent The bookmarked URL, or null if there is no bookmarkmatching the given shortcut.
 */
public static Intent getIntentForShortcut(ContentResolver cr,char shortcut){
  Intent intent=null;
  Cursor c=cr.query(CONTENT_URI,sIntentProjection,sShortcutSelection,new String[]{String.valueOf((int)shortcut)},ORDERING);
  try {
    while (intent == null && c.moveToNext()) {
      try {
        String intentURI=c.getString(c.getColumnIndexOrThrow(INTENT));
        intent=Intent.getIntent(intentURI);
      }
 catch (      java.net.URISyntaxException e) {
      }
catch (      IllegalArgumentException e) {
        Log.w(TAG,"String_Node_Str",e);
      }
    }
  }
  finally {
    if (c != null)     c.close();
  }
  return intent;
}
Program: 23665
Project: 23665
Buggy source:
private boolean parseAllMetaData(Resources res,XmlPullParser parser,AttributeSet attrs,String tag,Component outInfo,String[] outError) throws XmlPullParserException, IOException {
  int outerDepth=parser.getDepth();
  int type;
  while ((type=parser.next()) != XmlPullParser.END_DOCUMENT && (type != XmlPullParser.END_TAG || parser.getDepth() > outerDepth)) {
    if (type == XmlPullParser.END_TAG || type == XmlPullParser.TEXT) {
      continue;
    }
    if (parser.getName().equals("String_Node_Str")) {
      if ((outInfo.metaData=parseMetaData(res,parser,attrs,outInfo.metaData,outError)) == null) {
        return false;
      }
    }
 else {
      if (!RIGID_PARSER) {
        Log.w(TAG,"String_Node_Str" + mArchiveSourcePath + "String_Node_Str");
        Log.w(TAG,"String_Node_Str" + tag + "String_Node_Str"+ parser.getName());
        XmlUtils.skipCurrentTag(parser);
        continue;
      }
      outError[0]="String_Node_Str" + tag + "String_Node_Str"+ parser.getName();
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean parseAllMetaData(Resources res,XmlPullParser parser,AttributeSet attrs,String tag,Component outInfo,String[] outError) throws XmlPullParserException, IOException {
  int outerDepth=parser.getDepth();
  int type;
  while ((type=parser.next()) != XmlPullParser.END_DOCUMENT && (type != XmlPullParser.END_TAG || parser.getDepth() > outerDepth)) {
    if (type == XmlPullParser.END_TAG || type == XmlPullParser.TEXT) {
      continue;
    }
    if (parser.getName().equals("String_Node_Str")) {
      if ((outInfo.metaData=parseMetaData(res,parser,attrs,outInfo.metaData,outError)) == null) {
        return false;
      }
    }
 else {
      if (!RIGID_PARSER) {
        Log.w(TAG,"String_Node_Str" + tag + "String_Node_Str"+ parser.getName()+ "String_Node_Str"+ mArchiveSourcePath+ "String_Node_Str"+ parser.getPositionDescription());
        XmlUtils.skipCurrentTag(parser);
        continue;
      }
      outError[0]="String_Node_Str" + tag + "String_Node_Str"+ parser.getName();
      return false;
    }
  }
  return true;
}
Program: 23670
Project: 23670
Buggy source:
/** 
 * Convenience function to retrieve the bookmarked Intent for a particular shortcut key.
 * @param cr The ContentResolver to query.
 * @param shortcut The shortcut key.
 * @return Intent The bookmarked URL, or null if there is no bookmarkmatching the given shortcut.
 */
public static Intent getIntentForShortcut(ContentResolver cr,char shortcut){
  Intent intent=null;
  Cursor c=cr.query(CONTENT_URI,sIntentProjection,sShortcutSelection,new String[]{String.valueOf((int)shortcut)},ORDERING);
  try {
    while (intent == null && c.moveToNext()) {
      try {
        String intentURI=c.getString(c.getColumnIndexOrThrow(INTENT));
        intent=Intent.getIntent(intentURI);
      }
 catch (      java.net.URISyntaxException e) {
      }
catch (      IllegalArgumentException e) {
        Log.e(TAG,"String_Node_Str",e);
      }
    }
  }
  finally {
    if (c != null)     c.close();
  }
  return intent;
}

Fixed version (ground truth):
/** 
 * Convenience function to retrieve the bookmarked Intent for a particular shortcut key.
 * @param cr The ContentResolver to query.
 * @param shortcut The shortcut key.
 * @return Intent The bookmarked URL, or null if there is no bookmarkmatching the given shortcut.
 */
public static Intent getIntentForShortcut(ContentResolver cr,char shortcut){
  Intent intent=null;
  Cursor c=cr.query(CONTENT_URI,sIntentProjection,sShortcutSelection,new String[]{String.valueOf((int)shortcut)},ORDERING);
  try {
    while (intent == null && c.moveToNext()) {
      try {
        String intentURI=c.getString(c.getColumnIndexOrThrow(INTENT));
        intent=Intent.getIntent(intentURI);
      }
 catch (      java.net.URISyntaxException e) {
      }
catch (      IllegalArgumentException e) {
        Log.w(TAG,"String_Node_Str",e);
      }
    }
  }
  finally {
    if (c != null)     c.close();
  }
  return intent;
}
Program: 23672
Project: 23672
Buggy source:
View createUnlockScreenFor(UnlockMode unlockMode){
  if (unlockMode == UnlockMode.Pattern) {
    return new UnlockScreen(mContext,mLockPatternUtils,mUpdateMonitor,mKeyguardScreenCallback,mUpdateMonitor.getFailedAttempts(),mEnableFallback);
  }
 else   if (unlockMode == UnlockMode.SimPin) {
    return new SimUnlockScreen(mContext,mUpdateMonitor,mKeyguardScreenCallback);
  }
 else   if (unlockMode == UnlockMode.Account) {
    try {
      return new AccountUnlockScreen(mContext,mKeyguardScreenCallback,mLockPatternUtils);
    }
 catch (    IllegalStateException e) {
      Log.i(TAG,"String_Node_Str" + "String_Node_Str");
      return createUnlockScreenFor(UnlockMode.Pattern);
    }
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + unlockMode);
  }
}

Fixed version (ground truth):
View createUnlockScreenFor(UnlockMode unlockMode){
  if (unlockMode == UnlockMode.Pattern) {
    UnlockScreen view=new UnlockScreen(mContext,mLockPatternUtils,mUpdateMonitor,mKeyguardScreenCallback,mUpdateMonitor.getFailedAttempts());
    view.setEnableFallback(mEnableFallback);
    return view;
  }
 else   if (unlockMode == UnlockMode.SimPin) {
    return new SimUnlockScreen(mContext,mUpdateMonitor,mKeyguardScreenCallback);
  }
 else   if (unlockMode == UnlockMode.Account) {
    try {
      return new AccountUnlockScreen(mContext,mKeyguardScreenCallback,mLockPatternUtils);
    }
 catch (    IllegalStateException e) {
      Log.i(TAG,"String_Node_Str" + "String_Node_Str");
      return createUnlockScreenFor(UnlockMode.Pattern);
    }
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + unlockMode);
  }
}
Program: 23674
Project: 23674
Buggy source:
/** 
 * Plays a sound effect (Key clicks, lid open/close...)
 * @param effectType The type of sound effect. One of{@link #FX_KEY_CLICK},  {@link #FX_FOCUS_NAVIGATION_UP},  {@link #FX_FOCUS_NAVIGATION_DOWN},  {@link #FX_FOCUS_NAVIGATION_LEFT},  {@link #FX_FOCUS_NAVIGATION_RIGHT},  {@link #FX_KEYPRESS_STANDARD},  {@link #FX_KEYPRESS_SPACEBAR},  {@link #FX_KEYPRESS_DELETE},  {@link #FX_KEYPRESS_RETURN},
 * @param volume Sound effect volumeNOTE: This version is for applications that have their own settings panel for enabling and controlling volume.
 */
public void playSoundEffect(int effectType,float volume){
  if (effectType < 0 || effectType >= NUM_SOUND_EFFECTS) {
    return;
  }
  IAudioService service=getService();
  try {
    service.playSoundEffectVolume(effectType,volume);
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str" + e);
  }
}

Fixed version (ground truth):
/** 
 * Plays a sound effect (Key clicks, lid open/close...)
 * @param effectType The type of sound effect. One of{@link #FX_KEY_CLICK},  {@link #FX_FOCUS_NAVIGATION_UP},  {@link #FX_FOCUS_NAVIGATION_DOWN},  {@link #FX_FOCUS_NAVIGATION_LEFT},  {@link #FX_FOCUS_NAVIGATION_RIGHT},  {@link #FX_KEYPRESS_STANDARD},  {@link #FX_KEYPRESS_SPACEBAR},  {@link #FX_KEYPRESS_DELETE},  {@link #FX_KEYPRESS_RETURN},
 * @param volume Sound effect volume.The volume value is a raw scalar so UI controls should be scaled logarithmically. If a volume of -1 is specified, the AudioManager.STREAM_MUSIC stream volume minus 3dB will be used. NOTE: This version is for applications that have their own settings panel for enabling and controlling volume.
 */
public void playSoundEffect(int effectType,float volume){
  if (effectType < 0 || effectType >= NUM_SOUND_EFFECTS) {
    return;
  }
  IAudioService service=getService();
  try {
    service.playSoundEffectVolume(effectType,volume);
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str" + e);
  }
}
Program: 23676
Project: 23676
Buggy source:
/** 
 * Loads samples into the soundpool. This method must be called at when sound effects are enabled
 */
public boolean loadSoundEffects(){
synchronized (mSoundEffectsLock) {
    mSoundPool=new SoundPool(NUM_SOUNDPOOL_CHANNELS,AudioSystem.STREAM_SYSTEM,0);
    if (mSoundPool == null) {
      return false;
    }
    int[] poolId=new int[SOUND_EFFECT_FILES.length];
    for (int fileIdx=0; fileIdx < SOUND_EFFECT_FILES.length; fileIdx++) {
      poolId[fileIdx]=-1;
    }
    for (int effect=0; effect < AudioManager.NUM_SOUND_EFFECTS; effect++) {
      if (SOUND_EFFECT_FILES_MAP[effect][1] == 0) {
        continue;
      }
      if (poolId[SOUND_EFFECT_FILES_MAP[effect][0]] == -1) {
        String filePath=Environment.getRootDirectory() + SOUND_EFFECTS_PATH + SOUND_EFFECT_FILES[SOUND_EFFECT_FILES_MAP[effect][0]];
        int sampleId=mSoundPool.load(filePath,0);
        SOUND_EFFECT_FILES_MAP[effect][1]=sampleId;
        poolId[SOUND_EFFECT_FILES_MAP[effect][0]]=sampleId;
        if (sampleId <= 0) {
          Log.w(TAG,"String_Node_Str" + filePath);
        }
      }
 else {
        SOUND_EFFECT_FILES_MAP[effect][1]=poolId[SOUND_EFFECT_FILES_MAP[effect][0]];
      }
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Loads samples into the soundpool. This method must be called at when sound effects are enabled
 */
public boolean loadSoundEffects(){
synchronized (mSoundEffectsLock) {
    if (mSoundPool != null) {
      return true;
    }
    mSoundPool=new SoundPool(NUM_SOUNDPOOL_CHANNELS,AudioSystem.STREAM_SYSTEM,0);
    if (mSoundPool == null) {
      return false;
    }
    int[] poolId=new int[SOUND_EFFECT_FILES.length];
    for (int fileIdx=0; fileIdx < SOUND_EFFECT_FILES.length; fileIdx++) {
      poolId[fileIdx]=-1;
    }
    for (int effect=0; effect < AudioManager.NUM_SOUND_EFFECTS; effect++) {
      if (SOUND_EFFECT_FILES_MAP[effect][1] == 0) {
        continue;
      }
      if (poolId[SOUND_EFFECT_FILES_MAP[effect][0]] == -1) {
        String filePath=Environment.getRootDirectory() + SOUND_EFFECTS_PATH + SOUND_EFFECT_FILES[SOUND_EFFECT_FILES_MAP[effect][0]];
        int sampleId=mSoundPool.load(filePath,0);
        SOUND_EFFECT_FILES_MAP[effect][1]=sampleId;
        poolId[SOUND_EFFECT_FILES_MAP[effect][0]]=sampleId;
        if (sampleId <= 0) {
          Log.w(TAG,"String_Node_Str" + filePath);
        }
      }
 else {
        SOUND_EFFECT_FILES_MAP[effect][1]=poolId[SOUND_EFFECT_FILES_MAP[effect][0]];
      }
    }
  }
  return true;
}