nus-yam/ex-repair huggingface dataset:
Program: 191941
Project: 191941
Buggy source:
public void instantCollapse(){
  abortAnimations();
  setExpandedFraction(0f);
  if (mExpanding) {
    notifyExpandingFinished();
  }
}

Fixed version (ground truth):
public void instantCollapse(){
  abortAnimations();
  setExpandedFraction(0f);
  if (mExpanding) {
    notifyExpandingFinished();
  }
  if (mInstantExpanding) {
    mInstantExpanding=false;
    notifyBarPanelExpansionChanged();
  }
}
Program: 191942
Project: 191942
Buggy source:
public void expand(final boolean animate){
  if (!isFullyCollapsed() && !isCollapsing()) {
    return;
  }
  mInstantExpanding=true;
  mUpdateFlingOnLayout=false;
  abortAnimations();
  cancelPeek();
  if (mTracking) {
    onTrackingStopped(true);
  }
  if (mExpanding) {
    notifyExpandingFinished();
  }
  notifyBarPanelExpansionChanged();
  getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener(){
    @Override public void onGlobalLayout(){
      if (mStatusBar.getStatusBarWindow().getHeight() != mStatusBar.getStatusBarHeight()) {
        getViewTreeObserver().removeOnGlobalLayoutListener(this);
        if (animate) {
          notifyExpandingStarted();
          fling(0,true);
        }
 else {
          setExpandedFraction(1f);
        }
        mInstantExpanding=false;
      }
    }
  }
);
  requestLayout();
}

Fixed version (ground truth):
public void expand(final boolean animate){
  if (!isFullyCollapsed() && !isCollapsing()) {
    return;
  }
  mInstantExpanding=true;
  mUpdateFlingOnLayout=false;
  abortAnimations();
  cancelPeek();
  if (mTracking) {
    onTrackingStopped(true);
  }
  if (mExpanding) {
    notifyExpandingFinished();
  }
  notifyBarPanelExpansionChanged();
  getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener(){
    @Override public void onGlobalLayout(){
      if (!mInstantExpanding) {
        getViewTreeObserver().removeOnGlobalLayoutListener(this);
        return;
      }
      if (mStatusBar.getStatusBarWindow().getHeight() != mStatusBar.getStatusBarHeight()) {
        getViewTreeObserver().removeOnGlobalLayoutListener(this);
        if (animate) {
          notifyExpandingStarted();
          fling(0,true);
        }
 else {
          setExpandedFraction(1f);
        }
        mInstantExpanding=false;
      }
    }
  }
);
  requestLayout();
}
Program: 191943
Project: 191943
Buggy source:
@Override public void onGlobalLayout(){
  if (mStatusBar.getStatusBarWindow().getHeight() != mStatusBar.getStatusBarHeight()) {
    getViewTreeObserver().removeOnGlobalLayoutListener(this);
    if (animate) {
      notifyExpandingStarted();
      fling(0,true);
    }
 else {
      setExpandedFraction(1f);
    }
    mInstantExpanding=false;
  }
}

Fixed version (ground truth):
@Override public void onGlobalLayout(){
  if (!mInstantExpanding) {
    getViewTreeObserver().removeOnGlobalLayoutListener(this);
    return;
  }
  if (mStatusBar.getStatusBarWindow().getHeight() != mStatusBar.getStatusBarHeight()) {
    getViewTreeObserver().removeOnGlobalLayoutListener(this);
    if (animate) {
      notifyExpandingStarted();
      fling(0,true);
    }
 else {
      setExpandedFraction(1f);
    }
    mInstantExpanding=false;
  }
}
Program: 191945
Project: 191945
Buggy source:
boolean updateBoundsAfterConfigChange(boolean scheduleResize){
  if (mLastConfigChangedRotation != mLastUpdateDisplayInfoRotation) {
    return false;
  }
  final int newRotation=getDisplayInfo().rotation;
  final int newDensity=getDisplayInfo().logicalDensityDpi;
  if (mRotation == newRotation && mDensity == newDensity) {
    return false;
  }
  final int oldDockSide=mStackId == DOCKED_STACK_ID ? getDockSide() : DOCKED_INVALID;
  mDisplayContent.rotateBounds(mRotation,newRotation,mTmpRect2);
  if (mStackId == DOCKED_STACK_ID) {
    repositionDockedStackAfterRotation(mTmpRect2);
    snapDockedStackAfterRotation(mTmpRect2);
    final int newDockSide=getDockSide(mTmpRect2);
    if (oldDockSide != newDockSide) {
      mDisplayContent.getDockedDividerController().notifyDockSideChanged(newDockSide);
    }
  }
  if (scheduleResize) {
    mService.mH.obtainMessage(RESIZE_STACK,mStackId,0,mTmpRect2).sendToTarget();
  }
 else {
    mBoundsAfterRotation.set(mTmpRect2);
  }
  return true;
}

Fixed version (ground truth):
boolean updateBoundsAfterConfigChange(boolean scheduleResize){
  if (mFullscreen) {
    return false;
  }
  if (mLastConfigChangedRotation != mLastUpdateDisplayInfoRotation) {
    return false;
  }
  final int newRotation=getDisplayInfo().rotation;
  final int newDensity=getDisplayInfo().logicalDensityDpi;
  if (mRotation == newRotation && mDensity == newDensity) {
    return false;
  }
  final int oldDockSide=mStackId == DOCKED_STACK_ID ? getDockSide() : DOCKED_INVALID;
  mTmpRect2.set(mBounds);
  mDisplayContent.rotateBounds(mRotation,newRotation,mTmpRect2);
  if (mStackId == DOCKED_STACK_ID) {
    repositionDockedStackAfterRotation(mTmpRect2);
    snapDockedStackAfterRotation(mTmpRect2);
    final int newDockSide=getDockSide(mTmpRect2);
    if (oldDockSide != newDockSide) {
      mDisplayContent.getDockedDividerController().notifyDockSideChanged(newDockSide);
    }
  }
  if (scheduleResize) {
    mService.mH.obtainMessage(RESIZE_STACK,mStackId,0,mTmpRect2).sendToTarget();
  }
 else {
    mBoundsAfterRotation.set(mTmpRect2);
  }
  return true;
}
Program: 191946
Project: 191946
Buggy source:
boolean updateBoundsAfterConfigChange(boolean scheduleResize){
  if (mLastConfigChangedRotation != mLastUpdateDisplayInfoRotation) {
    return false;
  }
  final int newRotation=getDisplayInfo().rotation;
  final int newDensity=getDisplayInfo().logicalDensityDpi;
  if (mRotation == newRotation && mDensity == newDensity) {
    return false;
  }
  final int oldDockSide=mStackId == DOCKED_STACK_ID ? getDockSide() : DOCKED_INVALID;
  mDisplayContent.rotateBounds(mRotation,newRotation,mTmpRect2);
  if (mStackId == DOCKED_STACK_ID) {
    repositionDockedStackAfterRotation(mTmpRect2);
    snapDockedStackAfterRotation(mTmpRect2);
    final int newDockSide=getDockSide(mTmpRect2);
    if (oldDockSide != newDockSide) {
      mDisplayContent.getDockedDividerController().notifyDockSideChanged(newDockSide);
    }
  }
  if (scheduleResize) {
    mService.mH.obtainMessage(RESIZE_STACK,mStackId,0,mTmpRect2).sendToTarget();
  }
 else {
    mBoundsAfterRotation.set(mTmpRect2);
  }
  return true;
}

