Program: 92515
Project: 92515
Buggy source:
/** 
 * Invalidates the positive/neutral/negative action buttons. Hides the action button frames if no action buttons are visible. Updates the action button references based on whether stacking is enabled. Sets up text color, selectors, and other properties of visible action buttons. Also causes an invalidation of the dialog list.
 */
public final boolean invalidateActions(){
  if (!hasActionButtons()) {
    view.findViewById(R.id.buttonDefaultFrame).setVisibility(View.GONE);
    view.findViewById(R.id.buttonStackedFrame).setVisibility(View.GONE);
    invalidateList();
    return false;
  }
  if (isStacked) {
    view.findViewById(R.id.buttonDefaultFrame).setVisibility(View.GONE);
    view.findViewById(R.id.buttonStackedFrame).setVisibility(View.VISIBLE);
  }
 else {
    view.findViewById(R.id.buttonDefaultFrame).setVisibility(View.VISIBLE);
    view.findViewById(R.id.buttonStackedFrame).setVisibility(View.GONE);
  }
  positiveButton=view.findViewById(isStacked ? R.id.buttonStackedPositive : R.id.buttonDefaultPositive);
  if (mBuilder.positiveText != null && positiveButton.getVisibility() == View.VISIBLE) {
    TextView positiveTextView=(TextView)((FrameLayout)positiveButton).getChildAt(0);
    setTypeface(positiveTextView,mBuilder.mediumFont);
    positiveTextView.setText(mBuilder.positiveText);
    positiveTextView.setTextColor(getActionTextStateList(mBuilder.positiveColor));
    setBackgroundCompat(positiveButton,getButtonSelector(DialogAction.POSITIVE));
    positiveButton.setTag(POSITIVE);
    positiveButton.setOnClickListener(this);
    if (isStacked)     positiveTextView.setGravity(gravityIntToGravity(mBuilder.btnStackedGravity));
  }
  neutralButton=view.findViewById(isStacked ? R.id.buttonStackedNeutral : R.id.buttonDefaultNeutral);
  if (mBuilder.neutralText != null && neutralButton.getVisibility() == View.VISIBLE) {
    TextView neutralTextView=(TextView)((FrameLayout)neutralButton).getChildAt(0);
    setTypeface(neutralTextView,mBuilder.mediumFont);
    neutralTextView.setTextColor(getActionTextStateList(mBuilder.neutralColor));
    setBackgroundCompat(neutralButton,getButtonSelector(DialogAction.NEUTRAL));
    neutralTextView.setText(mBuilder.neutralText);
    neutralButton.setTag(NEUTRAL);
    neutralButton.setOnClickListener(this);
    if (isStacked)     neutralTextView.setGravity(gravityIntToGravity(mBuilder.btnStackedGravity));
  }
  negativeButton=view.findViewById(isStacked ? R.id.buttonStackedNegative : R.id.buttonDefaultNegative);
  if (mBuilder.negativeText != null && negativeButton.getVisibility() == View.VISIBLE) {
    TextView negativeTextView=(TextView)((FrameLayout)negativeButton).getChildAt(0);
    setTypeface(negativeTextView,mBuilder.mediumFont);
    negativeTextView.setTextColor(getActionTextStateList(mBuilder.negativeColor));
    setBackgroundCompat(negativeButton,getButtonSelector(DialogAction.NEGATIVE));
    negativeTextView.setText(mBuilder.negativeText);
    negativeButton.setTag(NEGATIVE);
    negativeButton.setOnClickListener(this);
    if (!isStacked) {
      RelativeLayout.LayoutParams params=new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,(int)getContext().getResources().getDimension(R.dimen.md_button_height));
      if (mBuilder.positiveText != null && positiveButton.getVisibility() == View.VISIBLE) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
          params.addRule(RelativeLayout.START_OF,R.id.buttonDefaultPositive);
        }
 else {
          params.addRule(RelativeLayout.LEFT_OF,R.id.buttonDefaultPositive);
        }
      }
 else {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
          params.addRule(RelativeLayout.ALIGN_PARENT_END);
        }
 else {
          params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
        }
      }
      negativeButton.setLayoutParams(params);
    }
 else {
      negativeTextView.setGravity(gravityIntToGravity(mBuilder.btnStackedGravity));
    }
  }
  invalidateList();
  return true;
}

