nus-yam/ex-repair huggingface dataset:
Program: 198866
Project: 198866
Buggy source:
@Override public void setMode(int code,int uid,String packageName,int mode){
  if (Binder.getCallingPid() == Process.myPid()) {
    return;
  }
  mContext.enforcePermission(android.Manifest.permission.UPDATE_APP_OPS_STATS,Binder.getCallingPid(),Binder.getCallingUid(),null);
  verifyIncomingOp(code);
  ArrayList<Callback> repCbs=null;
  code=AppOpsManager.opToSwitch(code);
synchronized (this) {
    Op op=getOpLocked(code,uid,packageName,true);
    if (op != null) {
      if (op.mode != mode) {
        op.mode=mode;
        ArrayList<Callback> cbs=mOpModeWatchers.get(code);
        if (cbs != null) {
          if (repCbs == null) {
            repCbs=new ArrayList<Callback>();
          }
          repCbs.addAll(cbs);
        }
        cbs=mPackageModeWatchers.get(packageName);
        if (cbs != null) {
          if (repCbs == null) {
            repCbs=new ArrayList<Callback>();
          }
          repCbs.addAll(cbs);
        }
        if (mode == AppOpsManager.opToDefaultMode(op.op)) {
          pruneOp(op,uid,packageName);
        }
        scheduleWriteNowLocked();
      }
    }
  }
  if (repCbs != null) {
    for (int i=0; i < repCbs.size(); i++) {
      try {
        repCbs.get(i).mCallback.opChanged(code,packageName);
      }
 catch (      RemoteException e) {
      }
    }
  }
}

Fixed version (ground truth):
@Override public void setMode(int code,int uid,String packageName,int mode){
  if (Binder.getCallingPid() != Process.myPid()) {
    mContext.enforcePermission(android.Manifest.permission.UPDATE_APP_OPS_STATS,Binder.getCallingPid(),Binder.getCallingUid(),null);
  }
  verifyIncomingOp(code);
  ArrayList<Callback> repCbs=null;
  code=AppOpsManager.opToSwitch(code);
synchronized (this) {
    Op op=getOpLocked(code,uid,packageName,true);
    if (op != null) {
      if (op.mode != mode) {
        op.mode=mode;
        ArrayList<Callback> cbs=mOpModeWatchers.get(code);
        if (cbs != null) {
          if (repCbs == null) {
            repCbs=new ArrayList<Callback>();
          }
          repCbs.addAll(cbs);
        }
        cbs=mPackageModeWatchers.get(packageName);
        if (cbs != null) {
          if (repCbs == null) {
            repCbs=new ArrayList<Callback>();
          }
          repCbs.addAll(cbs);
        }
        if (mode == AppOpsManager.opToDefaultMode(op.op)) {
          pruneOp(op,uid,packageName);
        }
        scheduleWriteNowLocked();
      }
    }
  }
  if (repCbs != null) {
    for (int i=0; i < repCbs.size(); i++) {
      try {
        repCbs.get(i).mCallback.opChanged(code,packageName);
      }
 catch (      RemoteException e) {
      }
    }
  }
}
Program: 198867
Project: 198867
Buggy source:
@Override public void setMode(int code,int uid,String packageName,int mode){
  if (Binder.getCallingPid() == Process.myPid()) {
    return;
  }
  mContext.enforcePermission(android.Manifest.permission.UPDATE_APP_OPS_STATS,Binder.getCallingPid(),Binder.getCallingUid(),null);
  verifyIncomingOp(code);
  ArrayList<Callback> repCbs=null;
  code=AppOpsManager.opToSwitch(code);
synchronized (this) {
    Op op=getOpLocked(code,uid,packageName,true);
    if (op != null) {
      if (op.mode != mode) {
        op.mode=mode;
        ArrayList<Callback> cbs=mOpModeWatchers.get(code);
        if (cbs != null) {
          if (repCbs == null) {
            repCbs=new ArrayList<Callback>();
          }
          repCbs.addAll(cbs);
        }
        cbs=mPackageModeWatchers.get(packageName);
        if (cbs != null) {
          if (repCbs == null) {
            repCbs=new ArrayList<Callback>();
          }
          repCbs.addAll(cbs);
        }
        if (mode == AppOpsManager.opToDefaultMode(op.op)) {
          pruneOp(op,uid,packageName);
        }
        scheduleWriteNowLocked();
      }
    }
  }
  if (repCbs != null) {
    for (int i=0; i < repCbs.size(); i++) {
      try {
        repCbs.get(i).mCallback.opChanged(code,packageName);
      }
 catch (      RemoteException e) {
      }
    }
  }
}

Fixed version (ground truth):
@Override public void setMode(int code,int uid,String packageName,int mode){
  if (Binder.getCallingPid() != Process.myPid()) {
    mContext.enforcePermission(android.Manifest.permission.UPDATE_APP_OPS_STATS,Binder.getCallingPid(),Binder.getCallingUid(),null);
  }
  verifyIncomingOp(code);
  ArrayList<Callback> repCbs=null;
  code=AppOpsManager.opToSwitch(code);
synchronized (this) {
    Op op=getOpLocked(code,uid,packageName,true);
    if (op != null) {
      if (op.mode != mode) {
        op.mode=mode;
        ArrayList<Callback> cbs=mOpModeWatchers.get(code);
        if (cbs != null) {
          if (repCbs == null) {
            repCbs=new ArrayList<Callback>();
          }
          repCbs.addAll(cbs);
        }
        cbs=mPackageModeWatchers.get(packageName);
        if (cbs != null) {
          if (repCbs == null) {
            repCbs=new ArrayList<Callback>();
          }
          repCbs.addAll(cbs);
        }
        if (mode == AppOpsManager.opToDefaultMode(op.op)) {
          pruneOp(op,uid,packageName);
        }
        scheduleWriteNowLocked();
      }
    }
  }
  if (repCbs != null) {
    for (int i=0; i < repCbs.size(); i++) {
      try {
        repCbs.get(i).mCallback.opChanged(code,packageName);
      }
 catch (      RemoteException e) {
      }
    }
  }
}
Program: 198868
Project: 198868
Buggy source:
@Override public AdvertiseData createFromParcel(Parcel in){
  Builder builder=new Builder();
  if (in.readInt() > 0) {
    List<ParcelUuid> uuids=new ArrayList<ParcelUuid>();
    in.readList(uuids,ParcelUuid.class.getClassLoader());
    for (    ParcelUuid uuid : uuids) {
      builder.addServiceUuid(uuid);
    }
  }
  int manufacturerId=in.readInt();
  int manufacturerDataLength=in.readInt();
  if (manufacturerDataLength > 0) {
    byte[] manufacturerData=new byte[manufacturerDataLength];
    in.readByteArray(manufacturerData);
    builder.setManufacturerData(manufacturerId,manufacturerData);
  }
  if (in.readInt() == 1) {
    ParcelUuid serviceDataUuid=in.readParcelable(ParcelUuid.class.getClassLoader());
    int serviceDataLength=in.readInt();
    if (serviceDataLength > 0) {
      byte[] serviceData=new byte[serviceDataLength];
      in.readByteArray(serviceData);
      builder.setServiceData(serviceDataUuid,serviceData);
    }
  }
  builder.setIncludeTxPowerLevel(in.readByte() == 1);
  builder.setIncludeDeviceName(in.readByte() == 1);
  return builder.build();
}

