Program: 92526
Project: 92526
Buggy source:
/** 
 * Invalidates the positive/neutral/negative action buttons. Decides whether they should be visible and sets their properties (such as height, text color, etc.).
 */
private 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) {
    TextView positiveTextView=(TextView)((FrameLayout)positiveButton).getChildAt(0);
    setTypeface(positiveTextView,mBuilder.mediumFont);
    positiveTextView.setText(mBuilder.positiveText);
    positiveTextView.setTextColor(getActionTextStateList(mBuilder.positiveColor));
    setBackgroundCompat(positiveButton,DialogUtils.resolveDrawable(getContext(),isStacked ? R.attr.md_selector : R.attr.md_btn_selector));
    positiveButton.setTag(POSITIVE);
    positiveButton.setOnClickListener(this);
  }
 else {
    positiveButton.setVisibility(View.GONE);
  }
  neutralButton=view.findViewById(isStacked ? R.id.buttonStackedNeutral : R.id.buttonDefaultNeutral);
  if (mBuilder.neutralText != null) {
    TextView neutralTextView=(TextView)((FrameLayout)neutralButton).getChildAt(0);
    setTypeface(neutralTextView,mBuilder.mediumFont);
    neutralButton.setVisibility(View.VISIBLE);
    neutralTextView.setTextColor(getActionTextStateList(mBuilder.neutralColor));
    setBackgroundCompat(neutralButton,DialogUtils.resolveDrawable(getContext(),isStacked ? R.attr.md_selector : R.attr.md_btn_selector));
    neutralTextView.setText(mBuilder.neutralText);
    neutralButton.setTag(NEUTRAL);
    neutralButton.setOnClickListener(this);
  }
 else {
    neutralButton.setVisibility(View.GONE);
  }
  negativeButton=view.findViewById(isStacked ? R.id.buttonStackedNegative : R.id.buttonDefaultNegative);
  if (mBuilder.negativeText != null) {
    TextView negativeTextView=(TextView)((FrameLayout)negativeButton).getChildAt(0);
    setTypeface(negativeTextView,mBuilder.mediumFont);
    negativeButton.setVisibility(View.VISIBLE);
    negativeTextView.setTextColor(getActionTextStateList(mBuilder.negativeColor));
    setBackgroundCompat(negativeButton,DialogUtils.resolveDrawable(getContext(),isStacked ? R.attr.md_selector : R.attr.md_btn_selector));
    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) {
        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_START);
        }
 else {
          params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
        }
      }
      negativeButton.setLayoutParams(params);
    }
  }
 else {
    negativeButton.setVisibility(View.GONE);
  }
  invalidateList();
  return true;
}

Fixed version (ground truth):
/** 
 * Invalidates the positive/neutral/negative action buttons. Decides whether they should be visible and sets their properties (such as height, text color, etc.).
 */
private 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) {
    TextView positiveTextView=(TextView)((FrameLayout)positiveButton).getChildAt(0);
    setTypeface(positiveTextView,mBuilder.mediumFont);
    positiveTextView.setText(mBuilder.positiveText);
    positiveTextView.setTextColor(getActionTextStateList(mBuilder.positiveColor));
    setBackgroundCompat(positiveButton,DialogUtils.resolveDrawable(getContext(),isStacked ? R.attr.md_selector : R.attr.md_btn_selector));
    positiveButton.setTag(POSITIVE);
    positiveButton.setOnClickListener(this);
  }
 else {
    positiveButton.setVisibility(View.GONE);
  }
  neutralButton=view.findViewById(isStacked ? R.id.buttonStackedNeutral : R.id.buttonDefaultNeutral);
  if (mBuilder.neutralText != null) {
    TextView neutralTextView=(TextView)((FrameLayout)neutralButton).getChildAt(0);
    setTypeface(neutralTextView,mBuilder.mediumFont);
    neutralButton.setVisibility(View.VISIBLE);
    neutralTextView.setTextColor(getActionTextStateList(mBuilder.neutralColor));
    setBackgroundCompat(neutralButton,DialogUtils.resolveDrawable(getContext(),isStacked ? R.attr.md_selector : R.attr.md_btn_selector));
    neutralTextView.setText(mBuilder.neutralText);
    neutralButton.setTag(NEUTRAL);
    neutralButton.setOnClickListener(this);
  }
 else {
    neutralButton.setVisibility(View.GONE);
  }
  negativeButton=view.findViewById(isStacked ? R.id.buttonStackedNegative : R.id.buttonDefaultNegative);
  if (mBuilder.negativeText != null) {
    TextView negativeTextView=(TextView)((FrameLayout)negativeButton).getChildAt(0);
    setTypeface(negativeTextView,mBuilder.mediumFont);
    negativeButton.setVisibility(View.VISIBLE);
    negativeTextView.setTextColor(getActionTextStateList(mBuilder.negativeColor));
    setBackgroundCompat(negativeButton,DialogUtils.resolveDrawable(getContext(),isStacked ? R.attr.md_selector : R.attr.md_btn_selector));
    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) {
        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 {
    negativeButton.setVisibility(View.GONE);
  }
  invalidateList();
  return true;
}