nus-yam/ex-repair huggingface dataset:
Program: 192527
Project: 192527
Buggy source:
public void taskChanged(String packageName){
  mCurrentPackageName=packageName;
  if (mFacetPackageMap.containsKey(packageName)) {
    setCurrentFacet(mFacetPackageMap.get(packageName));
  }
  String category=getPackageCategory(packageName);
  if (category != null) {
    setCurrentFacet(mFacetCategoryMap.get(category));
  }
}

Fixed version (ground truth):
public void taskChanged(String packageName){
  if (mFacetPackageMap.containsKey(packageName)) {
    setCurrentFacet(mFacetPackageMap.get(packageName));
  }
  String category=getPackageCategory(packageName);
  if (category != null) {
    setCurrentFacet(mFacetCategoryMap.get(category));
  }
}
Program: 192528
Project: 192528
Buggy source:
/** 
 * Saves the text to the   {@link SharedPreferences}.
 * @param text The text to save
 */
public void setText(String text){
  final boolean wasBlocking=shouldDisableDependents();
  mText=text;
  persistString(text);
  final boolean isBlocking=shouldDisableDependents();
  if (isBlocking != wasBlocking) {
    notifyDependencyChange(isBlocking);
  }
}

Fixed version (ground truth):
/** 
 * Saves the text to the   {@link SharedPreferences}.
 * @param text The text to save
 */
public void setText(String text){
  final boolean changed=!TextUtils.equals(mText,text);
  if (changed || !mTextSet) {
    mText=text;
    mTextSet=true;
    persistString(text);
    if (changed) {
      notifyDependencyChange(shouldDisableDependents());
      notifyChanged();
    }
  }
}
Program: 192529
Project: 192529
Buggy source:
private static CharSequence removeTextSizeSpans(CharSequence charSequence){
  if (charSequence instanceof Spanned) {
    Spanned ss=(Spanned)charSequence;
    Object[] spans=ss.getSpans(0,ss.length(),Object.class);
    SpannableStringBuilder builder=new SpannableStringBuilder(ss.toString());
    for (    Object span : spans) {
      Object resultSpan=span;
      if (span instanceof TextAppearanceSpan) {
        TextAppearanceSpan originalSpan=(TextAppearanceSpan)span;
        resultSpan=new TextAppearanceSpan(originalSpan.getFamily(),originalSpan.getTextStyle(),-1,originalSpan.getTextColor(),originalSpan.getLinkTextColor());
      }
 else       if (span instanceof RelativeSizeSpan || span instanceof AbsoluteSizeSpan) {
        continue;
      }
      builder.setSpan(resultSpan,ss.getSpanStart(span),ss.getSpanEnd(span),ss.getSpanFlags(span));
    }
    return builder;
  }
  return charSequence;
}

Fixed version (ground truth):
private static CharSequence removeTextSizeSpans(CharSequence charSequence){
  if (charSequence instanceof Spanned) {
    Spanned ss=(Spanned)charSequence;
    Object[] spans=ss.getSpans(0,ss.length(),Object.class);
    SpannableStringBuilder builder=new SpannableStringBuilder(ss.toString());
    for (    Object span : spans) {
      Object resultSpan=span;
      if (resultSpan instanceof CharacterStyle) {
        resultSpan=((CharacterStyle)span).getUnderlying();
      }
      if (resultSpan instanceof TextAppearanceSpan) {
        TextAppearanceSpan originalSpan=(TextAppearanceSpan)resultSpan;
        resultSpan=new TextAppearanceSpan(originalSpan.getFamily(),originalSpan.getTextStyle(),-1,originalSpan.getTextColor(),originalSpan.getLinkTextColor());
      }
 else       if (resultSpan instanceof RelativeSizeSpan || resultSpan instanceof AbsoluteSizeSpan) {
        continue;
      }
 else {
        resultSpan=span;
      }
      builder.setSpan(resultSpan,ss.getSpanStart(span),ss.getSpanEnd(span),ss.getSpanFlags(span));
    }
    return builder;
  }
  return charSequence;
}
Program: 192530
Project: 192530
Buggy source:
public void registerShortcutKey(long shortcutCode,IShortcutService shortcutService) throws RemoteException {
synchronized (mLock) {
    IShortcutService service=mShortcutKeyServices.get(shortcutCode);
    if (service != null && service.asBinder().isBinderAlive()) {
      throw new RemoteException("String_Node_Str");
    }
    mShortcutKeyServices.put(shortcutCode,shortcutService);
  }
}

Fixed version (ground truth):
public void registerShortcutKey(long shortcutCode,IShortcutService shortcutService) throws RemoteException {
synchronized (mLock) {
    IShortcutService service=mShortcutKeyServices.get(shortcutCode);
    if (service != null && service.asBinder().pingBinder()) {
      throw new RemoteException("String_Node_Str");
    }
    mShortcutKeyServices.put(shortcutCode,shortcutService);
  }
}
Program: 192531
Project: 192531
Buggy source:
/** 
 * Saves the text to the   {@link SharedPreferences}.
 * @param text The text to save
 */
public void setText(String text){
  final boolean wasBlocking=shouldDisableDependents();
  mText=text;
  persistString(text);
  final boolean isBlocking=shouldDisableDependents();
  if (isBlocking != wasBlocking) {
    notifyDependencyChange(isBlocking);
  }
}

Fixed version (ground truth):
/** 
 * Saves the text to the   {@link SharedPreferences}.
 * @param text The text to save
 */
public void setText(String text){
  final boolean changed=!TextUtils.equals(mText,text);
  if (changed || !mTextSet) {
    mText=text;
    mTextSet=true;
    persistString(text);
    if (changed) {
      notifyDependencyChange(shouldDisableDependents());
      notifyChanged();
    }
  }
}
Program: 192532
Project: 192532
Buggy source:
private static CharSequence removeTextSizeSpans(CharSequence charSequence){
  if (charSequence instanceof Spanned) {
    Spanned ss=(Spanned)charSequence;
    Object[] spans=ss.getSpans(0,ss.length(),Object.class);
    SpannableStringBuilder builder=new SpannableStringBuilder(ss.toString());
    for (    Object span : spans) {
      Object resultSpan=span;
      if (span instanceof TextAppearanceSpan) {
        TextAppearanceSpan originalSpan=(TextAppearanceSpan)span;
        resultSpan=new TextAppearanceSpan(originalSpan.getFamily(),originalSpan.getTextStyle(),-1,originalSpan.getTextColor(),originalSpan.getLinkTextColor());
      }
 else       if (span instanceof RelativeSizeSpan || span instanceof AbsoluteSizeSpan) {
        continue;
      }
      builder.setSpan(resultSpan,ss.getSpanStart(span),ss.getSpanEnd(span),ss.getSpanFlags(span));
    }
    return builder;
  }
  return charSequence;
}