Fixed version (ground truth):
@Override public AdvertiseData createFromParcel(Parcel in){
  Builder builder=new Builder();
  List<ParcelUuid> uuids=in.readArrayList(ParcelUuid.class.getClassLoader());
  if (uuids != null) {
    for (    ParcelUuid uuid : uuids) {
      builder.addServiceUuid(uuid);
    }
  }
  int manufacturerId=in.readInt();
  if (in.readInt() == 1) {
    int manufacturerDataLength=in.readInt();
    byte[] manufacturerData=new byte[manufacturerDataLength];
    in.readByteArray(manufacturerData);
    builder.setManufacturerData(manufacturerId,manufacturerData);
  }
  ParcelUuid serviceDataUuid=in.readParcelable(ParcelUuid.class.getClassLoader());
  if (in.readInt() == 1) {
    int serviceDataLength=in.readInt();
    byte[] serviceData=new byte[serviceDataLength];
    in.readByteArray(serviceData);
    builder.setServiceData(serviceDataUuid,serviceData);
  }
  builder.setIncludeTxPowerLevel(in.readByte() == 1);
  builder.setIncludeDeviceName(in.readByte() == 1);
  return builder.build();
}
Program: 198869
Project: 198869
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + mServiceUuids + "String_Node_Str"+ mManufacturerId+ "String_Node_Str"+ Arrays.toString(mManufacturerSpecificData)+ "String_Node_Str"+ mServiceDataUuid+ "String_Node_Str"+ Arrays.toString(mServiceData)+ "String_Node_Str"+ mIncludeTxPowerLevel+ "String_Node_Str"+ "String_Node_Str";
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + mServiceUuids + "String_Node_Str"+ mManufacturerId+ "String_Node_Str"+ Arrays.toString(mManufacturerSpecificData)+ "String_Node_Str"+ mServiceDataUuid+ "String_Node_Str"+ Arrays.toString(mServiceData)+ "String_Node_Str"+ mIncludeTxPowerLevel+ "String_Node_Str"+ mIncludeDeviceName+ "String_Node_Str";
}
Program: 198870
Project: 198870
Buggy source:
@Override public void writeToParcel(Parcel dest,int flags){
  if (mServiceUuids == null) {
    dest.writeInt(0);
  }
 else {
    dest.writeInt(mServiceUuids.size());
    dest.writeList(mServiceUuids);
  }
  dest.writeInt(mManufacturerId);
  if (mManufacturerSpecificData == null) {
    dest.writeInt(0);
  }
 else {
    dest.writeInt(mManufacturerSpecificData.length);
    dest.writeByteArray(mManufacturerSpecificData);
  }
  if (mServiceDataUuid == null) {
    dest.writeInt(0);
  }
 else {
    dest.writeInt(1);
    dest.writeParcelable(mServiceDataUuid,flags);
    if (mServiceData == null) {
      dest.writeInt(0);
    }
 else {
      dest.writeInt(mServiceData.length);
      dest.writeByteArray(mServiceData);
    }
  }
  dest.writeByte((byte)(getIncludeTxPowerLevel() ? 1 : 0));
  dest.writeByte((byte)(getIncludeDeviceName() ? 1 : 0));
}

Fixed version (ground truth):
@Override public void writeToParcel(Parcel dest,int flags){
  dest.writeList(mServiceUuids);
  dest.writeInt(mManufacturerId);
  if (mManufacturerSpecificData == null) {
    dest.writeInt(0);
  }
 else {
    dest.writeInt(1);
    dest.writeInt(mManufacturerSpecificData.length);
    dest.writeByteArray(mManufacturerSpecificData);
  }
  dest.writeParcelable(mServiceDataUuid,flags);
  if (mServiceData == null) {
    dest.writeInt(0);
  }
 else {
    dest.writeInt(1);
    dest.writeInt(mServiceData.length);
    dest.writeByteArray(mServiceData);
  }
  dest.writeByte((byte)(getIncludeTxPowerLevel() ? 1 : 0));
  dest.writeByte((byte)(getIncludeDeviceName() ? 1 : 0));
}
Program: 198871
Project: 198871
Buggy source:
private void testReadWriteParcelForFilter(ScanFilter filter){
  Parcel parcel=Parcel.obtain();
  filter.writeToParcel(parcel,0);
  parcel.setDataPosition(0);
  ScanFilter filterFromParcel=ScanFilter.CREATOR.createFromParcel(parcel);
  System.out.println(filterFromParcel);
  assertEquals(filter,filterFromParcel);
}

Fixed version (ground truth):
private void testReadWriteParcelForFilter(ScanFilter filter){
  Parcel parcel=Parcel.obtain();
  filter.writeToParcel(parcel,0);
  parcel.setDataPosition(0);
  ScanFilter filterFromParcel=ScanFilter.CREATOR.createFromParcel(parcel);
  assertEquals(filter,filterFromParcel);
}
Program: 198872
Project: 198872
Buggy source:
@Override public AdvertiseData createFromParcel(Parcel in){
  Builder builder=new Builder();
  if (in.readInt() > 0) {
    List<ParcelUuid> uuids=new ArrayList<ParcelUuid>();
    in.readList(uuids,ParcelUuid.class.getClassLoader());
    for (    ParcelUuid uuid : uuids) {
      builder.addServiceUuid(uuid);
    }
  }
  int manufacturerId=in.readInt();
  int manufacturerDataLength=in.readInt();
  if (manufacturerDataLength > 0) {
    byte[] manufacturerData=new byte[manufacturerDataLength];
    in.readByteArray(manufacturerData);
    builder.setManufacturerData(manufacturerId,manufacturerData);
  }
  if (in.readInt() == 1) {
    ParcelUuid serviceDataUuid=in.readParcelable(ParcelUuid.class.getClassLoader());
    int serviceDataLength=in.readInt();
    if (serviceDataLength > 0) {
      byte[] serviceData=new byte[serviceDataLength];
      in.readByteArray(serviceData);
      builder.setServiceData(serviceDataUuid,serviceData);
    }
  }
  builder.setIncludeTxPowerLevel(in.readByte() == 1);
  builder.setIncludeDeviceName(in.readByte() == 1);
  return builder.build();
}

