nus-yam/ex-repair huggingface dataset:
Program: 1319
Project: 1319
Buggy source:
private final int updateLruProcessInternalLocked(ProcessRecord app,long now,int index,String what,Object obj,ProcessRecord srcApp){
  app.lastActivityTime=now;
  if (app.activities.size() > 0) {
    return index;
  }
  int lrui=mLruProcesses.lastIndexOf(app);
  if (lrui < 0) {
    throw new IllegalStateException("String_Node_Str" + app + "String_Node_Str"+ what+ obj+ "String_Node_Str"+ srcApp);
  }
  if (lrui >= mLruProcessActivityStart) {
    return index;
  }
  mLruProcesses.remove(lrui);
  if (index > 0) {
    index--;
  }
  mLruProcesses.add(index,app);
  return index;
}

Fixed version (ground truth):
private final int updateLruProcessInternalLocked(ProcessRecord app,long now,int index,String what,Object obj,ProcessRecord srcApp){
  app.lastActivityTime=now;
  if (app.activities.size() > 0) {
    return index;
  }
  int lrui=mLruProcesses.lastIndexOf(app);
  if (lrui < 0) {
    Log.wtf(TAG,"String_Node_Str" + app + "String_Node_Str"+ what+ "String_Node_Str"+ obj+ "String_Node_Str"+ srcApp);
    return index;
  }
  if (lrui >= mLruProcessActivityStart) {
    return index;
  }
  mLruProcesses.remove(lrui);
  if (index > 0) {
    index--;
  }
  mLruProcesses.add(index,app);
  return index;
}
Program: 1320
Project: 1320
Buggy source:
final void updateLruProcessLocked(ProcessRecord app,boolean oomAdj,boolean activityChange){
  final boolean hasActivity=app.activities.size() > 0;
  if (!activityChange && hasActivity) {
    return;
  }
  mLruSeq++;
  final long now=SystemClock.uptimeMillis();
  app.lastActivityTime=now;
  int lrui=mLruProcesses.lastIndexOf(app);
  if (lrui >= 0) {
    if (lrui < mLruProcessActivityStart) {
      mLruProcessActivityStart--;
    }
    mLruProcesses.remove(lrui);
  }
  int nextIndex;
  if (!hasActivity) {
    mLruProcesses.add(mLruProcessActivityStart,app);
    nextIndex=mLruProcessActivityStart - 1;
    mLruProcessActivityStart++;
  }
 else {
    mLruProcesses.add(app);
    nextIndex=mLruProcessActivityStart;
  }
  for (int j=app.connections.size() - 1; j >= 0; j--) {
    ConnectionRecord cr=app.connections.valueAt(j);
    if (cr.binding != null && cr.binding.service != null && cr.binding.service.app != null && cr.binding.service.app.lruSeq != mLruSeq) {
      nextIndex=updateLruProcessInternalLocked(cr.binding.service.app,now,nextIndex,"String_Node_Str",cr,app);
    }
  }
  for (int j=app.conProviders.size() - 1; j >= 0; j--) {
    ContentProviderRecord cpr=app.conProviders.get(j).provider;
    if (cpr.proc != null && cpr.proc.lruSeq != mLruSeq) {
      nextIndex=updateLruProcessInternalLocked(cpr.proc,now,nextIndex,"String_Node_Str",cpr,app);
    }
  }
  if (oomAdj) {
    updateOomAdjLocked();
  }
}

Fixed version (ground truth):
final void updateLruProcessLocked(ProcessRecord app,boolean oomAdj,boolean activityChange){
  final boolean hasActivity=app.activities.size() > 0;
  if (!activityChange && hasActivity) {
    return;
  }
  mLruSeq++;
  final long now=SystemClock.uptimeMillis();
  app.lastActivityTime=now;
  int lrui=mLruProcesses.lastIndexOf(app);
  if (lrui >= 0) {
    if (lrui < mLruProcessActivityStart) {
      mLruProcessActivityStart--;
    }
    mLruProcesses.remove(lrui);
  }
  int nextIndex;
  if (!hasActivity) {
    mLruProcesses.add(mLruProcessActivityStart,app);
    nextIndex=mLruProcessActivityStart - 1;
    mLruProcessActivityStart++;
  }
 else {
    mLruProcesses.add(app);
    nextIndex=mLruProcessActivityStart;
  }
  for (int j=app.connections.size() - 1; j >= 0; j--) {
    ConnectionRecord cr=app.connections.valueAt(j);
    if (cr.binding != null && !cr.serviceDead && cr.binding.service != null && cr.binding.service.app != null && cr.binding.service.app.lruSeq != mLruSeq) {
      nextIndex=updateLruProcessInternalLocked(cr.binding.service.app,now,nextIndex,"String_Node_Str",cr,app);
    }
  }
  for (int j=app.conProviders.size() - 1; j >= 0; j--) {
    ContentProviderRecord cpr=app.conProviders.get(j).provider;
    if (cpr.proc != null && cpr.proc.lruSeq != mLruSeq) {
      nextIndex=updateLruProcessInternalLocked(cpr.proc,now,nextIndex,"String_Node_Str",cpr,app);
    }
  }
  if (oomAdj) {
    updateOomAdjLocked();
  }
}
Program: 1322
Project: 1322
Buggy source:
/** 
 * Writes the Bundle contents to a Parcel, typically in order for it to be passed through an IBinder connection.
 * @param parcel The parcel to copy this bundle to.
 */
public void writeToParcel(Parcel parcel,int flags){
  final boolean oldAllowFds=parcel.pushAllowFds(mAllowFds);
  try {
    if (mParcelledData != null) {
      int length=mParcelledData.dataSize();
      parcel.writeInt(length);
      parcel.writeInt(0x4C444E42);
      parcel.appendFrom(mParcelledData,0,length);
    }
 else {
      parcel.writeInt(-1);
      parcel.writeInt(0x4C444E42);
      int oldPos=parcel.dataPosition();
      parcel.writeArrayMapInternal(mMap);
      int newPos=parcel.dataPosition();
      parcel.setDataPosition(oldPos - 8);
      int length=newPos - oldPos;
      parcel.writeInt(length);
      parcel.setDataPosition(newPos);
    }
  }
  finally {
    parcel.restoreAllowFds(oldAllowFds);
  }
}