Fixed version (ground truth):
private static CharSequence removeTextSizeSpans(CharSequence charSequence){
  if (charSequence instanceof Spanned) {
    Spanned ss=(Spanned)charSequence;
    Object[] spans=ss.getSpans(0,ss.length(),Object.class);
    SpannableStringBuilder builder=new SpannableStringBuilder(ss.toString());
    for (    Object span : spans) {
      Object resultSpan=span;
      if (resultSpan instanceof CharacterStyle) {
        resultSpan=((CharacterStyle)span).getUnderlying();
      }
      if (resultSpan instanceof TextAppearanceSpan) {
        TextAppearanceSpan originalSpan=(TextAppearanceSpan)resultSpan;
        resultSpan=new TextAppearanceSpan(originalSpan.getFamily(),originalSpan.getTextStyle(),-1,originalSpan.getTextColor(),originalSpan.getLinkTextColor());
      }
 else       if (resultSpan instanceof RelativeSizeSpan || resultSpan instanceof AbsoluteSizeSpan) {
        continue;
      }
 else {
        resultSpan=span;
      }
      builder.setSpan(resultSpan,ss.getSpanStart(span),ss.getSpanEnd(span),ss.getSpanFlags(span));
    }
    return builder;
  }
  return charSequence;
}
Program: 192533
Project: 192533
Buggy source:
private void resetHeaderIndention(){
  if (mHeader.getPaddingEnd() != mNotificationContentMarginEnd) {
    ViewGroup.MarginLayoutParams headerParams=(MarginLayoutParams)mHeader.getLayoutParams();
    headerParams.setMarginEnd(0);
    mHeader.setPadding(isLayoutRtl() ? mNotificationContentMarginEnd : mHeader.getPaddingLeft(),mHeader.getPaddingTop(),isLayoutRtl() ? mHeader.getPaddingLeft() : mNotificationContentMarginEnd,mHeader.getPaddingBottom());
    mHeader.setLayoutParams(headerParams);
  }
}

Fixed version (ground truth):
private boolean resetHeaderIndention(){
  boolean remeasure=false;
  if (mHeader.getPaddingEnd() != mNotificationContentMarginEnd) {
    mHeader.setPaddingRelative(mHeader.getPaddingStart(),mHeader.getPaddingTop(),mNotificationContentMarginEnd,mHeader.getPaddingBottom());
    remeasure=true;
  }
  ViewGroup.MarginLayoutParams headerParams=(MarginLayoutParams)mHeader.getLayoutParams();
  headerParams.setMarginEnd(0);
  if (headerParams.getMarginEnd() != 0) {
    headerParams.setMarginEnd(0);
    mHeader.setLayoutParams(headerParams);
    remeasure=true;
  }
  return remeasure;
}
Program: 192535
Project: 192535
Buggy source:
/** 
 * Check whether the view state is currently expanded. This is given by the system in   {@link #setSystemExpanded(boolean)} and can be overridden by user expansion orcollapsing in  {@link #setUserExpanded(boolean)}. Note that the visual appearance of this view can differ from this state, if layout params are modified from outside.
 * @return whether the view state is currently expanded.
 */
public boolean isExpanded(){
  return !mOnKeyguard && (!hasUserChangedExpansion() && (isSystemExpanded() || isSystemChildExpanded()) || isUserExpanded());
}

Fixed version (ground truth):
public boolean isExpanded(boolean allowOnKeyguard){
  return (!mOnKeyguard || allowOnKeyguard) && (!hasUserChangedExpansion() && (isSystemExpanded() || isSystemChildExpanded()) || isUserExpanded());
}
Program: 192536
Project: 192536
Buggy source:
private int getVisualTypeForHeight(float viewHeight){
  boolean noExpandedChild=mExpandedChild == null;
  if (!noExpandedChild && viewHeight == mExpandedChild.getHeight()) {
    return VISIBLE_TYPE_EXPANDED;
  }
  if (!mUserExpanding && mIsChildInGroup && !isGroupExpanded()) {
    return VISIBLE_TYPE_SINGLELINE;
  }
  if (mIsHeadsUp && mHeadsUpChild != null) {
    if (viewHeight <= mHeadsUpChild.getHeight() || noExpandedChild) {
      return VISIBLE_TYPE_HEADSUP;
    }
 else {
      return VISIBLE_TYPE_EXPANDED;
    }
  }
 else {
    if (noExpandedChild || (viewHeight <= mContractedChild.getHeight() && (!mIsChildInGroup || !mContainingNotification.isExpanded()))) {
      return VISIBLE_TYPE_CONTRACTED;
    }
 else {
      return VISIBLE_TYPE_EXPANDED;
    }
  }
}

Fixed version (ground truth):
private int getVisualTypeForHeight(float viewHeight){
  boolean noExpandedChild=mExpandedChild == null;
  if (!noExpandedChild && viewHeight == mExpandedChild.getHeight()) {
    return VISIBLE_TYPE_EXPANDED;
  }
  if (!mUserExpanding && mIsChildInGroup && !isGroupExpanded()) {
    return VISIBLE_TYPE_SINGLELINE;
  }
  if (mIsHeadsUp && mHeadsUpChild != null) {
    if (viewHeight <= mHeadsUpChild.getHeight() || noExpandedChild) {
      return VISIBLE_TYPE_HEADSUP;
    }
 else {
      return VISIBLE_TYPE_EXPANDED;
    }
  }
 else {
    if (noExpandedChild || (viewHeight <= mContractedChild.getHeight() && (!mIsChildInGroup || !mContainingNotification.isExpanded(true)))) {
      return VISIBLE_TYPE_CONTRACTED;
    }
 else {
      return VISIBLE_TYPE_EXPANDED;
    }
  }
}
Program: 192537
Project: 192537
Buggy source:
/** 
 * @return one of the static enum types in this view, calculated form the current state
 */
private int calculateVisibleType(){
  if (mUserExpanding) {
    int height=!mIsChildInGroup || isGroupExpanded() || mContainingNotification.isExpanded() ? mContainingNotification.getMaxContentHeight() : mContainingNotification.getShowingLayout().getMinHeight();
    if (height == 0) {
      height=mContentHeight;
    }
    int expandedVisualType=getVisualTypeForHeight(height);
    int collapsedVisualType=getVisualTypeForHeight(mContainingNotification.getMinExpandHeight());
    return mTransformationStartVisibleType == collapsedVisualType ? expandedVisualType : collapsedVisualType;
  }
  int intrinsicHeight=mContainingNotification.getIntrinsicHeight();
  int viewHeight=mContentHeight;
  if (intrinsicHeight != 0) {
    viewHeight=Math.min(mContentHeight,intrinsicHeight);
  }
  return getVisualTypeForHeight(viewHeight);
}

