Program: 91022
Project: 91022
Buggy source:
@Override public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder,int position){
  if (getItemViewType(position) == BUTTON) {
    final ActionButton actionButton=buttons.get(position);
    Button button=((ButtonHolder)holder).button;
    button.setText(actionButton.text);
    button.setCompoundDrawablesWithIntrinsicBounds(actionButton.icon,0,0,0);
    if (actionButton.textColor != 0) {
      button.setTextColor(actionButton.textColor);
    }
    if (actionButton.icon != 0) {
      button.setPadding(button.getResources().getDimensionPixelSize(R.dimen.button_padding),button.getPaddingTop(),button.getPaddingRight(),button.getPaddingBottom());
    }
    button.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View view){
        if (actionButton.task != null) {
          actionButton.task.run();
        }
      }
    }
);
  }
 else {
    Paint paint=new Paint();
    float textSize=TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP,17,holder.itemView.getResources().getDisplayMetrics());
    paint.setTextSize(textSize);
    String text;
    if (position == 0) {
      text=buttons.get(1).text;
    }
 else {
      text=buttons.get(buttons.size() - 2).text;
    }
    int width=(int)paint.measureText(text);
    int paddings=(int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,58,holder.itemView.getResources().getDisplayMetrics());
    ViewGroup.LayoutParams layoutParams=holder.itemView.getLayoutParams();
    layoutParams.width=(holder.itemView.getResources().getDisplayMetrics().widthPixels - width - paddings) / 2;
  }
}

Fixed version (ground truth):
@Override public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder,int position){
  if (getItemViewType(position) == BUTTON) {
    final ActionButton actionButton=buttons.get(position);
    Button button=((ButtonHolder)holder).button;
    button.setText(actionButton.text);
    button.setCompoundDrawablesWithIntrinsicBounds(actionButton.icon,0,0,0);
    if (actionButton.textColor != 0) {
      button.setTextColor(actionButton.textColor);
    }
    if (actionButton.icon != 0) {
      button.setPadding(button.getResources().getDimensionPixelSize(R.dimen.button_padding),button.getPaddingTop(),button.getPaddingRight(),button.getPaddingBottom());
    }
 else {
      button.setPadding(button.getResources().getDimensionPixelSize(R.dimen.button_padding_large),button.getPaddingTop(),button.getPaddingRight(),button.getPaddingBottom());
    }
    button.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View view){
        if (actionButton.task != null) {
          actionButton.task.run();
        }
      }
    }
);
  }
 else {
    Paint paint=new Paint();
    float textSize=TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP,17,holder.itemView.getResources().getDisplayMetrics());
    paint.setTextSize(textSize);
    String text;
    if (position == 0) {
      text=buttons.get(1).text;
    }
 else {
      text=buttons.get(buttons.size() - 2).text;
    }
    int width=(int)paint.measureText(text);
    int paddings=(int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,58,holder.itemView.getResources().getDisplayMetrics());
    ViewGroup.LayoutParams layoutParams=holder.itemView.getLayoutParams();
    layoutParams.width=(holder.itemView.getResources().getDisplayMetrics().widthPixels - width - paddings) / 2;
  }
}