Fixed version (ground truth):
@Override public AdvertiseData createFromParcel(Parcel in){
  Builder builder=new Builder();
  List<ParcelUuid> uuids=in.readArrayList(ParcelUuid.class.getClassLoader());
  if (uuids != null) {
    for (    ParcelUuid uuid : uuids) {
      builder.addServiceUuid(uuid);
    }
  }
  int manufacturerId=in.readInt();
  if (in.readInt() == 1) {
    int manufacturerDataLength=in.readInt();
    byte[] manufacturerData=new byte[manufacturerDataLength];
    in.readByteArray(manufacturerData);
    builder.setManufacturerData(manufacturerId,manufacturerData);
  }
  ParcelUuid serviceDataUuid=in.readParcelable(ParcelUuid.class.getClassLoader());
  if (in.readInt() == 1) {
    int serviceDataLength=in.readInt();
    byte[] serviceData=new byte[serviceDataLength];
    in.readByteArray(serviceData);
    builder.setServiceData(serviceDataUuid,serviceData);
  }
  builder.setIncludeTxPowerLevel(in.readByte() == 1);
  builder.setIncludeDeviceName(in.readByte() == 1);
  return builder.build();
}
Program: 198873
Project: 198873
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + mServiceUuids + "String_Node_Str"+ mManufacturerId+ "String_Node_Str"+ Arrays.toString(mManufacturerSpecificData)+ "String_Node_Str"+ mServiceDataUuid+ "String_Node_Str"+ Arrays.toString(mServiceData)+ "String_Node_Str"+ mIncludeTxPowerLevel+ "String_Node_Str"+ "String_Node_Str";
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + mServiceUuids + "String_Node_Str"+ mManufacturerId+ "String_Node_Str"+ Arrays.toString(mManufacturerSpecificData)+ "String_Node_Str"+ mServiceDataUuid+ "String_Node_Str"+ Arrays.toString(mServiceData)+ "String_Node_Str"+ mIncludeTxPowerLevel+ "String_Node_Str"+ mIncludeDeviceName+ "String_Node_Str";
}
Program: 198874
Project: 198874
Buggy source:
@Override public void writeToParcel(Parcel dest,int flags){
  if (mServiceUuids == null) {
    dest.writeInt(0);
  }
 else {
    dest.writeInt(mServiceUuids.size());
    dest.writeList(mServiceUuids);
  }
  dest.writeInt(mManufacturerId);
  if (mManufacturerSpecificData == null) {
    dest.writeInt(0);
  }
 else {
    dest.writeInt(mManufacturerSpecificData.length);
    dest.writeByteArray(mManufacturerSpecificData);
  }
  if (mServiceDataUuid == null) {
    dest.writeInt(0);
  }
 else {
    dest.writeInt(1);
    dest.writeParcelable(mServiceDataUuid,flags);
    if (mServiceData == null) {
      dest.writeInt(0);
    }
 else {
      dest.writeInt(mServiceData.length);
      dest.writeByteArray(mServiceData);
    }
  }
  dest.writeByte((byte)(getIncludeTxPowerLevel() ? 1 : 0));
  dest.writeByte((byte)(getIncludeDeviceName() ? 1 : 0));
}

Fixed version (ground truth):
@Override public void writeToParcel(Parcel dest,int flags){
  dest.writeList(mServiceUuids);
  dest.writeInt(mManufacturerId);
  if (mManufacturerSpecificData == null) {
    dest.writeInt(0);
  }
 else {
    dest.writeInt(1);
    dest.writeInt(mManufacturerSpecificData.length);
    dest.writeByteArray(mManufacturerSpecificData);
  }
  dest.writeParcelable(mServiceDataUuid,flags);
  if (mServiceData == null) {
    dest.writeInt(0);
  }
 else {
    dest.writeInt(1);
    dest.writeInt(mServiceData.length);
    dest.writeByteArray(mServiceData);
  }
  dest.writeByte((byte)(getIncludeTxPowerLevel() ? 1 : 0));
  dest.writeByte((byte)(getIncludeDeviceName() ? 1 : 0));
}
Program: 198875
Project: 198875
Buggy source:
private void testReadWriteParcelForFilter(ScanFilter filter){
  Parcel parcel=Parcel.obtain();
  filter.writeToParcel(parcel,0);
  parcel.setDataPosition(0);
  ScanFilter filterFromParcel=ScanFilter.CREATOR.createFromParcel(parcel);
  System.out.println(filterFromParcel);
  assertEquals(filter,filterFromParcel);
}

Fixed version (ground truth):
private void testReadWriteParcelForFilter(ScanFilter filter){
  Parcel parcel=Parcel.obtain();
  filter.writeToParcel(parcel,0);
  parcel.setDataPosition(0);
  ScanFilter filterFromParcel=ScanFilter.CREATOR.createFromParcel(parcel);
  assertEquals(filter,filterFromParcel);
}
Program: 198876
Project: 198876
Buggy source:
@Override public void setMode(int code,int uid,String packageName,int mode){
  if (Binder.getCallingPid() == Process.myPid()) {
    return;
  }
  mContext.enforcePermission(android.Manifest.permission.UPDATE_APP_OPS_STATS,Binder.getCallingPid(),Binder.getCallingUid(),null);
  verifyIncomingOp(code);
  ArrayList<Callback> repCbs=null;
  code=AppOpsManager.opToSwitch(code);
synchronized (this) {
    Op op=getOpLocked(code,uid,packageName,true);
    if (op != null) {
      if (op.mode != mode) {
        op.mode=mode;
        ArrayList<Callback> cbs=mOpModeWatchers.get(code);
        if (cbs != null) {
          if (repCbs == null) {
            repCbs=new ArrayList<Callback>();
          }
          repCbs.addAll(cbs);
        }
        cbs=mPackageModeWatchers.get(packageName);
        if (cbs != null) {
          if (repCbs == null) {
            repCbs=new ArrayList<Callback>();
          }
          repCbs.addAll(cbs);
        }
        if (mode == AppOpsManager.opToDefaultMode(op.op)) {
          pruneOp(op,uid,packageName);
        }
        scheduleWriteNowLocked();
      }
    }
  }
  if (repCbs != null) {
    for (int i=0; i < repCbs.size(); i++) {
      try {
        repCbs.get(i).mCallback.opChanged(code,packageName);
      }
 catch (      RemoteException e) {
      }
    }
  }
}