Fixed version (ground truth):
/** 
 * @return one of the static enum types in this view, calculated form the current state
 */
private int calculateVisibleType(){
  if (mUserExpanding) {
    int height=!mIsChildInGroup || isGroupExpanded() || mContainingNotification.isExpanded(true) ? mContainingNotification.getMaxContentHeight() : mContainingNotification.getShowingLayout().getMinHeight();
    if (height == 0) {
      height=mContentHeight;
    }
    int expandedVisualType=getVisualTypeForHeight(height);
    int collapsedVisualType=getVisualTypeForHeight(mContainingNotification.getMinExpandHeight());
    return mTransformationStartVisibleType == collapsedVisualType ? expandedVisualType : collapsedVisualType;
  }
  int intrinsicHeight=mContainingNotification.getIntrinsicHeight();
  int viewHeight=mContentHeight;
  if (intrinsicHeight != 0) {
    viewHeight=Math.min(mContentHeight,intrinsicHeight);
  }
  return getVisualTypeForHeight(viewHeight);
}
Program: 192538
Project: 192538
Buggy source:
public void setActualHeight(int actualHeight){
  if (!mUserLocked) {
    return;
  }
  mActualHeight=actualHeight;
  float fraction=getChildExpandFraction();
  int childCount=mChildren.size();
  for (int i=0; i < childCount; i++) {
    ExpandableNotificationRow child=mChildren.get(i);
    float childHeight=child.isExpanded() ? child.getMaxExpandHeight() : child.getShowingLayout().getMinHeight(true);
    float singleLineHeight=child.getShowingLayout().getMinHeight(false);
    child.setActualHeight((int)NotificationUtils.interpolate(singleLineHeight,childHeight,fraction),false);
  }
}

Fixed version (ground truth):
public void setActualHeight(int actualHeight){
  if (!mUserLocked) {
    return;
  }
  mActualHeight=actualHeight;
  float fraction=getChildExpandFraction();
  int childCount=mChildren.size();
  for (int i=0; i < childCount; i++) {
    ExpandableNotificationRow child=mChildren.get(i);
    float childHeight=child.isExpanded(true) ? child.getMaxExpandHeight() : child.getShowingLayout().getMinHeight(true);
    float singleLineHeight=child.getShowingLayout().getMinHeight(false);
    child.setActualHeight((int)NotificationUtils.interpolate(singleLineHeight,childHeight,fraction),false);
  }
}
Program: 192539
Project: 192539
Buggy source:
public int getMaxContentHeight(){
  int maxContentHeight=mNotificationHeaderHeight + mNotificatonTopPadding;
  int visibleChildren=0;
  int childCount=mChildren.size();
  for (int i=0; i < childCount; i++) {
    if (visibleChildren >= NUMBER_OF_CHILDREN_WHEN_CHILDREN_EXPANDED) {
      break;
    }
    ExpandableNotificationRow child=mChildren.get(i);
    float childHeight=child.isExpanded() ? child.getMaxExpandHeight() : child.getShowingLayout().getMinHeight(true);
    maxContentHeight+=childHeight;
    visibleChildren++;
  }
  if (visibleChildren > 0) {
    maxContentHeight+=visibleChildren * mDividerHeight;
  }
  return maxContentHeight;
}

Fixed version (ground truth):
public int getMaxContentHeight(){
  int maxContentHeight=mNotificationHeaderHeight + mNotificatonTopPadding;
  int visibleChildren=0;
  int childCount=mChildren.size();
  for (int i=0; i < childCount; i++) {
    if (visibleChildren >= NUMBER_OF_CHILDREN_WHEN_CHILDREN_EXPANDED) {
      break;
    }
    ExpandableNotificationRow child=mChildren.get(i);
    float childHeight=child.isExpanded(true) ? child.getMaxExpandHeight() : child.getShowingLayout().getMinHeight(true);
    maxContentHeight+=childHeight;
    visibleChildren++;
  }
  if (visibleChildren > 0) {
    maxContentHeight+=visibleChildren * mDividerHeight;
  }
  return maxContentHeight;
}
Program: 192540
Project: 192540
Buggy source:
public ExpandableNotificationRow getViewAtPosition(float y){
  if (!mIsSummaryWithChildren || !mChildrenExpanded || (getNotificationChildren().size() == 1 && isClearable())) {
    return this;
  }
 else {
    ExpandableNotificationRow view=mChildrenContainer.getViewAtPosition(y);
    return view == null ? this : view;
  }
}

Fixed version (ground truth):
public ExpandableNotificationRow getViewAtPosition(float y){
  if (!mIsSummaryWithChildren || !mChildrenExpanded) {
    return this;
  }
 else {
    ExpandableNotificationRow view=mChildrenContainer.getViewAtPosition(y);
    return view == null ? this : view;
  }
}
Program: 192541
Project: 192541
Buggy source:
private void doKeyguardLaterLocked(long timeout){
  long when=SystemClock.elapsedRealtime() + timeout;
  Intent intent=new Intent(DELAYED_KEYGUARD_ACTION);
  intent.putExtra("String_Node_Str",mDelayedShowingSequence);
  PendingIntent sender=PendingIntent.getBroadcast(mContext,0,intent,PendingIntent.FLAG_CANCEL_CURRENT);
  mAlarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP,when,sender);
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + mDelayedShowingSequence);
  doKeyguardLaterForChildProfilesLocked();
}

Fixed version (ground truth):
private void doKeyguardLaterLocked(long timeout){
  long when=SystemClock.elapsedRealtime() + timeout;
  Intent intent=new Intent(DELAYED_KEYGUARD_ACTION);
  intent.putExtra("String_Node_Str",mDelayedShowingSequence);
  PendingIntent sender=PendingIntent.getBroadcast(mContext,0,intent,PendingIntent.FLAG_CANCEL_CURRENT);
  mAlarmManager.setExactAndAllowWhileIdle(AlarmManager.ELAPSED_REALTIME_WAKEUP,when,sender);
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + mDelayedShowingSequence);
  doKeyguardLaterForChildProfilesLocked();
}
Program: 192542
Project: 192542
Buggy source:
private void doKeyguardLaterForChildProfilesLocked(){
  UserManager um=UserManager.get(mContext);
  List<UserInfo> profiles=um.getEnabledProfiles(UserHandle.myUserId());
  for (  UserInfo info : profiles) {
    if (mLockPatternUtils.isSeparateProfileChallengeEnabled(info.id)) {
      long userTimeout=getLockTimeout(info.id);
      long userWhen=SystemClock.elapsedRealtime() + userTimeout;
      Intent lockIntent=new Intent(DELAYED_LOCK_PROFILE_ACTION);
      lockIntent.putExtra(Intent.EXTRA_USER_ID,info.id);
      PendingIntent lockSender=PendingIntent.getBroadcast(mContext,0,lockIntent,PendingIntent.FLAG_CANCEL_CURRENT);
      mAlarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP,userWhen,lockSender);
    }
  }
}