Fixed version (ground truth):
boolean updateBoundsAfterConfigChange(boolean scheduleResize){
  if (mFullscreen) {
    return false;
  }
  if (mLastConfigChangedRotation != mLastUpdateDisplayInfoRotation) {
    return false;
  }
  final int newRotation=getDisplayInfo().rotation;
  final int newDensity=getDisplayInfo().logicalDensityDpi;
  if (mRotation == newRotation && mDensity == newDensity) {
    return false;
  }
  final int oldDockSide=mStackId == DOCKED_STACK_ID ? getDockSide() : DOCKED_INVALID;
  mTmpRect2.set(mBounds);
  mDisplayContent.rotateBounds(mRotation,newRotation,mTmpRect2);
  if (mStackId == DOCKED_STACK_ID) {
    repositionDockedStackAfterRotation(mTmpRect2);
    snapDockedStackAfterRotation(mTmpRect2);
    final int newDockSide=getDockSide(mTmpRect2);
    if (oldDockSide != newDockSide) {
      mDisplayContent.getDockedDividerController().notifyDockSideChanged(newDockSide);
    }
  }
  if (scheduleResize) {
    mService.mH.obtainMessage(RESIZE_STACK,mStackId,0,mTmpRect2).sendToTarget();
  }
 else {
    mBoundsAfterRotation.set(mTmpRect2);
  }
  return true;
}
Program: 191947
Project: 191947
Buggy source:
boolean updateBoundsAfterConfigChange(boolean scheduleResize){
  if (mLastConfigChangedRotation != mLastUpdateDisplayInfoRotation) {
    return false;
  }
  final int newRotation=getDisplayInfo().rotation;
  final int newDensity=getDisplayInfo().logicalDensityDpi;
  if (mRotation == newRotation && mDensity == newDensity) {
    return false;
  }
  final int oldDockSide=mStackId == DOCKED_STACK_ID ? getDockSide() : DOCKED_INVALID;
  mDisplayContent.rotateBounds(mRotation,newRotation,mTmpRect2);
  if (mStackId == DOCKED_STACK_ID) {
    repositionDockedStackAfterRotation(mTmpRect2);
    snapDockedStackAfterRotation(mTmpRect2);
    final int newDockSide=getDockSide(mTmpRect2);
    if (oldDockSide != newDockSide) {
      mDisplayContent.getDockedDividerController().notifyDockSideChanged(newDockSide);
    }
  }
  if (scheduleResize) {
    mService.mH.obtainMessage(RESIZE_STACK,mStackId,0,mTmpRect2).sendToTarget();
  }
 else {
    mBoundsAfterRotation.set(mTmpRect2);
  }
  return true;
}

Fixed version (ground truth):
boolean updateBoundsAfterConfigChange(boolean scheduleResize){
  if (mFullscreen) {
    return false;
  }
  if (mLastConfigChangedRotation != mLastUpdateDisplayInfoRotation) {
    return false;
  }
  final int newRotation=getDisplayInfo().rotation;
  final int newDensity=getDisplayInfo().logicalDensityDpi;
  if (mRotation == newRotation && mDensity == newDensity) {
    return false;
  }
  final int oldDockSide=mStackId == DOCKED_STACK_ID ? getDockSide() : DOCKED_INVALID;
  mTmpRect2.set(mBounds);
  mDisplayContent.rotateBounds(mRotation,newRotation,mTmpRect2);
  if (mStackId == DOCKED_STACK_ID) {
    repositionDockedStackAfterRotation(mTmpRect2);
    snapDockedStackAfterRotation(mTmpRect2);
    final int newDockSide=getDockSide(mTmpRect2);
    if (oldDockSide != newDockSide) {
      mDisplayContent.getDockedDividerController().notifyDockSideChanged(newDockSide);
    }
  }
  if (scheduleResize) {
    mService.mH.obtainMessage(RESIZE_STACK,mStackId,0,mTmpRect2).sendToTarget();
  }
 else {
    mBoundsAfterRotation.set(mTmpRect2);
  }
  return true;
}
Program: 191951
Project: 191951
Buggy source:
/** 
 * Sets the focused state.
 */
public void setFocusState(int focusState){
  int prevFocusState=mFocusState;
  mFocusState=focusState;
  updateFrontBackTransforms();
  if (mCb != null) {
    mCb.onFocusStateChanged(prevFocusState,focusState);
  }
}

Fixed version (ground truth):
/** 
 * Sets the focused state.
 */
public void setFocusState(int focusState){
  int prevFocusState=mFocusState;
  mFocusState=focusState;
  updateFrontBackTransforms();
  if (mCb != null && (prevFocusState != focusState)) {
    mCb.onFocusStateChanged(prevFocusState,focusState);
  }
}
Program: 191952
Project: 191952
Buggy source:
/** 
 * Relayout the the visible   {@link TaskView}s to their current transforms as specified by the  {@link TaskStackLayoutAlgorithm} with the given {@param animation}. This call cancels any animations that are current running on those task views, and will ensure that the children  {@link TaskView}s will match the set of visible tasks in the stack.
 */
private void relayoutTaskViews(AnimationProps animation,boolean ignoreTaskOverrides){
  mDeferredTaskViewLayoutAnimation=null;
  bindVisibleTaskViews(mStackScroller.getStackScroll(),ignoreTaskOverrides);
  List<TaskView> taskViews=getTaskViews();
  int taskViewCount=taskViews.size();
  for (int i=0; i < taskViewCount; i++) {
    TaskView tv=taskViews.get(i);
    int taskIndex=mStack.indexOfStackTask(tv.getTask());
    TaskViewTransform transform=mCurrentTaskTransforms.get(taskIndex);
    if (mIgnoreTasks.contains(tv.getTask().key)) {
      continue;
    }
    updateTaskViewToTransform(tv,transform,animation);
  }
}

Fixed version (ground truth):
/** 
 * Relayout the the visible   {@link TaskView}s to their current transforms as specified by the  {@link TaskStackLayoutAlgorithm} with the given {@param animation}. This call cancels any animations that are current running on those task views, and will ensure that the children  {@link TaskView}s will match the set of visible tasks in the stack.
 */
private void relayoutTaskViews(AnimationProps animation,boolean ignoreTaskOverrides){
  cancelDeferredTaskViewLayoutAnimation();
  bindVisibleTaskViews(mStackScroller.getStackScroll(),ignoreTaskOverrides);
  List<TaskView> taskViews=getTaskViews();
  int taskViewCount=taskViews.size();
  for (int i=0; i < taskViewCount; i++) {
    TaskView tv=taskViews.get(i);
    int taskIndex=mStack.indexOfStackTask(tv.getTask());
    TaskViewTransform transform=mCurrentTaskTransforms.get(taskIndex);
    if (mIgnoreTasks.contains(tv.getTask().key)) {
      continue;
    }
    updateTaskViewToTransform(tv,transform,animation);
  }
}
Program: 191953
Project: 191953
Buggy source:
/** 
 * Cancels all   {@link TaskView} animations.
 * @param ignoreTasksSet The set of tasks to continue running their animations.
 */