Fixed version (ground truth):
@Override public void setMode(int code,int uid,String packageName,int mode){
  if (Binder.getCallingPid() != Process.myPid()) {
    mContext.enforcePermission(android.Manifest.permission.UPDATE_APP_OPS_STATS,Binder.getCallingPid(),Binder.getCallingUid(),null);
  }
  verifyIncomingOp(code);
  ArrayList<Callback> repCbs=null;
  code=AppOpsManager.opToSwitch(code);
synchronized (this) {
    Op op=getOpLocked(code,uid,packageName,true);
    if (op != null) {
      if (op.mode != mode) {
        op.mode=mode;
        ArrayList<Callback> cbs=mOpModeWatchers.get(code);
        if (cbs != null) {
          if (repCbs == null) {
            repCbs=new ArrayList<Callback>();
          }
          repCbs.addAll(cbs);
        }
        cbs=mPackageModeWatchers.get(packageName);
        if (cbs != null) {
          if (repCbs == null) {
            repCbs=new ArrayList<Callback>();
          }
          repCbs.addAll(cbs);
        }
        if (mode == AppOpsManager.opToDefaultMode(op.op)) {
          pruneOp(op,uid,packageName);
        }
        scheduleWriteNowLocked();
      }
    }
  }
  if (repCbs != null) {
    for (int i=0; i < repCbs.size(); i++) {
      try {
        repCbs.get(i).mCallback.opChanged(code,packageName);
      }
 catch (      RemoteException e) {
      }
    }
  }
}
Program: 198877
Project: 198877
Buggy source:
private void updateSpeedBumpState(StackScrollState resultState,StackScrollAlgorithmState algorithmState,int speedBumpIndex){
  int childCount=algorithmState.visibleChildren.size();
  for (int i=0; i < childCount; i++) {
    View child=algorithmState.visibleChildren.get(i);
    StackScrollState.ViewState childViewState=resultState.getViewStateForView(child);
    childViewState.belowSpeedBump=speedBumpIndex != -1 && i > speedBumpIndex;
  }
}

Fixed version (ground truth):
private void updateSpeedBumpState(StackScrollState resultState,StackScrollAlgorithmState algorithmState,int speedBumpIndex){
  int childCount=algorithmState.visibleChildren.size();
  for (int i=0; i < childCount; i++) {
    View child=algorithmState.visibleChildren.get(i);
    StackScrollState.ViewState childViewState=resultState.getViewStateForView(child);
    childViewState.belowSpeedBump=speedBumpIndex != -1 && i >= speedBumpIndex;
  }
}
Program: 198878
Project: 198878
Buggy source:
private void updateSpeedBumpState(StackScrollState resultState,StackScrollAlgorithmState algorithmState,int speedBumpIndex){
  int childCount=algorithmState.visibleChildren.size();
  for (int i=0; i < childCount; i++) {
    View child=algorithmState.visibleChildren.get(i);
    StackScrollState.ViewState childViewState=resultState.getViewStateForView(child);
    childViewState.belowSpeedBump=speedBumpIndex != -1 && i > speedBumpIndex;
  }
}

Fixed version (ground truth):
private void updateSpeedBumpState(StackScrollState resultState,StackScrollAlgorithmState algorithmState,int speedBumpIndex){
  int childCount=algorithmState.visibleChildren.size();
  for (int i=0; i < childCount; i++) {
    View child=algorithmState.visibleChildren.get(i);
    StackScrollState.ViewState childViewState=resultState.getViewStateForView(child);
    childViewState.belowSpeedBump=speedBumpIndex != -1 && i >= speedBumpIndex;
  }
}
Program: 198880
Project: 198880
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  ScrollView scrollView=new ScrollView(this);
  GridLayout container=new GridLayout(this);
  scrollView.addView(container);
  container.setColumnCount(3);
  container.setBackgroundColor(0xFF888888);
  LayoutParams params=new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT);
  params.width=400;
  params.height=300;
  for (int i=0; i < icon.length; i++) {
    TextView t=new TextView(this);
    t.setText(scaleTypes[i]);
    container.addView(t);
    ImageView png_view=new ImageView(this);
    png_view.setLayoutParams(params);
    png_view.setScaleType(ImageView.ScaleType.values()[i]);
    png_view.setImageResource(icon[i]);
    container.addView(png_view);
    ImageView view=new ImageView(this);
    view.setLayoutParams(params);
    view.setScaleType(ImageView.ScaleType.values()[i]);
    view.setImageResource(vector_icons[i]);
    container.addView(view);
  }
  setContentView(scrollView);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  ScrollView scrollView=new ScrollView(this);
  GridLayout container=new GridLayout(this);
  scrollView.addView(container);
  container.setColumnCount(3);
  container.setBackgroundColor(0xFF888888);
  LayoutParams params=new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT);
  params.width=400;
  params.height=300;
  for (int i=0; i < scaleTypes.length; i++) {
    TextView t=new TextView(this);
    t.setText(scaleTypes[i]);
    container.addView(t);
    ImageView.ScaleType scaleType=ImageView.ScaleType.values()[i];
    ImageView png_view=new ImageView(this);
    png_view.setLayoutParams(params);
    png_view.setScaleType(scaleType);
    png_view.setImageResource(icon);
    container.addView(png_view);
    ImageView view=new ImageView(this);
    view.setLayoutParams(params);
    view.setScaleType(scaleType);
    view.setImageResource(vector_icon);
    container.addView(view);
  }
  setContentView(scrollView);
}
Program: 198882
Project: 198882
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  ScrollView scrollView=new ScrollView(this);
  GridLayout container=new GridLayout(this);
  scrollView.addView(container);
  container.setColumnCount(3);
  container.setBackgroundColor(0xFF888888);
  LayoutParams params=new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT);
  params.width=400;
  params.height=300;
  for (int i=0; i < icon.length; i++) {
    TextView t=new TextView(this);
    t.setText(scaleTypes[i]);
    container.addView(t);
    ImageView png_view=new ImageView(this);
    png_view.setLayoutParams(params);
    png_view.setScaleType(ImageView.ScaleType.values()[i]);
    png_view.setImageResource(icon[i]);
    container.addView(png_view);
    ImageView view=new ImageView(this);
    view.setLayoutParams(params);
    view.setScaleType(ImageView.ScaleType.values()[i]);
    view.setImageResource(vector_icons[i]);
    container.addView(view);
  }
  setContentView(scrollView);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  ScrollView scrollView=new ScrollView(this);
  GridLayout container=new GridLayout(this);
  scrollView.addView(container);
  container.setColumnCount(3);
  container.setBackgroundColor(0xFF888888);
  LayoutParams params=new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT);
  params.width=400;
  params.height=300;
  for (int i=0; i < scaleTypes.length; i++) {
    TextView t=new TextView(this);
    t.setText(scaleTypes[i]);
    container.addView(t);
    ImageView.ScaleType scaleType=ImageView.ScaleType.values()[i];
    ImageView png_view=new ImageView(this);
    png_view.setLayoutParams(params);
    png_view.setScaleType(scaleType);
    png_view.setImageResource(icon);
    container.addView(png_view);
    ImageView view=new ImageView(this);
    view.setLayoutParams(params);
    view.setScaleType(scaleType);
    view.setImageResource(vector_icon);
    container.addView(view);
  }
  setContentView(scrollView);
}
Program: 198884
Project: 198884
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  ScrollView scrollView=new ScrollView(this);
  GridLayout container=new GridLayout(this);
  scrollView.addView(container);
  container.setColumnCount(3);
  container.setBackgroundColor(0xFF888888);
  LayoutParams params=new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT);
  params.width=400;
  params.height=300;
  for (int i=0; i < icon.length; i++) {
    TextView t=new TextView(this);
    t.setText(scaleTypes[i]);
    container.addView(t);
    ImageView png_view=new ImageView(this);
    png_view.setLayoutParams(params);
    png_view.setScaleType(ImageView.ScaleType.values()[i]);
    png_view.setImageResource(icon[i]);
    container.addView(png_view);
    ImageView view=new ImageView(this);
    view.setLayoutParams(params);
    view.setScaleType(ImageView.ScaleType.values()[i]);
    view.setImageResource(vector_icons[i]);
    container.addView(view);
  }
  setContentView(scrollView);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  ScrollView scrollView=new ScrollView(this);
  GridLayout container=new GridLayout(this);
  scrollView.addView(container);
  container.setColumnCount(3);
  container.setBackgroundColor(0xFF888888);
  LayoutParams params=new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT);
  params.width=400;
  params.height=300;
  for (int i=0; i < scaleTypes.length; i++) {
    TextView t=new TextView(this);
    t.setText(scaleTypes[i]);
    container.addView(t);
    ImageView.ScaleType scaleType=ImageView.ScaleType.values()[i];
    ImageView png_view=new ImageView(this);
    png_view.setLayoutParams(params);
    png_view.setScaleType(scaleType);
    png_view.setImageResource(icon);
    container.addView(png_view);
    ImageView view=new ImageView(this);
    view.setLayoutParams(params);
    view.setScaleType(scaleType);
    view.setImageResource(vector_icon);
    container.addView(view);
  }
  setContentView(scrollView);
}
Program: 198885
Project: 198885
Buggy source:
@Override public void onChildDismissed(View v){
  TaskView tv=(TaskView)v;
  if (mSv.mHwLayersTrigger.getCount() == 0) {
    tv.disableHwLayers();
  }
  tv.setClipViewInStack(true);
  mSv.onTaskViewDismissed(tv);
}