Fixed version (ground truth):
private void doKeyguardLaterForChildProfilesLocked(){
  UserManager um=UserManager.get(mContext);
  List<UserInfo> profiles=um.getEnabledProfiles(UserHandle.myUserId());
  for (  UserInfo info : profiles) {
    if (mLockPatternUtils.isSeparateProfileChallengeEnabled(info.id)) {
      long userTimeout=getLockTimeout(info.id);
      long userWhen=SystemClock.elapsedRealtime() + userTimeout;
      Intent lockIntent=new Intent(DELAYED_LOCK_PROFILE_ACTION);
      lockIntent.putExtra(Intent.EXTRA_USER_ID,info.id);
      PendingIntent lockSender=PendingIntent.getBroadcast(mContext,0,lockIntent,PendingIntent.FLAG_CANCEL_CURRENT);
      mAlarmManager.setExactAndAllowWhileIdle(AlarmManager.ELAPSED_REALTIME_WAKEUP,userWhen,lockSender);
    }
  }
}
Program: 192543
Project: 192543
Buggy source:
public void registerShortcutKey(long shortcutCode,IShortcutService shortcutService) throws RemoteException {
synchronized (mLock) {
    IShortcutService service=mShortcutKeyServices.get(shortcutCode);
    if (service != null && service.asBinder().isBinderAlive()) {
      throw new RemoteException("String_Node_Str");
    }
    mShortcutKeyServices.put(shortcutCode,shortcutService);
  }
}

Fixed version (ground truth):
public void registerShortcutKey(long shortcutCode,IShortcutService shortcutService) throws RemoteException {
synchronized (mLock) {
    IShortcutService service=mShortcutKeyServices.get(shortcutCode);
    if (service != null && service.asBinder().pingBinder()) {
      throw new RemoteException("String_Node_Str");
    }
    mShortcutKeyServices.put(shortcutCode,shortcutService);
  }
}
Program: 192544
Project: 192544
Buggy source:
public AppErrorDialog(Context context,ActivityManagerService service,Data data){
  super(context);
  Resources res=context.getResources();
  mService=service;
  mProc=data.proc;
  mResult=data.result;
  mRepeating=data.repeating;
  if ((mProc.pkgList.size() == 1) && (mName=context.getPackageManager().getApplicationLabel(mProc.info)) != null) {
    setTitle(res.getString(mRepeating ? com.android.internal.R.string.aerr_application_repeated : com.android.internal.R.string.aerr_application,mName.toString(),mProc.info.processName));
  }
 else {
    mName=mProc.processName;
    setTitle(res.getString(mRepeating ? com.android.internal.R.string.aerr_process_repeated : com.android.internal.R.string.aerr_process,mName.toString()));
  }
  setCancelable(false);
  WindowManager.LayoutParams attrs=getWindow().getAttributes();
  attrs.setTitle("String_Node_Str" + mProc.info.processName);
  attrs.privateFlags|=WindowManager.LayoutParams.PRIVATE_FLAG_SYSTEM_ERROR | WindowManager.LayoutParams.PRIVATE_FLAG_SHOW_FOR_ALL_USERS;
  getWindow().setAttributes(attrs);
  if (mProc.persistent) {
    getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ERROR);
  }
  mHandler.sendMessageDelayed(mHandler.obtainMessage(TIMEOUT),DISMISS_TIMEOUT);
}

Fixed version (ground truth):
public AppErrorDialog(Context context,ActivityManagerService service,Data data){
  super(context);
  Resources res=context.getResources();
  mService=service;
  mProc=data.proc;
  mResult=data.result;
  mRepeating=data.repeating;
  BidiFormatter bidi=BidiFormatter.getInstance();
  if ((mProc.pkgList.size() == 1) && (mName=context.getPackageManager().getApplicationLabel(mProc.info)) != null) {
    setTitle(res.getString(mRepeating ? com.android.internal.R.string.aerr_application_repeated : com.android.internal.R.string.aerr_application,bidi.unicodeWrap(mName.toString()),bidi.unicodeWrap(mProc.info.processName)));
  }
 else {
    mName=mProc.processName;
    setTitle(res.getString(mRepeating ? com.android.internal.R.string.aerr_process_repeated : com.android.internal.R.string.aerr_process,bidi.unicodeWrap(mName.toString())));
  }
  setCancelable(false);
  WindowManager.LayoutParams attrs=getWindow().getAttributes();
  attrs.setTitle("String_Node_Str" + mProc.info.processName);
  attrs.privateFlags|=WindowManager.LayoutParams.PRIVATE_FLAG_SYSTEM_ERROR | WindowManager.LayoutParams.PRIVATE_FLAG_SHOW_FOR_ALL_USERS;
  getWindow().setAttributes(attrs);
  if (mProc.persistent) {
    getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ERROR);
  }
  mHandler.sendMessageDelayed(mHandler.obtainMessage(TIMEOUT),DISMISS_TIMEOUT);
}
Program: 192545
Project: 192545
Buggy source:
public AppNotRespondingDialog(ActivityManagerService service,Context context,ProcessRecord app,ActivityRecord activity,boolean aboveSystem){
  super(context);
  mService=service;
  mProc=app;
  Resources res=context.getResources();
  setCancelable(false);
  int resid;
  CharSequence name1=activity != null ? activity.info.loadLabel(context.getPackageManager()) : null;
  CharSequence name2=null;
  if ((app.pkgList.size() == 1) && (name2=context.getPackageManager().getApplicationLabel(app.info)) != null) {
    if (name1 != null) {
      resid=com.android.internal.R.string.anr_activity_application;
    }
 else {
      name1=name2;
      name2=app.processName;
      resid=com.android.internal.R.string.anr_application_process;
    }
  }
 else {
    if (name1 != null) {
      name2=app.processName;
      resid=com.android.internal.R.string.anr_activity_process;
    }
 else {
      name1=app.processName;
      resid=com.android.internal.R.string.anr_process;
    }
  }
  setTitle(name2 != null ? res.getString(resid,name1.toString(),name2.toString()) : res.getString(resid,name1.toString()));
  if (aboveSystem) {
    getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ERROR);
  }
  WindowManager.LayoutParams attrs=getWindow().getAttributes();
  attrs.setTitle("String_Node_Str" + app.info.processName);
  attrs.privateFlags=WindowManager.LayoutParams.PRIVATE_FLAG_SYSTEM_ERROR | WindowManager.LayoutParams.PRIVATE_FLAG_SHOW_FOR_ALL_USERS;
  getWindow().setAttributes(attrs);
}