void cancelAllTaskViewAnimations(ArraySet<Task.TaskKey> ignoreTasksSet){
  List<TaskView> taskViews=getTaskViews();
  for (int i=taskViews.size() - 1; i >= 0; i--) {
    final TaskView tv=taskViews.get(i);
    if (!ignoreTasksSet.contains(tv.getTask().key)) {
      tv.cancelTransformAnimation();
    }
  }
}

Fixed version (ground truth):
/** 
 * Cancels all   {@link TaskView} animations.
 */
void cancelAllTaskViewAnimations(){
  List<TaskView> taskViews=getTaskViews();
  for (int i=taskViews.size() - 1; i >= 0; i--) {
    final TaskView tv=taskViews.get(i);
    if (!mIgnoreTasks.contains(tv.getTask().key)) {
      tv.cancelTransformAnimation();
    }
  }
}
Program: 191955
Project: 191955
Buggy source:
/** 
 * Sets the focused state.
 */
public void setFocusState(int focusState){
  int prevFocusState=mFocusState;
  mFocusState=focusState;
  updateFrontBackTransforms();
  if (mCb != null) {
    mCb.onFocusStateChanged(prevFocusState,focusState);
  }
}

Fixed version (ground truth):
/** 
 * Sets the focused state.
 */
public void setFocusState(int focusState){
  int prevFocusState=mFocusState;
  mFocusState=focusState;
  updateFrontBackTransforms();
  if (mCb != null && (prevFocusState != focusState)) {
    mCb.onFocusStateChanged(prevFocusState,focusState);
  }
}
Program: 191956
Project: 191956
Buggy source:
/** 
 * Relayout the the visible   {@link TaskView}s to their current transforms as specified by the  {@link TaskStackLayoutAlgorithm} with the given {@param animation}. This call cancels any animations that are current running on those task views, and will ensure that the children  {@link TaskView}s will match the set of visible tasks in the stack.
 */
private void relayoutTaskViews(AnimationProps animation,boolean ignoreTaskOverrides){
  mDeferredTaskViewLayoutAnimation=null;
  bindVisibleTaskViews(mStackScroller.getStackScroll(),ignoreTaskOverrides);
  List<TaskView> taskViews=getTaskViews();
  int taskViewCount=taskViews.size();
  for (int i=0; i < taskViewCount; i++) {
    TaskView tv=taskViews.get(i);
    int taskIndex=mStack.indexOfStackTask(tv.getTask());
    TaskViewTransform transform=mCurrentTaskTransforms.get(taskIndex);
    if (mIgnoreTasks.contains(tv.getTask().key)) {
      continue;
    }
    updateTaskViewToTransform(tv,transform,animation);
  }
}

Fixed version (ground truth):
/** 
 * Relayout the the visible   {@link TaskView}s to their current transforms as specified by the  {@link TaskStackLayoutAlgorithm} with the given {@param animation}. This call cancels any animations that are current running on those task views, and will ensure that the children  {@link TaskView}s will match the set of visible tasks in the stack.
 */
private void relayoutTaskViews(AnimationProps animation,boolean ignoreTaskOverrides){
  cancelDeferredTaskViewLayoutAnimation();
  bindVisibleTaskViews(mStackScroller.getStackScroll(),ignoreTaskOverrides);
  List<TaskView> taskViews=getTaskViews();
  int taskViewCount=taskViews.size();
  for (int i=0; i < taskViewCount; i++) {
    TaskView tv=taskViews.get(i);
    int taskIndex=mStack.indexOfStackTask(tv.getTask());
    TaskViewTransform transform=mCurrentTaskTransforms.get(taskIndex);
    if (mIgnoreTasks.contains(tv.getTask().key)) {
      continue;
    }
    updateTaskViewToTransform(tv,transform,animation);
  }
}
Program: 191957
Project: 191957
Buggy source:
/** 
 * Cancels all   {@link TaskView} animations.
 * @param ignoreTasksSet The set of tasks to continue running their animations.
 */
void cancelAllTaskViewAnimations(ArraySet<Task.TaskKey> ignoreTasksSet){
  List<TaskView> taskViews=getTaskViews();
  for (int i=taskViews.size() - 1; i >= 0; i--) {
    final TaskView tv=taskViews.get(i);
    if (!ignoreTasksSet.contains(tv.getTask().key)) {
      tv.cancelTransformAnimation();
    }
  }
}

Fixed version (ground truth):
/** 
 * Cancels all   {@link TaskView} animations.
 */
void cancelAllTaskViewAnimations(){
  List<TaskView> taskViews=getTaskViews();
  for (int i=taskViews.size() - 1; i >= 0; i--) {
    final TaskView tv=taskViews.get(i);
    if (!mIgnoreTasks.contains(tv.getTask().key)) {
      tv.cancelTransformAnimation();
    }
  }
}
Program: 191962
Project: 191962
Buggy source:
private void bindHeaderChronometerAndTime(RemoteViews contentView){
  if (showsTimeOrChronometer()) {
    contentView.setViewVisibility(R.id.time_divider,View.VISIBLE);
    if (mN.extras.getBoolean(EXTRA_SHOW_CHRONOMETER)) {
      contentView.setViewVisibility(R.id.chronometer,View.VISIBLE);
      contentView.setLong(R.id.chronometer,"String_Node_Str",mN.when + (SystemClock.elapsedRealtime() - System.currentTimeMillis()));
      contentView.setBoolean(R.id.chronometer,"String_Node_Str",true);
      boolean countsDown=mN.extras.getBoolean(EXTRA_CHRONOMETER_COUNTS_DOWN);
      contentView.setChronometerCountDown(R.id.chronometer,countsDown);
    }
 else {
      contentView.setViewVisibility(R.id.time,View.VISIBLE);
      contentView.setLong(R.id.time,"String_Node_Str",mN.when);
    }
  }
}

Fixed version (ground truth):
private void bindHeaderChronometerAndTime(RemoteViews contentView){
  if (showsTimeOrChronometer()) {
    contentView.setViewVisibility(R.id.time_divider,View.VISIBLE);
    if (mN.extras.getBoolean(EXTRA_SHOW_CHRONOMETER)) {
      contentView.setViewVisibility(R.id.chronometer,View.VISIBLE);
      contentView.setLong(R.id.chronometer,"String_Node_Str",mN.when + (SystemClock.elapsedRealtime() - System.currentTimeMillis()));
      contentView.setBoolean(R.id.chronometer,"String_Node_Str",true);
      boolean countsDown=mN.extras.getBoolean(EXTRA_CHRONOMETER_COUNTS_DOWN);
      contentView.setChronometerCountDown(R.id.chronometer,countsDown);
    }
 else {
      contentView.setViewVisibility(R.id.time,View.VISIBLE);
      contentView.setLong(R.id.time,"String_Node_Str",mN.when);
    }
  }
 else {
    contentView.setLong(R.id.time,"String_Node_Str",mN.when != 0 ? mN.when : mN.creationTime);
  }
}
Program: 191963
Project: 191963
Buggy source:
/** 
 * Resets the notification header to its original state
 */
