nus-yam/ex-repair huggingface dataset:
Program: 181450
Project: 181450
Buggy source:
private boolean getValueAt(int index,TypedValue outValue){
  final int[] data=mData;
  final int type=data[index + AssetManager.STYLE_TYPE];
  if (type == TypedValue.TYPE_NULL) {
    return false;
  }
  outValue.type=type;
  outValue.data=data[index + AssetManager.STYLE_DATA];
  outValue.assetCookie=data[index + AssetManager.STYLE_ASSET_COOKIE];
  outValue.resourceId=data[index + AssetManager.STYLE_RESOURCE_ID];
  outValue.changingConfigurations=data[index + AssetManager.STYLE_CHANGING_CONFIGURATIONS];
  outValue.density=data[index + AssetManager.STYLE_DENSITY];
  if (type == TypedValue.TYPE_STRING) {
    outValue.string=loadStringValueAt(index);
  }
  return true;
}

Fixed version (ground truth):
private boolean getValueAt(int index,TypedValue outValue){
  final int[] data=mData;
  final int type=data[index + AssetManager.STYLE_TYPE];
  if (type == TypedValue.TYPE_NULL) {
    return false;
  }
  outValue.type=type;
  outValue.data=data[index + AssetManager.STYLE_DATA];
  outValue.assetCookie=data[index + AssetManager.STYLE_ASSET_COOKIE];
  outValue.resourceId=data[index + AssetManager.STYLE_RESOURCE_ID];
  outValue.changingConfigurations=data[index + AssetManager.STYLE_CHANGING_CONFIGURATIONS];
  outValue.density=data[index + AssetManager.STYLE_DENSITY];
  outValue.string=(type == TypedValue.TYPE_STRING) ? loadStringValueAt(index) : null;
  return true;
}
Program: 181451
Project: 181451
Buggy source:
private final IContentProvider getProvider(Context context,String name){
synchronized (mProviderMap) {
    final ProviderClientRecord pr=mProviderMap.get(name);
    if (pr != null) {
      return pr.mProvider;
    }
  }
  IActivityManager.ContentProviderHolder holder=null;
  try {
    holder=ActivityManagerNative.getDefault().getContentProvider(getApplicationThread(),name);
  }
 catch (  RemoteException ex) {
  }
  if (holder == null) {
    Slog.e(TAG,"String_Node_Str" + name);
    return null;
  }
  if (holder.permissionFailure != null) {
    throw new SecurityException("String_Node_Str" + holder.permissionFailure + "String_Node_Str"+ name);
  }
  IContentProvider prov=installProvider(context,holder.provider,holder.info,true);
  if (holder.noReleaseNeeded || holder.provider == null) {
synchronized (mProviderMap) {
      mProviderRefCountMap.put(prov.asBinder(),new ProviderRefCount(10000));
    }
  }
  return prov;
}

Fixed version (ground truth):
private final IContentProvider getProvider(Context context,String name){
synchronized (mProviderMap) {
    final ProviderClientRecord pr=mProviderMap.get(name);
    if (pr != null) {
      return pr.mProvider;
    }
  }
  IActivityManager.ContentProviderHolder holder=null;
  try {
    holder=ActivityManagerNative.getDefault().getContentProvider(getApplicationThread(),name);
  }
 catch (  RemoteException ex) {
  }
  if (holder == null) {
    Slog.e(TAG,"String_Node_Str" + name);
    return null;
  }
  IContentProvider prov=installProvider(context,holder.provider,holder.info,true);
  if (holder.noReleaseNeeded || holder.provider == null) {
synchronized (mProviderMap) {
      mProviderRefCountMap.put(prov.asBinder(),new ProviderRefCount(10000));
    }
  }
  return prov;
}
Program: 181452
Project: 181452
Buggy source:
private ContentProviderHolder(Parcel source){
  info=ProviderInfo.CREATOR.createFromParcel(source);
  permissionFailure=source.readString();
  provider=ContentProviderNative.asInterface(source.readStrongBinder());
  noReleaseNeeded=source.readInt() != 0;
}

Fixed version (ground truth):
private ContentProviderHolder(Parcel source){
  info=ProviderInfo.CREATOR.createFromParcel(source);
  provider=ContentProviderNative.asInterface(source.readStrongBinder());
  noReleaseNeeded=source.readInt() != 0;
}
Program: 181453
Project: 181453
Buggy source:
/** 
 * After being instantiated, this is called to tell the content provider about itself.
 * @param context The context this provider is running in
 * @param info Registered information about this content provider
 */
public void attachInfo(Context context,ProviderInfo info){
  if (mContext == null) {
    mContext=context;
    mMyUid=Process.myUid();
    if (info != null) {
      setReadPermission(info.readPermission);
      setWritePermission(info.writePermission);
      setPathPermissions(info.pathPermissions);
    }
    ContentProvider.this.onCreate();
  }
}

Fixed version (ground truth):
/** 
 * After being instantiated, this is called to tell the content provider about itself.
 * @param context The context this provider is running in
 * @param info Registered information about this content provider
 */
public void attachInfo(Context context,ProviderInfo info){
  if (mContext == null) {
    mContext=context;
    mMyUid=Process.myUid();
    if (info != null) {
      setReadPermission(info.readPermission);
      setWritePermission(info.writePermission);
      setPathPermissions(info.pathPermissions);
      mExported=info.exported;
    }
    ContentProvider.this.onCreate();
  }
}
Program: 181454
Project: 181454
Buggy source:
private void enforceReadPermission(Uri uri){
  final int uid=Binder.getCallingUid();
  if (uid == mMyUid) {
    return;
  }
  final Context context=getContext();
  final String rperm=getReadPermission();
  final int pid=Binder.getCallingPid();
  if (rperm == null || context.checkPermission(rperm,pid,uid) == PackageManager.PERMISSION_GRANTED) {
    return;
  }
  PathPermission[] pps=getPathPermissions();
  if (pps != null) {
    final String path=uri.getPath();
    int i=pps.length;
    while (i > 0) {
      i--;
      final PathPermission pp=pps[i];
      final String pprperm=pp.getReadPermission();
      if (pprperm != null && pp.match(path)) {
        if (context.checkPermission(pprperm,pid,uid) == PackageManager.PERMISSION_GRANTED) {
          return;
        }
      }
    }
  }
  if (context.checkUriPermission(uri,pid,uid,Intent.FLAG_GRANT_READ_URI_PERMISSION) == PackageManager.PERMISSION_GRANTED) {
    return;
  }
  String msg="String_Node_Str" + ContentProvider.this.getClass().getName() + "String_Node_Str"+ uri+ "String_Node_Str"+ Binder.getCallingPid()+ "String_Node_Str"+ Binder.getCallingUid()+ "String_Node_Str"+ rperm;
  throw new SecurityException(msg);
}