Fixed version (ground truth):
public AppNotRespondingDialog(ActivityManagerService service,Context context,ProcessRecord app,ActivityRecord activity,boolean aboveSystem){
  super(context);
  mService=service;
  mProc=app;
  Resources res=context.getResources();
  setCancelable(false);
  int resid;
  CharSequence name1=activity != null ? activity.info.loadLabel(context.getPackageManager()) : null;
  CharSequence name2=null;
  if ((app.pkgList.size() == 1) && (name2=context.getPackageManager().getApplicationLabel(app.info)) != null) {
    if (name1 != null) {
      resid=com.android.internal.R.string.anr_activity_application;
    }
 else {
      name1=name2;
      name2=app.processName;
      resid=com.android.internal.R.string.anr_application_process;
    }
  }
 else {
    if (name1 != null) {
      name2=app.processName;
      resid=com.android.internal.R.string.anr_activity_process;
    }
 else {
      name1=app.processName;
      resid=com.android.internal.R.string.anr_process;
    }
  }
  BidiFormatter bidi=BidiFormatter.getInstance();
  setTitle(name2 != null ? res.getString(resid,bidi.unicodeWrap(name1.toString()),bidi.unicodeWrap(name2.toString())) : res.getString(resid,bidi.unicodeWrap(name1.toString())));
  if (aboveSystem) {
    getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ERROR);
  }
  WindowManager.LayoutParams attrs=getWindow().getAttributes();
  attrs.setTitle("String_Node_Str" + app.info.processName);
  attrs.privateFlags=WindowManager.LayoutParams.PRIVATE_FLAG_SYSTEM_ERROR | WindowManager.LayoutParams.PRIVATE_FLAG_SHOW_FOR_ALL_USERS;
  getWindow().setAttributes(attrs);
}
Program: 192546
Project: 192546
Buggy source:
public ScrimController createScrimController(ScrimView scrimBehind,ScrimView scrimInFront,View headsUpScrim,boolean scrimSrcEnabled){
  return new ScrimController(scrimBehind,scrimInFront,headsUpScrim,scrimSrcEnabled);
}

Fixed version (ground truth):
public ScrimController createScrimController(ScrimView scrimBehind,ScrimView scrimInFront,View headsUpScrim){
  return new ScrimController(scrimBehind,scrimInFront,headsUpScrim);
}
Program: 192548
Project: 192548
Buggy source:
public ScrimController(ScrimView scrimBehind,ScrimView scrimInFront,View headsUpScrim,boolean scrimSrcEnabled){
  mScrimBehind=scrimBehind;
  mScrimInFront=scrimInFront;
  mHeadsUpScrim=headsUpScrim;
  final Context context=scrimBehind.getContext();
  mUnlockMethodCache=UnlockMethodCache.getInstance(context);
  mScrimSrcEnabled=scrimSrcEnabled;
  updateHeadsUpScrim(false);
}

Fixed version (ground truth):
public ScrimController(ScrimView scrimBehind,ScrimView scrimInFront,View headsUpScrim){
  mScrimBehind=scrimBehind;
  mScrimInFront=scrimInFront;
  mHeadsUpScrim=headsUpScrim;
  final Context context=scrimBehind.getContext();
  mUnlockMethodCache=UnlockMethodCache.getInstance(context);
  updateHeadsUpScrim(false);
}
Program: 192549
Project: 192549
Buggy source:
public NotificationStackScrollLayout(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  super(context,attrs,defStyleAttr,defStyleRes);
  mBgColor=context.getColor(R.color.notification_shade_background_color);
  int minHeight=getResources().getDimensionPixelSize(R.dimen.notification_min_height);
  int maxHeight=getResources().getDimensionPixelSize(R.dimen.notification_max_height);
  mExpandHelper=new ExpandHelper(getContext(),this,minHeight,maxHeight);
  mExpandHelper.setEventSource(this);
  mExpandHelper.setScrollAdapter(this);
  mSwipeHelper=new NotificationSwipeHelper(SwipeHelper.X,this,getContext());
  mSwipeHelper.setLongPressListener(mLongPressListener);
  mStackScrollAlgorithm=new StackScrollAlgorithm(context);
  initView(context);
  setWillNotDraw(false);
  if (DEBUG) {
    mDebugPaint=new Paint();
    mDebugPaint.setColor(0xffff0000);
    mDebugPaint.setStrokeWidth(2);
    mDebugPaint.setStyle(Paint.Style.STROKE);
  }
  mFalsingManager=FalsingManager.getInstance(context);
  mBackgroundPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC));
}

Fixed version (ground truth):
public NotificationStackScrollLayout(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  super(context,attrs,defStyleAttr,defStyleRes);
  mBgColor=context.getColor(R.color.notification_shade_background_color);
  int minHeight=getResources().getDimensionPixelSize(R.dimen.notification_min_height);
  int maxHeight=getResources().getDimensionPixelSize(R.dimen.notification_max_height);
  mExpandHelper=new ExpandHelper(getContext(),this,minHeight,maxHeight);
  mExpandHelper.setEventSource(this);
  mExpandHelper.setScrollAdapter(this);
  mSwipeHelper=new NotificationSwipeHelper(SwipeHelper.X,this,getContext());
  mSwipeHelper.setLongPressListener(mLongPressListener);
  mStackScrollAlgorithm=new StackScrollAlgorithm(context);
  initView(context);
  setWillNotDraw(false);
  if (DEBUG) {
    mDebugPaint=new Paint();
    mDebugPaint.setColor(0xffff0000);
    mDebugPaint.setStrokeWidth(2);
    mDebugPaint.setStyle(Paint.Style.STROKE);
  }
  mFalsingManager=FalsingManager.getInstance(context);
}
Program: 192550
Project: 192550
Buggy source:
public AppErrorDialog(Context context,ActivityManagerService service,Data data){
  super(context);
  Resources res=context.getResources();
  mService=service;
  mProc=data.proc;
  mResult=data.result;
  mRepeating=data.repeating;
  if ((mProc.pkgList.size() == 1) && (mName=context.getPackageManager().getApplicationLabel(mProc.info)) != null) {
    setTitle(res.getString(mRepeating ? com.android.internal.R.string.aerr_application_repeated : com.android.internal.R.string.aerr_application,mName.toString(),mProc.info.processName));
  }
 else {
    mName=mProc.processName;
    setTitle(res.getString(mRepeating ? com.android.internal.R.string.aerr_process_repeated : com.android.internal.R.string.aerr_process,mName.toString()));
  }
  setCancelable(false);
  WindowManager.LayoutParams attrs=getWindow().getAttributes();
  attrs.setTitle("String_Node_Str" + mProc.info.processName);
  attrs.privateFlags|=WindowManager.LayoutParams.PRIVATE_FLAG_SYSTEM_ERROR | WindowManager.LayoutParams.PRIVATE_FLAG_SHOW_FOR_ALL_USERS;
  getWindow().setAttributes(attrs);
  if (mProc.persistent) {
    getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ERROR);
  }
  mHandler.sendMessageDelayed(mHandler.obtainMessage(TIMEOUT),DISMISS_TIMEOUT);
}