Fixed version (ground truth):
/** 
 * Writes the Bundle contents to a Parcel, typically in order for it to be passed through an IBinder connection.
 * @param parcel The parcel to copy this bundle to.
 */
public void writeToParcel(Parcel parcel,int flags){
  final boolean oldAllowFds=parcel.pushAllowFds(mAllowFds);
  try {
    if (mParcelledData != null) {
      int length=mParcelledData.dataSize();
      parcel.writeInt(length);
      parcel.writeInt(BUNDLE_MAGIC);
      parcel.appendFrom(mParcelledData,0,length);
    }
 else {
      parcel.writeInt(-1);
      parcel.writeInt(BUNDLE_MAGIC);
      int oldPos=parcel.dataPosition();
      parcel.writeArrayMapInternal(mMap);
      int newPos=parcel.dataPosition();
      parcel.setDataPosition(oldPos - 8);
      int length=newPos - oldPos;
      parcel.writeInt(length);
      parcel.setDataPosition(newPos);
    }
  }
  finally {
    parcel.restoreAllowFds(oldAllowFds);
  }
}
Program: 1323
Project: 1323
Buggy source:
void readFromParcelInner(Parcel parcel,int length){
  int magic=parcel.readInt();
  if (magic != 0x4C444E42) {
    String st=Log.getStackTraceString(new RuntimeException());
    Log.e("String_Node_Str","String_Node_Str");
    Log.e("String_Node_Str","String_Node_Str" + st);
  }
  int offset=parcel.dataPosition();
  parcel.setDataPosition(offset + length);
  Parcel p=Parcel.obtain();
  p.setDataPosition(0);
  p.appendFrom(parcel,offset,length);
  p.setDataPosition(0);
  mParcelledData=p;
  mHasFds=p.hasFileDescriptors();
  mFdsKnown=true;
}

Fixed version (ground truth):
void readFromParcelInner(Parcel parcel,int length){
  int magic=parcel.readInt();
  if (magic != BUNDLE_MAGIC) {
    throw new IllegalStateException("String_Node_Str" + Integer.toHexString(magic));
  }
  int offset=parcel.dataPosition();
  parcel.setDataPosition(offset + length);
  Parcel p=Parcel.obtain();
  p.setDataPosition(0);
  p.appendFrom(parcel,offset,length);
  p.setDataPosition(0);
  if (mMap != null) {
    if (mFdsKnown) {
      mHasFds|=p.hasFileDescriptors();
    }
    int N=p.readInt();
    p.readArrayMapSafelyInternal(mMap,N,mClassLoader);
    p.recycle();
  }
 else {
    mParcelledData=p;
    mHasFds=p.hasFileDescriptors();
    mFdsKnown=true;
  }
}
Program: 1324
Project: 1324
Buggy source:
void readArrayMapInternal(ArrayMap outVal,int N,ClassLoader loader){
  while (N > 0) {
    Object key=readValue(loader);
    Object value=readValue(loader);
    outVal.append(key,value);
    N--;
  }
}

Fixed version (ground truth):
void readArrayMapInternal(ArrayMap outVal,int N,ClassLoader loader){
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  while (N > 0) {
    Object key=readValue(loader);
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + (N - 1) + "String_Node_Str"+ (key != null ? key.hashCode() : 0)+ "String_Node_Str"+ key);
    Object value=readValue(loader);
    outVal.append(key,value);
    N--;
  }
}
Program: 1325
Project: 1325
Buggy source:
/** 
 * Flatten an ArrayMap into the parcel at the current dataPosition(), growing dataCapacity() if needed.  The Map keys must be String objects.
 */
void writeArrayMapInternal(ArrayMap<String,Object> val){
  if (val == null) {
    writeInt(-1);
    return;
  }
  final int N=val.size();
  writeInt(N);
  for (int i=0; i < N; i++) {
    writeValue(val.keyAt(i));
    writeValue(val.valueAt(i));
  }
}

Fixed version (ground truth):
/** 
 * Flatten an ArrayMap into the parcel at the current dataPosition(), growing dataCapacity() if needed.  The Map keys must be String objects.
 */
void writeArrayMapInternal(ArrayMap<String,Object> val){
  if (val == null) {
    writeInt(-1);
    return;
  }
  final int N=val.size();
  writeInt(N);
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  for (int i=0; i < N; i++) {
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + i + "String_Node_Str"+ (val.keyAt(i) != null ? val.keyAt(i).hashCode() : 0)+ "String_Node_Str"+ val.keyAt(i));
    writeValue(val.keyAt(i));
    writeValue(val.valueAt(i));
  }
}
Program: 1327
Project: 1327
Buggy source:
/** 
 * Writes the Bundle contents to a Parcel, typically in order for it to be passed through an IBinder connection.
 * @param parcel The parcel to copy this bundle to.
 */
public void writeToParcel(Parcel parcel,int flags){
  final boolean oldAllowFds=parcel.pushAllowFds(mAllowFds);
  try {
    if (mParcelledData != null) {
      int length=mParcelledData.dataSize();
      parcel.writeInt(length);
      parcel.writeInt(0x4C444E42);
      parcel.appendFrom(mParcelledData,0,length);
    }
 else {
      parcel.writeInt(-1);
      parcel.writeInt(0x4C444E42);
      int oldPos=parcel.dataPosition();
      parcel.writeArrayMapInternal(mMap);
      int newPos=parcel.dataPosition();
      parcel.setDataPosition(oldPos - 8);
      int length=newPos - oldPos;
      parcel.writeInt(length);
      parcel.setDataPosition(newPos);
    }
  }
  finally {
    parcel.restoreAllowFds(oldAllowFds);
  }
}

Fixed version (ground truth):
/** 
 * Writes the Bundle contents to a Parcel, typically in order for it to be passed through an IBinder connection.
 * @param parcel The parcel to copy this bundle to.
 */