private void resetNotificationHeader(RemoteViews contentView){
  contentView.setImageViewResource(R.id.icon,0);
  contentView.setBoolean(R.id.notification_header,"String_Node_Str",false);
  contentView.setTextViewText(R.id.app_name_text,null);
  contentView.setViewVisibility(R.id.chronometer,View.GONE);
  contentView.setViewVisibility(R.id.header_text,View.GONE);
  contentView.setViewVisibility(R.id.header_text_divider,View.GONE);
  contentView.setViewVisibility(R.id.time_divider,View.GONE);
  contentView.setImageViewIcon(R.id.profile_badge,null);
  contentView.setViewVisibility(R.id.profile_badge,View.GONE);
}

Fixed version (ground truth):
/** 
 * Resets the notification header to its original state
 */
private void resetNotificationHeader(RemoteViews contentView){
  contentView.setImageViewResource(R.id.icon,0);
  contentView.setBoolean(R.id.notification_header,"String_Node_Str",false);
  contentView.setTextViewText(R.id.app_name_text,null);
  contentView.setViewVisibility(R.id.chronometer,View.GONE);
  contentView.setViewVisibility(R.id.header_text,View.GONE);
  contentView.setViewVisibility(R.id.header_text_divider,View.GONE);
  contentView.setViewVisibility(R.id.time_divider,View.GONE);
  contentView.setViewVisibility(R.id.time,View.GONE);
  contentView.setImageViewIcon(R.id.profile_badge,null);
  contentView.setViewVisibility(R.id.profile_badge,View.GONE);
}
Program: 191964
Project: 191964
Buggy source:
/** 
 * @return true if the built notification will show the time or the chronometer; falseotherwise
 */
private boolean showsTimeOrChronometer(){
  return mN.when != 0 && mN.extras.getBoolean(EXTRA_SHOW_WHEN);
}

Fixed version (ground truth):
/** 
 * @return true if the notification will show the time or the chronometer; falseotherwise
 * @hide
 */
public boolean showsTimeOrChronometer(){
  return when != 0 && extras.getBoolean(EXTRA_SHOW_WHEN);
}
Program: 191966
Project: 191966
Buggy source:
void update(){
  if (mTime == null) {
    return;
  }
  if (mShowRelativeTime) {
    updateRelativeTime();
    return;
  }
  int display;
  Date time=mTime;
  Time t=new Time();
  t.set(mTimeMillis);
  t.second=0;
  t.hour-=12;
  long twelveHoursBefore=t.toMillis(false);
  t.hour+=12;
  long twelveHoursAfter=t.toMillis(false);
  t.hour=0;
  t.minute=0;
  long midnightBefore=t.toMillis(false);
  t.monthDay++;
  long midnightAfter=t.toMillis(false);
  long nowMillis=System.currentTimeMillis();
  t.set(nowMillis);
  t.second=0;
  nowMillis=t.normalize(false);
  choose_display: {
    if ((nowMillis >= midnightBefore && nowMillis < midnightAfter) || (nowMillis >= twelveHoursBefore && nowMillis < twelveHoursAfter)) {
      display=SHOW_TIME;
      break choose_display;
    }
    display=SHOW_MONTH_DAY_YEAR;
    break choose_display;
  }
  DateFormat format;
  if (display == mLastDisplay && mLastFormat != null) {
    format=mLastFormat;
  }
 else {
switch (display) {
case SHOW_TIME:
      format=getTimeFormat();
    break;
case SHOW_MONTH_DAY_YEAR:
  format=DateFormat.getDateInstance(DateFormat.SHORT);
break;
default :
throw new RuntimeException("String_Node_Str" + display);
}
mLastFormat=format;
}
String text=format.format(mTime);
setText(text);
if (display == SHOW_TIME) {
mUpdateTimeMillis=twelveHoursAfter > midnightAfter ? twelveHoursAfter : midnightAfter;
}
 else {
if (mTimeMillis < nowMillis) {
mUpdateTimeMillis=0;
}
 else {
mUpdateTimeMillis=twelveHoursBefore < midnightBefore ? twelveHoursBefore : midnightBefore;
}
}
}

Fixed version (ground truth):
void update(){
  if (mTime == null || getVisibility() == GONE) {
    return;
  }
  if (mShowRelativeTime) {
    updateRelativeTime();
    return;
  }
  int display;
  Date time=mTime;
  Time t=new Time();
  t.set(mTimeMillis);
  t.second=0;
  t.hour-=12;
  long twelveHoursBefore=t.toMillis(false);
  t.hour+=12;
  long twelveHoursAfter=t.toMillis(false);
  t.hour=0;
  t.minute=0;
  long midnightBefore=t.toMillis(false);
  t.monthDay++;
  long midnightAfter=t.toMillis(false);
  long nowMillis=System.currentTimeMillis();
  t.set(nowMillis);
  t.second=0;
  nowMillis=t.normalize(false);
  choose_display: {
    if ((nowMillis >= midnightBefore && nowMillis < midnightAfter) || (nowMillis >= twelveHoursBefore && nowMillis < twelveHoursAfter)) {
      display=SHOW_TIME;
      break choose_display;
    }
    display=SHOW_MONTH_DAY_YEAR;
    break choose_display;
  }
  DateFormat format;
  if (display == mLastDisplay && mLastFormat != null) {
    format=mLastFormat;
  }
 else {
switch (display) {
case SHOW_TIME:
      format=getTimeFormat();
    break;
case SHOW_MONTH_DAY_YEAR:
  format=DateFormat.getDateInstance(DateFormat.SHORT);
break;
default :
throw new RuntimeException("String_Node_Str" + display);
}
mLastFormat=format;
}
String text=format.format(mTime);
setText(text);
if (display == SHOW_TIME) {
mUpdateTimeMillis=twelveHoursAfter > midnightAfter ? twelveHoursAfter : midnightAfter;
}
 else {
if (mTimeMillis < nowMillis) {
mUpdateTimeMillis=0;
}
 else {
mUpdateTimeMillis=twelveHoursBefore < midnightBefore ? twelveHoursBefore : midnightBefore;
}
}
}
Program: 191968
Project: 191968
Buggy source:
private void recreateNotificationHeader(){
  final Notification.Builder builder=Notification.Builder.recoverBuilder(getContext(),getStatusBarNotification().getNotification());
  final RemoteViews header=builder.makeNotificationHeader();
  if (mNotificationHeader == null) {
    mNotificationHeader=(NotificationHeaderView)header.apply(getContext(),this);
    final View expandButton=mNotificationHeader.findViewById(com.android.internal.R.id.expand_button);
    expandButton.setVisibility(VISIBLE);
    mNotificationHeader.setOnClickListener(mExpandClickListener);
    mNotificationHeaderWrapper=NotificationViewWrapper.wrap(getContext(),mNotificationHeader);
    addView(mNotificationHeader,indexOfChild(mChildrenContainer) + 1);
    mTranslateableViews.add(mNotificationHeader);
  }
 else {
    header.reapply(getContext(),mNotificationHeader);
    mNotificationHeaderWrapper.notifyContentUpdated(mEntry.notification);
  }
  updateChildrenHeaderAppearance();
}