Fixed version (ground truth):
/** 
 * Invalidates the positive/neutral/negative action buttons. Hides the action button frames if no action buttons are visible. Updates the action button references based on whether stacking is enabled. Sets up text color, selectors, and other properties of visible action buttons.
 */
public final boolean invalidateActions(){
  if (!hasActionButtons()) {
    view.findViewById(R.id.buttonDefaultFrame).setVisibility(View.GONE);
    view.findViewById(R.id.buttonStackedFrame).setVisibility(View.GONE);
    invalidateList();
    return false;
  }
  if (isStacked) {
    view.findViewById(R.id.buttonDefaultFrame).setVisibility(View.GONE);
    view.findViewById(R.id.buttonStackedFrame).setVisibility(View.VISIBLE);
  }
 else {
    view.findViewById(R.id.buttonDefaultFrame).setVisibility(View.VISIBLE);
    view.findViewById(R.id.buttonStackedFrame).setVisibility(View.GONE);
  }
  positiveButton=view.findViewById(isStacked ? R.id.buttonStackedPositive : R.id.buttonDefaultPositive);
  if (mBuilder.positiveText != null && positiveButton.getVisibility() == View.VISIBLE) {
    TextView positiveTextView=(TextView)((FrameLayout)positiveButton).getChildAt(0);
    setTypeface(positiveTextView,mBuilder.mediumFont);
    positiveTextView.setText(mBuilder.positiveText);
    positiveTextView.setTextColor(getActionTextStateList(mBuilder.positiveColor));
    setBackgroundCompat(positiveButton,getButtonSelector(DialogAction.POSITIVE));
    positiveButton.setTag(POSITIVE);
    positiveButton.setOnClickListener(this);
    if (isStacked)     positiveTextView.setGravity(gravityIntToGravity(mBuilder.btnStackedGravity));
  }
  neutralButton=view.findViewById(isStacked ? R.id.buttonStackedNeutral : R.id.buttonDefaultNeutral);
  if (mBuilder.neutralText != null && neutralButton.getVisibility() == View.VISIBLE) {
    TextView neutralTextView=(TextView)((FrameLayout)neutralButton).getChildAt(0);
    setTypeface(neutralTextView,mBuilder.mediumFont);
    neutralTextView.setTextColor(getActionTextStateList(mBuilder.neutralColor));
    setBackgroundCompat(neutralButton,getButtonSelector(DialogAction.NEUTRAL));
    neutralTextView.setText(mBuilder.neutralText);
    neutralButton.setTag(NEUTRAL);
    neutralButton.setOnClickListener(this);
    if (isStacked)     neutralTextView.setGravity(gravityIntToGravity(mBuilder.btnStackedGravity));
  }
  negativeButton=view.findViewById(isStacked ? R.id.buttonStackedNegative : R.id.buttonDefaultNegative);
  if (mBuilder.negativeText != null && negativeButton.getVisibility() == View.VISIBLE) {
    TextView negativeTextView=(TextView)((FrameLayout)negativeButton).getChildAt(0);
    setTypeface(negativeTextView,mBuilder.mediumFont);
    negativeTextView.setTextColor(getActionTextStateList(mBuilder.negativeColor));
    setBackgroundCompat(negativeButton,getButtonSelector(DialogAction.NEGATIVE));
    negativeTextView.setText(mBuilder.negativeText);
    negativeButton.setTag(NEGATIVE);
    negativeButton.setOnClickListener(this);
    if (!isStacked) {
      RelativeLayout.LayoutParams params=new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,(int)getContext().getResources().getDimension(R.dimen.md_button_height));
      if (mBuilder.positiveText != null && positiveButton.getVisibility() == View.VISIBLE) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
          params.addRule(RelativeLayout.START_OF,R.id.buttonDefaultPositive);
        }
 else {
          params.addRule(RelativeLayout.LEFT_OF,R.id.buttonDefaultPositive);
        }
      }
 else {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
          params.addRule(RelativeLayout.ALIGN_PARENT_END);
        }
 else {
          params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
        }
      }
      negativeButton.setLayoutParams(params);
    }
 else {
      negativeTextView.setGravity(gravityIntToGravity(mBuilder.btnStackedGravity));
    }
  }
  return true;
}