public void writeToParcel(Parcel parcel,int flags){
  final boolean oldAllowFds=parcel.pushAllowFds(mAllowFds);
  try {
    if (mParcelledData != null) {
      int length=mParcelledData.dataSize();
      parcel.writeInt(length);
      parcel.writeInt(BUNDLE_MAGIC);
      parcel.appendFrom(mParcelledData,0,length);
    }
 else {
      parcel.writeInt(-1);
      parcel.writeInt(BUNDLE_MAGIC);
      int oldPos=parcel.dataPosition();
      parcel.writeArrayMapInternal(mMap);
      int newPos=parcel.dataPosition();
      parcel.setDataPosition(oldPos - 8);
      int length=newPos - oldPos;
      parcel.writeInt(length);
      parcel.setDataPosition(newPos);
    }
  }
  finally {
    parcel.restoreAllowFds(oldAllowFds);
  }
}
Program: 1328
Project: 1328
Buggy source:
void readFromParcelInner(Parcel parcel,int length){
  int magic=parcel.readInt();
  if (magic != 0x4C444E42) {
    String st=Log.getStackTraceString(new RuntimeException());
    Log.e("String_Node_Str","String_Node_Str");
    Log.e("String_Node_Str","String_Node_Str" + st);
  }
  int offset=parcel.dataPosition();
  parcel.setDataPosition(offset + length);
  Parcel p=Parcel.obtain();
  p.setDataPosition(0);
  p.appendFrom(parcel,offset,length);
  p.setDataPosition(0);
  mParcelledData=p;
  mHasFds=p.hasFileDescriptors();
  mFdsKnown=true;
}

Fixed version (ground truth):
void readFromParcelInner(Parcel parcel,int length){
  int magic=parcel.readInt();
  if (magic != BUNDLE_MAGIC) {
    throw new IllegalStateException("String_Node_Str" + Integer.toHexString(magic));
  }
  int offset=parcel.dataPosition();
  parcel.setDataPosition(offset + length);
  Parcel p=Parcel.obtain();
  p.setDataPosition(0);
  p.appendFrom(parcel,offset,length);
  p.setDataPosition(0);
  if (mMap != null) {
    if (mFdsKnown) {
      mHasFds|=p.hasFileDescriptors();
    }
    int N=p.readInt();
    p.readArrayMapSafelyInternal(mMap,N,mClassLoader);
    p.recycle();
  }
 else {
    mParcelledData=p;
    mHasFds=p.hasFileDescriptors();
    mFdsKnown=true;
  }
}
Program: 1329
Project: 1329
Buggy source:
void readArrayMapInternal(ArrayMap outVal,int N,ClassLoader loader){
  while (N > 0) {
    Object key=readValue(loader);
    Object value=readValue(loader);
    outVal.append(key,value);
    N--;
  }
}

Fixed version (ground truth):
void readArrayMapInternal(ArrayMap outVal,int N,ClassLoader loader){
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  while (N > 0) {
    Object key=readValue(loader);
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + (N - 1) + "String_Node_Str"+ (key != null ? key.hashCode() : 0)+ "String_Node_Str"+ key);
    Object value=readValue(loader);
    outVal.append(key,value);
    N--;
  }
}
Program: 1330
Project: 1330
Buggy source:
/** 
 * Flatten an ArrayMap into the parcel at the current dataPosition(), growing dataCapacity() if needed.  The Map keys must be String objects.
 */
void writeArrayMapInternal(ArrayMap<String,Object> val){
  if (val == null) {
    writeInt(-1);
    return;
  }
  final int N=val.size();
  writeInt(N);
  for (int i=0; i < N; i++) {
    writeValue(val.keyAt(i));
    writeValue(val.valueAt(i));
  }
}

Fixed version (ground truth):
/** 
 * Flatten an ArrayMap into the parcel at the current dataPosition(), growing dataCapacity() if needed.  The Map keys must be String objects.
 */
void writeArrayMapInternal(ArrayMap<String,Object> val){
  if (val == null) {
    writeInt(-1);
    return;
  }
  final int N=val.size();
  writeInt(N);
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  for (int i=0; i < N; i++) {
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + i + "String_Node_Str"+ (val.keyAt(i) != null ? val.keyAt(i).hashCode() : 0)+ "String_Node_Str"+ val.keyAt(i));
    writeValue(val.keyAt(i));
    writeValue(val.valueAt(i));
  }
}
Program: 1332
Project: 1332
Buggy source:
/** 
 * Writes the Bundle contents to a Parcel, typically in order for it to be passed through an IBinder connection.
 * @param parcel The parcel to copy this bundle to.
 */
public void writeToParcel(Parcel parcel,int flags){
  final boolean oldAllowFds=parcel.pushAllowFds(mAllowFds);
  try {
    if (mParcelledData != null) {
      int length=mParcelledData.dataSize();
      parcel.writeInt(length);
      parcel.writeInt(0x4C444E42);
      parcel.appendFrom(mParcelledData,0,length);
    }
 else {
      parcel.writeInt(-1);
      parcel.writeInt(0x4C444E42);
      int oldPos=parcel.dataPosition();
      parcel.writeArrayMapInternal(mMap);
      int newPos=parcel.dataPosition();
      parcel.setDataPosition(oldPos - 8);
      int length=newPos - oldPos;
      parcel.writeInt(length);
      parcel.setDataPosition(newPos);
    }
  }
  finally {
    parcel.restoreAllowFds(oldAllowFds);
  }
}

Fixed version (ground truth):
/** 
 * Writes the Bundle contents to a Parcel, typically in order for it to be passed through an IBinder connection.
 * @param parcel The parcel to copy this bundle to.
 */
public void writeToParcel(Parcel parcel,int flags){
  final boolean oldAllowFds=parcel.pushAllowFds(mAllowFds);
  try {
    if (mParcelledData != null) {
      int length=mParcelledData.dataSize();
      parcel.writeInt(length);
      parcel.writeInt(BUNDLE_MAGIC);
      parcel.appendFrom(mParcelledData,0,length);
    }
 else {
      parcel.writeInt(-1);
      parcel.writeInt(BUNDLE_MAGIC);
      int oldPos=parcel.dataPosition();
      parcel.writeArrayMapInternal(mMap);
      int newPos=parcel.dataPosition();
      parcel.setDataPosition(oldPos - 8);
      int length=newPos - oldPos;
      parcel.writeInt(length);
      parcel.setDataPosition(newPos);
    }
  }
  finally {
    parcel.restoreAllowFds(oldAllowFds);
  }
}
Program: 1333
Project: 1333
Buggy source:
void readFromParcelInner(Parcel parcel,int length){
  int magic=parcel.readInt();
  if (magic != 0x4C444E42) {
    String st=Log.getStackTraceString(new RuntimeException());
    Log.e("String_Node_Str","String_Node_Str");
    Log.e("String_Node_Str","String_Node_Str" + st);
  }
  int offset=parcel.dataPosition();
  parcel.setDataPosition(offset + length);
  Parcel p=Parcel.obtain();
  p.setDataPosition(0);
  p.appendFrom(parcel,offset,length);
  p.setDataPosition(0);
  mParcelledData=p;
  mHasFds=p.hasFileDescriptors();
  mFdsKnown=true;
}