Fixed version (ground truth):
private void recreateNotificationHeader(){
  final Notification.Builder builder=Notification.Builder.recoverBuilder(getContext(),getStatusBarNotification().getNotification());
  final RemoteViews header=builder.makeNotificationHeader();
  if (mNotificationHeader == null) {
    mNotificationHeader=(NotificationHeaderView)header.apply(getContext(),this);
    final View expandButton=mNotificationHeader.findViewById(com.android.internal.R.id.expand_button);
    expandButton.setVisibility(VISIBLE);
    mNotificationHeader.setOnClickListener(mExpandClickListener);
    mNotificationHeaderWrapper=NotificationViewWrapper.wrap(getContext(),mNotificationHeader,this);
    addView(mNotificationHeader,indexOfChild(mChildrenContainer) + 1);
    mTranslateableViews.add(mNotificationHeader);
  }
 else {
    header.reapply(getContext(),mNotificationHeader);
    mNotificationHeaderWrapper.notifyContentUpdated(mEntry.notification);
  }
  updateChildrenHeaderAppearance();
}
Program: 191969
Project: 191969
Buggy source:
public void setContractedChild(View child){
  if (mContractedChild != null) {
    mContractedChild.animate().cancel();
    mContractedChild.removeOnLayoutChangeListener(mLayoutUpdater);
    removeView(mContractedChild);
  }
  addView(child);
  mContractedChild=child;
  mContractedChild.addOnLayoutChangeListener(mLayoutUpdater);
  mContractedWrapper=NotificationViewWrapper.wrap(getContext(),child);
  selectLayout(false,true);
  mContractedWrapper.setDark(mDark,false,0);
}

Fixed version (ground truth):
public void setContractedChild(View child){
  if (mContractedChild != null) {
    mContractedChild.animate().cancel();
    mContractedChild.removeOnLayoutChangeListener(mLayoutUpdater);
    removeView(mContractedChild);
  }
  addView(child);
  mContractedChild=child;
  mContractedChild.addOnLayoutChangeListener(mLayoutUpdater);
  mContractedWrapper=NotificationViewWrapper.wrap(getContext(),child,mContainingNotification);
  selectLayout(false,true);
  mContractedWrapper.setDark(mDark,false,0);
}
Program: 191970
Project: 191970
Buggy source:
public void setExpandedChild(View child){
  if (mExpandedChild != null) {
    mExpandedChild.animate().cancel();
    mExpandedChild.removeOnLayoutChangeListener(mLayoutUpdater);
    removeView(mExpandedChild);
  }
  addView(child);
  mExpandedChild=child;
  mExpandedChild.addOnLayoutChangeListener(mLayoutUpdater);
  mExpandedWrapper=NotificationViewWrapper.wrap(getContext(),child);
  selectLayout(false,true);
}

Fixed version (ground truth):
public void setExpandedChild(View child){
  if (mExpandedChild != null) {
    mExpandedChild.animate().cancel();
    mExpandedChild.removeOnLayoutChangeListener(mLayoutUpdater);
    removeView(mExpandedChild);
  }
  addView(child);
  mExpandedChild=child;
  mExpandedChild.addOnLayoutChangeListener(mLayoutUpdater);
  mExpandedWrapper=NotificationViewWrapper.wrap(getContext(),child,mContainingNotification);
  selectLayout(false,true);
}
Program: 191971
Project: 191971
Buggy source:
public void setHeadsUpChild(View child){
  if (mHeadsUpChild != null) {
    mHeadsUpChild.animate().cancel();
    mHeadsUpChild.removeOnLayoutChangeListener(mLayoutUpdater);
    removeView(mHeadsUpChild);
  }
  addView(child);
  mHeadsUpChild=child;
  mHeadsUpChild.addOnLayoutChangeListener(mLayoutUpdater);
  mHeadsUpWrapper=NotificationViewWrapper.wrap(getContext(),child);
  selectLayout(false,true);
}

Fixed version (ground truth):
public void setHeadsUpChild(View child){
  if (mHeadsUpChild != null) {
    mHeadsUpChild.animate().cancel();
    mHeadsUpChild.removeOnLayoutChangeListener(mLayoutUpdater);
    removeView(mHeadsUpChild);
  }
  addView(child);
  mHeadsUpChild=child;
  mHeadsUpChild.addOnLayoutChangeListener(mLayoutUpdater);
  mHeadsUpWrapper=NotificationViewWrapper.wrap(getContext(),child,mContainingNotification);
  selectLayout(false,true);
}
Program: 191972
Project: 191972
Buggy source:
protected NotificationBigPictureTemplateViewWrapper(Context ctx,View view){
  super(ctx,view);
}

Fixed version (ground truth):
protected NotificationBigPictureTemplateViewWrapper(Context ctx,View view,ExpandableNotificationRow row){
  super(ctx,view,row);
}
Program: 191973
Project: 191973
Buggy source:
protected NotificationBigTextTemplateViewWrapper(Context ctx,View view){
  super(ctx,view);
}

Fixed version (ground truth):
protected NotificationBigTextTemplateViewWrapper(Context ctx,View view,ExpandableNotificationRow row){
  super(ctx,view,row);
}
Program: 191974
Project: 191974
Buggy source:
protected NotificationCustomViewWrapper(View view){
  super(view);
  mInvertHelper=new ViewInvertHelper(view,NotificationPanelView.DOZE_ANIMATION_DURATION);
}

