nus-yam/ex-repair huggingface dataset:
Program: 21992
Project: 21992
Buggy source:
private final void realStartServiceLocked(ServiceRecord r,ProcessRecord app) throws RemoteException {
  if (app.thread == null) {
    throw new RemoteException();
  }
  r.app=app;
  r.restartTime=r.lastActivity=SystemClock.uptimeMillis();
  app.services.add(r);
  bumpServiceExecutingLocked(r);
  updateLruProcessLocked(app,true,true);
  boolean created=false;
  try {
    if (DEBUG_SERVICE)     Slog.v(TAG,"String_Node_Str" + r.name + "String_Node_Str"+ r.intent);
    mStringBuilder.setLength(0);
    r.intent.getIntent().toShortString(mStringBuilder,false,true);
    EventLog.writeEvent(EventLogTags.AM_CREATE_SERVICE,System.identityHashCode(r),r.shortName,mStringBuilder.toString(),r.app.pid);
synchronized (r.stats.getBatteryStats()) {
      r.stats.startLaunchedLocked();
    }
    ensurePackageDexOpt(r.serviceInfo.packageName);
    app.thread.scheduleCreateService(r,r.serviceInfo);
    r.postNotification();
    created=true;
  }
  finally {
    if (!created) {
      app.services.remove(r);
      scheduleServiceRestartLocked(r,false);
    }
  }
  requestServiceBindingsLocked(r);
  if (r.startRequested && r.callStart && r.pendingStarts.size() == 0) {
    r.lastStartId++;
    if (r.lastStartId < 1) {
      r.lastStartId=1;
    }
    r.pendingStarts.add(new ServiceRecord.StartItem(r.lastStartId,null));
  }
  sendServiceArgsLocked(r,true);
}

Fixed version (ground truth):
private final void realStartServiceLocked(ServiceRecord r,ProcessRecord app) throws RemoteException {
  if (app.thread == null) {
    throw new RemoteException();
  }
  r.app=app;
  r.restartTime=r.lastActivity=SystemClock.uptimeMillis();
  app.services.add(r);
  bumpServiceExecutingLocked(r);
  updateLruProcessLocked(app,true,true);
  boolean created=false;
  try {
    if (DEBUG_SERVICE)     Slog.v(TAG,"String_Node_Str" + r.name + "String_Node_Str"+ r.intent);
    mStringBuilder.setLength(0);
    r.intent.getIntent().toShortString(mStringBuilder,false,true);
    EventLog.writeEvent(EventLogTags.AM_CREATE_SERVICE,System.identityHashCode(r),r.shortName,mStringBuilder.toString(),r.app.pid);
synchronized (r.stats.getBatteryStats()) {
      r.stats.startLaunchedLocked();
    }
    ensurePackageDexOpt(r.serviceInfo.packageName);
    app.thread.scheduleCreateService(r,r.serviceInfo);
    r.postNotification();
    created=true;
  }
  finally {
    if (!created) {
      app.services.remove(r);
      scheduleServiceRestartLocked(r,false);
    }
  }
  requestServiceBindingsLocked(r);
  if (r.startRequested && r.callStart && r.pendingStarts.size() == 0) {
    r.lastStartId++;
    if (r.lastStartId < 1) {
      r.lastStartId=1;
    }
    r.pendingStarts.add(new ServiceRecord.StartItem(r,r.lastStartId,null,-1));
  }
  sendServiceArgsLocked(r,true);
}
Program: 21993
Project: 21993
Buggy source:
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);
}