Fixed version (ground truth):
void readFromParcelInner(Parcel parcel,int length){
  int magic=parcel.readInt();
  if (magic != BUNDLE_MAGIC) {
    throw new IllegalStateException("String_Node_Str" + Integer.toHexString(magic));
  }
  int offset=parcel.dataPosition();
  parcel.setDataPosition(offset + length);
  Parcel p=Parcel.obtain();
  p.setDataPosition(0);
  p.appendFrom(parcel,offset,length);
  p.setDataPosition(0);
  if (mMap != null) {
    if (mFdsKnown) {
      mHasFds|=p.hasFileDescriptors();
    }
    int N=p.readInt();
    p.readArrayMapSafelyInternal(mMap,N,mClassLoader);
    p.recycle();
  }
 else {
    mParcelledData=p;
    mHasFds=p.hasFileDescriptors();
    mFdsKnown=true;
  }
}
Program: 1334
Project: 1334
Buggy source:
void readArrayMapInternal(ArrayMap outVal,int N,ClassLoader loader){
  while (N > 0) {
    Object key=readValue(loader);
    Object value=readValue(loader);
    outVal.append(key,value);
    N--;
  }
}

Fixed version (ground truth):
void readArrayMapInternal(ArrayMap outVal,int N,ClassLoader loader){
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  while (N > 0) {
    Object key=readValue(loader);
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + (N - 1) + "String_Node_Str"+ (key != null ? key.hashCode() : 0)+ "String_Node_Str"+ key);
    Object value=readValue(loader);
    outVal.append(key,value);
    N--;
  }
}
Program: 1335
Project: 1335
Buggy source:
/** 
 * Flatten an ArrayMap into the parcel at the current dataPosition(), growing dataCapacity() if needed.  The Map keys must be String objects.
 */
void writeArrayMapInternal(ArrayMap<String,Object> val){
  if (val == null) {
    writeInt(-1);
    return;
  }
  final int N=val.size();
  writeInt(N);
  for (int i=0; i < N; i++) {
    writeValue(val.keyAt(i));
    writeValue(val.valueAt(i));
  }
}

Fixed version (ground truth):
/** 
 * Flatten an ArrayMap into the parcel at the current dataPosition(), growing dataCapacity() if needed.  The Map keys must be String objects.
 */
void writeArrayMapInternal(ArrayMap<String,Object> val){
  if (val == null) {
    writeInt(-1);
    return;
  }
  final int N=val.size();
  writeInt(N);
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  for (int i=0; i < N; i++) {
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + i + "String_Node_Str"+ (val.keyAt(i) != null ? val.keyAt(i).hashCode() : 0)+ "String_Node_Str"+ val.keyAt(i));
    writeValue(val.keyAt(i));
    writeValue(val.valueAt(i));
  }
}
Program: 1336
Project: 1336
Buggy source:
/** 
 * Writes the Bundle contents to a Parcel, typically in order for it to be passed through an IBinder connection.
 * @param parcel The parcel to copy this bundle to.
 */
public void writeToParcel(Parcel parcel,int flags){
  final boolean oldAllowFds=parcel.pushAllowFds(mAllowFds);
  try {
    if (mParcelledData != null) {
      int length=mParcelledData.dataSize();
      parcel.writeInt(length);
      parcel.writeInt(0x4C444E42);
      parcel.appendFrom(mParcelledData,0,length);
    }
 else {
      parcel.writeInt(-1);
      parcel.writeInt(0x4C444E42);
      int oldPos=parcel.dataPosition();
      parcel.writeArrayMapInternal(mMap);
      int newPos=parcel.dataPosition();
      parcel.setDataPosition(oldPos - 8);
      int length=newPos - oldPos;
      parcel.writeInt(length);
      parcel.setDataPosition(newPos);
    }
  }
  finally {
    parcel.restoreAllowFds(oldAllowFds);
  }
}

Fixed version (ground truth):
/** 
 * Writes the Bundle contents to a Parcel, typically in order for it to be passed through an IBinder connection.
 * @param parcel The parcel to copy this bundle to.
 */
public void writeToParcel(Parcel parcel,int flags){
  final boolean oldAllowFds=parcel.pushAllowFds(mAllowFds);
  try {
    if (mParcelledData != null) {
      int length=mParcelledData.dataSize();
      parcel.writeInt(length);
      parcel.writeInt(BUNDLE_MAGIC);
      parcel.appendFrom(mParcelledData,0,length);
    }
 else {
      parcel.writeInt(-1);
      parcel.writeInt(BUNDLE_MAGIC);
      int oldPos=parcel.dataPosition();
      parcel.writeArrayMapInternal(mMap);
      int newPos=parcel.dataPosition();
      parcel.setDataPosition(oldPos - 8);
      int length=newPos - oldPos;
      parcel.writeInt(length);
      parcel.setDataPosition(newPos);
    }
  }
  finally {
    parcel.restoreAllowFds(oldAllowFds);
  }
}
Program: 1337
Project: 1337
Buggy source:
void readFromParcelInner(Parcel parcel,int length){
  int magic=parcel.readInt();
  if (magic != 0x4C444E42) {
    String st=Log.getStackTraceString(new RuntimeException());
    Log.e("String_Node_Str","String_Node_Str");
    Log.e("String_Node_Str","String_Node_Str" + st);
  }
  int offset=parcel.dataPosition();
  parcel.setDataPosition(offset + length);
  Parcel p=Parcel.obtain();
  p.setDataPosition(0);
  p.appendFrom(parcel,offset,length);
  p.setDataPosition(0);
  mParcelledData=p;
  mHasFds=p.hasFileDescriptors();
  mFdsKnown=true;
}