Fixed version (ground truth):
@Override public void onChildDismissed(View v){
  TaskView tv=(TaskView)v;
  if (mSv.mHwLayersTrigger.getCount() == 0) {
    tv.disableHwLayers();
  }
  tv.setClipViewInStack(true);
  tv.setTouchEnabled(true);
  mSv.onTaskViewDismissed(tv);
}
Program: 198886
Project: 198886
Buggy source:
@Override public void onChildDismissed(View v){
  TaskView tv=(TaskView)v;
  if (mSv.mHwLayersTrigger.getCount() == 0) {
    tv.disableHwLayers();
  }
  tv.setClipViewInStack(true);
  mSv.onTaskViewDismissed(tv);
}

Fixed version (ground truth):
@Override public void onChildDismissed(View v){
  TaskView tv=(TaskView)v;
  if (mSv.mHwLayersTrigger.getCount() == 0) {
    tv.disableHwLayers();
  }
  tv.setClipViewInStack(true);
  tv.setTouchEnabled(true);
  mSv.onTaskViewDismissed(tv);
}
Program: 198887
Project: 198887
Buggy source:
@Override public void onChildDismissed(View v){
  TaskView tv=(TaskView)v;
  if (mSv.mHwLayersTrigger.getCount() == 0) {
    tv.disableHwLayers();
  }
  tv.setClipViewInStack(true);
  mSv.onTaskViewDismissed(tv);
}

Fixed version (ground truth):
@Override public void onChildDismissed(View v){
  TaskView tv=(TaskView)v;
  if (mSv.mHwLayersTrigger.getCount() == 0) {
    tv.disableHwLayers();
  }
  tv.setClipViewInStack(true);
  tv.setTouchEnabled(true);
  mSv.onTaskViewDismissed(tv);
}
Program: 198888
Project: 198888
Buggy source:
private void updateSpeedBumpState(StackScrollState resultState,StackScrollAlgorithmState algorithmState,int speedBumpIndex){
  int childCount=algorithmState.visibleChildren.size();
  for (int i=0; i < childCount; i++) {
    View child=algorithmState.visibleChildren.get(i);
    StackScrollState.ViewState childViewState=resultState.getViewStateForView(child);
    childViewState.belowSpeedBump=speedBumpIndex != -1 && i > speedBumpIndex;
  }
}

Fixed version (ground truth):
private void updateSpeedBumpState(StackScrollState resultState,StackScrollAlgorithmState algorithmState,int speedBumpIndex){
  int childCount=algorithmState.visibleChildren.size();
  for (int i=0; i < childCount; i++) {
    View child=algorithmState.visibleChildren.get(i);
    StackScrollState.ViewState childViewState=resultState.getViewStateForView(child);
    childViewState.belowSpeedBump=speedBumpIndex != -1 && i >= speedBumpIndex;
  }
}
Program: 198889
Project: 198889
Buggy source:
private void updateSpeedBumpState(StackScrollState resultState,StackScrollAlgorithmState algorithmState,int speedBumpIndex){
  int childCount=algorithmState.visibleChildren.size();
  for (int i=0; i < childCount; i++) {
    View child=algorithmState.visibleChildren.get(i);
    StackScrollState.ViewState childViewState=resultState.getViewStateForView(child);
    childViewState.belowSpeedBump=speedBumpIndex != -1 && i > speedBumpIndex;
  }
}

Fixed version (ground truth):
private void updateSpeedBumpState(StackScrollState resultState,StackScrollAlgorithmState algorithmState,int speedBumpIndex){
  int childCount=algorithmState.visibleChildren.size();
  for (int i=0; i < childCount; i++) {
    View child=algorithmState.visibleChildren.get(i);
    StackScrollState.ViewState childViewState=resultState.getViewStateForView(child);
    childViewState.belowSpeedBump=speedBumpIndex != -1 && i >= speedBumpIndex;
  }
}
Program: 198890
Project: 198890
Buggy source:
private void updateSpeedBumpState(StackScrollState resultState,StackScrollAlgorithmState algorithmState,int speedBumpIndex){
  int childCount=algorithmState.visibleChildren.size();
  for (int i=0; i < childCount; i++) {
    View child=algorithmState.visibleChildren.get(i);
    StackScrollState.ViewState childViewState=resultState.getViewStateForView(child);
    childViewState.belowSpeedBump=speedBumpIndex != -1 && i > speedBumpIndex;
  }
}