Fixed version (ground truth):
void grantUriPermissionFromIntentLocked(int callingUid,String targetPkg,Intent intent,UriPermissionOwner owner){
  int targetUid=checkGrantUriPermissionFromIntentLocked(callingUid,targetPkg,intent);
  if (targetUid < 0) {
    return;
  }
  grantUriPermissionUncheckedFromIntentLocked(targetUid,targetPkg,intent,owner);
}
Program: 21994
Project: 21994
Buggy source:
public boolean stopServiceToken(ComponentName className,IBinder token,int startId){
synchronized (this) {
    if (DEBUG_SERVICE)     Slog.v(TAG,"String_Node_Str" + className + "String_Node_Str"+ token+ "String_Node_Str"+ startId);
    ServiceRecord r=findServiceLocked(className,token);
    if (r != null) {
      if (startId >= 0) {
        ServiceRecord.StartItem si=r.findDeliveredStart(startId,false);
        if (si != null) {
          while (r.deliveredStarts.size() > 0) {
            if (r.deliveredStarts.remove(0) == si) {
              break;
            }
          }
        }
        if (r.lastStartId != startId) {
          return false;
        }
        if (r.deliveredStarts.size() > 0) {
          Slog.w(TAG,"String_Node_Str" + startId + "String_Node_Str"+ r.deliveredStarts.size()+ "String_Node_Str");
        }
      }
synchronized (r.stats.getBatteryStats()) {
        r.stats.stopRunningLocked();
        r.startRequested=false;
        r.callStart=false;
      }
      final long origId=Binder.clearCallingIdentity();
      bringDownServiceLocked(r,false);
      Binder.restoreCallingIdentity(origId);
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean stopServiceToken(ComponentName className,IBinder token,int startId){
synchronized (this) {
    if (DEBUG_SERVICE)     Slog.v(TAG,"String_Node_Str" + className + "String_Node_Str"+ token+ "String_Node_Str"+ startId);
    ServiceRecord r=findServiceLocked(className,token);
    if (r != null) {
      if (startId >= 0) {
        ServiceRecord.StartItem si=r.findDeliveredStart(startId,false);
        if (si != null) {
          while (r.deliveredStarts.size() > 0) {
            ServiceRecord.StartItem cur=r.deliveredStarts.remove(0);
            cur.removeUriPermissionsLocked();
            if (cur == si) {
              break;
            }
          }
        }
        if (r.lastStartId != startId) {
          return false;
        }
        if (r.deliveredStarts.size() > 0) {
          Slog.w(TAG,"String_Node_Str" + startId + "String_Node_Str"+ r.deliveredStarts.size()+ "String_Node_Str");
        }
      }
synchronized (r.stats.getBatteryStats()) {
        r.stats.stopRunningLocked();
        r.startRequested=false;
        r.callStart=false;
      }
      final long origId=Binder.clearCallingIdentity();
      bringDownServiceLocked(r,false);
      Binder.restoreCallingIdentity(origId);
      return true;
    }
  }
  return false;
}
Program: 21997
Project: 21997
Buggy source:
private final void sendServiceArgsLocked(ServiceRecord r,boolean oomAdjusted){
  final int N=r.pendingStarts.size();
  if (N == 0) {
    return;
  }
  int i=0;
  while (i < N) {
    try {
      ServiceRecord.StartItem si=r.pendingStarts.get(i);
      if (DEBUG_SERVICE)       Slog.v(TAG,"String_Node_Str" + r.name + "String_Node_Str"+ r.intent+ "String_Node_Str"+ si.intent);
      if (si.intent == null && N > 1) {
        i++;
        continue;
      }
      bumpServiceExecutingLocked(r);
      if (!oomAdjusted) {
        oomAdjusted=true;
        updateOomAdjLocked(r.app);
      }
      int flags=0;
      if (si.deliveryCount > 0) {
        flags|=Service.START_FLAG_RETRY;
      }
      if (si.doneExecutingCount > 0) {
        flags|=Service.START_FLAG_REDELIVERY;
      }
      r.app.thread.scheduleServiceArgs(r,si.id,flags,si.intent);
      si.deliveredTime=SystemClock.uptimeMillis();
      r.deliveredStarts.add(si);
      si.deliveryCount++;
      i++;
    }
 catch (    RemoteException e) {
      break;
    }
catch (    Exception e) {
      Slog.w(TAG,"String_Node_Str",e);
      break;
    }
  }
  if (i == N) {
    r.pendingStarts.clear();
  }
 else {
    while (i > 0) {
      i--;
      r.pendingStarts.remove(i);
    }
  }
}

Fixed version (ground truth):
private final void sendServiceArgsLocked(ServiceRecord r,boolean oomAdjusted){
  final int N=r.pendingStarts.size();
  if (N == 0) {
    return;
  }
  while (r.pendingStarts.size() > 0) {
    try {
      ServiceRecord.StartItem si=r.pendingStarts.remove(0);
      if (DEBUG_SERVICE)       Slog.v(TAG,"String_Node_Str" + r.name + "String_Node_Str"+ r.intent+ "String_Node_Str"+ si.intent);
      if (si.intent == null) {
        continue;
      }
      si.deliveredTime=SystemClock.uptimeMillis();
      r.deliveredStarts.add(si);
      si.deliveryCount++;
      if (si.targetPermissionUid >= 0) {
        grantUriPermissionUncheckedFromIntentLocked(si.targetPermissionUid,r.packageName,si.intent,si);
      }
      bumpServiceExecutingLocked(r);
      if (!oomAdjusted) {
        oomAdjusted=true;
        updateOomAdjLocked(r.app);
      }
      int flags=0;
      if (si.deliveryCount > 0) {
        flags|=Service.START_FLAG_RETRY;
      }
      if (si.doneExecutingCount > 0) {
        flags|=Service.START_FLAG_REDELIVERY;
      }
      r.app.thread.scheduleServiceArgs(r,si.id,flags,si.intent);
    }
 catch (    RemoteException e) {
      break;
    }
catch (    Exception e) {
      Slog.w(TAG,"String_Node_Str",e);
      break;
    }
  }
}
Program: 22000
Project: 22000
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: 22001
Project: 22001
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: 22002
Project: 22002
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: 22003
Project: 22003
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: 22004
Project: 22004
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: 22005
Project: 22005
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: 22006
Project: 22006
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: 22007
Project: 22007
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: 22008
Project: 22008
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: 22009
Project: 22009
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: 22013
Project: 22013
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: 22014
Project: 22014
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: 22015
Project: 22015
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: 22016
Project: 22016
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: 22017
Project: 22017
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: 22018
Project: 22018
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: 22019
Project: 22019
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: 22020
Project: 22020
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: 22024
Project: 22024
Buggy source:
/** 
 * Retrieves the compelete voice mail number.
 * @hide
 */
public String getCompleteVoiceMailNumber(){
  mContext.enforceCallingOrSelfPermission(CALL_PRIVILEGED,"String_Node_Str");
  String number=mPhone.getVoiceMailNumber();
  Log.d(LOG_TAG,"String_Node_Str");
  return number;
}

Fixed version (ground truth):
/** 
 * Retrieves the complete voice mail number.
 * @hide
 */
public String getCompleteVoiceMailNumber(){
  mContext.enforceCallingOrSelfPermission(CALL_PRIVILEGED,"String_Node_Str");
  String number=mPhone.getVoiceMailNumber();
  Log.d(LOG_TAG,"String_Node_Str");
  return number;
}
Program: 22025
Project: 22025
Buggy source:
/** 
 * response.obj.result is an String[14] See ril.h for details Please note that registration state 4 ("unknown") is treated as "out of service" above
 */
public void getRegistrationState(Message result){
  String ret[]=new String[14];
  ret[0]="String_Node_Str";
  ret[1]=null;
  ret[2]=null;
  ret[3]=null;
  ret[4]=null;
  ret[5]=null;
  ret[6]=null;
  ret[7]=null;
  ret[8]=null;
  ret[9]=null;
  ret[10]=null;
  ret[11]=null;
  ret[12]=null;
  ret[13]=null;
  ret[14]=null;
  resultSuccess(result,ret);
}

Fixed version (ground truth):
/** 
 * response.obj.result is an String[14] See ril.h for details Please note that registration state 4 ("unknown") is treated as "out of service" above
 */
public void getRegistrationState(Message result){
  String ret[]=new String[14];
  ret[0]="String_Node_Str";
  ret[1]=null;
  ret[2]=null;
  ret[3]=null;
  ret[4]=null;
  ret[5]=null;
  ret[6]=null;
  ret[7]=null;
  ret[8]=null;
  ret[9]=null;
  ret[10]=null;
  ret[11]=null;
  ret[12]=null;
  ret[13]=null;
  resultSuccess(result,ret);
}
Program: 22026
Project: 22026
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: 22027
Project: 22027
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: 22028
Project: 22028
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: 22029
Project: 22029
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: 22030
Project: 22030
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: 22031
Project: 22031
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: 22032
Project: 22032
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: 22033
Project: 22033
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: 22034
Project: 22034
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: 22035
Project: 22035
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);
}