Fixed version (ground truth):
void readFromParcelInner(Parcel parcel,int length){
  int magic=parcel.readInt();
  if (magic != BUNDLE_MAGIC) {
    throw new IllegalStateException("String_Node_Str" + Integer.toHexString(magic));
  }
  int offset=parcel.dataPosition();
  parcel.setDataPosition(offset + length);
  Parcel p=Parcel.obtain();
  p.setDataPosition(0);
  p.appendFrom(parcel,offset,length);
  p.setDataPosition(0);
  if (mMap != null) {
    if (mFdsKnown) {
      mHasFds|=p.hasFileDescriptors();
    }
    int N=p.readInt();
    p.readArrayMapSafelyInternal(mMap,N,mClassLoader);
    p.recycle();
  }
 else {
    mParcelledData=p;
    mHasFds=p.hasFileDescriptors();
    mFdsKnown=true;
  }
}
Program: 1338
Project: 1338
Buggy source:
void readArrayMapInternal(ArrayMap outVal,int N,ClassLoader loader){
  while (N > 0) {
    Object key=readValue(loader);
    Object value=readValue(loader);
    outVal.append(key,value);
    N--;
  }
}

Fixed version (ground truth):
void readArrayMapInternal(ArrayMap outVal,int N,ClassLoader loader){
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  while (N > 0) {
    Object key=readValue(loader);
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + (N - 1) + "String_Node_Str"+ (key != null ? key.hashCode() : 0)+ "String_Node_Str"+ key);
    Object value=readValue(loader);
    outVal.append(key,value);
    N--;
  }
}
Program: 1339
Project: 1339
Buggy source:
/** 
 * Flatten an ArrayMap into the parcel at the current dataPosition(), growing dataCapacity() if needed.  The Map keys must be String objects.
 */
void writeArrayMapInternal(ArrayMap<String,Object> val){
  if (val == null) {
    writeInt(-1);
    return;
  }
  final int N=val.size();
  writeInt(N);
  for (int i=0; i < N; i++) {
    writeValue(val.keyAt(i));
    writeValue(val.valueAt(i));
  }
}

Fixed version (ground truth):
/** 
 * Flatten an ArrayMap into the parcel at the current dataPosition(), growing dataCapacity() if needed.  The Map keys must be String objects.
 */
void writeArrayMapInternal(ArrayMap<String,Object> val){
  if (val == null) {
    writeInt(-1);
    return;
  }
  final int N=val.size();
  writeInt(N);
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  for (int i=0; i < N; i++) {
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + i + "String_Node_Str"+ (val.keyAt(i) != null ? val.keyAt(i).hashCode() : 0)+ "String_Node_Str"+ val.keyAt(i));
    writeValue(val.keyAt(i));
    writeValue(val.valueAt(i));
  }
}
Program: 1341
Project: 1341
Buggy source:
private final void setProcessTrackerState(ProcessRecord proc,int memFactor,long now){
  if (proc.thread != null) {
    proc.baseProcessTracker.setState(proc.repProcState,memFactor,now,proc.pkgList);
  }
}