Fixed version (ground truth):
public AppErrorDialog(Context context,ActivityManagerService service,Data data){
  super(context);
  Resources res=context.getResources();
  mService=service;
  mProc=data.proc;
  mResult=data.result;
  mRepeating=data.repeating;
  BidiFormatter bidi=BidiFormatter.getInstance();
  if ((mProc.pkgList.size() == 1) && (mName=context.getPackageManager().getApplicationLabel(mProc.info)) != null) {
    setTitle(res.getString(mRepeating ? com.android.internal.R.string.aerr_application_repeated : com.android.internal.R.string.aerr_application,bidi.unicodeWrap(mName.toString()),bidi.unicodeWrap(mProc.info.processName)));
  }
 else {
    mName=mProc.processName;
    setTitle(res.getString(mRepeating ? com.android.internal.R.string.aerr_process_repeated : com.android.internal.R.string.aerr_process,bidi.unicodeWrap(mName.toString())));
  }
  setCancelable(false);
  WindowManager.LayoutParams attrs=getWindow().getAttributes();
  attrs.setTitle("String_Node_Str" + mProc.info.processName);
  attrs.privateFlags|=WindowManager.LayoutParams.PRIVATE_FLAG_SYSTEM_ERROR | WindowManager.LayoutParams.PRIVATE_FLAG_SHOW_FOR_ALL_USERS;
  getWindow().setAttributes(attrs);
  if (mProc.persistent) {
    getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ERROR);
  }
  mHandler.sendMessageDelayed(mHandler.obtainMessage(TIMEOUT),DISMISS_TIMEOUT);
}
Program: 192551
Project: 192551
Buggy source:
public AppNotRespondingDialog(ActivityManagerService service,Context context,ProcessRecord app,ActivityRecord activity,boolean aboveSystem){
  super(context);
  mService=service;
  mProc=app;
  Resources res=context.getResources();
  setCancelable(false);
  int resid;
  CharSequence name1=activity != null ? activity.info.loadLabel(context.getPackageManager()) : null;
  CharSequence name2=null;
  if ((app.pkgList.size() == 1) && (name2=context.getPackageManager().getApplicationLabel(app.info)) != null) {
    if (name1 != null) {
      resid=com.android.internal.R.string.anr_activity_application;
    }
 else {
      name1=name2;
      name2=app.processName;
      resid=com.android.internal.R.string.anr_application_process;
    }
  }
 else {
    if (name1 != null) {
      name2=app.processName;
      resid=com.android.internal.R.string.anr_activity_process;
    }
 else {
      name1=app.processName;
      resid=com.android.internal.R.string.anr_process;
    }
  }
  setTitle(name2 != null ? res.getString(resid,name1.toString(),name2.toString()) : res.getString(resid,name1.toString()));
  if (aboveSystem) {
    getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ERROR);
  }
  WindowManager.LayoutParams attrs=getWindow().getAttributes();
  attrs.setTitle("String_Node_Str" + app.info.processName);
  attrs.privateFlags=WindowManager.LayoutParams.PRIVATE_FLAG_SYSTEM_ERROR | WindowManager.LayoutParams.PRIVATE_FLAG_SHOW_FOR_ALL_USERS;
  getWindow().setAttributes(attrs);
}

Fixed version (ground truth):
public AppNotRespondingDialog(ActivityManagerService service,Context context,ProcessRecord app,ActivityRecord activity,boolean aboveSystem){
  super(context);
  mService=service;
  mProc=app;
  Resources res=context.getResources();
  setCancelable(false);
  int resid;
  CharSequence name1=activity != null ? activity.info.loadLabel(context.getPackageManager()) : null;
  CharSequence name2=null;
  if ((app.pkgList.size() == 1) && (name2=context.getPackageManager().getApplicationLabel(app.info)) != null) {
    if (name1 != null) {
      resid=com.android.internal.R.string.anr_activity_application;
    }
 else {
      name1=name2;
      name2=app.processName;
      resid=com.android.internal.R.string.anr_application_process;
    }
  }
 else {
    if (name1 != null) {
      name2=app.processName;
      resid=com.android.internal.R.string.anr_activity_process;
    }
 else {
      name1=app.processName;
      resid=com.android.internal.R.string.anr_process;
    }
  }
  BidiFormatter bidi=BidiFormatter.getInstance();
  setTitle(name2 != null ? res.getString(resid,bidi.unicodeWrap(name1.toString()),bidi.unicodeWrap(name2.toString())) : res.getString(resid,bidi.unicodeWrap(name1.toString())));
  if (aboveSystem) {
    getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ERROR);
  }
  WindowManager.LayoutParams attrs=getWindow().getAttributes();
  attrs.setTitle("String_Node_Str" + app.info.processName);
  attrs.privateFlags=WindowManager.LayoutParams.PRIVATE_FLAG_SYSTEM_ERROR | WindowManager.LayoutParams.PRIVATE_FLAG_SHOW_FOR_ALL_USERS;
  getWindow().setAttributes(attrs);
}
Program: 192552
Project: 192552
Buggy source:
public boolean canChildBeExpanded(View v){
  return v instanceof ExpandableNotificationRow && ((ExpandableNotificationRow)v).isExpandable() && !((ExpandableNotificationRow)v).isHeadsUp();
}

Fixed version (ground truth):
public boolean canChildBeExpanded(View v){
  return v instanceof ExpandableNotificationRow && ((ExpandableNotificationRow)v).isExpandable() && (mIsExpanded || !((ExpandableNotificationRow)v).isPinned());
}
Program: 192554
Project: 192554
Buggy source:
private void startAdvancedPrintOptionsActivity(PrinterInfo printer){
  ComponentName serviceName=printer.getId().getServiceName();
  String activityName=PrintOptionUtils.getAdvancedOptionsActivityName(this,serviceName);
  if (TextUtils.isEmpty(activityName)) {
    return;
  }
  Intent intent=new Intent(Intent.ACTION_MAIN);
  intent.setComponent(new ComponentName(serviceName.getPackageName(),activityName));
  List<ResolveInfo> resolvedActivities=getPackageManager().queryIntentActivities(intent,0);
  if (resolvedActivities.isEmpty()) {
    return;
  }
  if (resolvedActivities.get(0).activityInfo.exported) {
    intent.putExtra(PrintService.EXTRA_PRINT_JOB_INFO,mPrintJob);
    intent.putExtra(PrintService.EXTRA_PRINTER_INFO,printer);
    intent.putExtra(PrintService.EXTRA_PRINT_DOCUMENT_INFO,mPrintedDocument.getDocumentInfo().info);
    try {
      startActivityForResult(intent,ACTIVITY_REQUEST_POPULATE_ADVANCED_PRINT_OPTIONS);
    }
 catch (    ActivityNotFoundException anfe) {
      Log.e(LOG_TAG,"String_Node_Str" + intent,anfe);
    }
  }
}