Fixed version (ground truth):
private void enforceReadPermission(Uri uri){
  final int uid=Binder.getCallingUid();
  if (uid == mMyUid) {
    return;
  }
  final Context context=getContext();
  final String rperm=getReadPermission();
  final int pid=Binder.getCallingPid();
  if (mExported && (rperm == null || context.checkPermission(rperm,pid,uid) == PackageManager.PERMISSION_GRANTED)) {
    return;
  }
  PathPermission[] pps=getPathPermissions();
  if (pps != null) {
    final String path=uri.getPath();
    int i=pps.length;
    while (i > 0) {
      i--;
      final PathPermission pp=pps[i];
      final String pprperm=pp.getReadPermission();
      if (pprperm != null && pp.match(path)) {
        if (context.checkPermission(pprperm,pid,uid) == PackageManager.PERMISSION_GRANTED) {
          return;
        }
      }
    }
  }
  if (context.checkUriPermission(uri,pid,uid,Intent.FLAG_GRANT_READ_URI_PERMISSION) == PackageManager.PERMISSION_GRANTED) {
    return;
  }
  String msg="String_Node_Str" + ContentProvider.this.getClass().getName() + "String_Node_Str"+ uri+ "String_Node_Str"+ Binder.getCallingPid()+ "String_Node_Str"+ Binder.getCallingUid()+ "String_Node_Str"+ rperm;
  throw new SecurityException(msg);
}
Program: 181455
Project: 181455
Buggy source:
private boolean hasWritePermission(Uri uri){
  final int uid=Binder.getCallingUid();
  if (uid == mMyUid) {
    return true;
  }
  final Context context=getContext();
  final String wperm=getWritePermission();
  final int pid=Binder.getCallingPid();
  if (wperm == null || context.checkPermission(wperm,pid,uid) == PackageManager.PERMISSION_GRANTED) {
    return true;
  }
  PathPermission[] pps=getPathPermissions();
  if (pps != null) {
    final String path=uri.getPath();
    int i=pps.length;
    while (i > 0) {
      i--;
      final PathPermission pp=pps[i];
      final String ppwperm=pp.getWritePermission();
      if (ppwperm != null && pp.match(path)) {
        if (context.checkPermission(ppwperm,pid,uid) == PackageManager.PERMISSION_GRANTED) {
          return true;
        }
      }
    }
  }
  if (context.checkUriPermission(uri,pid,uid,Intent.FLAG_GRANT_WRITE_URI_PERMISSION) == PackageManager.PERMISSION_GRANTED) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean hasWritePermission(Uri uri){
  final int uid=Binder.getCallingUid();
  if (uid == mMyUid) {
    return true;
  }
  final Context context=getContext();
  final String wperm=getWritePermission();
  final int pid=Binder.getCallingPid();
  if (mExported && (wperm == null || context.checkPermission(wperm,pid,uid) == PackageManager.PERMISSION_GRANTED)) {
    return true;
  }
  PathPermission[] pps=getPathPermissions();
  if (pps != null) {
    final String path=uri.getPath();
    int i=pps.length;
    while (i > 0) {
      i--;
      final PathPermission pp=pps[i];
      final String ppwperm=pp.getWritePermission();
      if (ppwperm != null && pp.match(path)) {
        if (context.checkPermission(ppwperm,pid,uid) == PackageManager.PERMISSION_GRANTED) {
          return true;
        }
      }
    }
  }
  if (context.checkUriPermission(uri,pid,uid,Intent.FLAG_GRANT_WRITE_URI_PERMISSION) == PackageManager.PERMISSION_GRANTED) {
    return true;
  }
  return false;
}
Program: 181456
Project: 181456
Buggy source:
void grantUriPermissionFromIntentLocked(int callingUid,String targetPkg,Intent intent,ActivityRecord activity){
  if (intent == null) {
    return;
  }
  Uri data=intent.getData();
  if (data == null) {
    return;
  }
  grantUriPermissionLocked(callingUid,targetPkg,data,intent.getFlags(),activity);
}

Fixed version (ground truth):
void grantUriPermissionFromIntentLocked(int callingUid,String targetPkg,Intent intent,ActivityRecord activity){
  if (DEBUG_URI_PERMISSION)   Slog.v(TAG,"String_Node_Str" + (intent != null ? intent.getData() : null) + "String_Node_Str"+ intent+ "String_Node_Str"+ Integer.toHexString(intent != null ? intent.getFlags() : 0));
  if (intent == null) {
    return;
  }
  Uri data=intent.getData();
  if (data == null) {
    return;
  }
  grantUriPermissionLocked(callingUid,targetPkg,data,intent.getFlags(),activity);
}
Program: 181457
Project: 181457
Buggy source:
public void handleApplicationStrictModeViolation(IBinder app,int violationMask,StrictMode.ViolationInfo info){
  ProcessRecord r=findAppProcess(app);
  if ((violationMask & StrictMode.PENALTY_DROPBOX) != 0) {
    Integer stackFingerprint=info.crashInfo.stackTrace.hashCode();
    boolean logIt=true;
synchronized (mAlreadyLoggedViolatedStacks) {
      if (mAlreadyLoggedViolatedStacks.contains(stackFingerprint)) {
        logIt=false;
      }
 else {
        if (mAlreadyLoggedViolatedStacks.size() >= MAX_DUP_SUPPRESSED_STACKS) {
          mAlreadyLoggedViolatedStacks.clear();
        }
        mAlreadyLoggedViolatedStacks.add(stackFingerprint);
      }
    }
    if (logIt) {
      logStrictModeViolationToDropBox(r,info);
    }
  }
  if ((violationMask & StrictMode.PENALTY_DIALOG) != 0) {
    AppErrorResult result=new AppErrorResult();
synchronized (this) {
      final long origId=Binder.clearCallingIdentity();
      Message msg=Message.obtain();
      msg.what=SHOW_STRICT_MODE_VIOLATION_MSG;
      HashMap<String,Object> data=new HashMap<String,Object>();
      data.put("String_Node_Str",result);
      data.put("String_Node_Str",r);
      data.put("String_Node_Str",violationMask);
      data.put("String_Node_Str",info);
      msg.obj=data;
      mHandler.sendMessage(msg);
      Binder.restoreCallingIdentity(origId);
    }
    int res=result.get();
    Log.w(TAG,"String_Node_Str" + res);
  }
}

Fixed version (ground truth):
public void handleApplicationStrictModeViolation(IBinder app,int violationMask,StrictMode.ViolationInfo info){
  ProcessRecord r=findAppProcess(app);
  if ((violationMask & StrictMode.PENALTY_DROPBOX) != 0) {
    Integer stackFingerprint=info.crashInfo.stackTrace.hashCode();
    boolean logIt=true;
synchronized (mAlreadyLoggedViolatedStacks) {
      if (mAlreadyLoggedViolatedStacks.contains(stackFingerprint)) {
        logIt=false;
      }
 else {
        if (mAlreadyLoggedViolatedStacks.size() >= MAX_DUP_SUPPRESSED_STACKS) {
          mAlreadyLoggedViolatedStacks.clear();
        }
        mAlreadyLoggedViolatedStacks.add(stackFingerprint);
      }
    }
    if (logIt) {
      logStrictModeViolationToDropBox(r,info);
    }
  }
  if ((violationMask & StrictMode.PENALTY_DIALOG) != 0) {
    AppErrorResult result=new AppErrorResult();
synchronized (this) {
      final long origId=Binder.clearCallingIdentity();
      Message msg=Message.obtain();
      msg.what=SHOW_STRICT_MODE_VIOLATION_MSG;
      HashMap<String,Object> data=new HashMap<String,Object>();
      data.put("String_Node_Str",result);
      data.put("String_Node_Str",r);
      data.put("String_Node_Str",violationMask);
      data.put("String_Node_Str",info);
      msg.obj=data;
      mHandler.sendMessage(msg);
      Binder.restoreCallingIdentity(origId);
    }
    int res=result.get();
    Slog.w(TAG,"String_Node_Str" + res);
  }
}
Program: 181458
Project: 181458
Buggy source:
private final boolean checkHoldingPermissionsLocked(IPackageManager pm,ProviderInfo pi,int uid,int modeFlags){
  try {
    if ((modeFlags & Intent.FLAG_GRANT_READ_URI_PERMISSION) != 0) {
      if ((pi.readPermission != null) && (pm.checkUidPermission(pi.readPermission,uid) != PackageManager.PERMISSION_GRANTED)) {
        return false;
      }
    }
    if ((modeFlags & Intent.FLAG_GRANT_WRITE_URI_PERMISSION) != 0) {
      if ((pi.writePermission != null) && (pm.checkUidPermission(pi.writePermission,uid) != PackageManager.PERMISSION_GRANTED)) {
        return false;
      }
    }
    return true;
  }
 catch (  RemoteException e) {
    return false;
  }
}

Fixed version (ground truth):
private final boolean checkHoldingPermissionsLocked(IPackageManager pm,ProviderInfo pi,int uid,int modeFlags){
  try {
    if ((modeFlags & Intent.FLAG_GRANT_READ_URI_PERMISSION) != 0) {
      if ((pi.readPermission != null) && (pm.checkUidPermission(pi.readPermission,uid) != PackageManager.PERMISSION_GRANTED)) {
        return false;
      }
    }
    if ((modeFlags & Intent.FLAG_GRANT_WRITE_URI_PERMISSION) != 0) {
      if ((pi.writePermission != null) && (pm.checkUidPermission(pi.writePermission,uid) != PackageManager.PERMISSION_GRANTED)) {
        return false;
      }
    }
    if (!pi.exported && pi.applicationInfo.uid != uid) {
      return false;
    }
    return true;
  }
 catch (  RemoteException e) {
    return false;
  }
}
Program: 181462
Project: 181462
Buggy source:
private final IContentProvider getProvider(Context context,String name){
synchronized (mProviderMap) {
    final ProviderClientRecord pr=mProviderMap.get(name);
    if (pr != null) {
      return pr.mProvider;
    }
  }
  IActivityManager.ContentProviderHolder holder=null;
  try {
    holder=ActivityManagerNative.getDefault().getContentProvider(getApplicationThread(),name);
  }
 catch (  RemoteException ex) {
  }
  if (holder == null) {
    Slog.e(TAG,"String_Node_Str" + name);
    return null;
  }
  if (holder.permissionFailure != null) {
    throw new SecurityException("String_Node_Str" + holder.permissionFailure + "String_Node_Str"+ name);
  }
  IContentProvider prov=installProvider(context,holder.provider,holder.info,true);
  if (holder.noReleaseNeeded || holder.provider == null) {
synchronized (mProviderMap) {
      mProviderRefCountMap.put(prov.asBinder(),new ProviderRefCount(10000));
    }
  }
  return prov;
}

Fixed version (ground truth):
private final IContentProvider getProvider(Context context,String name){
synchronized (mProviderMap) {
    final ProviderClientRecord pr=mProviderMap.get(name);
    if (pr != null) {
      return pr.mProvider;
    }
  }
  IActivityManager.ContentProviderHolder holder=null;
  try {
    holder=ActivityManagerNative.getDefault().getContentProvider(getApplicationThread(),name);
  }
 catch (  RemoteException ex) {
  }
  if (holder == null) {
    Slog.e(TAG,"String_Node_Str" + name);
    return null;
  }
  IContentProvider prov=installProvider(context,holder.provider,holder.info,true);
  if (holder.noReleaseNeeded || holder.provider == null) {
synchronized (mProviderMap) {
      mProviderRefCountMap.put(prov.asBinder(),new ProviderRefCount(10000));
    }
  }
  return prov;
}
Program: 181463
Project: 181463
Buggy source:
private ContentProviderHolder(Parcel source){
  info=ProviderInfo.CREATOR.createFromParcel(source);
  permissionFailure=source.readString();
  provider=ContentProviderNative.asInterface(source.readStrongBinder());
  noReleaseNeeded=source.readInt() != 0;
}

Fixed version (ground truth):
private ContentProviderHolder(Parcel source){
  info=ProviderInfo.CREATOR.createFromParcel(source);
  provider=ContentProviderNative.asInterface(source.readStrongBinder());
  noReleaseNeeded=source.readInt() != 0;
}
Program: 181464
Project: 181464
Buggy source:
/** 
 * After being instantiated, this is called to tell the content provider about itself.
 * @param context The context this provider is running in
 * @param info Registered information about this content provider
 */
public void attachInfo(Context context,ProviderInfo info){
  if (mContext == null) {
    mContext=context;
    mMyUid=Process.myUid();
    if (info != null) {
      setReadPermission(info.readPermission);
      setWritePermission(info.writePermission);
      setPathPermissions(info.pathPermissions);
    }
    ContentProvider.this.onCreate();
  }
}

Fixed version (ground truth):
/** 
 * After being instantiated, this is called to tell the content provider about itself.
 * @param context The context this provider is running in
 * @param info Registered information about this content provider
 */
public void attachInfo(Context context,ProviderInfo info){
  if (mContext == null) {
    mContext=context;
    mMyUid=Process.myUid();
    if (info != null) {
      setReadPermission(info.readPermission);
      setWritePermission(info.writePermission);
      setPathPermissions(info.pathPermissions);
      mExported=info.exported;
    }
    ContentProvider.this.onCreate();
  }
}
Program: 181465
Project: 181465
Buggy source:
private void enforceReadPermission(Uri uri){
  final int uid=Binder.getCallingUid();
  if (uid == mMyUid) {
    return;
  }
  final Context context=getContext();
  final String rperm=getReadPermission();
  final int pid=Binder.getCallingPid();
  if (rperm == null || context.checkPermission(rperm,pid,uid) == PackageManager.PERMISSION_GRANTED) {
    return;
  }
  PathPermission[] pps=getPathPermissions();
  if (pps != null) {
    final String path=uri.getPath();
    int i=pps.length;
    while (i > 0) {
      i--;
      final PathPermission pp=pps[i];
      final String pprperm=pp.getReadPermission();
      if (pprperm != null && pp.match(path)) {
        if (context.checkPermission(pprperm,pid,uid) == PackageManager.PERMISSION_GRANTED) {
          return;
        }
      }
    }
  }
  if (context.checkUriPermission(uri,pid,uid,Intent.FLAG_GRANT_READ_URI_PERMISSION) == PackageManager.PERMISSION_GRANTED) {
    return;
  }
  String msg="String_Node_Str" + ContentProvider.this.getClass().getName() + "String_Node_Str"+ uri+ "String_Node_Str"+ Binder.getCallingPid()+ "String_Node_Str"+ Binder.getCallingUid()+ "String_Node_Str"+ rperm;
  throw new SecurityException(msg);
}

Fixed version (ground truth):
private void enforceReadPermission(Uri uri){
  final int uid=Binder.getCallingUid();
  if (uid == mMyUid) {
    return;
  }
  final Context context=getContext();
  final String rperm=getReadPermission();
  final int pid=Binder.getCallingPid();
  if (mExported && (rperm == null || context.checkPermission(rperm,pid,uid) == PackageManager.PERMISSION_GRANTED)) {
    return;
  }
  PathPermission[] pps=getPathPermissions();
  if (pps != null) {
    final String path=uri.getPath();
    int i=pps.length;
    while (i > 0) {
      i--;
      final PathPermission pp=pps[i];
      final String pprperm=pp.getReadPermission();
      if (pprperm != null && pp.match(path)) {
        if (context.checkPermission(pprperm,pid,uid) == PackageManager.PERMISSION_GRANTED) {
          return;
        }
      }
    }
  }
  if (context.checkUriPermission(uri,pid,uid,Intent.FLAG_GRANT_READ_URI_PERMISSION) == PackageManager.PERMISSION_GRANTED) {
    return;
  }
  String msg="String_Node_Str" + ContentProvider.this.getClass().getName() + "String_Node_Str"+ uri+ "String_Node_Str"+ Binder.getCallingPid()+ "String_Node_Str"+ Binder.getCallingUid()+ "String_Node_Str"+ rperm;
  throw new SecurityException(msg);
}
Program: 181466
Project: 181466
Buggy source:
private boolean hasWritePermission(Uri uri){
  final int uid=Binder.getCallingUid();
  if (uid == mMyUid) {
    return true;
  }
  final Context context=getContext();
  final String wperm=getWritePermission();
  final int pid=Binder.getCallingPid();
  if (wperm == null || context.checkPermission(wperm,pid,uid) == PackageManager.PERMISSION_GRANTED) {
    return true;
  }
  PathPermission[] pps=getPathPermissions();
  if (pps != null) {
    final String path=uri.getPath();
    int i=pps.length;
    while (i > 0) {
      i--;
      final PathPermission pp=pps[i];
      final String ppwperm=pp.getWritePermission();
      if (ppwperm != null && pp.match(path)) {
        if (context.checkPermission(ppwperm,pid,uid) == PackageManager.PERMISSION_GRANTED) {
          return true;
        }
      }
    }
  }
  if (context.checkUriPermission(uri,pid,uid,Intent.FLAG_GRANT_WRITE_URI_PERMISSION) == PackageManager.PERMISSION_GRANTED) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean hasWritePermission(Uri uri){
  final int uid=Binder.getCallingUid();
  if (uid == mMyUid) {
    return true;
  }
  final Context context=getContext();
  final String wperm=getWritePermission();
  final int pid=Binder.getCallingPid();
  if (mExported && (wperm == null || context.checkPermission(wperm,pid,uid) == PackageManager.PERMISSION_GRANTED)) {
    return true;
  }
  PathPermission[] pps=getPathPermissions();
  if (pps != null) {
    final String path=uri.getPath();
    int i=pps.length;
    while (i > 0) {
      i--;
      final PathPermission pp=pps[i];
      final String ppwperm=pp.getWritePermission();
      if (ppwperm != null && pp.match(path)) {
        if (context.checkPermission(ppwperm,pid,uid) == PackageManager.PERMISSION_GRANTED) {
          return true;
        }
      }
    }
  }
  if (context.checkUriPermission(uri,pid,uid,Intent.FLAG_GRANT_WRITE_URI_PERMISSION) == PackageManager.PERMISSION_GRANTED) {
    return true;
  }
  return false;
}
Program: 181467
Project: 181467
Buggy source:
void grantUriPermissionFromIntentLocked(int callingUid,String targetPkg,Intent intent,ActivityRecord activity){
  if (intent == null) {
    return;
  }
  Uri data=intent.getData();
  if (data == null) {
    return;
  }
  grantUriPermissionLocked(callingUid,targetPkg,data,intent.getFlags(),activity);
}

Fixed version (ground truth):
void grantUriPermissionFromIntentLocked(int callingUid,String targetPkg,Intent intent,ActivityRecord activity){
  if (DEBUG_URI_PERMISSION)   Slog.v(TAG,"String_Node_Str" + (intent != null ? intent.getData() : null) + "String_Node_Str"+ intent+ "String_Node_Str"+ Integer.toHexString(intent != null ? intent.getFlags() : 0));
  if (intent == null) {
    return;
  }
  Uri data=intent.getData();
  if (data == null) {
    return;
  }
  grantUriPermissionLocked(callingUid,targetPkg,data,intent.getFlags(),activity);
}
Program: 181468
Project: 181468
Buggy source:
public void handleApplicationStrictModeViolation(IBinder app,int violationMask,StrictMode.ViolationInfo info){
  ProcessRecord r=findAppProcess(app);
  if ((violationMask & StrictMode.PENALTY_DROPBOX) != 0) {
    Integer stackFingerprint=info.crashInfo.stackTrace.hashCode();
    boolean logIt=true;
synchronized (mAlreadyLoggedViolatedStacks) {
      if (mAlreadyLoggedViolatedStacks.contains(stackFingerprint)) {
        logIt=false;
      }
 else {
        if (mAlreadyLoggedViolatedStacks.size() >= MAX_DUP_SUPPRESSED_STACKS) {
          mAlreadyLoggedViolatedStacks.clear();
        }
        mAlreadyLoggedViolatedStacks.add(stackFingerprint);
      }
    }
    if (logIt) {
      logStrictModeViolationToDropBox(r,info);
    }
  }
  if ((violationMask & StrictMode.PENALTY_DIALOG) != 0) {
    AppErrorResult result=new AppErrorResult();
synchronized (this) {
      final long origId=Binder.clearCallingIdentity();
      Message msg=Message.obtain();
      msg.what=SHOW_STRICT_MODE_VIOLATION_MSG;
      HashMap<String,Object> data=new HashMap<String,Object>();
      data.put("String_Node_Str",result);
      data.put("String_Node_Str",r);
      data.put("String_Node_Str",violationMask);
      data.put("String_Node_Str",info);
      msg.obj=data;
      mHandler.sendMessage(msg);
      Binder.restoreCallingIdentity(origId);
    }
    int res=result.get();
    Log.w(TAG,"String_Node_Str" + res);
  }
}

Fixed version (ground truth):
public void handleApplicationStrictModeViolation(IBinder app,int violationMask,StrictMode.ViolationInfo info){
  ProcessRecord r=findAppProcess(app);
  if ((violationMask & StrictMode.PENALTY_DROPBOX) != 0) {
    Integer stackFingerprint=info.crashInfo.stackTrace.hashCode();
    boolean logIt=true;
synchronized (mAlreadyLoggedViolatedStacks) {
      if (mAlreadyLoggedViolatedStacks.contains(stackFingerprint)) {
        logIt=false;
      }
 else {
        if (mAlreadyLoggedViolatedStacks.size() >= MAX_DUP_SUPPRESSED_STACKS) {
          mAlreadyLoggedViolatedStacks.clear();
        }
        mAlreadyLoggedViolatedStacks.add(stackFingerprint);
      }
    }
    if (logIt) {
      logStrictModeViolationToDropBox(r,info);
    }
  }
  if ((violationMask & StrictMode.PENALTY_DIALOG) != 0) {
    AppErrorResult result=new AppErrorResult();
synchronized (this) {
      final long origId=Binder.clearCallingIdentity();
      Message msg=Message.obtain();
      msg.what=SHOW_STRICT_MODE_VIOLATION_MSG;
      HashMap<String,Object> data=new HashMap<String,Object>();
      data.put("String_Node_Str",result);
      data.put("String_Node_Str",r);
      data.put("String_Node_Str",violationMask);
      data.put("String_Node_Str",info);
      msg.obj=data;
      mHandler.sendMessage(msg);
      Binder.restoreCallingIdentity(origId);
    }
    int res=result.get();
    Slog.w(TAG,"String_Node_Str" + res);
  }
}
Program: 181469
Project: 181469
Buggy source:
private final boolean checkHoldingPermissionsLocked(IPackageManager pm,ProviderInfo pi,int uid,int modeFlags){
  try {
    if ((modeFlags & Intent.FLAG_GRANT_READ_URI_PERMISSION) != 0) {
      if ((pi.readPermission != null) && (pm.checkUidPermission(pi.readPermission,uid) != PackageManager.PERMISSION_GRANTED)) {
        return false;
      }
    }
    if ((modeFlags & Intent.FLAG_GRANT_WRITE_URI_PERMISSION) != 0) {
      if ((pi.writePermission != null) && (pm.checkUidPermission(pi.writePermission,uid) != PackageManager.PERMISSION_GRANTED)) {
        return false;
      }
    }
    return true;
  }
 catch (  RemoteException e) {
    return false;
  }
}

Fixed version (ground truth):
private final boolean checkHoldingPermissionsLocked(IPackageManager pm,ProviderInfo pi,int uid,int modeFlags){
  try {
    if ((modeFlags & Intent.FLAG_GRANT_READ_URI_PERMISSION) != 0) {
      if ((pi.readPermission != null) && (pm.checkUidPermission(pi.readPermission,uid) != PackageManager.PERMISSION_GRANTED)) {
        return false;
      }
    }
    if ((modeFlags & Intent.FLAG_GRANT_WRITE_URI_PERMISSION) != 0) {
      if ((pi.writePermission != null) && (pm.checkUidPermission(pi.writePermission,uid) != PackageManager.PERMISSION_GRANTED)) {
        return false;
      }
    }
    if (!pi.exported && pi.applicationInfo.uid != uid) {
      return false;
    }
    return true;
  }
 catch (  RemoteException e) {
    return false;
  }
}
Program: 181473
Project: 181473
Buggy source:
/** 
 * Puts the device to speaker mode. 
 */
void setSpeakerMode();

Fixed version (ground truth):
/** 
 * Puts the device to speaker mode. 
 */
void setSpeakerMode(boolean speakerMode);
Program: 181474
Project: 181474
Buggy source:
private void stopCall(boolean releaseSocket){
  Log.d(TAG,"String_Node_Str");
  if (mRtpSession != null) {
    mRtpSession.join(null);
    if (releaseSocket) {
      mRtpSession.release();
      mRtpSession=null;
    }
  }
  setInCallMode();
}

Fixed version (ground truth):
private void stopCall(boolean releaseSocket){
  Log.d(TAG,"String_Node_Str");
  if (mRtpSession != null) {
    mRtpSession.join(null);
    if (releaseSocket) {
      mRtpSession.release();
      mRtpSession=null;
    }
  }
}
Program: 181475
Project: 181475
Buggy source:
public synchronized void setSpeakerMode(){
  ((AudioManager)mContext.getSystemService(Context.AUDIO_SERVICE)).setSpeakerphoneOn(true);
}

Fixed version (ground truth):
public synchronized void setSpeakerMode(boolean speakerMode){
  ((AudioManager)mContext.getSystemService(Context.AUDIO_SERVICE)).setSpeakerphoneOn(speakerMode);
}
Program: 181477
Project: 181477
Buggy source:
public void dump(Printer pw,String prefix){
  pw.println(prefix + this);
  pw.println(prefix + "String_Node_Str" + mRun);
  pw.println(prefix + "String_Node_Str" + mThread);
  pw.println(prefix + "String_Node_Str" + ((mQueue != null) ? mQueue : "String_Node_Str"));
  if (mQueue != null) {
synchronized (mQueue) {
      Message msg=mQueue.mMessages;
      int n=0;
      while (msg != null) {
        pw.println(prefix + "String_Node_Str" + n+ "String_Node_Str"+ msg);
        n++;
        msg=msg.next;
      }
      pw.println(prefix + "String_Node_Str" + n+ "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public void dump(Printer pw,String prefix){
  pw.println(prefix + this);
  pw.println(prefix + "String_Node_Str" + mRun);
  pw.println(prefix + "String_Node_Str" + mThread);
  pw.println(prefix + "String_Node_Str" + ((mQueue != null) ? mQueue : "String_Node_Str"));
  if (mQueue != null) {
synchronized (mQueue) {
      long now=SystemClock.uptimeMillis();
      Message msg=mQueue.mMessages;
      int n=0;
      while (msg != null) {
        pw.println(prefix + "String_Node_Str" + n+ "String_Node_Str"+ msg.toString(now));
        n++;
        msg=msg.next;
      }
      pw.println(prefix + "String_Node_Str" + n+ "String_Node_Str");
    }
  }
}
Program: 181478
Project: 181478
Buggy source:
public String toString(){
  StringBuilder b=new StringBuilder();
  b.append("String_Node_Str");
  b.append(what);
  b.append("String_Node_Str");
  b.append(when);
  if (arg1 != 0) {
    b.append("String_Node_Str");
    b.append(arg1);
  }
  if (arg2 != 0) {
    b.append("String_Node_Str");
    b.append(arg2);
  }
  if (obj != null) {
    b.append("String_Node_Str");
    b.append(obj);
  }
  b.append("String_Node_Str");
  return b.toString();
}

Fixed version (ground truth):
String toString(long now){
  StringBuilder b=new StringBuilder();
  b.append("String_Node_Str");
  b.append(what);
  b.append("String_Node_Str");
  TimeUtils.formatDuration(when - now,b);
  if (arg1 != 0) {
    b.append("String_Node_Str");
    b.append(arg1);
  }
  if (arg2 != 0) {
    b.append("String_Node_Str");
    b.append(arg2);
  }
  if (obj != null) {
    b.append("String_Node_Str");
    b.append(obj);
  }
  b.append("String_Node_Str");
  return b.toString();
}
Program: 181479
Project: 181479
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  ImageView content=new ImageView(this);
  content.setImageResource(com.android.internal.R.drawable.platlogo);
  content.setScaleType(ImageView.ScaleType.FIT_CENTER);
  setContentView(content);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mToast=Toast.makeText(this,"String_Node_Str",Toast.LENGTH_SHORT);
  ImageView content=new ImageView(this);
  content.setImageResource(com.android.internal.R.drawable.platlogo);
  content.setScaleType(ImageView.ScaleType.FIT_CENTER);
  setContentView(content);
}
Program: 181480
Project: 181480
Buggy source:
public void noteScreenOnLocked(){
  if (!mScreenOn) {
    mHistoryCur.states|=HistoryItem.STATE_SCREEN_ON_FLAG;
    if (DEBUG_HISTORY)     Slog.v(TAG,"String_Node_Str" + Integer.toHexString(mHistoryCur.states));
    addHistoryRecordLocked(SystemClock.elapsedRealtime());
    mScreenOn=true;
    mScreenOnTimer.startRunningLocked(this);
    if (mScreenBrightnessBin >= 0) {
      mScreenBrightnessTimer[mScreenBrightnessBin].startRunningLocked(this);
    }
    noteStartWakeLocked(-1,-1,"String_Node_Str",0);
  }
}

Fixed version (ground truth):
public void noteScreenOnLocked(){
  if (!mScreenOn) {
    mHistoryCur.states|=HistoryItem.STATE_SCREEN_ON_FLAG;
    if (DEBUG_HISTORY)     Slog.v(TAG,"String_Node_Str" + Integer.toHexString(mHistoryCur.states));
    addHistoryRecordLocked(SystemClock.elapsedRealtime());
    mScreenOn=true;
    mScreenOnTimer.startRunningLocked(this);
    if (mScreenBrightnessBin >= 0) {
      mScreenBrightnessTimer[mScreenBrightnessBin].startRunningLocked(this);
    }
    noteStartWakeLocked(-1,-1,"String_Node_Str",WAKE_TYPE_PARTIAL);
  }
}
Program: 181481
Project: 181481
Buggy source:
public void noteStartWakeLocked(int pid,String name,int type){
  StopwatchTimer t=getWakeTimerLocked(name,type);
  if (t != null) {
    t.startRunningLocked(BatteryStatsImpl.this);
  }
  if (pid >= 0) {
    Pid p=getPidStatsLocked(pid);
    p.mWakeStart=SystemClock.elapsedRealtime();
  }
}

Fixed version (ground truth):
public void noteStartWakeLocked(int pid,String name,int type){
  StopwatchTimer t=getWakeTimerLocked(name,type);
  if (t != null) {
    t.startRunningLocked(BatteryStatsImpl.this);
  }
  if (pid >= 0 && type == WAKE_TYPE_PARTIAL) {
    Pid p=getPidStatsLocked(pid);
    p.mWakeStart=SystemClock.elapsedRealtime();
  }
}
Program: 181482
Project: 181482
Buggy source:
public void noteStopWakeLocked(int pid,String name,int type){
  StopwatchTimer t=getWakeTimerLocked(name,type);
  if (t != null) {
    t.stopRunningLocked(BatteryStatsImpl.this);
  }
  if (pid >= 0) {
    Pid p=mPids.get(pid);
    if (p != null) {
      p.mWakeSum+=SystemClock.elapsedRealtime() - p.mWakeStart;
      p.mWakeStart=0;
    }
  }
}

Fixed version (ground truth):
public void noteStopWakeLocked(int pid,String name,int type){
  StopwatchTimer t=getWakeTimerLocked(name,type);
  if (t != null) {
    t.stopRunningLocked(BatteryStatsImpl.this);
  }
  if (pid >= 0 && type == WAKE_TYPE_PARTIAL) {
    Pid p=mPids.get(pid);
    if (p != null) {
      p.mWakeSum+=SystemClock.elapsedRealtime() - p.mWakeStart;
      p.mWakeStart=0;
    }
  }
}
Program: 181483
Project: 181483
Buggy source:
public void noteScreenOffLocked(){
  if (mScreenOn) {
    mHistoryCur.states&=~HistoryItem.STATE_SCREEN_ON_FLAG;
    if (DEBUG_HISTORY)     Slog.v(TAG,"String_Node_Str" + Integer.toHexString(mHistoryCur.states));
    addHistoryRecordLocked(SystemClock.elapsedRealtime());
    mScreenOn=false;
    mScreenOnTimer.stopRunningLocked(this);
    if (mScreenBrightnessBin >= 0) {
      mScreenBrightnessTimer[mScreenBrightnessBin].stopRunningLocked(this);
    }
    noteStopWakeLocked(-1,-1,"String_Node_Str",0);
  }
}

Fixed version (ground truth):
public void noteScreenOffLocked(){
  if (mScreenOn) {
    mHistoryCur.states&=~HistoryItem.STATE_SCREEN_ON_FLAG;
    if (DEBUG_HISTORY)     Slog.v(TAG,"String_Node_Str" + Integer.toHexString(mHistoryCur.states));
    addHistoryRecordLocked(SystemClock.elapsedRealtime());
    mScreenOn=false;
    mScreenOnTimer.stopRunningLocked(this);
    if (mScreenBrightnessBin >= 0) {
      mScreenBrightnessTimer[mScreenBrightnessBin].stopRunningLocked(this);
    }
    noteStopWakeLocked(-1,-1,"String_Node_Str",WAKE_TYPE_PARTIAL);
  }
}
Program: 181484
Project: 181484
Buggy source:
/** 
 * Get an SMS-SUBMIT PDU for a data message to a destination address &amp; port
 * @param destAddr the address of the destination for the message
 * @param userDara the data for the message
 * @param statusReportRequested Indicates whether a report is requested for this message.
 * @return a <code>SubmitPdu</code> containing the encoded SCaddress, if applicable, and the encoded message. Returns null on encode error.
 */
public static SubmitPdu getSubmitPdu(String destAddr,UserData userData,boolean statusReportRequested){
  return privateGetSubmitPdu(destAddr,statusReportRequested,userData);
}

Fixed version (ground truth):
/** 
 * Get an SMS-SUBMIT PDU for a data message to a destination address &amp; port
 * @param destAddr the address of the destination for the message
 * @param userData the data for the message
 * @param statusReportRequested Indicates whether a report is requested for this message.
 * @return a <code>SubmitPdu</code> containing the encoded SCaddress, if applicable, and the encoded message. Returns null on encode error.
 */
public static SubmitPdu getSubmitPdu(String destAddr,UserData userData,boolean statusReportRequested){
  return privateGetSubmitPdu(destAddr,statusReportRequested,userData);
}
Program: 181485
Project: 181485
Buggy source:
/** 
 * Calculate the number of septets needed to encode the message.
 * @param messageBody the message to encode
 * @param use7bitOnly ignore (but still count) illegal characters if true
 * @return TextEncodingDetails
 */
public static TextEncodingDetails calculateLength(CharSequence messageBody,boolean use7bitOnly){
  return BearerData.calcTextEncodingDetails(messageBody.toString(),use7bitOnly);
}

Fixed version (ground truth):
/** 
 * Calculate the number of septets needed to encode the message.
 * @param messageBody the message to encode
 * @param use7bitOnly ignore (but still count) illegal characters if true
 * @return TextEncodingDetails
 */
public static TextEncodingDetails calculateLength(CharSequence messageBody,boolean use7bitOnly){
  return BearerData.calcTextEncodingDetails(messageBody,use7bitOnly);
}
Program: 181487
Project: 181487
Buggy source:
/** 
 * Calculate the message text encoding length, fragmentation, and other details.
 * @param force ignore (but still count) illegal characters if true
 * @return septet count, or -1 on failure
 */
public static TextEncodingDetails calcTextEncodingDetails(CharSequence msg,boolean force7BitEncoding){
  TextEncodingDetails ted;
  int septets=countAsciiSeptets(msg,force7BitEncoding);
  if (septets != -1 && septets <= SmsMessage.MAX_USER_DATA_SEPTETS) {
    ted=new TextEncodingDetails();
    ted.msgCount=1;
    ted.codeUnitCount=septets;
    ted.codeUnitsRemaining=SmsMessage.MAX_USER_DATA_SEPTETS - septets;
    ted.codeUnitSize=SmsMessage.ENCODING_7BIT;
  }
 else {
    ted=com.android.internal.telephony.gsm.SmsMessage.calculateLength(msg,force7BitEncoding);
    if (ted.msgCount == 1 && ted.codeUnitSize == SmsMessage.ENCODING_7BIT) {
      ted.codeUnitCount=msg.length();
      int octets=ted.codeUnitCount * 2;
      if (octets > MAX_USER_DATA_BYTES) {
        ted.msgCount=(octets / MAX_USER_DATA_BYTES_WITH_HEADER) + 1;
        ted.codeUnitsRemaining=(MAX_USER_DATA_BYTES_WITH_HEADER - (octets % MAX_USER_DATA_BYTES_WITH_HEADER)) / 2;
      }
 else {
        ted.msgCount=1;
        ted.codeUnitsRemaining=(MAX_USER_DATA_BYTES - octets) / 2;
      }
      ted.codeUnitSize=ENCODING_16BIT;
    }
  }
  return ted;
}

Fixed version (ground truth):
/** 
 * Calculate the message text encoding length, fragmentation, and other details.
 * @param msg message text
 * @param force7BitEncoding ignore (but still count) illegal characters if true
 * @return septet count, or -1 on failure
 */
public static TextEncodingDetails calcTextEncodingDetails(CharSequence msg,boolean force7BitEncoding){
  TextEncodingDetails ted;
  int septets=countAsciiSeptets(msg,force7BitEncoding);
  if (septets != -1 && septets <= SmsMessage.MAX_USER_DATA_SEPTETS) {
    ted=new TextEncodingDetails();
    ted.msgCount=1;
    ted.codeUnitCount=septets;
    ted.codeUnitsRemaining=SmsMessage.MAX_USER_DATA_SEPTETS - septets;
    ted.codeUnitSize=SmsMessage.ENCODING_7BIT;
  }
 else {
    ted=com.android.internal.telephony.gsm.SmsMessage.calculateLength(msg,force7BitEncoding);
    if (ted.msgCount == 1 && ted.codeUnitSize == SmsMessage.ENCODING_7BIT) {
      ted.codeUnitCount=msg.length();
      int octets=ted.codeUnitCount * 2;
      if (octets > MAX_USER_DATA_BYTES) {
        ted.msgCount=(octets + (MAX_USER_DATA_BYTES_WITH_HEADER - 1)) / MAX_USER_DATA_BYTES_WITH_HEADER;
        ted.codeUnitsRemaining=((ted.msgCount * MAX_USER_DATA_BYTES_WITH_HEADER) - octets) / 2;
      }
 else {
        ted.msgCount=1;
        ted.codeUnitsRemaining=(MAX_USER_DATA_BYTES - octets) / 2;
      }
      ted.codeUnitSize=ENCODING_16BIT;
    }
  }
  return ted;
}
Program: 181488
Project: 181488
Buggy source:
/** 
 * Calculate the number of septets needed to encode the message.
 * @param msgBody the message to encode
 * @param use7bitOnly ignore (but still count) illegal characters if true
 * @return TextEncodingDetails
 */
public static TextEncodingDetails calculateLength(CharSequence msgBody,boolean use7bitOnly){
  TextEncodingDetails ted=new TextEncodingDetails();
  try {
    int septets=GsmAlphabet.countGsmSeptets(msgBody,!use7bitOnly);
    ted.codeUnitCount=septets;
    if (septets > MAX_USER_DATA_SEPTETS) {
      ted.msgCount=(septets / MAX_USER_DATA_SEPTETS_WITH_HEADER) + 1;
      ted.codeUnitsRemaining=MAX_USER_DATA_SEPTETS_WITH_HEADER - (septets % MAX_USER_DATA_SEPTETS_WITH_HEADER);
    }
 else {
      ted.msgCount=1;
      ted.codeUnitsRemaining=MAX_USER_DATA_SEPTETS - septets;
    }
    ted.codeUnitSize=ENCODING_7BIT;
  }
 catch (  EncodeException ex) {
    int octets=msgBody.length() * 2;
    ted.codeUnitCount=msgBody.length();
    if (octets > MAX_USER_DATA_BYTES) {
      ted.msgCount=(octets / MAX_USER_DATA_BYTES_WITH_HEADER) + 1;
      ted.codeUnitsRemaining=(MAX_USER_DATA_BYTES_WITH_HEADER - (octets % MAX_USER_DATA_BYTES_WITH_HEADER)) / 2;
    }
 else {
      ted.msgCount=1;
      ted.codeUnitsRemaining=(MAX_USER_DATA_BYTES - octets) / 2;
    }
    ted.codeUnitSize=ENCODING_16BIT;
  }
  return ted;
}

Fixed version (ground truth):
/** 
 * Calculate the number of septets needed to encode the message.
 * @param msgBody the message to encode
 * @param use7bitOnly ignore (but still count) illegal characters if true
 * @return TextEncodingDetails
 */
public static TextEncodingDetails calculateLength(CharSequence msgBody,boolean use7bitOnly){
  TextEncodingDetails ted=new TextEncodingDetails();
  try {
    int septets=GsmAlphabet.countGsmSeptets(msgBody,!use7bitOnly);
    ted.codeUnitCount=septets;
    if (septets > MAX_USER_DATA_SEPTETS) {
      ted.msgCount=(septets + (MAX_USER_DATA_SEPTETS_WITH_HEADER - 1)) / MAX_USER_DATA_SEPTETS_WITH_HEADER;
      ted.codeUnitsRemaining=(ted.msgCount * MAX_USER_DATA_SEPTETS_WITH_HEADER) - septets;
    }
 else {
      ted.msgCount=1;
      ted.codeUnitsRemaining=MAX_USER_DATA_SEPTETS - septets;
    }
    ted.codeUnitSize=ENCODING_7BIT;
  }
 catch (  EncodeException ex) {
    int octets=msgBody.length() * 2;
    ted.codeUnitCount=msgBody.length();
    if (octets > MAX_USER_DATA_BYTES) {
      ted.msgCount=(octets + (MAX_USER_DATA_BYTES_WITH_HEADER - 1)) / MAX_USER_DATA_BYTES_WITH_HEADER;
      ted.codeUnitsRemaining=((ted.msgCount * MAX_USER_DATA_BYTES_WITH_HEADER) - octets) / 2;
    }
 else {
      ted.msgCount=1;
      ted.codeUnitsRemaining=(MAX_USER_DATA_BYTES - octets) / 2;
    }
    ted.codeUnitSize=ENCODING_16BIT;
  }
  return ted;
}
Program: 181489
Project: 181489
Buggy source:
public void dump(Printer pw,String prefix){
  pw.println(prefix + this);
  pw.println(prefix + "String_Node_Str" + mRun);
  pw.println(prefix + "String_Node_Str" + mThread);
  pw.println(prefix + "String_Node_Str" + ((mQueue != null) ? mQueue : "String_Node_Str"));
  if (mQueue != null) {
synchronized (mQueue) {
      Message msg=mQueue.mMessages;
      int n=0;
      while (msg != null) {
        pw.println(prefix + "String_Node_Str" + n+ "String_Node_Str"+ msg);
        n++;
        msg=msg.next;
      }
      pw.println(prefix + "String_Node_Str" + n+ "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public void dump(Printer pw,String prefix){
  pw.println(prefix + this);
  pw.println(prefix + "String_Node_Str" + mRun);
  pw.println(prefix + "String_Node_Str" + mThread);
  pw.println(prefix + "String_Node_Str" + ((mQueue != null) ? mQueue : "String_Node_Str"));
  if (mQueue != null) {
synchronized (mQueue) {
      long now=SystemClock.uptimeMillis();
      Message msg=mQueue.mMessages;
      int n=0;
      while (msg != null) {
        pw.println(prefix + "String_Node_Str" + n+ "String_Node_Str"+ msg.toString(now));
        n++;
        msg=msg.next;
      }
      pw.println(prefix + "String_Node_Str" + n+ "String_Node_Str");
    }
  }
}
Program: 181490
Project: 181490
Buggy source:
public String toString(){
  StringBuilder b=new StringBuilder();
  b.append("String_Node_Str");
  b.append(what);
  b.append("String_Node_Str");
  b.append(when);
  if (arg1 != 0) {
    b.append("String_Node_Str");
    b.append(arg1);
  }
  if (arg2 != 0) {
    b.append("String_Node_Str");
    b.append(arg2);
  }
  if (obj != null) {
    b.append("String_Node_Str");
    b.append(obj);
  }
  b.append("String_Node_Str");
  return b.toString();
}

Fixed version (ground truth):
String toString(long now){
  StringBuilder b=new StringBuilder();
  b.append("String_Node_Str");
  b.append(what);
  b.append("String_Node_Str");
  TimeUtils.formatDuration(when - now,b);
  if (arg1 != 0) {
    b.append("String_Node_Str");
    b.append(arg1);
  }
  if (arg2 != 0) {
    b.append("String_Node_Str");
    b.append(arg2);
  }
  if (obj != null) {
    b.append("String_Node_Str");
    b.append(obj);
  }
  b.append("String_Node_Str");
  return b.toString();
}
Program: 181491
Project: 181491
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  ImageView content=new ImageView(this);
  content.setImageResource(com.android.internal.R.drawable.platlogo);
  content.setScaleType(ImageView.ScaleType.FIT_CENTER);
  setContentView(content);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mToast=Toast.makeText(this,"String_Node_Str",Toast.LENGTH_SHORT);
  ImageView content=new ImageView(this);
  content.setImageResource(com.android.internal.R.drawable.platlogo);
  content.setScaleType(ImageView.ScaleType.FIT_CENTER);
  setContentView(content);
}
Program: 181492
Project: 181492
Buggy source:
public void noteScreenOnLocked(){
  if (!mScreenOn) {
    mHistoryCur.states|=HistoryItem.STATE_SCREEN_ON_FLAG;
    if (DEBUG_HISTORY)     Slog.v(TAG,"String_Node_Str" + Integer.toHexString(mHistoryCur.states));
    addHistoryRecordLocked(SystemClock.elapsedRealtime());
    mScreenOn=true;
    mScreenOnTimer.startRunningLocked(this);
    if (mScreenBrightnessBin >= 0) {
      mScreenBrightnessTimer[mScreenBrightnessBin].startRunningLocked(this);
    }
    noteStartWakeLocked(-1,-1,"String_Node_Str",0);
  }
}

Fixed version (ground truth):
public void noteScreenOnLocked(){
  if (!mScreenOn) {
    mHistoryCur.states|=HistoryItem.STATE_SCREEN_ON_FLAG;
    if (DEBUG_HISTORY)     Slog.v(TAG,"String_Node_Str" + Integer.toHexString(mHistoryCur.states));
    addHistoryRecordLocked(SystemClock.elapsedRealtime());
    mScreenOn=true;
    mScreenOnTimer.startRunningLocked(this);
    if (mScreenBrightnessBin >= 0) {
      mScreenBrightnessTimer[mScreenBrightnessBin].startRunningLocked(this);
    }
    noteStartWakeLocked(-1,-1,"String_Node_Str",WAKE_TYPE_PARTIAL);
  }
}
Program: 181493
Project: 181493
Buggy source:
public void noteStartWakeLocked(int pid,String name,int type){
  StopwatchTimer t=getWakeTimerLocked(name,type);
  if (t != null) {
    t.startRunningLocked(BatteryStatsImpl.this);
  }
  if (pid >= 0) {
    Pid p=getPidStatsLocked(pid);
    p.mWakeStart=SystemClock.elapsedRealtime();
  }
}

Fixed version (ground truth):
public void noteStartWakeLocked(int pid,String name,int type){
  StopwatchTimer t=getWakeTimerLocked(name,type);
  if (t != null) {
    t.startRunningLocked(BatteryStatsImpl.this);
  }
  if (pid >= 0 && type == WAKE_TYPE_PARTIAL) {
    Pid p=getPidStatsLocked(pid);
    p.mWakeStart=SystemClock.elapsedRealtime();
  }
}