Fixed version (ground truth):
private void updateSpeedBumpState(StackScrollState resultState,StackScrollAlgorithmState algorithmState,int speedBumpIndex){
  int childCount=algorithmState.visibleChildren.size();
  for (int i=0; i < childCount; i++) {
    View child=algorithmState.visibleChildren.get(i);
    StackScrollState.ViewState childViewState=resultState.getViewStateForView(child);
    childViewState.belowSpeedBump=speedBumpIndex != -1 && i >= speedBumpIndex;
  }
}
Program: 198891
Project: 198891
Buggy source:
/** 
 * Removes all the entries in the cache. 
 */
final void evictAll(){
  mCache.evictAll();
  mKeys.clear();
}

Fixed version (ground truth):
/** 
 * Removes all the entries in the cache. 
 */
final void evictAll(){
  mCache.evictAll();
  mTaskKeys.clear();
}
Program: 198892
Project: 198892
Buggy source:
@Override protected int sizeOf(Task.TaskKey t,V v){
  return computeSize(v);
}

Fixed version (ground truth):
@Override protected int sizeOf(Integer taskId,V v){
  return computeSize(v);
}
Program: 198893
Project: 198893
Buggy source:
/** 
 * Gets a specific entry in the cache. 
 */
final V get(Task.TaskKey key){
  return mCache.get(key);
}

Fixed version (ground truth):
/** 
 * Gets a specific entry in the cache. 
 */
final V get(Task.TaskKey key){
  return mCache.get(key.id);
}
Program: 198894
Project: 198894
Buggy source:
public KeyStoreLruCache(int cacheSize){
  mCache=new LruCache<Task.TaskKey,V>(cacheSize){
    @Override protected int sizeOf(    Task.TaskKey t,    V v){
      return computeSize(v);
    }
    @Override protected void entryRemoved(    boolean evicted,    Task.TaskKey key,    V oldV,    V newV){
      mKeys.remove(key);
    }
  }
;
}

Fixed version (ground truth):
public KeyStoreLruCache(int cacheSize){
  mCache=new LruCache<Integer,V>(cacheSize){
    @Override protected int sizeOf(    Integer taskId,    V v){
      return computeSize(v);
    }
    @Override protected void entryRemoved(    boolean evicted,    Integer taskId,    V oldV,    V newV){
      mTaskKeys.remove(taskId);
    }
  }
;
}
Program: 198895
Project: 198895
Buggy source:
@Override protected void entryRemoved(boolean evicted,Task.TaskKey key,V oldV,V newV){
  mKeys.remove(key);
}

Fixed version (ground truth):
@Override protected void entryRemoved(boolean evicted,Integer taskId,V oldV,V newV){
  mTaskKeys.remove(taskId);
}
Program: 198896
Project: 198896
Buggy source:
/** 
 * Puts an entry in the cache for a specific key. 
 */
final void put(Task.TaskKey key,V value){
  mCache.put(key,value);
  if (mKeys.containsKey(key)) {
    mKeys.get(key).updateLastActiveTime(key.lastActiveTime);
  }
 else {
    mKeys.put(key,key);
  }
}

Fixed version (ground truth):
/** 
 * Puts an entry in the cache for a specific key. 
 */
final void put(Task.TaskKey key,V value){
  mCache.put(key.id,value);
  mTaskKeys.put(key.id,key);
}
Program: 198897
Project: 198897
Buggy source:
/** 
 * Removes a cache entry for a specific key. 
 */
final void remove(Task.TaskKey key){
  mCache.remove(key);
  mKeys.remove(key);
}

Fixed version (ground truth):
/** 
 * Removes a cache entry for a specific key. 
 */
final void remove(Task.TaskKey key){
  mCache.remove(key.id);
  mTaskKeys.remove(key.id);
}
Program: 198899
Project: 198899
Buggy source:
/** 
 * Acquires the task resource data directly from the pool. 
 */
public void loadTaskData(Task t){
  Drawable applicationIcon=mApplicationIconCache.get(t.key);
  Bitmap thumbnail=mThumbnailCache.get(t.key);
  boolean requiresLoad=false;
  if (applicationIcon == null) {
    applicationIcon=mDefaultApplicationIcon;
    requiresLoad=true;
  }
  if (thumbnail == null) {
    thumbnail=mLoadingThumbnail;
    requiresLoad=true;
  }
  if (requiresLoad) {
    mLoadQueue.addTask(t);
  }
  t.notifyTaskDataLoaded(thumbnail,applicationIcon);
}

Fixed version (ground truth):
/** 
 * Acquires the task resource data directly from the pool. 
 */
public void loadTaskData(Task t){
  Drawable applicationIcon=mApplicationIconCache.getAndInvalidateIfModified(t.key);
  Bitmap thumbnail=mThumbnailCache.getAndInvalidateIfModified(t.key);
  boolean requiresLoad=(applicationIcon == null) || (thumbnail == null);
  applicationIcon=applicationIcon != null ? applicationIcon : mDefaultApplicationIcon;
  thumbnail=thumbnail != null ? thumbnail : mDefaultThumbnail;
  if (requiresLoad) {
    mLoadQueue.addTask(t);
  }
  t.notifyTaskDataLoaded(thumbnail,applicationIcon);
}
Program: 198900
Project: 198900
Buggy source:
private static List<ActivityManager.RecentTaskInfo> getRecentTasks(SystemServicesProxy ssp){
  List<ActivityManager.RecentTaskInfo> tasks=ssp.getRecentTasks(50,UserHandle.CURRENT.getIdentifier());
  Collections.reverse(tasks);
  return tasks;
}

Fixed version (ground truth):
/** 
 * Gets the list of recent tasks, ordered from back to front. 
 */