Fixed version (ground truth):
protected NotificationCustomViewWrapper(View view,ExpandableNotificationRow row){
  super(view,row);
  mInvertHelper=new ViewInvertHelper(view,NotificationPanelView.DOZE_ANIMATION_DURATION);
}
Program: 191975
Project: 191975
Buggy source:
@Override public void setDark(boolean dark,boolean fade,long delay){
  if (dark == mDark && mDarkInitialized) {
    return;
  }
  super.setDark(dark,fade,delay);
  if (fade) {
    mInvertHelper.fade(dark,delay);
  }
 else {
    mInvertHelper.update(dark);
  }
  if (mIcon != null) {
    boolean hadColorFilter=mNotificationHeader.getOriginalIconColor() != NotificationHeaderView.NO_COLOR;
    if (fade) {
      if (hadColorFilter) {
        fadeIconColorFilter(mIcon,dark,delay);
        fadeIconAlpha(mIcon,dark,delay);
      }
 else {
        fadeGrayscale(mIcon,dark,delay);
      }
    }
 else {
      if (hadColorFilter) {
        updateIconColorFilter(mIcon,dark);
        updateIconAlpha(mIcon,dark);
      }
 else {
        updateGrayscale(mIcon,dark);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void setDark(boolean dark,boolean fade,long delay){
  if (dark == mDark && mDarkInitialized) {
    return;
  }
  super.setDark(dark,fade,delay);
  if (fade) {
    mInvertHelper.fade(dark,delay);
  }
 else {
    mInvertHelper.update(dark);
  }
  if (mIcon != null && !mRow.isChildInGroup()) {
    boolean hadColorFilter=mNotificationHeader.getOriginalIconColor() != NotificationHeaderView.NO_COLOR;
    if (fade) {
      if (hadColorFilter) {
        fadeIconColorFilter(mIcon,dark,delay);
        fadeIconAlpha(mIcon,dark,delay);
      }
 else {
        fadeGrayscale(mIcon,dark,delay);
      }
    }
 else {
      if (hadColorFilter) {
        updateIconColorFilter(mIcon,dark);
        updateIconAlpha(mIcon,dark);
      }
 else {
        updateGrayscale(mIcon,dark);
      }
    }
  }
}
Program: 191976
Project: 191976
Buggy source:
protected NotificationHeaderViewWrapper(Context ctx,View view){
  super(view);
  mIconDarkAlpha=ctx.getResources().getInteger(R.integer.doze_small_icon_alpha);
  mInvertHelper=new ViewInvertHelper(ctx,NotificationPanelView.DOZE_ANIMATION_DURATION);
  mTransformationHelper=new ViewTransformationHelper();
  resolveHeaderViews();
  updateInvertHelper();
}

Fixed version (ground truth):
protected NotificationHeaderViewWrapper(Context ctx,View view,ExpandableNotificationRow row){
  super(view,row);
  mIconDarkAlpha=ctx.getResources().getInteger(R.integer.doze_small_icon_alpha);
  mInvertHelper=new ViewInvertHelper(ctx,NotificationPanelView.DOZE_ANIMATION_DURATION);
  mTransformationHelper=new ViewTransformationHelper();
  resolveHeaderViews();
  updateInvertHelper();
}
Program: 191977
Project: 191977
Buggy source:
protected NotificationMediaTemplateViewWrapper(Context ctx,View view){
  super(ctx,view);
}

Fixed version (ground truth):
protected NotificationMediaTemplateViewWrapper(Context ctx,View view,ExpandableNotificationRow row){
  super(ctx,view,row);
}
Program: 191979
Project: 191979
Buggy source:
protected NotificationViewWrapper(View view){
  mView=view;
}

Fixed version (ground truth):
protected NotificationViewWrapper(View view,ExpandableNotificationRow row){
  mView=view;
  mRow=row;
}
Program: 191980
Project: 191980
Buggy source:
public static NotificationViewWrapper wrap(Context ctx,View v){
  if (v.getId() == com.android.internal.R.id.status_bar_latest_event_content) {
    if ("String_Node_Str".equals(v.getTag())) {
      return new NotificationBigPictureTemplateViewWrapper(ctx,v);
    }
 else     if ("String_Node_Str".equals(v.getTag())) {
      return new NotificationBigTextTemplateViewWrapper(ctx,v);
    }
 else     if ("String_Node_Str".equals(v.getTag()) || "String_Node_Str".equals(v.getTag())) {
      return new NotificationMediaTemplateViewWrapper(ctx,v);
    }
    return new NotificationTemplateViewWrapper(ctx,v);
  }
 else   if (v instanceof NotificationHeaderView) {
    return new NotificationHeaderViewWrapper(ctx,v);
  }
 else {
    return new NotificationCustomViewWrapper(v);
  }
}

Fixed version (ground truth):
public static NotificationViewWrapper wrap(Context ctx,View v,ExpandableNotificationRow row){
  if (v.getId() == com.android.internal.R.id.status_bar_latest_event_content) {
    if ("String_Node_Str".equals(v.getTag())) {
      return new NotificationBigPictureTemplateViewWrapper(ctx,v,row);
    }
 else     if ("String_Node_Str".equals(v.getTag())) {
      return new NotificationBigTextTemplateViewWrapper(ctx,v,row);
    }
 else     if ("String_Node_Str".equals(v.getTag()) || "String_Node_Str".equals(v.getTag())) {
      return new NotificationMediaTemplateViewWrapper(ctx,v,row);
    }
    return new NotificationTemplateViewWrapper(ctx,v,row);
  }
 else   if (v instanceof NotificationHeaderView) {
    return new NotificationHeaderViewWrapper(ctx,v,row);
  }
 else {
    return new NotificationCustomViewWrapper(v,row);
  }
}
Program: 191981
Project: 191981
Buggy source:
private void recreateNotificationHeader(){
  final Notification.Builder builder=Notification.Builder.recoverBuilder(getContext(),getStatusBarNotification().getNotification());
  final RemoteViews header=builder.makeNotificationHeader();
  if (mNotificationHeader == null) {
    mNotificationHeader=(NotificationHeaderView)header.apply(getContext(),this);
    final View expandButton=mNotificationHeader.findViewById(com.android.internal.R.id.expand_button);
    expandButton.setVisibility(VISIBLE);
    mNotificationHeader.setOnClickListener(mExpandClickListener);
    mNotificationHeaderWrapper=NotificationViewWrapper.wrap(getContext(),mNotificationHeader);
    addView(mNotificationHeader,indexOfChild(mChildrenContainer) + 1);
    mTranslateableViews.add(mNotificationHeader);
  }
 else {
    header.reapply(getContext(),mNotificationHeader);
    mNotificationHeaderWrapper.notifyContentUpdated(mEntry.notification);
  }
  updateChildrenHeaderAppearance();
}

Fixed version (ground truth):
private void recreateNotificationHeader(){
  final Notification.Builder builder=Notification.Builder.recoverBuilder(getContext(),getStatusBarNotification().getNotification());
  final RemoteViews header=builder.makeNotificationHeader();
  if (mNotificationHeader == null) {
    mNotificationHeader=(NotificationHeaderView)header.apply(getContext(),this);
    final View expandButton=mNotificationHeader.findViewById(com.android.internal.R.id.expand_button);
    expandButton.setVisibility(VISIBLE);
    mNotificationHeader.setOnClickListener(mExpandClickListener);
    mNotificationHeaderWrapper=NotificationViewWrapper.wrap(getContext(),mNotificationHeader,this);
    addView(mNotificationHeader,indexOfChild(mChildrenContainer) + 1);
    mTranslateableViews.add(mNotificationHeader);
  }
 else {
    header.reapply(getContext(),mNotificationHeader);
    mNotificationHeaderWrapper.notifyContentUpdated(mEntry.notification);
  }
  updateChildrenHeaderAppearance();
}
Program: 191982
Project: 191982
Buggy source:
public void setContractedChild(View child){
  if (mContractedChild != null) {
    mContractedChild.animate().cancel();
    mContractedChild.removeOnLayoutChangeListener(mLayoutUpdater);
    removeView(mContractedChild);
  }
  addView(child);
  mContractedChild=child;
  mContractedChild.addOnLayoutChangeListener(mLayoutUpdater);
  mContractedWrapper=NotificationViewWrapper.wrap(getContext(),child);
  selectLayout(false,true);
  mContractedWrapper.setDark(mDark,false,0);
}

Fixed version (ground truth):
public void setContractedChild(View child){
  if (mContractedChild != null) {
    mContractedChild.animate().cancel();
    mContractedChild.removeOnLayoutChangeListener(mLayoutUpdater);
    removeView(mContractedChild);
  }
  addView(child);
  mContractedChild=child;
  mContractedChild.addOnLayoutChangeListener(mLayoutUpdater);
  mContractedWrapper=NotificationViewWrapper.wrap(getContext(),child,mContainingNotification);
  selectLayout(false,true);
  mContractedWrapper.setDark(mDark,false,0);
}
Program: 191983
Project: 191983
Buggy source:
public void setExpandedChild(View child){
  if (mExpandedChild != null) {
    mExpandedChild.animate().cancel();
    mExpandedChild.removeOnLayoutChangeListener(mLayoutUpdater);
    removeView(mExpandedChild);
  }
  addView(child);
  mExpandedChild=child;
  mExpandedChild.addOnLayoutChangeListener(mLayoutUpdater);
  mExpandedWrapper=NotificationViewWrapper.wrap(getContext(),child);
  selectLayout(false,true);
}

Fixed version (ground truth):
public void setExpandedChild(View child){
  if (mExpandedChild != null) {
    mExpandedChild.animate().cancel();
    mExpandedChild.removeOnLayoutChangeListener(mLayoutUpdater);
    removeView(mExpandedChild);
  }
  addView(child);
  mExpandedChild=child;
  mExpandedChild.addOnLayoutChangeListener(mLayoutUpdater);
  mExpandedWrapper=NotificationViewWrapper.wrap(getContext(),child,mContainingNotification);
  selectLayout(false,true);
}
Program: 191984
Project: 191984
Buggy source:
public void setHeadsUpChild(View child){
  if (mHeadsUpChild != null) {
    mHeadsUpChild.animate().cancel();
    mHeadsUpChild.removeOnLayoutChangeListener(mLayoutUpdater);
    removeView(mHeadsUpChild);
  }
  addView(child);
  mHeadsUpChild=child;
  mHeadsUpChild.addOnLayoutChangeListener(mLayoutUpdater);
  mHeadsUpWrapper=NotificationViewWrapper.wrap(getContext(),child);
  selectLayout(false,true);
}

Fixed version (ground truth):
public void setHeadsUpChild(View child){
  if (mHeadsUpChild != null) {
    mHeadsUpChild.animate().cancel();
    mHeadsUpChild.removeOnLayoutChangeListener(mLayoutUpdater);
    removeView(mHeadsUpChild);
  }
  addView(child);
  mHeadsUpChild=child;
  mHeadsUpChild.addOnLayoutChangeListener(mLayoutUpdater);
  mHeadsUpWrapper=NotificationViewWrapper.wrap(getContext(),child,mContainingNotification);
  selectLayout(false,true);
}
Program: 191985
Project: 191985
Buggy source:
protected NotificationBigPictureTemplateViewWrapper(Context ctx,View view){
  super(ctx,view);
}

Fixed version (ground truth):
protected NotificationBigPictureTemplateViewWrapper(Context ctx,View view,ExpandableNotificationRow row){
  super(ctx,view,row);
}
Program: 191986
Project: 191986
Buggy source:
protected NotificationBigTextTemplateViewWrapper(Context ctx,View view){
  super(ctx,view);
}

Fixed version (ground truth):
protected NotificationBigTextTemplateViewWrapper(Context ctx,View view,ExpandableNotificationRow row){
  super(ctx,view,row);
}
Program: 191987
Project: 191987
Buggy source:
protected NotificationCustomViewWrapper(View view){
  super(view);
  mInvertHelper=new ViewInvertHelper(view,NotificationPanelView.DOZE_ANIMATION_DURATION);
}

Fixed version (ground truth):
protected NotificationCustomViewWrapper(View view,ExpandableNotificationRow row){
  super(view,row);
  mInvertHelper=new ViewInvertHelper(view,NotificationPanelView.DOZE_ANIMATION_DURATION);
}
Program: 191988
Project: 191988
Buggy source:
@Override public void setDark(boolean dark,boolean fade,long delay){
  if (dark == mDark && mDarkInitialized) {
    return;
  }
  super.setDark(dark,fade,delay);
  if (fade) {
    mInvertHelper.fade(dark,delay);
  }
 else {
    mInvertHelper.update(dark);
  }
  if (mIcon != null) {
    boolean hadColorFilter=mNotificationHeader.getOriginalIconColor() != NotificationHeaderView.NO_COLOR;
    if (fade) {
      if (hadColorFilter) {
        fadeIconColorFilter(mIcon,dark,delay);
        fadeIconAlpha(mIcon,dark,delay);
      }
 else {
        fadeGrayscale(mIcon,dark,delay);
      }
    }
 else {
      if (hadColorFilter) {
        updateIconColorFilter(mIcon,dark);
        updateIconAlpha(mIcon,dark);
      }
 else {
        updateGrayscale(mIcon,dark);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void setDark(boolean dark,boolean fade,long delay){
  if (dark == mDark && mDarkInitialized) {
    return;
  }
  super.setDark(dark,fade,delay);
  if (fade) {
    mInvertHelper.fade(dark,delay);
  }
 else {
    mInvertHelper.update(dark);
  }
  if (mIcon != null && !mRow.isChildInGroup()) {
    boolean hadColorFilter=mNotificationHeader.getOriginalIconColor() != NotificationHeaderView.NO_COLOR;
    if (fade) {
      if (hadColorFilter) {
        fadeIconColorFilter(mIcon,dark,delay);
        fadeIconAlpha(mIcon,dark,delay);
      }
 else {
        fadeGrayscale(mIcon,dark,delay);
      }
    }
 else {
      if (hadColorFilter) {
        updateIconColorFilter(mIcon,dark);
        updateIconAlpha(mIcon,dark);
      }
 else {
        updateGrayscale(mIcon,dark);
      }
    }
  }
}
Program: 191989
Project: 191989
Buggy source:
protected NotificationHeaderViewWrapper(Context ctx,View view){
  super(view);
  mIconDarkAlpha=ctx.getResources().getInteger(R.integer.doze_small_icon_alpha);
  mInvertHelper=new ViewInvertHelper(ctx,NotificationPanelView.DOZE_ANIMATION_DURATION);
  mTransformationHelper=new ViewTransformationHelper();
  resolveHeaderViews();
  updateInvertHelper();
}

Fixed version (ground truth):
protected NotificationHeaderViewWrapper(Context ctx,View view,ExpandableNotificationRow row){
  super(view,row);
  mIconDarkAlpha=ctx.getResources().getInteger(R.integer.doze_small_icon_alpha);
  mInvertHelper=new ViewInvertHelper(ctx,NotificationPanelView.DOZE_ANIMATION_DURATION);
  mTransformationHelper=new ViewTransformationHelper();
  resolveHeaderViews();
  updateInvertHelper();
}
Program: 191990
Project: 191990
Buggy source:
protected NotificationMediaTemplateViewWrapper(Context ctx,View view){
  super(ctx,view);
}

Fixed version (ground truth):
protected NotificationMediaTemplateViewWrapper(Context ctx,View view,ExpandableNotificationRow row){
  super(ctx,view,row);
}
Program: 191992
Project: 191992
Buggy source:
protected NotificationViewWrapper(View view){
  mView=view;
}

Fixed version (ground truth):
protected NotificationViewWrapper(View view,ExpandableNotificationRow row){
  mView=view;
  mRow=row;
}
Program: 191993
Project: 191993
Buggy source:
public static NotificationViewWrapper wrap(Context ctx,View v){
  if (v.getId() == com.android.internal.R.id.status_bar_latest_event_content) {
    if ("String_Node_Str".equals(v.getTag())) {
      return new NotificationBigPictureTemplateViewWrapper(ctx,v);
    }
 else     if ("String_Node_Str".equals(v.getTag())) {
      return new NotificationBigTextTemplateViewWrapper(ctx,v);
    }
 else     if ("String_Node_Str".equals(v.getTag()) || "String_Node_Str".equals(v.getTag())) {
      return new NotificationMediaTemplateViewWrapper(ctx,v);
    }
    return new NotificationTemplateViewWrapper(ctx,v);
  }
 else   if (v instanceof NotificationHeaderView) {
    return new NotificationHeaderViewWrapper(ctx,v);
  }
 else {
    return new NotificationCustomViewWrapper(v);
  }
}

Fixed version (ground truth):
public static NotificationViewWrapper wrap(Context ctx,View v,ExpandableNotificationRow row){
  if (v.getId() == com.android.internal.R.id.status_bar_latest_event_content) {
    if ("String_Node_Str".equals(v.getTag())) {
      return new NotificationBigPictureTemplateViewWrapper(ctx,v,row);
    }
 else     if ("String_Node_Str".equals(v.getTag())) {
      return new NotificationBigTextTemplateViewWrapper(ctx,v,row);
    }
 else     if ("String_Node_Str".equals(v.getTag()) || "String_Node_Str".equals(v.getTag())) {
      return new NotificationMediaTemplateViewWrapper(ctx,v,row);
    }
    return new NotificationTemplateViewWrapper(ctx,v,row);
  }
 else   if (v instanceof NotificationHeaderView) {
    return new NotificationHeaderViewWrapper(ctx,v,row);
  }
 else {
    return new NotificationCustomViewWrapper(v,row);
  }
}
Program: 191995
Project: 191995
Buggy source:
private void bindHeaderChronometerAndTime(RemoteViews contentView){
  if (showsTimeOrChronometer()) {
    contentView.setViewVisibility(R.id.time_divider,View.VISIBLE);
    if (mN.extras.getBoolean(EXTRA_SHOW_CHRONOMETER)) {
      contentView.setViewVisibility(R.id.chronometer,View.VISIBLE);
      contentView.setLong(R.id.chronometer,"String_Node_Str",mN.when + (SystemClock.elapsedRealtime() - System.currentTimeMillis()));
      contentView.setBoolean(R.id.chronometer,"String_Node_Str",true);
      boolean countsDown=mN.extras.getBoolean(EXTRA_CHRONOMETER_COUNTS_DOWN);
      contentView.setChronometerCountDown(R.id.chronometer,countsDown);
    }
 else {
      contentView.setViewVisibility(R.id.time,View.VISIBLE);
      contentView.setLong(R.id.time,"String_Node_Str",mN.when);
    }
  }
}

Fixed version (ground truth):
private void bindHeaderChronometerAndTime(RemoteViews contentView){
  if (showsTimeOrChronometer()) {
    contentView.setViewVisibility(R.id.time_divider,View.VISIBLE);
    if (mN.extras.getBoolean(EXTRA_SHOW_CHRONOMETER)) {
      contentView.setViewVisibility(R.id.chronometer,View.VISIBLE);
      contentView.setLong(R.id.chronometer,"String_Node_Str",mN.when + (SystemClock.elapsedRealtime() - System.currentTimeMillis()));
      contentView.setBoolean(R.id.chronometer,"String_Node_Str",true);
      boolean countsDown=mN.extras.getBoolean(EXTRA_CHRONOMETER_COUNTS_DOWN);
      contentView.setChronometerCountDown(R.id.chronometer,countsDown);
    }
 else {
      contentView.setViewVisibility(R.id.time,View.VISIBLE);
      contentView.setLong(R.id.time,"String_Node_Str",mN.when);
    }
  }
 else {
    contentView.setLong(R.id.time,"String_Node_Str",mN.when != 0 ? mN.when : mN.creationTime);
  }
}
Program: 191996
Project: 191996
Buggy source:
/** 
 * Resets the notification header to its original state
 */
private void resetNotificationHeader(RemoteViews contentView){
  contentView.setImageViewResource(R.id.icon,0);
  contentView.setBoolean(R.id.notification_header,"String_Node_Str",false);
  contentView.setTextViewText(R.id.app_name_text,null);
  contentView.setViewVisibility(R.id.chronometer,View.GONE);
  contentView.setViewVisibility(R.id.header_text,View.GONE);
  contentView.setViewVisibility(R.id.header_text_divider,View.GONE);
  contentView.setViewVisibility(R.id.time_divider,View.GONE);
  contentView.setImageViewIcon(R.id.profile_badge,null);
  contentView.setViewVisibility(R.id.profile_badge,View.GONE);
}

Fixed version (ground truth):
/** 
 * Resets the notification header to its original state
 */
private void resetNotificationHeader(RemoteViews contentView){
  contentView.setImageViewResource(R.id.icon,0);
  contentView.setBoolean(R.id.notification_header,"String_Node_Str",false);
  contentView.setTextViewText(R.id.app_name_text,null);
  contentView.setViewVisibility(R.id.chronometer,View.GONE);
  contentView.setViewVisibility(R.id.header_text,View.GONE);
  contentView.setViewVisibility(R.id.header_text_divider,View.GONE);
  contentView.setViewVisibility(R.id.time_divider,View.GONE);
  contentView.setViewVisibility(R.id.time,View.GONE);
  contentView.setImageViewIcon(R.id.profile_badge,null);
  contentView.setViewVisibility(R.id.profile_badge,View.GONE);
}
Program: 191997
Project: 191997
Buggy source:
/** 
 * @return true if the built notification will show the time or the chronometer; falseotherwise
 */
private boolean showsTimeOrChronometer(){
  return mN.when != 0 && mN.extras.getBoolean(EXTRA_SHOW_WHEN);
}

Fixed version (ground truth):
/** 
 * @return true if the notification will show the time or the chronometer; falseotherwise
 * @hide
 */
public boolean showsTimeOrChronometer(){
  return when != 0 && extras.getBoolean(EXTRA_SHOW_WHEN);
}