Fixed version (ground truth):
private final void setProcessTrackerState(ProcessRecord proc,int memFactor,long now){
  if (proc.thread != null && proc.baseProcessTracker != null) {
    proc.baseProcessTracker.setState(proc.repProcState,memFactor,now,proc.pkgList);
  }
}
Program: 1342
Project: 1342
Buggy source:
public boolean addPackage(String pkg,ProcessStatsService tracker){
  if (!pkgList.containsKey(pkg)) {
    pkgList.put(pkg,tracker.getProcessStateLocked(pkg,info.uid,processName));
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean addPackage(String pkg,ProcessStatsService tracker){
  if (!pkgList.containsKey(pkg)) {
    pkgList.put(pkg,baseProcessTracker != null ? tracker.getProcessStateLocked(pkg,info.uid,processName) : null);
    return true;
  }
  return false;
}
Program: 1343
Project: 1343
Buggy source:
public void resetPackageList(ProcessStatsService tracker){
  long now=SystemClock.uptimeMillis();
  baseProcessTracker.setState(ProcessStats.STATE_NOTHING,tracker.getMemFactorLocked(),now,pkgList);
  final int N=pkgList.size();
  if (N != 1) {
    for (int i=0; i < N; i++) {
      ProcessStats.ProcessState ps=pkgList.valueAt(i);
      if (ps != null && ps != baseProcessTracker) {
        ps.makeInactive();
      }
    }
    pkgList.clear();
    ProcessStats.ProcessState ps=tracker.getProcessStateLocked(info.packageName,info.uid,processName);
    pkgList.put(info.packageName,ps);
    if (thread != null && ps != baseProcessTracker) {
      ps.makeActive();
    }
  }
}

Fixed version (ground truth):
public void resetPackageList(ProcessStatsService tracker){
  final int N=pkgList.size();
  if (baseProcessTracker != null) {
    long now=SystemClock.uptimeMillis();
    baseProcessTracker.setState(ProcessStats.STATE_NOTHING,tracker.getMemFactorLocked(),now,pkgList);
    if (N != 1) {
      for (int i=0; i < N; i++) {
        ProcessStats.ProcessState ps=pkgList.valueAt(i);
        if (ps != null && ps != baseProcessTracker) {
          ps.makeInactive();
        }
      }
      pkgList.clear();
      ProcessStats.ProcessState ps=tracker.getProcessStateLocked(info.packageName,info.uid,processName);
      pkgList.put(info.packageName,ps);
      if (thread != null && ps != baseProcessTracker) {
        ps.makeActive();
      }
    }
  }
 else   if (N != 1) {
    pkgList.clear();
    pkgList.put(info.packageName,null);
  }
}
Program: 1344
Project: 1344
Buggy source:
private final void setProcessTrackerState(ProcessRecord proc,int memFactor,long now){
  if (proc.thread != null) {
    proc.baseProcessTracker.setState(proc.repProcState,memFactor,now,proc.pkgList);
  }
}

Fixed version (ground truth):
private final void setProcessTrackerState(ProcessRecord proc,int memFactor,long now){
  if (proc.thread != null && proc.baseProcessTracker != null) {
    proc.baseProcessTracker.setState(proc.repProcState,memFactor,now,proc.pkgList);
  }
}
Program: 1345
Project: 1345
Buggy source:
public boolean addPackage(String pkg,ProcessStatsService tracker){
  if (!pkgList.containsKey(pkg)) {
    pkgList.put(pkg,tracker.getProcessStateLocked(pkg,info.uid,processName));
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean addPackage(String pkg,ProcessStatsService tracker){
  if (!pkgList.containsKey(pkg)) {
    pkgList.put(pkg,baseProcessTracker != null ? tracker.getProcessStateLocked(pkg,info.uid,processName) : null);
    return true;
  }
  return false;
}
Program: 1346
Project: 1346
Buggy source:
public void resetPackageList(ProcessStatsService tracker){
  long now=SystemClock.uptimeMillis();
  baseProcessTracker.setState(ProcessStats.STATE_NOTHING,tracker.getMemFactorLocked(),now,pkgList);
  final int N=pkgList.size();
  if (N != 1) {
    for (int i=0; i < N; i++) {
      ProcessStats.ProcessState ps=pkgList.valueAt(i);
      if (ps != null && ps != baseProcessTracker) {
        ps.makeInactive();
      }
    }
    pkgList.clear();
    ProcessStats.ProcessState ps=tracker.getProcessStateLocked(info.packageName,info.uid,processName);
    pkgList.put(info.packageName,ps);
    if (thread != null && ps != baseProcessTracker) {
      ps.makeActive();
    }
  }
}

Fixed version (ground truth):
public void resetPackageList(ProcessStatsService tracker){
  final int N=pkgList.size();
  if (baseProcessTracker != null) {
    long now=SystemClock.uptimeMillis();
    baseProcessTracker.setState(ProcessStats.STATE_NOTHING,tracker.getMemFactorLocked(),now,pkgList);
    if (N != 1) {
      for (int i=0; i < N; i++) {
        ProcessStats.ProcessState ps=pkgList.valueAt(i);
        if (ps != null && ps != baseProcessTracker) {
          ps.makeInactive();
        }
      }
      pkgList.clear();
      ProcessStats.ProcessState ps=tracker.getProcessStateLocked(info.packageName,info.uid,processName);
      pkgList.put(info.packageName,ps);
      if (thread != null && ps != baseProcessTracker) {
        ps.makeActive();
      }
    }
  }
 else   if (N != 1) {
    pkgList.clear();
    pkgList.put(info.packageName,null);
  }
}
Program: 1349
Project: 1349
Buggy source:
private final void setProcessTrackerState(ProcessRecord proc,int memFactor,long now){
  if (proc.thread != null) {
    proc.baseProcessTracker.setState(proc.repProcState,memFactor,now,proc.pkgList);
  }
}

Fixed version (ground truth):
private final void setProcessTrackerState(ProcessRecord proc,int memFactor,long now){
  if (proc.thread != null && proc.baseProcessTracker != null) {
    proc.baseProcessTracker.setState(proc.repProcState,memFactor,now,proc.pkgList);
  }
}
Program: 1350
Project: 1350
Buggy source:
public boolean addPackage(String pkg,ProcessStatsService tracker){
  if (!pkgList.containsKey(pkg)) {
    pkgList.put(pkg,tracker.getProcessStateLocked(pkg,info.uid,processName));
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean addPackage(String pkg,ProcessStatsService tracker){
  if (!pkgList.containsKey(pkg)) {
    pkgList.put(pkg,baseProcessTracker != null ? tracker.getProcessStateLocked(pkg,info.uid,processName) : null);
    return true;
  }
  return false;
}
Program: 1351
Project: 1351
Buggy source:
public void resetPackageList(ProcessStatsService tracker){
  long now=SystemClock.uptimeMillis();
  baseProcessTracker.setState(ProcessStats.STATE_NOTHING,tracker.getMemFactorLocked(),now,pkgList);
  final int N=pkgList.size();
  if (N != 1) {
    for (int i=0; i < N; i++) {
      ProcessStats.ProcessState ps=pkgList.valueAt(i);
      if (ps != null && ps != baseProcessTracker) {
        ps.makeInactive();
      }
    }
    pkgList.clear();
    ProcessStats.ProcessState ps=tracker.getProcessStateLocked(info.packageName,info.uid,processName);
    pkgList.put(info.packageName,ps);
    if (thread != null && ps != baseProcessTracker) {
      ps.makeActive();
    }
  }
}

Fixed version (ground truth):
public void resetPackageList(ProcessStatsService tracker){
  final int N=pkgList.size();
  if (baseProcessTracker != null) {
    long now=SystemClock.uptimeMillis();
    baseProcessTracker.setState(ProcessStats.STATE_NOTHING,tracker.getMemFactorLocked(),now,pkgList);
    if (N != 1) {
      for (int i=0; i < N; i++) {
        ProcessStats.ProcessState ps=pkgList.valueAt(i);
        if (ps != null && ps != baseProcessTracker) {
          ps.makeInactive();
        }
      }
      pkgList.clear();
      ProcessStats.ProcessState ps=tracker.getProcessStateLocked(info.packageName,info.uid,processName);
      pkgList.put(info.packageName,ps);
      if (thread != null && ps != baseProcessTracker) {
        ps.makeActive();
      }
    }
  }
 else   if (N != 1) {
    pkgList.clear();
    pkgList.put(info.packageName,null);
  }
}
Program: 1354
Project: 1354
Buggy source:
private final void setProcessTrackerState(ProcessRecord proc,int memFactor,long now){
  if (proc.thread != null) {
    proc.baseProcessTracker.setState(proc.repProcState,memFactor,now,proc.pkgList);
  }
}

Fixed version (ground truth):
private final void setProcessTrackerState(ProcessRecord proc,int memFactor,long now){
  if (proc.thread != null && proc.baseProcessTracker != null) {
    proc.baseProcessTracker.setState(proc.repProcState,memFactor,now,proc.pkgList);
  }
}
Program: 1355
Project: 1355
Buggy source:
public boolean addPackage(String pkg,ProcessStatsService tracker){
  if (!pkgList.containsKey(pkg)) {
    pkgList.put(pkg,tracker.getProcessStateLocked(pkg,info.uid,processName));
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean addPackage(String pkg,ProcessStatsService tracker){
  if (!pkgList.containsKey(pkg)) {
    pkgList.put(pkg,baseProcessTracker != null ? tracker.getProcessStateLocked(pkg,info.uid,processName) : null);
    return true;
  }
  return false;
}
Program: 1356
Project: 1356
Buggy source:
public void resetPackageList(ProcessStatsService tracker){
  long now=SystemClock.uptimeMillis();
  baseProcessTracker.setState(ProcessStats.STATE_NOTHING,tracker.getMemFactorLocked(),now,pkgList);
  final int N=pkgList.size();
  if (N != 1) {
    for (int i=0; i < N; i++) {
      ProcessStats.ProcessState ps=pkgList.valueAt(i);
      if (ps != null && ps != baseProcessTracker) {
        ps.makeInactive();
      }
    }
    pkgList.clear();
    ProcessStats.ProcessState ps=tracker.getProcessStateLocked(info.packageName,info.uid,processName);
    pkgList.put(info.packageName,ps);
    if (thread != null && ps != baseProcessTracker) {
      ps.makeActive();
    }
  }
}

Fixed version (ground truth):
public void resetPackageList(ProcessStatsService tracker){
  final int N=pkgList.size();
  if (baseProcessTracker != null) {
    long now=SystemClock.uptimeMillis();
    baseProcessTracker.setState(ProcessStats.STATE_NOTHING,tracker.getMemFactorLocked(),now,pkgList);
    if (N != 1) {
      for (int i=0; i < N; i++) {
        ProcessStats.ProcessState ps=pkgList.valueAt(i);
        if (ps != null && ps != baseProcessTracker) {
          ps.makeInactive();
        }
      }
      pkgList.clear();
      ProcessStats.ProcessState ps=tracker.getProcessStateLocked(info.packageName,info.uid,processName);
      pkgList.put(info.packageName,ps);
      if (thread != null && ps != baseProcessTracker) {
        ps.makeActive();
      }
    }
  }
 else   if (N != 1) {
    pkgList.clear();
    pkgList.put(info.packageName,null);
  }
}
Program: 1358
Project: 1358
Buggy source:
static private void dumpHelp(PrintWriter pw){
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
}

Fixed version (ground truth):
static private void dumpHelp(PrintWriter pw){
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
}
Program: 1361
Project: 1361
Buggy source:
static private void dumpHelp(PrintWriter pw){
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
}

Fixed version (ground truth):
static private void dumpHelp(PrintWriter pw){
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
}
Program: 1364
Project: 1364
Buggy source:
static private void dumpHelp(PrintWriter pw){
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
}

Fixed version (ground truth):
static private void dumpHelp(PrintWriter pw){
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
}
Program: 1367
Project: 1367
Buggy source:
static private void dumpHelp(PrintWriter pw){
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
}

Fixed version (ground truth):
static private void dumpHelp(PrintWriter pw){
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
}
Program: 1369
Project: 1369
Buggy source:
private ProcessState pullFixedProc(ArrayMap<String,ProcessState> pkgList,int index){
  ProcessState proc=pkgList.valueAt(index);
  if (proc.mMultiPackage) {
    proc=mStats.mPackages.get(pkgList.keyAt(index),proc.mUid).mProcesses.get(proc.mName);
    if (proc == null) {
      throw new IllegalStateException("String_Node_Str");
    }
    pkgList.setValueAt(index,proc);
  }
  return proc;
}

Fixed version (ground truth):
private ProcessState pullFixedProc(ArrayMap<String,ProcessState> pkgList,int index){
  ProcessState proc=pkgList.valueAt(index);
  if (proc.mMultiPackage) {
    PackageState pkg=mStats.mPackages.get(pkgList.keyAt(index),proc.mUid);
    if (pkg == null) {
      throw new IllegalStateException("String_Node_Str" + pkgList.keyAt(index) + "String_Node_Str"+ proc.mName);
    }
    proc=pkg.mProcesses.get(proc.mName);
    if (proc == null) {
      throw new IllegalStateException("String_Node_Str");
    }
    pkgList.setValueAt(index,proc);
  }
  return proc;
}
Program: 1370
Project: 1370
Buggy source:
private ProcessState pullFixedProc(ArrayMap<String,ProcessState> pkgList,int index){
  ProcessState proc=pkgList.valueAt(index);
  if (proc.mMultiPackage) {
    proc=mStats.mPackages.get(pkgList.keyAt(index),proc.mUid).mProcesses.get(proc.mName);
    if (proc == null) {
      throw new IllegalStateException("String_Node_Str");
    }
    pkgList.setValueAt(index,proc);
  }
  return proc;
}

Fixed version (ground truth):
private ProcessState pullFixedProc(ArrayMap<String,ProcessState> pkgList,int index){
  ProcessState proc=pkgList.valueAt(index);
  if (proc.mMultiPackage) {
    PackageState pkg=mStats.mPackages.get(pkgList.keyAt(index),proc.mUid);
    if (pkg == null) {
      throw new IllegalStateException("String_Node_Str" + pkgList.keyAt(index) + "String_Node_Str"+ proc.mName);
    }
    proc=pkg.mProcesses.get(proc.mName);
    if (proc == null) {
      throw new IllegalStateException("String_Node_Str");
    }
    pkgList.setValueAt(index,proc);
  }
  return proc;
}
Program: 1371
Project: 1371
Buggy source:
private ProcessState pullFixedProc(ArrayMap<String,ProcessState> pkgList,int index){
  ProcessState proc=pkgList.valueAt(index);
  if (proc.mMultiPackage) {
    proc=mStats.mPackages.get(pkgList.keyAt(index),proc.mUid).mProcesses.get(proc.mName);
    if (proc == null) {
      throw new IllegalStateException("String_Node_Str");
    }
    pkgList.setValueAt(index,proc);
  }
  return proc;
}

Fixed version (ground truth):
private ProcessState pullFixedProc(ArrayMap<String,ProcessState> pkgList,int index){
  ProcessState proc=pkgList.valueAt(index);
  if (proc.mMultiPackage) {
    PackageState pkg=mStats.mPackages.get(pkgList.keyAt(index),proc.mUid);
    if (pkg == null) {
      throw new IllegalStateException("String_Node_Str" + pkgList.keyAt(index) + "String_Node_Str"+ proc.mName);
    }
    proc=pkg.mProcesses.get(proc.mName);
    if (proc == null) {
      throw new IllegalStateException("String_Node_Str");
    }
    pkgList.setValueAt(index,proc);
  }
  return proc;
}
Program: 1372
Project: 1372
Buggy source:
private ProcessState pullFixedProc(ArrayMap<String,ProcessState> pkgList,int index){
  ProcessState proc=pkgList.valueAt(index);
  if (proc.mMultiPackage) {
    proc=mStats.mPackages.get(pkgList.keyAt(index),proc.mUid).mProcesses.get(proc.mName);
    if (proc == null) {
      throw new IllegalStateException("String_Node_Str");
    }
    pkgList.setValueAt(index,proc);
  }
  return proc;
}

Fixed version (ground truth):
private ProcessState pullFixedProc(ArrayMap<String,ProcessState> pkgList,int index){
  ProcessState proc=pkgList.valueAt(index);
  if (proc.mMultiPackage) {
    PackageState pkg=mStats.mPackages.get(pkgList.keyAt(index),proc.mUid);
    if (pkg == null) {
      throw new IllegalStateException("String_Node_Str" + pkgList.keyAt(index) + "String_Node_Str"+ proc.mName);
    }
    proc=pkg.mProcesses.get(proc.mName);
    if (proc == null) {
      throw new IllegalStateException("String_Node_Str");
    }
    pkgList.setValueAt(index,proc);
  }
  return proc;
}
Program: 1373
Project: 1373
Buggy source:
void ensureNotStartingBackground(ServiceRecord r){
  if (mStartingBackground.remove(r)) {
    if (DEBUG_DELAYED_STATS)     Slog.v(TAG,"String_Node_Str" + r);
    rescheduleDelayedStarts();
  }
  if (mPendingServices.remove(r)) {
    if (DEBUG_DELAYED_STATS)     Slog.v(TAG,"String_Node_Str" + r);
  }
}

Fixed version (ground truth):
void ensureNotStartingBackground(ServiceRecord r){
  if (mStartingBackground.remove(r)) {
    if (DEBUG_DELAYED_STATS)     Slog.v(TAG,"String_Node_Str" + r);
    rescheduleDelayedStarts();
  }
  if (mDelayedStartList.remove(r)) {
    if (DEBUG_DELAYED_STATS)     Slog.v(TAG,"String_Node_Str" + r);
  }
}
Program: 1374
Project: 1374
Buggy source:
void ensureNotStartingBackground(ServiceRecord r){
  if (mStartingBackground.remove(r)) {
    if (DEBUG_DELAYED_STATS)     Slog.v(TAG,"String_Node_Str" + r);
    rescheduleDelayedStarts();
  }
  if (mPendingServices.remove(r)) {
    if (DEBUG_DELAYED_STATS)     Slog.v(TAG,"String_Node_Str" + r);
  }
}

Fixed version (ground truth):
void ensureNotStartingBackground(ServiceRecord r){
  if (mStartingBackground.remove(r)) {
    if (DEBUG_DELAYED_STATS)     Slog.v(TAG,"String_Node_Str" + r);
    rescheduleDelayedStarts();
  }
  if (mDelayedStartList.remove(r)) {
    if (DEBUG_DELAYED_STATS)     Slog.v(TAG,"String_Node_Str" + r);
  }
}
Program: 1375
Project: 1375
Buggy source:
void ensureNotStartingBackground(ServiceRecord r){
  if (mStartingBackground.remove(r)) {
    if (DEBUG_DELAYED_STATS)     Slog.v(TAG,"String_Node_Str" + r);
    rescheduleDelayedStarts();
  }
  if (mPendingServices.remove(r)) {
    if (DEBUG_DELAYED_STATS)     Slog.v(TAG,"String_Node_Str" + r);
  }
}

Fixed version (ground truth):
void ensureNotStartingBackground(ServiceRecord r){
  if (mStartingBackground.remove(r)) {
    if (DEBUG_DELAYED_STATS)     Slog.v(TAG,"String_Node_Str" + r);
    rescheduleDelayedStarts();
  }
  if (mDelayedStartList.remove(r)) {
    if (DEBUG_DELAYED_STATS)     Slog.v(TAG,"String_Node_Str" + r);
  }
}
Program: 1376
Project: 1376
Buggy source:
void ensureNotStartingBackground(ServiceRecord r){
  if (mStartingBackground.remove(r)) {
    if (DEBUG_DELAYED_STATS)     Slog.v(TAG,"String_Node_Str" + r);
    rescheduleDelayedStarts();
  }
  if (mPendingServices.remove(r)) {
    if (DEBUG_DELAYED_STATS)     Slog.v(TAG,"String_Node_Str" + r);
  }
}

Fixed version (ground truth):
void ensureNotStartingBackground(ServiceRecord r){
  if (mStartingBackground.remove(r)) {
    if (DEBUG_DELAYED_STATS)     Slog.v(TAG,"String_Node_Str" + r);
    rescheduleDelayedStarts();
  }
  if (mDelayedStartList.remove(r)) {
    if (DEBUG_DELAYED_STATS)     Slog.v(TAG,"String_Node_Str" + r);
  }
}
Program: 1377
Project: 1377
Buggy source:
/** 
 * @hide 
 */
public int startOp(int op){
  return startOp(op,Process.myUid(),mContext.getBasePackageName());
}

Fixed version (ground truth):
/** 
 * @hide 
 */
public int startOp(int op){
  return startOp(op,Process.myUid(),mContext.getOpPackageName());
}
Program: 1378
Project: 1378
Buggy source:
public void finishOp(int op){
  finishOp(op,Process.myUid(),mContext.getBasePackageName());
}

Fixed version (ground truth):
public void finishOp(int op){
  finishOp(op,Process.myUid(),mContext.getOpPackageName());
}
Program: 1379
Project: 1379
Buggy source:
/** 
 * @hide 
 */
public int noteOp(int op){
  return noteOp(op,Process.myUid(),mContext.getBasePackageName());
}

Fixed version (ground truth):
/** 
 * @hide 
 */
public int noteOp(int op){
  return noteOp(op,Process.myUid(),mContext.getOpPackageName());
}