private static List<ActivityManager.RecentTaskInfo> getRecentTasks(SystemServicesProxy ssp){
  List<ActivityManager.RecentTaskInfo> tasks=ssp.getRecentTasks(50,UserHandle.CURRENT.getIdentifier());
  Collections.reverse(tasks);
  return tasks;
}
Program: 198902
Project: 198902
Buggy source:
@Override public void run(){
  if (task.isActive) {
    RecentsTaskLoader.getInstance().getSystemServicesProxy().moveTaskToFront(task.key.id,launchOpts);
  }
 else {
    Intent i=new Intent(task.key.baseIntent);
    i.addFlags(Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY | Intent.FLAG_ACTIVITY_TASK_ON_HOME);
    if ((i.getFlags() & Intent.FLAG_ACTIVITY_NEW_DOCUMENT) == 0) {
      i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    }
    try {
      UserHandle taskUser=new UserHandle(task.userId);
      if (launchOpts != null) {
        getContext().startActivityAsUser(i,launchOpts.toBundle(),taskUser);
      }
 else {
        getContext().startActivityAsUser(i,taskUser);
        if (lockToTask) {
          ssp.lockCurrentTask();
        }
      }
    }
 catch (    ActivityNotFoundException anfe) {
      Console.logError(getContext(),"String_Node_Str");
    }
    onTaskViewDismissed(task);
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (task.isActive) {
    RecentsTaskLoader.getInstance().getSystemServicesProxy().moveTaskToFront(task.key.id,launchOpts);
  }
 else {
    Intent i=new Intent(task.key.baseIntent);
    i.addFlags(Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY | Intent.FLAG_ACTIVITY_TASK_ON_HOME);
    if (!Utilities.isDocument(i)) {
      i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    }
    try {
      UserHandle taskUser=new UserHandle(task.userId);
      if (launchOpts != null) {
        getContext().startActivityAsUser(i,launchOpts.toBundle(),taskUser);
      }
 else {
        getContext().startActivityAsUser(i,taskUser);
        if (lockToTask) {
          ssp.lockCurrentTask();
        }
      }
    }
 catch (    ActivityNotFoundException anfe) {
      Console.logError(getContext(),"String_Node_Str");
    }
    onTaskViewDismissed(task);
  }
}
Program: 198903
Project: 198903
Buggy source:
@Override public void onTaskViewDismissed(Task t){
  RecentsTaskLoader loader=RecentsTaskLoader.getInstance();
  loader.deleteTaskData(t,false);
  int flags=t.key.baseIntent.getFlags();
  boolean isDocument=(flags & Intent.FLAG_ACTIVITY_NEW_DOCUMENT) == Intent.FLAG_ACTIVITY_NEW_DOCUMENT;
  RecentsTaskLoader.getInstance().getSystemServicesProxy().removeTask(t.key.id,isDocument);
}

Fixed version (ground truth):
@Override public void onTaskViewDismissed(Task t){
  RecentsTaskLoader loader=RecentsTaskLoader.getInstance();
  loader.deleteTaskData(t,false);
  RecentsTaskLoader.getInstance().getSystemServicesProxy().removeTask(t.key.id,Utilities.isDocument(t.key.baseIntent));
}
Program: 198904
Project: 198904
Buggy source:
private void acquireWakeLockInternal(IBinder lock,int flags,String tag,String packageName,WorkSource ws,String historyTag,int uid,int pid){
synchronized (mLock) {
    if (DEBUG_SPEW) {
      Slog.d(TAG,"String_Node_Str" + Objects.hashCode(lock) + "String_Node_Str"+ Integer.toHexString(flags)+ "String_Node_Str"+ tag+ "String_Node_Str"+ ws+ "String_Node_Str"+ uid+ "String_Node_Str"+ pid);
    }
    WakeLock wakeLock;
    int index=findWakeLockIndexLocked(lock);
    if (index >= 0) {
      wakeLock=mWakeLocks.get(index);
      if (!wakeLock.hasSameProperties(flags,tag,ws,uid,pid)) {
        notifyWakeLockChangingLocked(wakeLock,flags,tag,packageName,uid,pid,ws,historyTag);
        wakeLock.updateProperties(flags,tag,packageName,ws,historyTag,uid,pid);
      }
    }
 else {
      wakeLock=new WakeLock(lock,flags,tag,packageName,ws,historyTag,uid,pid);
      try {
        lock.linkToDeath(wakeLock,0);
      }
 catch (      RemoteException ex) {
        throw new IllegalArgumentException("String_Node_Str");
      }
      notifyWakeLockAcquiredLocked(wakeLock);
      mWakeLocks.add(wakeLock);
    }
    applyWakeLockFlagsOnAcquireLocked(wakeLock);
    mDirty|=DIRTY_WAKE_LOCKS;
    updatePowerStateLocked();
  }
}

Fixed version (ground truth):
private void acquireWakeLockInternal(IBinder lock,int flags,String tag,String packageName,WorkSource ws,String historyTag,int uid,int pid){
synchronized (mLock) {
    if (DEBUG_SPEW) {
      Slog.d(TAG,"String_Node_Str" + Objects.hashCode(lock) + "String_Node_Str"+ Integer.toHexString(flags)+ "String_Node_Str"+ tag+ "String_Node_Str"+ ws+ "String_Node_Str"+ uid+ "String_Node_Str"+ pid);
    }
    WakeLock wakeLock;
    int index=findWakeLockIndexLocked(lock);
    boolean notifyAcquire;
    if (index >= 0) {
      wakeLock=mWakeLocks.get(index);
      if (!wakeLock.hasSameProperties(flags,tag,ws,uid,pid)) {
        notifyWakeLockChangingLocked(wakeLock,flags,tag,packageName,uid,pid,ws,historyTag);
        wakeLock.updateProperties(flags,tag,packageName,ws,historyTag,uid,pid);
      }
      notifyAcquire=false;
    }
 else {
      wakeLock=new WakeLock(lock,flags,tag,packageName,ws,historyTag,uid,pid);
      try {
        lock.linkToDeath(wakeLock,0);
      }
 catch (      RemoteException ex) {
        throw new IllegalArgumentException("String_Node_Str");
      }
      mWakeLocks.add(wakeLock);
      notifyAcquire=true;
    }
    applyWakeLockFlagsOnAcquireLocked(wakeLock);
    mDirty|=DIRTY_WAKE_LOCKS;
    updatePowerStateLocked();
    if (notifyAcquire) {
      notifyWakeLockAcquiredLocked(wakeLock);
    }
  }
}
Program: 198906
Project: 198906
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  ScrollView scrollView=new ScrollView(this);
  GridLayout container=new GridLayout(this);
  scrollView.addView(container);
  container.setColumnCount(3);
  container.setBackgroundColor(0xFF888888);
  LayoutParams params=new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT);
  params.width=400;
  params.height=300;
  for (int i=0; i < icon.length; i++) {
    TextView t=new TextView(this);
    t.setText(scaleTypes[i]);
    container.addView(t);
    ImageView png_view=new ImageView(this);
    png_view.setLayoutParams(params);
    png_view.setScaleType(ImageView.ScaleType.values()[i]);
    png_view.setImageResource(icon[i]);
    container.addView(png_view);
    ImageView view=new ImageView(this);
    view.setLayoutParams(params);
    view.setScaleType(ImageView.ScaleType.values()[i]);
    view.setImageResource(vector_icons[i]);
    container.addView(view);
  }
  setContentView(scrollView);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  ScrollView scrollView=new ScrollView(this);
  GridLayout container=new GridLayout(this);
  scrollView.addView(container);
  container.setColumnCount(3);
  container.setBackgroundColor(0xFF888888);
  LayoutParams params=new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT);
  params.width=400;
  params.height=300;
  for (int i=0; i < scaleTypes.length; i++) {
    TextView t=new TextView(this);
    t.setText(scaleTypes[i]);
    container.addView(t);
    ImageView.ScaleType scaleType=ImageView.ScaleType.values()[i];
    ImageView png_view=new ImageView(this);
    png_view.setLayoutParams(params);
    png_view.setScaleType(scaleType);
    png_view.setImageResource(icon);
    container.addView(png_view);
    ImageView view=new ImageView(this);
    view.setLayoutParams(params);
    view.setScaleType(scaleType);
    view.setImageResource(vector_icon);
    container.addView(view);
  }
  setContentView(scrollView);
}
Program: 198907
Project: 198907
Buggy source:
@Override public void onChildDismissed(View v){
  TaskView tv=(TaskView)v;
  if (mSv.mHwLayersTrigger.getCount() == 0) {
    tv.disableHwLayers();
  }
  tv.setClipViewInStack(true);
  mSv.onTaskViewDismissed(tv);
}