Fixed version (ground truth):
private void startAdvancedPrintOptionsActivity(PrinterInfo printer){
  ComponentName serviceName=printer.getId().getServiceName();
  String activityName=PrintOptionUtils.getAdvancedOptionsActivityName(this,serviceName);
  if (TextUtils.isEmpty(activityName)) {
    return;
  }
  Intent intent=new Intent(Intent.ACTION_MAIN);
  intent.setComponent(new ComponentName(serviceName.getPackageName(),activityName));
  List<ResolveInfo> resolvedActivities=getPackageManager().queryIntentActivities(intent,0);
  if (resolvedActivities.isEmpty()) {
    return;
  }
  if (resolvedActivities.get(0).activityInfo.exported) {
    PrintJobInfo.Builder printJobBuilder=new PrintJobInfo.Builder(mPrintJob);
    printJobBuilder.setPages(mSelectedPages);
    intent.putExtra(PrintService.EXTRA_PRINT_JOB_INFO,printJobBuilder.build());
    intent.putExtra(PrintService.EXTRA_PRINTER_INFO,printer);
    intent.putExtra(PrintService.EXTRA_PRINT_DOCUMENT_INFO,mPrintedDocument.getDocumentInfo().info);
    try {
      startActivityForResult(intent,ACTIVITY_REQUEST_POPULATE_ADVANCED_PRINT_OPTIONS);
    }
 catch (    ActivityNotFoundException anfe) {
      Log.e(LOG_TAG,"String_Node_Str" + intent,anfe);
    }
  }
}
Program: 192555
Project: 192555
Buggy source:
public void resetHeight(){
  if (mIsHeadsUp) {
    resetActualHeight();
  }
  mMaxExpandHeight=0;
  mHeadsUpHeight=0;
  mWasReset=true;
  onHeightReset();
  requestLayout();
}

Fixed version (ground truth):
public void resetHeight(){
  mMaxExpandHeight=0;
  mHeadsUpHeight=0;
  onHeightReset();
  requestLayout();
}
Program: 192556
Project: 192556
Buggy source:
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  boolean updateExpandHeight=mMaxExpandHeight == 0 && !mWasReset;
  updateMaxHeights();
  if (updateExpandHeight) {
    applyExpansionToLayout();
  }
  mWasReset=false;
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  updateMaxHeights();
}
Program: 192557
Project: 192557
Buggy source:
/** 
 * Resets this view so it can be re-used for an updated notification.
 */
@Override public void reset(){
  super.reset();
  final boolean wasExpanded=isExpanded();
  mExpandable=false;
  mHasUserChangedExpansion=false;
  mUserLocked=false;
  mShowingPublic=false;
  mSensitive=false;
  mShowingPublicInitialized=false;
  mIsSystemExpanded=false;
  mOnKeyguard=false;
  mPublicLayout.reset(mIsHeadsUp);
  mPrivateLayout.reset(mIsHeadsUp);
  resetHeight();
  resetTranslation();
  logExpansionEvent(false,wasExpanded);
}

Fixed version (ground truth):
/** 
 * Resets this view so it can be re-used for an updated notification.
 */
@Override public void reset(){
  super.reset();
  final boolean wasExpanded=isExpanded();
  mExpandable=false;
  mHasUserChangedExpansion=false;
  mUserLocked=false;
  mShowingPublic=false;
  mSensitive=false;
  mShowingPublicInitialized=false;
  mIsSystemExpanded=false;
  mOnKeyguard=false;
  mPublicLayout.reset();
  mPrivateLayout.reset();
  resetHeight();
  resetTranslation();
  logExpansionEvent(false,wasExpanded);
}
Program: 192558
Project: 192558
Buggy source:
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  if (!mActualHeightInitialized && mActualHeight == 0) {
    int initialHeight=getInitialHeight();
    if (initialHeight != 0) {
      setActualHeight(initialHeight);
    }
  }
  updateClipping();
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  updateClipping();
}
Program: 192559
Project: 192559
Buggy source:
@Override public void run(){
  hiddenView.setVisible(false);
}

Fixed version (ground truth):
@Override public void run(){
  if (hiddenView != getTransformableViewForVisibleType(mVisibleType)) {
    hiddenView.setVisible(false);
  }
}
Program: 192560
Project: 192560
Buggy source:
public NotificationContentView(Context context,AttributeSet attrs){
  super(context,attrs);
  mHybridViewManager=new HybridNotificationViewManager(getContext(),this);
  mMinContractedHeight=getResources().getDimensionPixelSize(R.dimen.min_notification_layout_height);
  mNotificationContentMarginEnd=getResources().getDimensionPixelSize(com.android.internal.R.dimen.notification_content_margin_end);
  reset(true);
}

Fixed version (ground truth):
public NotificationContentView(Context context,AttributeSet attrs){
  super(context,attrs);
  mHybridViewManager=new HybridNotificationViewManager(getContext(),this);
  mMinContractedHeight=getResources().getDimensionPixelSize(R.dimen.min_notification_layout_height);
  mNotificationContentMarginEnd=getResources().getDimensionPixelSize(com.android.internal.R.dimen.notification_content_margin_end);
  reset();
}
Program: 192561
Project: 192561
Buggy source:
public void reset(boolean resetActualHeight){
  if (mContractedChild != null) {
    mContractedChild.animate().cancel();
    removeView(mContractedChild);
  }
  if (mExpandedChild != null) {
    mExpandedChild.animate().cancel();
    removeView(mExpandedChild);
  }
  if (mHeadsUpChild != null) {
    mHeadsUpChild.animate().cancel();
    removeView(mHeadsUpChild);
  }
  mContractedChild=null;
  mExpandedChild=null;
  mHeadsUpChild=null;
  mVisibleType=VISIBLE_TYPE_CONTRACTED;
  if (resetActualHeight) {
    mContentHeight=mSmallHeight;
  }
}

Fixed version (ground truth):
public void reset(){
  if (mContractedChild != null) {
    mContractedChild.animate().cancel();
    removeView(mContractedChild);
  }
  if (mExpandedChild != null) {
    mExpandedChild.animate().cancel();
    removeView(mExpandedChild);
  }
  if (mHeadsUpChild != null) {
    mHeadsUpChild.animate().cancel();
    removeView(mHeadsUpChild);
  }
  mContractedChild=null;
  mExpandedChild=null;
  mHeadsUpChild=null;
}
Program: 192562
Project: 192562
Buggy source:
/** 
 * @return one of the static enum types in this view, calculated form the current state
 */
