nus-yam/ex-repair huggingface dataset:
Program: 197926
Project: 197926
Buggy source:
/** 
 * Rebuilds the notification passed in to the rebuild-constructor  {@link #Builder(Context,Notification)}. <p> Throws IllegalStateException when invoked on a Builder that isn't in rebuild mode.
 * @hide
 */
private Notification rebuild(){
  if (mRebuildNotification == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  Bundle extras=mRebuildNotification.extras;
  if (extras.getBoolean(EXTRA_REBUILD_LARGE_ICON)) {
    mRebuildNotification.largeIcon=extras.getParcelable(EXTRA_LARGE_ICON);
  }
  extras.remove(EXTRA_REBUILD_LARGE_ICON);
  if (extras.getBoolean(EXTRA_REBUILD_CONTENT_VIEW)) {
    setBuilderContentView(mRebuildNotification,makeContentView());
    if (mStyle != null) {
      mStyle.populateContentView(mRebuildNotification);
    }
  }
  extras.remove(EXTRA_REBUILD_CONTENT_VIEW);
  if (extras.getBoolean(EXTRA_REBUILD_BIG_CONTENT_VIEW)) {
    setBuilderBigContentView(mRebuildNotification,makeBigContentView());
    if (mStyle != null) {
      mStyle.populateBigContentView(mRebuildNotification);
    }
  }
  extras.remove(EXTRA_REBUILD_BIG_CONTENT_VIEW);
  if (extras.getBoolean(EXTRA_REBUILD_HEADS_UP_CONTENT_VIEW)) {
    setBuilderHeadsUpContentView(mRebuildNotification,makeHeadsUpContentView());
    if (mStyle != null) {
      mStyle.populateHeadsUpContentView(mRebuildNotification);
    }
  }
  extras.remove(EXTRA_REBUILD_HEADS_UP_CONTENT_VIEW);
  return mRebuildNotification;
}

Fixed version (ground truth):
/** 
 * Rebuilds the notification passed in to the rebuild-constructor  {@link #Builder(Context,Notification)}. <p> Throws IllegalStateException when invoked on a Builder that isn't in rebuild mode.
 * @hide
 */
private Notification rebuild(){
  if (mRebuildNotification == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  mHasThreeLines=hasThreeLines();
  Bundle extras=mRebuildNotification.extras;
  if (extras.getBoolean(EXTRA_REBUILD_LARGE_ICON)) {
    mRebuildNotification.largeIcon=extras.getParcelable(EXTRA_LARGE_ICON);
  }
  extras.remove(EXTRA_REBUILD_LARGE_ICON);
  if (extras.getBoolean(EXTRA_REBUILD_CONTENT_VIEW)) {
    setBuilderContentView(mRebuildNotification,makeContentView());
    if (mStyle != null) {
      mStyle.populateContentView(mRebuildNotification);
    }
  }
  extras.remove(EXTRA_REBUILD_CONTENT_VIEW);
  if (extras.getBoolean(EXTRA_REBUILD_BIG_CONTENT_VIEW)) {
    setBuilderBigContentView(mRebuildNotification,makeBigContentView());
    if (mStyle != null) {
      mStyle.populateBigContentView(mRebuildNotification);
    }
  }
  extras.remove(EXTRA_REBUILD_BIG_CONTENT_VIEW);
  if (extras.getBoolean(EXTRA_REBUILD_HEADS_UP_CONTENT_VIEW)) {
    setBuilderHeadsUpContentView(mRebuildNotification,makeHeadsUpContentView());
    if (mStyle != null) {
      mStyle.populateHeadsUpContentView(mRebuildNotification);
    }
  }
  extras.remove(EXTRA_REBUILD_HEADS_UP_CONTENT_VIEW);
  mHasThreeLines=false;
  return mRebuildNotification;
}
Program: 197927
Project: 197927
Buggy source:
private RemoteViews makeBigContentView(){
  CharSequence oldBuilderContentText=mBuilder.mContentText;
  mBuilder.mContentText=null;
  RemoteViews contentView=getStandardView(mBuilder.getInboxLayoutResource());
  mBuilder.mContentText=oldBuilderContentText;
  contentView.setViewVisibility(R.id.text2,View.GONE);
  int[] rowIds={R.id.inbox_text0,R.id.inbox_text1,R.id.inbox_text2,R.id.inbox_text3,R.id.inbox_text4,R.id.inbox_text5,R.id.inbox_text6};
  for (  int rowId : rowIds) {
    contentView.setViewVisibility(rowId,View.GONE);
  }
  final boolean largeText=mBuilder.mContext.getResources().getConfiguration().fontScale > 1f;
  final float subTextSize=mBuilder.mContext.getResources().getDimensionPixelSize(R.dimen.notification_subtext_size);
  int i=0;
  while (i < mTexts.size() && i < rowIds.length) {
    CharSequence str=mTexts.get(i);
    if (str != null && !str.equals("String_Node_Str")) {
      contentView.setViewVisibility(rowIds[i],View.VISIBLE);
      contentView.setTextViewText(rowIds[i],mBuilder.processLegacyText(str));
      if (largeText) {
        contentView.setTextViewTextSize(rowIds[i],TypedValue.COMPLEX_UNIT_PX,subTextSize);
      }
    }
    i++;
  }
  contentView.setViewVisibility(R.id.inbox_end_pad,mTexts.size() > 0 ? View.VISIBLE : View.GONE);
  contentView.setViewVisibility(R.id.inbox_more,mTexts.size() > rowIds.length ? View.VISIBLE : View.GONE);
  applyTopPadding(contentView);
  mBuilder.addProfileBadge(contentView,R.id.profile_badge_large_template);
  return contentView;
}

Fixed version (ground truth):
private RemoteViews makeBigContentView(){
  CharSequence oldBuilderContentText=mBuilder.mContentText;
  mBuilder.mContentText=null;
  RemoteViews contentView=getStandardView(mBuilder.getInboxLayoutResource());
  mBuilder.mContentText=oldBuilderContentText;
  contentView.setViewVisibility(R.id.text2,View.GONE);
  int[] rowIds={R.id.inbox_text0,R.id.inbox_text1,R.id.inbox_text2,R.id.inbox_text3,R.id.inbox_text4,R.id.inbox_text5,R.id.inbox_text6};
  for (  int rowId : rowIds) {
    contentView.setViewVisibility(rowId,View.GONE);
  }
  final boolean largeText=mBuilder.mContext.getResources().getConfiguration().fontScale > 1f;
  final float subTextSize=mBuilder.mContext.getResources().getDimensionPixelSize(R.dimen.notification_subtext_size);
  int i=0;
  while (i < mTexts.size() && i < rowIds.length) {
    CharSequence str=mTexts.get(i);
    if (str != null && !str.equals("String_Node_Str")) {
      contentView.setViewVisibility(rowIds[i],View.VISIBLE);
      contentView.setTextViewText(rowIds[i],mBuilder.processLegacyText(str));
      if (largeText) {
        contentView.setTextViewTextSize(rowIds[i],TypedValue.COMPLEX_UNIT_PX,subTextSize);
      }
    }
    i++;
  }
  contentView.setViewVisibility(R.id.inbox_end_pad,mTexts.size() > 0 ? View.VISIBLE : View.GONE);
  contentView.setViewVisibility(R.id.inbox_more,mTexts.size() > rowIds.length ? View.VISIBLE : View.GONE);
  applyTopPadding(contentView);
  mBuilder.shrinkLine3Text(contentView);
  mBuilder.addProfileBadge(contentView,R.id.profile_badge_large_template);
  return contentView;
}
Program: 197928
Project: 197928
Buggy source:
private Bitmap getProfileBadge(){
  UserManager userManager=(UserManager)mContext.getSystemService(Context.USER_SERVICE);
  Drawable badge=userManager.getBadgeForUser(new UserHandle(mOriginatingUserId),0);
  if (badge == null) {
    return null;
  }
  final int width=badge.getIntrinsicWidth();
  final int height=badge.getIntrinsicHeight();
  Bitmap bitmap=Bitmap.createBitmap(width,height,Bitmap.Config.ARGB_8888);
  Canvas canvas=new Canvas(bitmap);
  badge.setBounds(0,0,width,height);
  badge.draw(canvas);
  return bitmap;
}

Fixed version (ground truth):
private Bitmap getProfileBadge(){
  Drawable badge=getProfileBadgeDrawable();
  if (badge == null) {
    return null;
  }
  final int size=mContext.getResources().getDimensionPixelSize(R.dimen.notification_badge_size);
  Bitmap bitmap=Bitmap.createBitmap(size,size,Bitmap.Config.ARGB_8888);
  Canvas canvas=new Canvas(bitmap);
  badge.setBounds(0,0,size,size);
  badge.draw(canvas);
  return bitmap;
}
Program: 197929
Project: 197929
Buggy source:
/** 
 * Changes the padding of the first line such that the big and small content view have the same top padding.
 * @hide
 */
protected void applyTopPadding(RemoteViews contentView){
  int topPadding=Builder.calculateTopPadding(mBuilder.mContext,mBuilder.hasThreeLines(),mBuilder.mContext.getResources().getConfiguration().fontScale);
  contentView.setViewPadding(R.id.line1,0,topPadding,0,0);
}

Fixed version (ground truth):
/** 
 * Changes the padding of the first line such that the big and small content view have the same top padding.
 * @hide
 */
protected void applyTopPadding(RemoteViews contentView){
  int topPadding=Builder.calculateTopPadding(mBuilder.mContext,mBuilder.mHasThreeLines,mBuilder.mContext.getResources().getConfiguration().fontScale);
  contentView.setViewPadding(R.id.line1,0,topPadding,0,0);
}
Program: 197930
Project: 197930
Buggy source:
private static BatteryStatsImpl getStats(IBatteryStats service){
  try {
    ParcelFileDescriptor pfd=service.getStatisticsStream();
    if (pfd != null) {
      FileInputStream fis=new ParcelFileDescriptor.AutoCloseInputStream(pfd);
      try {
        byte[] data=readFully(fis,MemoryFile.getSize(pfd.getFileDescriptor()));
        Parcel parcel=Parcel.obtain();
        parcel.unmarshall(data,0,data.length);
        parcel.setDataPosition(0);
        BatteryStatsImpl stats=com.android.internal.os.BatteryStatsImpl.CREATOR.createFromParcel(parcel);
        stats.distributeWorkLocked(BatteryStats.STATS_SINCE_CHARGED);
        return stats;
      }
 catch (      IOException e) {
        Log.w(TAG,"String_Node_Str",e);
      }
    }
  }
 catch (  RemoteException e) {
    Log.w(TAG,"String_Node_Str",e);
  }
  return null;
}

Fixed version (ground truth):
private static BatteryStatsImpl getStats(IBatteryStats service){
  try {
    ParcelFileDescriptor pfd=service.getStatisticsStream();
    if (pfd != null) {
      FileInputStream fis=new ParcelFileDescriptor.AutoCloseInputStream(pfd);
      try {
        byte[] data=readFully(fis,MemoryFile.getSize(pfd.getFileDescriptor()));
        Parcel parcel=Parcel.obtain();
        parcel.unmarshall(data,0,data.length);
        parcel.setDataPosition(0);
        BatteryStatsImpl stats=com.android.internal.os.BatteryStatsImpl.CREATOR.createFromParcel(parcel);
        stats.distributeWorkLocked(BatteryStats.STATS_SINCE_CHARGED);
        return stats;
      }
 catch (      IOException e) {
        Log.w(TAG,"String_Node_Str",e);
      }
    }
  }
 catch (  RemoteException e) {
    Log.w(TAG,"String_Node_Str",e);
  }
  return new BatteryStatsImpl();
}
Program: 197933
Project: 197933
Buggy source:
private static BatteryStatsImpl getStats(IBatteryStats service){
  try {
    ParcelFileDescriptor pfd=service.getStatisticsStream();
    if (pfd != null) {
      FileInputStream fis=new ParcelFileDescriptor.AutoCloseInputStream(pfd);
      try {
        byte[] data=readFully(fis,MemoryFile.getSize(pfd.getFileDescriptor()));
        Parcel parcel=Parcel.obtain();
        parcel.unmarshall(data,0,data.length);
        parcel.setDataPosition(0);
        BatteryStatsImpl stats=com.android.internal.os.BatteryStatsImpl.CREATOR.createFromParcel(parcel);
        stats.distributeWorkLocked(BatteryStats.STATS_SINCE_CHARGED);
        return stats;
      }
 catch (      IOException e) {
        Log.w(TAG,"String_Node_Str",e);
      }
    }
  }
 catch (  RemoteException e) {
    Log.w(TAG,"String_Node_Str",e);
  }
  return null;
}

Fixed version (ground truth):
private static BatteryStatsImpl getStats(IBatteryStats service){
  try {
    ParcelFileDescriptor pfd=service.getStatisticsStream();
    if (pfd != null) {
      FileInputStream fis=new ParcelFileDescriptor.AutoCloseInputStream(pfd);
      try {
        byte[] data=readFully(fis,MemoryFile.getSize(pfd.getFileDescriptor()));
        Parcel parcel=Parcel.obtain();
        parcel.unmarshall(data,0,data.length);
        parcel.setDataPosition(0);
        BatteryStatsImpl stats=com.android.internal.os.BatteryStatsImpl.CREATOR.createFromParcel(parcel);
        stats.distributeWorkLocked(BatteryStats.STATS_SINCE_CHARGED);
        return stats;
      }
 catch (      IOException e) {
        Log.w(TAG,"String_Node_Str",e);
      }
    }
  }
 catch (  RemoteException e) {
    Log.w(TAG,"String_Node_Str",e);
  }
  return new BatteryStatsImpl();
}
Program: 197936
Project: 197936
Buggy source:
private static BatteryStatsImpl getStats(IBatteryStats service){
  try {
    ParcelFileDescriptor pfd=service.getStatisticsStream();
    if (pfd != null) {
      FileInputStream fis=new ParcelFileDescriptor.AutoCloseInputStream(pfd);
      try {
        byte[] data=readFully(fis,MemoryFile.getSize(pfd.getFileDescriptor()));
        Parcel parcel=Parcel.obtain();
        parcel.unmarshall(data,0,data.length);
        parcel.setDataPosition(0);
        BatteryStatsImpl stats=com.android.internal.os.BatteryStatsImpl.CREATOR.createFromParcel(parcel);
        stats.distributeWorkLocked(BatteryStats.STATS_SINCE_CHARGED);
        return stats;
      }
 catch (      IOException e) {
        Log.w(TAG,"String_Node_Str",e);
      }
    }
  }
 catch (  RemoteException e) {
    Log.w(TAG,"String_Node_Str",e);
  }
  return null;
}

Fixed version (ground truth):
private static BatteryStatsImpl getStats(IBatteryStats service){
  try {
    ParcelFileDescriptor pfd=service.getStatisticsStream();
    if (pfd != null) {
      FileInputStream fis=new ParcelFileDescriptor.AutoCloseInputStream(pfd);
      try {
        byte[] data=readFully(fis,MemoryFile.getSize(pfd.getFileDescriptor()));
        Parcel parcel=Parcel.obtain();
        parcel.unmarshall(data,0,data.length);
        parcel.setDataPosition(0);
        BatteryStatsImpl stats=com.android.internal.os.BatteryStatsImpl.CREATOR.createFromParcel(parcel);
        stats.distributeWorkLocked(BatteryStats.STATS_SINCE_CHARGED);
        return stats;
      }
 catch (      IOException e) {
        Log.w(TAG,"String_Node_Str",e);
      }
    }
  }
 catch (  RemoteException e) {
    Log.w(TAG,"String_Node_Str",e);
  }
  return new BatteryStatsImpl();
}
Program: 197939
Project: 197939
Buggy source:
private static BatteryStatsImpl getStats(IBatteryStats service){
  try {
    ParcelFileDescriptor pfd=service.getStatisticsStream();
    if (pfd != null) {
      FileInputStream fis=new ParcelFileDescriptor.AutoCloseInputStream(pfd);
      try {
        byte[] data=readFully(fis,MemoryFile.getSize(pfd.getFileDescriptor()));
        Parcel parcel=Parcel.obtain();
        parcel.unmarshall(data,0,data.length);
        parcel.setDataPosition(0);
        BatteryStatsImpl stats=com.android.internal.os.BatteryStatsImpl.CREATOR.createFromParcel(parcel);
        stats.distributeWorkLocked(BatteryStats.STATS_SINCE_CHARGED);
        return stats;
      }
 catch (      IOException e) {
        Log.w(TAG,"String_Node_Str",e);
      }
    }
  }
 catch (  RemoteException e) {
    Log.w(TAG,"String_Node_Str",e);
  }
  return null;
}

Fixed version (ground truth):
private static BatteryStatsImpl getStats(IBatteryStats service){
  try {
    ParcelFileDescriptor pfd=service.getStatisticsStream();
    if (pfd != null) {
      FileInputStream fis=new ParcelFileDescriptor.AutoCloseInputStream(pfd);
      try {
        byte[] data=readFully(fis,MemoryFile.getSize(pfd.getFileDescriptor()));
        Parcel parcel=Parcel.obtain();
        parcel.unmarshall(data,0,data.length);
        parcel.setDataPosition(0);
        BatteryStatsImpl stats=com.android.internal.os.BatteryStatsImpl.CREATOR.createFromParcel(parcel);
        stats.distributeWorkLocked(BatteryStats.STATS_SINCE_CHARGED);
        return stats;
      }
 catch (      IOException e) {
        Log.w(TAG,"String_Node_Str",e);
      }
    }
  }
 catch (  RemoteException e) {
    Log.w(TAG,"String_Node_Str",e);
  }
  return new BatteryStatsImpl();
}
Program: 197943
Project: 197943
Buggy source:
public void prepareForDumpLocked(){
  pullPendingStateUpdatesLocked();
}

Fixed version (ground truth):
public void prepareForDumpLocked(){
  pullPendingStateUpdatesLocked();
  getStartClockTime();
}
Program: 197944
Project: 197944
Buggy source:
@Override public long getStartClockTime(){
  return mStartClockTime;
}

Fixed version (ground truth):
@Override public long getStartClockTime(){
  if (!isStartClockTimeValid()) {
    mStartClockTime=System.currentTimeMillis();
    if (isStartClockTimeValid()) {
      recordCurrentTimeChangeLocked(mStartClockTime,SystemClock.elapsedRealtime(),SystemClock.uptimeMillis());
    }
  }
  return mStartClockTime;
}
Program: 197948
Project: 197948
Buggy source:
public void prepareForDumpLocked(){
  pullPendingStateUpdatesLocked();
}

Fixed version (ground truth):
public void prepareForDumpLocked(){
  pullPendingStateUpdatesLocked();
  getStartClockTime();
}
Program: 197949
Project: 197949
Buggy source:
@Override public long getStartClockTime(){
  return mStartClockTime;
}

Fixed version (ground truth):
@Override public long getStartClockTime(){
  if (!isStartClockTimeValid()) {
    mStartClockTime=System.currentTimeMillis();
    if (isStartClockTimeValid()) {
      recordCurrentTimeChangeLocked(mStartClockTime,SystemClock.elapsedRealtime(),SystemClock.uptimeMillis());
    }
  }
  return mStartClockTime;
}
Program: 197953
Project: 197953
Buggy source:
public void prepareForDumpLocked(){
  pullPendingStateUpdatesLocked();
}

Fixed version (ground truth):
public void prepareForDumpLocked(){
  pullPendingStateUpdatesLocked();
  getStartClockTime();
}
Program: 197954
Project: 197954
Buggy source:
@Override public long getStartClockTime(){
  return mStartClockTime;
}

Fixed version (ground truth):
@Override public long getStartClockTime(){
  if (!isStartClockTimeValid()) {
    mStartClockTime=System.currentTimeMillis();
    if (isStartClockTimeValid()) {
      recordCurrentTimeChangeLocked(mStartClockTime,SystemClock.elapsedRealtime(),SystemClock.uptimeMillis());
    }
  }
  return mStartClockTime;
}
Program: 197958
Project: 197958
Buggy source:
public void prepareForDumpLocked(){
  pullPendingStateUpdatesLocked();
}

Fixed version (ground truth):
public void prepareForDumpLocked(){
  pullPendingStateUpdatesLocked();
  getStartClockTime();
}
Program: 197959
Project: 197959
Buggy source:
@Override public long getStartClockTime(){
  return mStartClockTime;
}

Fixed version (ground truth):
@Override public long getStartClockTime(){
  if (!isStartClockTimeValid()) {
    mStartClockTime=System.currentTimeMillis();
    if (isStartClockTimeValid()) {
      recordCurrentTimeChangeLocked(mStartClockTime,SystemClock.elapsedRealtime(),SystemClock.uptimeMillis());
    }
  }
  return mStartClockTime;
}
Program: 197962
Project: 197962
Buggy source:
private static BatteryStatsImpl getStats(IBatteryStats service){
  try {
    ParcelFileDescriptor pfd=service.getStatisticsStream();
    if (pfd != null) {
      FileInputStream fis=new ParcelFileDescriptor.AutoCloseInputStream(pfd);
      try {
        byte[] data=readFully(fis,MemoryFile.getSize(pfd.getFileDescriptor()));
        Parcel parcel=Parcel.obtain();
        parcel.unmarshall(data,0,data.length);
        parcel.setDataPosition(0);
        BatteryStatsImpl stats=com.android.internal.os.BatteryStatsImpl.CREATOR.createFromParcel(parcel);
        stats.distributeWorkLocked(BatteryStats.STATS_SINCE_CHARGED);
        return stats;
      }
 catch (      IOException e) {
        Log.w(TAG,"String_Node_Str",e);
      }
    }
  }
 catch (  RemoteException e) {
    Log.w(TAG,"String_Node_Str",e);
  }
  return null;
}

Fixed version (ground truth):
private static BatteryStatsImpl getStats(IBatteryStats service){
  try {
    ParcelFileDescriptor pfd=service.getStatisticsStream();
    if (pfd != null) {
      FileInputStream fis=new ParcelFileDescriptor.AutoCloseInputStream(pfd);
      try {
        byte[] data=readFully(fis,MemoryFile.getSize(pfd.getFileDescriptor()));
        Parcel parcel=Parcel.obtain();
        parcel.unmarshall(data,0,data.length);
        parcel.setDataPosition(0);
        BatteryStatsImpl stats=com.android.internal.os.BatteryStatsImpl.CREATOR.createFromParcel(parcel);
        stats.distributeWorkLocked(BatteryStats.STATS_SINCE_CHARGED);
        return stats;
      }
 catch (      IOException e) {
        Log.w(TAG,"String_Node_Str",e);
      }
    }
  }
 catch (  RemoteException e) {
    Log.w(TAG,"String_Node_Str",e);
  }
  return new BatteryStatsImpl();
}
Program: 197965
Project: 197965
Buggy source:
@Override public void performRemoveAnimation(long duration,float translationDirection,Runnable onFinishedRunnable){
  enableAppearDrawing(true);
  if (mDrawingAppearAnimation) {
    startAppearAnimation(false,translationDirection,0,duration,onFinishedRunnable);
  }
}

Fixed version (ground truth):
@Override public void performRemoveAnimation(long duration,float translationDirection,Runnable onFinishedRunnable){
  enableAppearDrawing(true);
  if (mDrawingAppearAnimation) {
    startAppearAnimation(false,translationDirection,0,duration,onFinishedRunnable);
  }
 else   if (onFinishedRunnable != null) {
    onFinishedRunnable.run();
  }
}
Program: 197967
Project: 197967
Buggy source:
@Override public void performRemoveAnimation(long duration,float translationDirection,Runnable onFinishedRunnable){
  enableAppearDrawing(true);
  if (mDrawingAppearAnimation) {
    startAppearAnimation(false,translationDirection,0,duration,onFinishedRunnable);
  }
}

Fixed version (ground truth):
@Override public void performRemoveAnimation(long duration,float translationDirection,Runnable onFinishedRunnable){
  enableAppearDrawing(true);
  if (mDrawingAppearAnimation) {
    startAppearAnimation(false,translationDirection,0,duration,onFinishedRunnable);
  }
 else   if (onFinishedRunnable != null) {
    onFinishedRunnable.run();
  }
}
Program: 197969
Project: 197969
Buggy source:
@Override public void performRemoveAnimation(long duration,float translationDirection,Runnable onFinishedRunnable){
  enableAppearDrawing(true);
  if (mDrawingAppearAnimation) {
    startAppearAnimation(false,translationDirection,0,duration,onFinishedRunnable);
  }
}

Fixed version (ground truth):
@Override public void performRemoveAnimation(long duration,float translationDirection,Runnable onFinishedRunnable){
  enableAppearDrawing(true);
  if (mDrawingAppearAnimation) {
    startAppearAnimation(false,translationDirection,0,duration,onFinishedRunnable);
  }
 else   if (onFinishedRunnable != null) {
    onFinishedRunnable.run();
  }
}
Program: 197971
Project: 197971
Buggy source:
@Override public void performRemoveAnimation(long duration,float translationDirection,Runnable onFinishedRunnable){
  enableAppearDrawing(true);
  if (mDrawingAppearAnimation) {
    startAppearAnimation(false,translationDirection,0,duration,onFinishedRunnable);
  }
}

Fixed version (ground truth):
@Override public void performRemoveAnimation(long duration,float translationDirection,Runnable onFinishedRunnable){
  enableAppearDrawing(true);
  if (mDrawingAppearAnimation) {
    startAppearAnimation(false,translationDirection,0,duration,onFinishedRunnable);
  }
 else   if (onFinishedRunnable != null) {
    onFinishedRunnable.run();
  }
}
Program: 197973
Project: 197973
Buggy source:
@Override public void performRemoveAnimation(long duration,float translationDirection,Runnable onFinishedRunnable){
  enableAppearDrawing(true);
  if (mDrawingAppearAnimation) {
    startAppearAnimation(false,translationDirection,0,duration,onFinishedRunnable);
  }
}

Fixed version (ground truth):
@Override public void performRemoveAnimation(long duration,float translationDirection,Runnable onFinishedRunnable){
  enableAppearDrawing(true);
  if (mDrawingAppearAnimation) {
    startAppearAnimation(false,translationDirection,0,duration,onFinishedRunnable);
  }
 else   if (onFinishedRunnable != null) {
    onFinishedRunnable.run();
  }
}
Program: 197976
Project: 197976
Buggy source:
public void prepareForDumpLocked(){
  pullPendingStateUpdatesLocked();
}

Fixed version (ground truth):
public void prepareForDumpLocked(){
  pullPendingStateUpdatesLocked();
  getStartClockTime();
}
Program: 197977
Project: 197977
Buggy source:
@Override public long getStartClockTime(){
  return mStartClockTime;
}

Fixed version (ground truth):
@Override public long getStartClockTime(){
  if (!isStartClockTimeValid()) {
    mStartClockTime=System.currentTimeMillis();
    if (isStartClockTimeValid()) {
      recordCurrentTimeChangeLocked(mStartClockTime,SystemClock.elapsedRealtime(),SystemClock.uptimeMillis());
    }
  }
  return mStartClockTime;
}
Program: 197980
Project: 197980
Buggy source:
/** 
 * Sends key to a target CEC device.
 * @param keyCode key code to send. Defined in {@link android.view.KeyEvent}.
 * @param isPressed true if this is key press event
 */
@Override @ServiceThreadOnly protected void sendKeyEvent(int keyCode,boolean isPressed){
  assertRunOnServiceThread();
  List<SendKeyAction> action=getActions(SendKeyAction.class);
  if (!action.isEmpty()) {
    action.get(0).processKeyEvent(keyCode,isPressed);
  }
 else {
    if (isPressed && getActiveSource().isValid()) {
      int logicalAddress=getActiveSource().logicalAddress;
      addAndStartAction(new SendKeyAction(this,logicalAddress,keyCode));
    }
 else {
      Slog.w(TAG,"String_Node_Str" + keyCode + "String_Node_Str"+ isPressed);
    }
  }
}

Fixed version (ground truth):
/** 
 * Sends key to a target CEC device.
 * @param keyCode key code to send. Defined in {@link android.view.KeyEvent}.
 * @param isPressed true if this is key press event
 */
@Override @ServiceThreadOnly protected void sendKeyEvent(int keyCode,boolean isPressed){
  assertRunOnServiceThread();
  if (!HdmiCecKeycode.isSupportedKeycode(keyCode)) {
    Slog.w(TAG,"String_Node_Str" + keyCode);
    return;
  }
  List<SendKeyAction> action=getActions(SendKeyAction.class);
  if (!action.isEmpty()) {
    action.get(0).processKeyEvent(keyCode,isPressed);
  }
 else {
    if (isPressed && getActiveSource().isValid()) {
      int logicalAddress=getActiveSource().logicalAddress;
      addAndStartAction(new SendKeyAction(this,logicalAddress,keyCode));
    }
 else {
      Slog.w(TAG,"String_Node_Str" + keyCode + "String_Node_Str"+ isPressed);
    }
  }
}
Program: 197984
Project: 197984
Buggy source:
public boolean handleApplicationWtf(IBinder app,String tag,ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException {
  Parcel data=Parcel.obtain();
  Parcel reply=Parcel.obtain();
  data.writeInterfaceToken(IActivityManager.descriptor);
  data.writeStrongBinder(app);
  data.writeString(tag);
  crashInfo.writeToParcel(data,0);
  mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION,data,reply,0);
  reply.readException();
  boolean res=reply.readInt() != 0;
  reply.recycle();
  data.recycle();
  return res;
}

Fixed version (ground truth):
public boolean handleApplicationWtf(IBinder app,String tag,boolean system,ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException {
  Parcel data=Parcel.obtain();
  Parcel reply=Parcel.obtain();
  data.writeInterfaceToken(IActivityManager.descriptor);
  data.writeStrongBinder(app);
  data.writeString(tag);
  data.writeInt(system ? 1 : 0);
  crashInfo.writeToParcel(data,0);
  mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION,data,reply,0);
  reply.readException();
  boolean res=reply.readInt() != 0;
  reply.recycle();
  data.recycle();
  return res;
}
Program: 197985
Project: 197985
Buggy source:
public boolean handleApplicationWtf(IBinder app,String tag,ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException ;

Fixed version (ground truth):
public boolean handleApplicationWtf(IBinder app,String tag,boolean system,ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException ;
Program: 197986
Project: 197986
Buggy source:
static int wtf(int logId,String tag,String msg,Throwable tr,boolean localStack){
  TerribleFailure what=new TerribleFailure(msg,tr);
  int bytes=println_native(logId,ASSERT,tag,msg + '\n' + getStackTraceString(localStack ? what : tr));
  sWtfHandler.onTerribleFailure(tag,what);
  return bytes;
}

Fixed version (ground truth):
static int wtf(int logId,String tag,String msg,Throwable tr,boolean localStack,boolean system){
  TerribleFailure what=new TerribleFailure(msg,tr);
  int bytes=println_native(logId,ASSERT,tag,msg + '\n' + getStackTraceString(localStack ? what : tr));
  sWtfHandler.onTerribleFailure(tag,what,system);
  return bytes;
}
Program: 197987
Project: 197987
Buggy source:
/** 
 * Like   {@link #wtf(String,String)}, but also writes to the log the full call stack.
 * @hide
 */
public static int wtfStack(String tag,String msg){
  return wtf(LOG_ID_MAIN,tag,msg,null,true);
}

Fixed version (ground truth):
/** 
 * Like   {@link #wtf(String,String)}, but also writes to the log the full call stack.
 * @hide
 */
public static int wtfStack(String tag,String msg){
  return wtf(LOG_ID_MAIN,tag,msg,null,true,false);
}
Program: 197988
Project: 197988
Buggy source:
public void onTerribleFailure(String tag,TerribleFailure what){
  RuntimeInit.wtf(tag,what);
}

Fixed version (ground truth):
public void onTerribleFailure(String tag,TerribleFailure what,boolean system){
  RuntimeInit.wtf(tag,what,system);
}
Program: 197989
Project: 197989
Buggy source:
public static int wtf(String tag,String msg,Throwable tr){
  return Log.wtf(Log.LOG_ID_SYSTEM,tag,msg,tr,false);
}

Fixed version (ground truth):
public static int wtf(String tag,String msg,Throwable tr){
  return Log.wtf(Log.LOG_ID_SYSTEM,tag,msg,tr,false,true);
}
Program: 197990
Project: 197990
Buggy source:
public static int wtfStack(String tag,String msg){
  return Log.wtf(Log.LOG_ID_SYSTEM,tag,msg,null,true);
}

Fixed version (ground truth):
public static int wtfStack(String tag,String msg){
  return Log.wtf(Log.LOG_ID_SYSTEM,tag,msg,null,true,true);
}
Program: 197991
Project: 197991
Buggy source:
/** 
 * Report a serious error in the current process.  May or may not cause the process to terminate (depends on system settings).
 * @param tag to record with the error
 * @param t exception describing the error site and conditions
 */
public static void wtf(String tag,Throwable t){
  try {
    if (ActivityManagerNative.getDefault().handleApplicationWtf(mApplicationObject,tag,new ApplicationErrorReport.CrashInfo(t))) {
      Process.killProcess(Process.myPid());
      System.exit(10);
    }
  }
 catch (  Throwable t2) {
    Slog.e(TAG,"String_Node_Str",t2);
    Slog.e(TAG,"String_Node_Str",t);
  }
}

Fixed version (ground truth):
/** 
 * Report a serious error in the current process.  May or may not cause the process to terminate (depends on system settings).
 * @param tag to record with the error
 * @param t exception describing the error site and conditions
 */
public static void wtf(String tag,Throwable t,boolean system){
  try {
    if (ActivityManagerNative.getDefault().handleApplicationWtf(mApplicationObject,tag,system,new ApplicationErrorReport.CrashInfo(t))) {
      Process.killProcess(Process.myPid());
      System.exit(10);
    }
  }
 catch (  Throwable t2) {
    Slog.e(TAG,"String_Node_Str",t2);
    Slog.e(TAG,"String_Node_Str",t);
  }
}
Program: 197993
Project: 197993
Buggy source:
/** 
 * Used by   {@link Log} via {@link com.android.internal.os.RuntimeInit} to report serious errors.
 * @param app object of the crashing app, null for the system server
 * @param tag reported by the caller
 * @param crashInfo describing the context of the error
 * @return true if the process should exit immediately (WTF is fatal)
 */
public boolean handleApplicationWtf(IBinder app,String tag,ApplicationErrorReport.CrashInfo crashInfo){
  ProcessRecord r=findAppProcess(app,"String_Node_Str");
  final String processName=app == null ? "String_Node_Str" : (r == null ? "String_Node_Str" : r.processName);
  EventLog.writeEvent(EventLogTags.AM_WTF,UserHandle.getUserId(Binder.getCallingUid()),Binder.getCallingPid(),processName,r == null ? -1 : r.info.flags,tag,crashInfo.exceptionMessage);
  addErrorToDropBox("String_Node_Str",r,processName,null,null,tag,null,null,crashInfo);
  if (r != null && r.pid != Process.myPid() && Settings.Global.getInt(mContext.getContentResolver(),Settings.Global.WTF_IS_FATAL,0) != 0) {
    crashApplication(r,crashInfo);
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Used by   {@link Log} via {@link com.android.internal.os.RuntimeInit} to report serious errors.
 * @param app object of the crashing app, null for the system server
 * @param tag reported by the caller
 * @param system whether this wtf is coming from the system
 * @param crashInfo describing the context of the error
 * @return true if the process should exit immediately (WTF is fatal)
 */
public boolean handleApplicationWtf(IBinder app,final String tag,boolean system,final ApplicationErrorReport.CrashInfo crashInfo){
  final ProcessRecord r=findAppProcess(app,"String_Node_Str");
  final String processName=app == null ? "String_Node_Str" : (r == null ? "String_Node_Str" : r.processName);
  EventLog.writeEvent(EventLogTags.AM_WTF,UserHandle.getUserId(Binder.getCallingUid()),Binder.getCallingPid(),processName,r == null ? -1 : r.info.flags,tag,crashInfo.exceptionMessage);
  if (system) {
    mHandler.post(new Runnable(){
      @Override public void run(){
        addErrorToDropBox("String_Node_Str",r,processName,null,null,tag,null,null,crashInfo);
      }
    }
);
    return false;
  }
  addErrorToDropBox("String_Node_Str",r,processName,null,null,tag,null,null,crashInfo);
  if (r != null && r.pid != Process.myPid() && Settings.Global.getInt(mContext.getContentResolver(),Settings.Global.WTF_IS_FATAL,0) != 0) {
    crashApplication(r,crashInfo);
    return true;
  }
 else {
    return false;
  }
}
Program: 197995
Project: 197995
Buggy source:
public boolean handleApplicationWtf(IBinder app,String tag,ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException {
  Parcel data=Parcel.obtain();
  Parcel reply=Parcel.obtain();
  data.writeInterfaceToken(IActivityManager.descriptor);
  data.writeStrongBinder(app);
  data.writeString(tag);
  crashInfo.writeToParcel(data,0);
  mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION,data,reply,0);
  reply.readException();
  boolean res=reply.readInt() != 0;
  reply.recycle();
  data.recycle();
  return res;
}

Fixed version (ground truth):
public boolean handleApplicationWtf(IBinder app,String tag,boolean system,ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException {
  Parcel data=Parcel.obtain();
  Parcel reply=Parcel.obtain();
  data.writeInterfaceToken(IActivityManager.descriptor);
  data.writeStrongBinder(app);
  data.writeString(tag);
  data.writeInt(system ? 1 : 0);
  crashInfo.writeToParcel(data,0);
  mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION,data,reply,0);
  reply.readException();
  boolean res=reply.readInt() != 0;
  reply.recycle();
  data.recycle();
  return res;
}
Program: 197996
Project: 197996
Buggy source:
public boolean handleApplicationWtf(IBinder app,String tag,ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException ;

Fixed version (ground truth):
public boolean handleApplicationWtf(IBinder app,String tag,boolean system,ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException ;
Program: 197997
Project: 197997
Buggy source:
static int wtf(int logId,String tag,String msg,Throwable tr,boolean localStack){
  TerribleFailure what=new TerribleFailure(msg,tr);
  int bytes=println_native(logId,ASSERT,tag,msg + '\n' + getStackTraceString(localStack ? what : tr));
  sWtfHandler.onTerribleFailure(tag,what);
  return bytes;
}

Fixed version (ground truth):
static int wtf(int logId,String tag,String msg,Throwable tr,boolean localStack,boolean system){
  TerribleFailure what=new TerribleFailure(msg,tr);
  int bytes=println_native(logId,ASSERT,tag,msg + '\n' + getStackTraceString(localStack ? what : tr));
  sWtfHandler.onTerribleFailure(tag,what,system);
  return bytes;
}
Program: 197998
Project: 197998
Buggy source:
/** 
 * Like   {@link #wtf(String,String)}, but also writes to the log the full call stack.
 * @hide
 */
public static int wtfStack(String tag,String msg){
  return wtf(LOG_ID_MAIN,tag,msg,null,true);
}

Fixed version (ground truth):
/** 
 * Like   {@link #wtf(String,String)}, but also writes to the log the full call stack.
 * @hide
 */
public static int wtfStack(String tag,String msg){
  return wtf(LOG_ID_MAIN,tag,msg,null,true,false);
}
Program: 197999
Project: 197999
Buggy source:
public void onTerribleFailure(String tag,TerribleFailure what){
  RuntimeInit.wtf(tag,what);
}

Fixed version (ground truth):
public void onTerribleFailure(String tag,TerribleFailure what,boolean system){
  RuntimeInit.wtf(tag,what,system);
}
Program: 198000
Project: 198000
Buggy source:
public static int wtf(String tag,String msg,Throwable tr){
  return Log.wtf(Log.LOG_ID_SYSTEM,tag,msg,tr,false);
}

Fixed version (ground truth):
public static int wtf(String tag,String msg,Throwable tr){
  return Log.wtf(Log.LOG_ID_SYSTEM,tag,msg,tr,false,true);
}
Program: 198001
Project: 198001
Buggy source:
public static int wtfStack(String tag,String msg){
  return Log.wtf(Log.LOG_ID_SYSTEM,tag,msg,null,true);
}

Fixed version (ground truth):
public static int wtfStack(String tag,String msg){
  return Log.wtf(Log.LOG_ID_SYSTEM,tag,msg,null,true,true);
}
Program: 198002
Project: 198002
Buggy source:
/** 
 * Report a serious error in the current process.  May or may not cause the process to terminate (depends on system settings).
 * @param tag to record with the error
 * @param t exception describing the error site and conditions
 */
public static void wtf(String tag,Throwable t){
  try {
    if (ActivityManagerNative.getDefault().handleApplicationWtf(mApplicationObject,tag,new ApplicationErrorReport.CrashInfo(t))) {
      Process.killProcess(Process.myPid());
      System.exit(10);
    }
  }
 catch (  Throwable t2) {
    Slog.e(TAG,"String_Node_Str",t2);
    Slog.e(TAG,"String_Node_Str",t);
  }
}

Fixed version (ground truth):
/** 
 * Report a serious error in the current process.  May or may not cause the process to terminate (depends on system settings).
 * @param tag to record with the error
 * @param t exception describing the error site and conditions
 */
public static void wtf(String tag,Throwable t,boolean system){
  try {
    if (ActivityManagerNative.getDefault().handleApplicationWtf(mApplicationObject,tag,system,new ApplicationErrorReport.CrashInfo(t))) {
      Process.killProcess(Process.myPid());
      System.exit(10);
    }
  }
 catch (  Throwable t2) {
    Slog.e(TAG,"String_Node_Str",t2);
    Slog.e(TAG,"String_Node_Str",t);
  }
}
Program: 198004
Project: 198004
Buggy source:
/** 
 * Used by   {@link Log} via {@link com.android.internal.os.RuntimeInit} to report serious errors.
 * @param app object of the crashing app, null for the system server
 * @param tag reported by the caller
 * @param crashInfo describing the context of the error
 * @return true if the process should exit immediately (WTF is fatal)
 */
public boolean handleApplicationWtf(IBinder app,String tag,ApplicationErrorReport.CrashInfo crashInfo){
  ProcessRecord r=findAppProcess(app,"String_Node_Str");
  final String processName=app == null ? "String_Node_Str" : (r == null ? "String_Node_Str" : r.processName);
  EventLog.writeEvent(EventLogTags.AM_WTF,UserHandle.getUserId(Binder.getCallingUid()),Binder.getCallingPid(),processName,r == null ? -1 : r.info.flags,tag,crashInfo.exceptionMessage);
  addErrorToDropBox("String_Node_Str",r,processName,null,null,tag,null,null,crashInfo);
  if (r != null && r.pid != Process.myPid() && Settings.Global.getInt(mContext.getContentResolver(),Settings.Global.WTF_IS_FATAL,0) != 0) {
    crashApplication(r,crashInfo);
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Used by   {@link Log} via {@link com.android.internal.os.RuntimeInit} to report serious errors.
 * @param app object of the crashing app, null for the system server
 * @param tag reported by the caller
 * @param system whether this wtf is coming from the system
 * @param crashInfo describing the context of the error
 * @return true if the process should exit immediately (WTF is fatal)
 */
public boolean handleApplicationWtf(IBinder app,final String tag,boolean system,final ApplicationErrorReport.CrashInfo crashInfo){
  final ProcessRecord r=findAppProcess(app,"String_Node_Str");
  final String processName=app == null ? "String_Node_Str" : (r == null ? "String_Node_Str" : r.processName);
  EventLog.writeEvent(EventLogTags.AM_WTF,UserHandle.getUserId(Binder.getCallingUid()),Binder.getCallingPid(),processName,r == null ? -1 : r.info.flags,tag,crashInfo.exceptionMessage);
  if (system) {
    mHandler.post(new Runnable(){
      @Override public void run(){
        addErrorToDropBox("String_Node_Str",r,processName,null,null,tag,null,null,crashInfo);
      }
    }
);
    return false;
  }
  addErrorToDropBox("String_Node_Str",r,processName,null,null,tag,null,null,crashInfo);
  if (r != null && r.pid != Process.myPid() && Settings.Global.getInt(mContext.getContentResolver(),Settings.Global.WTF_IS_FATAL,0) != 0) {
    crashApplication(r,crashInfo);
    return true;
  }
 else {
    return false;
  }
}
Program: 198006
Project: 198006
Buggy source:
public boolean handleApplicationWtf(IBinder app,String tag,ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException {
  Parcel data=Parcel.obtain();
  Parcel reply=Parcel.obtain();
  data.writeInterfaceToken(IActivityManager.descriptor);
  data.writeStrongBinder(app);
  data.writeString(tag);
  crashInfo.writeToParcel(data,0);
  mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION,data,reply,0);
  reply.readException();
  boolean res=reply.readInt() != 0;
  reply.recycle();
  data.recycle();
  return res;
}

Fixed version (ground truth):
public boolean handleApplicationWtf(IBinder app,String tag,boolean system,ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException {
  Parcel data=Parcel.obtain();
  Parcel reply=Parcel.obtain();
  data.writeInterfaceToken(IActivityManager.descriptor);
  data.writeStrongBinder(app);
  data.writeString(tag);
  data.writeInt(system ? 1 : 0);
  crashInfo.writeToParcel(data,0);
  mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION,data,reply,0);
  reply.readException();
  boolean res=reply.readInt() != 0;
  reply.recycle();
  data.recycle();
  return res;
}
Program: 198007
Project: 198007
Buggy source:
public boolean handleApplicationWtf(IBinder app,String tag,ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException ;

Fixed version (ground truth):
public boolean handleApplicationWtf(IBinder app,String tag,boolean system,ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException ;
Program: 198008
Project: 198008
Buggy source:
static int wtf(int logId,String tag,String msg,Throwable tr,boolean localStack){
  TerribleFailure what=new TerribleFailure(msg,tr);
  int bytes=println_native(logId,ASSERT,tag,msg + '\n' + getStackTraceString(localStack ? what : tr));
  sWtfHandler.onTerribleFailure(tag,what);
  return bytes;
}

Fixed version (ground truth):
static int wtf(int logId,String tag,String msg,Throwable tr,boolean localStack,boolean system){
  TerribleFailure what=new TerribleFailure(msg,tr);
  int bytes=println_native(logId,ASSERT,tag,msg + '\n' + getStackTraceString(localStack ? what : tr));
  sWtfHandler.onTerribleFailure(tag,what,system);
  return bytes;
}
Program: 198009
Project: 198009
Buggy source:
/** 
 * Like   {@link #wtf(String,String)}, but also writes to the log the full call stack.
 * @hide
 */
public static int wtfStack(String tag,String msg){
  return wtf(LOG_ID_MAIN,tag,msg,null,true);
}

Fixed version (ground truth):
/** 
 * Like   {@link #wtf(String,String)}, but also writes to the log the full call stack.
 * @hide
 */
public static int wtfStack(String tag,String msg){
  return wtf(LOG_ID_MAIN,tag,msg,null,true,false);
}
Program: 198010
Project: 198010
Buggy source:
public void onTerribleFailure(String tag,TerribleFailure what){
  RuntimeInit.wtf(tag,what);
}

Fixed version (ground truth):
public void onTerribleFailure(String tag,TerribleFailure what,boolean system){
  RuntimeInit.wtf(tag,what,system);
}
Program: 198011
Project: 198011
Buggy source:
public static int wtf(String tag,String msg,Throwable tr){
  return Log.wtf(Log.LOG_ID_SYSTEM,tag,msg,tr,false);
}

Fixed version (ground truth):
public static int wtf(String tag,String msg,Throwable tr){
  return Log.wtf(Log.LOG_ID_SYSTEM,tag,msg,tr,false,true);
}
Program: 198012
Project: 198012
Buggy source:
public static int wtfStack(String tag,String msg){
  return Log.wtf(Log.LOG_ID_SYSTEM,tag,msg,null,true);
}

Fixed version (ground truth):
public static int wtfStack(String tag,String msg){
  return Log.wtf(Log.LOG_ID_SYSTEM,tag,msg,null,true,true);
}
Program: 198013
Project: 198013
Buggy source:
/** 
 * Report a serious error in the current process.  May or may not cause the process to terminate (depends on system settings).
 * @param tag to record with the error
 * @param t exception describing the error site and conditions
 */
public static void wtf(String tag,Throwable t){
  try {
    if (ActivityManagerNative.getDefault().handleApplicationWtf(mApplicationObject,tag,new ApplicationErrorReport.CrashInfo(t))) {
      Process.killProcess(Process.myPid());
      System.exit(10);
    }
  }
 catch (  Throwable t2) {
    Slog.e(TAG,"String_Node_Str",t2);
    Slog.e(TAG,"String_Node_Str",t);
  }
}

Fixed version (ground truth):
/** 
 * Report a serious error in the current process.  May or may not cause the process to terminate (depends on system settings).
 * @param tag to record with the error
 * @param t exception describing the error site and conditions
 */
public static void wtf(String tag,Throwable t,boolean system){
  try {
    if (ActivityManagerNative.getDefault().handleApplicationWtf(mApplicationObject,tag,system,new ApplicationErrorReport.CrashInfo(t))) {
      Process.killProcess(Process.myPid());
      System.exit(10);
    }
  }
 catch (  Throwable t2) {
    Slog.e(TAG,"String_Node_Str",t2);
    Slog.e(TAG,"String_Node_Str",t);
  }
}
Program: 198015
Project: 198015
Buggy source:
/** 
 * Used by   {@link Log} via {@link com.android.internal.os.RuntimeInit} to report serious errors.
 * @param app object of the crashing app, null for the system server
 * @param tag reported by the caller
 * @param crashInfo describing the context of the error
 * @return true if the process should exit immediately (WTF is fatal)
 */
public boolean handleApplicationWtf(IBinder app,String tag,ApplicationErrorReport.CrashInfo crashInfo){
  ProcessRecord r=findAppProcess(app,"String_Node_Str");
  final String processName=app == null ? "String_Node_Str" : (r == null ? "String_Node_Str" : r.processName);
  EventLog.writeEvent(EventLogTags.AM_WTF,UserHandle.getUserId(Binder.getCallingUid()),Binder.getCallingPid(),processName,r == null ? -1 : r.info.flags,tag,crashInfo.exceptionMessage);
  addErrorToDropBox("String_Node_Str",r,processName,null,null,tag,null,null,crashInfo);
  if (r != null && r.pid != Process.myPid() && Settings.Global.getInt(mContext.getContentResolver(),Settings.Global.WTF_IS_FATAL,0) != 0) {
    crashApplication(r,crashInfo);
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Used by   {@link Log} via {@link com.android.internal.os.RuntimeInit} to report serious errors.
 * @param app object of the crashing app, null for the system server
 * @param tag reported by the caller
 * @param system whether this wtf is coming from the system
 * @param crashInfo describing the context of the error
 * @return true if the process should exit immediately (WTF is fatal)
 */
public boolean handleApplicationWtf(IBinder app,final String tag,boolean system,final ApplicationErrorReport.CrashInfo crashInfo){
  final ProcessRecord r=findAppProcess(app,"String_Node_Str");
  final String processName=app == null ? "String_Node_Str" : (r == null ? "String_Node_Str" : r.processName);
  EventLog.writeEvent(EventLogTags.AM_WTF,UserHandle.getUserId(Binder.getCallingUid()),Binder.getCallingPid(),processName,r == null ? -1 : r.info.flags,tag,crashInfo.exceptionMessage);
  if (system) {
    mHandler.post(new Runnable(){
      @Override public void run(){
        addErrorToDropBox("String_Node_Str",r,processName,null,null,tag,null,null,crashInfo);
      }
    }
);
    return false;
  }
  addErrorToDropBox("String_Node_Str",r,processName,null,null,tag,null,null,crashInfo);
  if (r != null && r.pid != Process.myPid() && Settings.Global.getInt(mContext.getContentResolver(),Settings.Global.WTF_IS_FATAL,0) != 0) {
    crashApplication(r,crashInfo);
    return true;
  }
 else {
    return false;
  }
}