Fixed version (ground truth):
@Override public void onChildDismissed(View v){
  TaskView tv=(TaskView)v;
  if (mSv.mHwLayersTrigger.getCount() == 0) {
    tv.disableHwLayers();
  }
  tv.setClipViewInStack(true);
  tv.setTouchEnabled(true);
  mSv.onTaskViewDismissed(tv);
}
Program: 198908
Project: 198908
Buggy source:
/** 
 * Removes all the entries in the cache. 
 */
final void evictAll(){
  mCache.evictAll();
  mKeys.clear();
}

Fixed version (ground truth):
/** 
 * Removes all the entries in the cache. 
 */
final void evictAll(){
  mCache.evictAll();
  mTaskKeys.clear();
}
Program: 198909
Project: 198909
Buggy source:
@Override protected int sizeOf(Task.TaskKey t,V v){
  return computeSize(v);
}

Fixed version (ground truth):
@Override protected int sizeOf(Integer taskId,V v){
  return computeSize(v);
}
Program: 198910
Project: 198910
Buggy source:
/** 
 * Gets a specific entry in the cache. 
 */
final V get(Task.TaskKey key){
  return mCache.get(key);
}

Fixed version (ground truth):
/** 
 * Gets a specific entry in the cache. 
 */
final V get(Task.TaskKey key){
  return mCache.get(key.id);
}
Program: 198911
Project: 198911
Buggy source:
public KeyStoreLruCache(int cacheSize){
  mCache=new LruCache<Task.TaskKey,V>(cacheSize){
    @Override protected int sizeOf(    Task.TaskKey t,    V v){
      return computeSize(v);
    }
    @Override protected void entryRemoved(    boolean evicted,    Task.TaskKey key,    V oldV,    V newV){
      mKeys.remove(key);
    }
  }
;
}

Fixed version (ground truth):
public KeyStoreLruCache(int cacheSize){
  mCache=new LruCache<Integer,V>(cacheSize){
    @Override protected int sizeOf(    Integer taskId,    V v){
      return computeSize(v);
    }
    @Override protected void entryRemoved(    boolean evicted,    Integer taskId,    V oldV,    V newV){
      mTaskKeys.remove(taskId);
    }
  }
;
}
Program: 198912
Project: 198912
Buggy source:
@Override protected void entryRemoved(boolean evicted,Task.TaskKey key,V oldV,V newV){
  mKeys.remove(key);
}

Fixed version (ground truth):
@Override protected void entryRemoved(boolean evicted,Integer taskId,V oldV,V newV){
  mTaskKeys.remove(taskId);
}
Program: 198913
Project: 198913
Buggy source:
/** 
 * Puts an entry in the cache for a specific key. 
 */
final void put(Task.TaskKey key,V value){
  mCache.put(key,value);
  if (mKeys.containsKey(key)) {
    mKeys.get(key).updateLastActiveTime(key.lastActiveTime);
  }
 else {
    mKeys.put(key,key);
  }
}

Fixed version (ground truth):
/** 
 * Puts an entry in the cache for a specific key. 
 */
final void put(Task.TaskKey key,V value){
  mCache.put(key.id,value);
  mTaskKeys.put(key.id,key);
}
Program: 198914
Project: 198914
Buggy source:
/** 
 * Removes a cache entry for a specific key. 
 */
final void remove(Task.TaskKey key){
  mCache.remove(key);
  mKeys.remove(key);
}

Fixed version (ground truth):
/** 
 * Removes a cache entry for a specific key. 
 */
final void remove(Task.TaskKey key){
  mCache.remove(key.id);
  mTaskKeys.remove(key.id);
}
Program: 198916
Project: 198916
Buggy source:
/** 
 * Acquires the task resource data directly from the pool. 
 */
public void loadTaskData(Task t){
  Drawable applicationIcon=mApplicationIconCache.get(t.key);
  Bitmap thumbnail=mThumbnailCache.get(t.key);
  boolean requiresLoad=false;
  if (applicationIcon == null) {
    applicationIcon=mDefaultApplicationIcon;
    requiresLoad=true;
  }
  if (thumbnail == null) {
    thumbnail=mLoadingThumbnail;
    requiresLoad=true;
  }
  if (requiresLoad) {
    mLoadQueue.addTask(t);
  }
  t.notifyTaskDataLoaded(thumbnail,applicationIcon);
}

Fixed version (ground truth):
/** 
 * Acquires the task resource data directly from the pool. 
 */
public void loadTaskData(Task t){
  Drawable applicationIcon=mApplicationIconCache.getAndInvalidateIfModified(t.key);
  Bitmap thumbnail=mThumbnailCache.getAndInvalidateIfModified(t.key);
  boolean requiresLoad=(applicationIcon == null) || (thumbnail == null);
  applicationIcon=applicationIcon != null ? applicationIcon : mDefaultApplicationIcon;
  thumbnail=thumbnail != null ? thumbnail : mDefaultThumbnail;
  if (requiresLoad) {
    mLoadQueue.addTask(t);
  }
  t.notifyTaskDataLoaded(thumbnail,applicationIcon);
}
Program: 198917
Project: 198917
Buggy source:
private static List<ActivityManager.RecentTaskInfo> getRecentTasks(SystemServicesProxy ssp){
  List<ActivityManager.RecentTaskInfo> tasks=ssp.getRecentTasks(50,UserHandle.CURRENT.getIdentifier());
  Collections.reverse(tasks);
  return tasks;
}

Fixed version (ground truth):
/** 
 * Gets the list of recent tasks, ordered from back to front. 
 */
private static List<ActivityManager.RecentTaskInfo> getRecentTasks(SystemServicesProxy ssp){
  List<ActivityManager.RecentTaskInfo> tasks=ssp.getRecentTasks(50,UserHandle.CURRENT.getIdentifier());
  Collections.reverse(tasks);
  return tasks;
}