private int calculateVisibleType(){
  if (mUserExpanding) {
    int height=!mIsChildInGroup || isGroupExpanded() || mContainingNotification.isExpanded() ? mContainingNotification.getMaxContentHeight() : mContainingNotification.getShowingLayout().getMinHeight();
    int expandedVisualType=getVisualTypeForHeight(height);
    int collapsedVisualType=getVisualTypeForHeight(mContainingNotification.getMinExpandHeight());
    return mTransformationStartVisibleType == collapsedVisualType ? expandedVisualType : collapsedVisualType;
  }
  int viewHeight=Math.min(mContentHeight,mContainingNotification.getIntrinsicHeight());
  return getVisualTypeForHeight(viewHeight);
}

Fixed version (ground truth):
/** 
 * @return one of the static enum types in this view, calculated form the current state
 */
private int calculateVisibleType(){
  if (mUserExpanding) {
    int height=!mIsChildInGroup || isGroupExpanded() || mContainingNotification.isExpanded() ? mContainingNotification.getMaxContentHeight() : mContainingNotification.getShowingLayout().getMinHeight();
    if (height == 0) {
      height=mContentHeight;
    }
    int expandedVisualType=getVisualTypeForHeight(height);
    int collapsedVisualType=getVisualTypeForHeight(mContainingNotification.getMinExpandHeight());
    return mTransformationStartVisibleType == collapsedVisualType ? expandedVisualType : collapsedVisualType;
  }
  int intrinsicHeight=mContainingNotification.getIntrinsicHeight();
  int viewHeight=mContentHeight;
  if (intrinsicHeight != 0) {
    viewHeight=Math.min(mContentHeight,intrinsicHeight);
  }
  return getVisualTypeForHeight(viewHeight);
}
Program: 192563
Project: 192563
Buggy source:
public void onNotificationUpdated(NotificationData.Entry entry){
  mStatusBarNotification=entry.notification;
  mBeforeN=entry.targetSdk < Build.VERSION_CODES.N;
  updateSingleLineView();
  applyRemoteInput(entry);
  selectLayout(false,true);
  if (mContractedChild != null) {
    mContractedWrapper.notifyContentUpdated(entry.notification);
  }
  if (mExpandedChild != null) {
    mExpandedWrapper.notifyContentUpdated(entry.notification);
  }
  if (mHeadsUpChild != null) {
    mHeadsUpWrapper.notifyContentUpdated(entry.notification);
  }
  setDark(mDark,false,0);
}

Fixed version (ground truth):
public void onNotificationUpdated(NotificationData.Entry entry){
  mStatusBarNotification=entry.notification;
  mBeforeN=entry.targetSdk < Build.VERSION_CODES.N;
  updateSingleLineView();
  applyRemoteInput(entry);
  if (mContractedChild != null) {
    mContractedWrapper.notifyContentUpdated(entry.notification);
  }
  if (mExpandedChild != null) {
    mExpandedWrapper.notifyContentUpdated(entry.notification);
  }
  if (mHeadsUpChild != null) {
    mHeadsUpWrapper.notifyContentUpdated(entry.notification);
  }
  selectLayout(false,true);
  setDark(mDark,false,0);
}
Program: 192564
Project: 192564
Buggy source:
private void animateToVisibleType(int visibleType){
  final TransformableView shownView=getTransformableViewForVisibleType(visibleType);
  final TransformableView hiddenView=getTransformableViewForVisibleType(mVisibleType);
  shownView.transformFrom(hiddenView);
  getViewForVisibleType(visibleType).setVisibility(View.VISIBLE);
  hiddenView.transformTo(shownView,new Runnable(){
    @Override public void run(){
      hiddenView.setVisible(false);
    }
  }
);
}

Fixed version (ground truth):
private void animateToVisibleType(int visibleType){
  final TransformableView shownView=getTransformableViewForVisibleType(visibleType);
  final TransformableView hiddenView=getTransformableViewForVisibleType(mVisibleType);
  if (shownView == hiddenView) {
    shownView.setVisible(true);
    return;
  }
  shownView.transformFrom(hiddenView);
  getViewForVisibleType(visibleType).setVisibility(View.VISIBLE);
  hiddenView.transformTo(shownView,new Runnable(){
    @Override public void run(){
      if (hiddenView != getTransformableViewForVisibleType(mVisibleType)) {
        hiddenView.setVisible(false);
      }
    }
  }
);
}
Program: 192565
Project: 192565
Buggy source:
public void resetHeight(){
  if (mIsHeadsUp) {
    resetActualHeight();
  }
  mMaxExpandHeight=0;
  mHeadsUpHeight=0;
  mWasReset=true;
  onHeightReset();
  requestLayout();
}

Fixed version (ground truth):
public void resetHeight(){
  mMaxExpandHeight=0;
  mHeadsUpHeight=0;
  onHeightReset();
  requestLayout();
}
Program: 192566
Project: 192566
Buggy source:
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  boolean updateExpandHeight=mMaxExpandHeight == 0 && !mWasReset;
  updateMaxHeights();
  if (updateExpandHeight) {
    applyExpansionToLayout();
  }
  mWasReset=false;
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  updateMaxHeights();
}
Program: 192567
Project: 192567
Buggy source:
/** 
 * Resets this view so it can be re-used for an updated notification.
 */
@Override public void reset(){
  super.reset();
  final boolean wasExpanded=isExpanded();
  mExpandable=false;
  mHasUserChangedExpansion=false;
  mUserLocked=false;
  mShowingPublic=false;
  mSensitive=false;
  mShowingPublicInitialized=false;
  mIsSystemExpanded=false;
  mOnKeyguard=false;
  mPublicLayout.reset(mIsHeadsUp);
  mPrivateLayout.reset(mIsHeadsUp);
  resetHeight();
  resetTranslation();
  logExpansionEvent(false,wasExpanded);
}

Fixed version (ground truth):
/** 
 * Resets this view so it can be re-used for an updated notification.
 */
@Override public void reset(){
  super.reset();
  final boolean wasExpanded=isExpanded();
  mExpandable=false;
  mHasUserChangedExpansion=false;
  mUserLocked=false;
  mShowingPublic=false;
  mSensitive=false;
  mShowingPublicInitialized=false;
  mIsSystemExpanded=false;
  mOnKeyguard=false;
  mPublicLayout.reset();
  mPrivateLayout.reset();
  resetHeight();
  resetTranslation();
  logExpansionEvent(false,wasExpanded);
}