Program: 92508
Project: 92508
Buggy source:
@Override public void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int width=MeasureSpec.getSize(widthMeasureSpec);
  int height=MeasureSpec.getSize(heightMeasureSpec);
  mUseFullPadding=true;
  boolean hasButtons=false;
  final boolean stacked;
  if (!mForceStack) {
    int buttonsWidth=0;
    for (    MDButton button : mButtons) {
      if (button != null && button.getVisibility() != View.GONE) {
        button.setStacked(false,false);
        measureChild(button,widthMeasureSpec,heightMeasureSpec);
        buttonsWidth+=button.getMeasuredWidth();
        hasButtons=true;
      }
    }
    int buttonBarPadding=getContext().getResources().getDimensionPixelSize(R.dimen.md_neutral_button_margin);
    final int buttonFrameWidth=width - 2 * buttonBarPadding;
    stacked=buttonsWidth > buttonFrameWidth;
  }
 else {
    stacked=true;
  }
  int stackedHeight=0;
  mIsStacked=stacked;
  if (stacked) {
    for (    MDButton button : mButtons) {
      if (button != null && button.getVisibility() != View.GONE) {
        button.setStacked(true,false);
        measureChild(button,widthMeasureSpec,heightMeasureSpec);
        stackedHeight+=button.getMeasuredHeight();
        hasButtons=true;
      }
    }
  }
  int availableHeight=height;
  int fullPadding=0;
  int minPadding=0;
  if (hasButtons) {
    if (mIsStacked) {
      availableHeight-=stackedHeight;
      fullPadding+=2 * mButtonPaddingFull;
      minPadding+=2 * mButtonPaddingFull;
    }
 else {
      availableHeight-=mButtonBarHeight;
      fullPadding+=2 * mButtonPaddingFull;
    }
  }
 else {
    fullPadding+=2 * mButtonPaddingFull;
  }
  if (isVisible(mTitleBar)) {
    mTitleBar.measure(MeasureSpec.makeMeasureSpec(width,MeasureSpec.EXACTLY),MeasureSpec.UNSPECIFIED);
    availableHeight-=mTitleBar.getMeasuredHeight();
  }
 else {
    fullPadding+=mNoTitlePaddingFull;
  }
  if (isVisible(mContent)) {
    mContent.measure(MeasureSpec.makeMeasureSpec(width,MeasureSpec.EXACTLY),MeasureSpec.makeMeasureSpec(availableHeight - minPadding,MeasureSpec.AT_MOST));
    if (mContent.getMeasuredHeight() <= availableHeight - fullPadding) {
      if (!mReducePaddingNoTitleNoButtons || isVisible(mTitleBar) || hasButtons) {
        mUseFullPadding=true;
        availableHeight-=mContent.getMeasuredHeight() + fullPadding;
      }
 else {
        mUseFullPadding=false;
        availableHeight-=mContent.getMeasuredHeight() + minPadding;
      }
    }
 else {
      mUseFullPadding=false;
      availableHeight=0;
      setScrollListenerForDividersVisibility(mContent);
    }
  }
  setMeasuredDimension(width,height - availableHeight);
}

Fixed version (ground truth):
@Override public void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int width=MeasureSpec.getSize(widthMeasureSpec);
  int height=MeasureSpec.getSize(heightMeasureSpec);
  mUseFullPadding=true;
  boolean hasButtons=false;
  final boolean stacked;
  if (!mForceStack) {
    int buttonsWidth=0;
    for (    MDButton button : mButtons) {
      if (button != null && button.getVisibility() != View.GONE) {
        button.setStacked(false,false);
        measureChild(button,widthMeasureSpec,heightMeasureSpec);
        buttonsWidth+=button.getMeasuredWidth();
        hasButtons=true;
      }
    }
    int buttonBarPadding=getContext().getResources().getDimensionPixelSize(R.dimen.md_neutral_button_margin);
    final int buttonFrameWidth=width - 2 * buttonBarPadding;
    stacked=buttonsWidth > buttonFrameWidth;
  }
 else {
    stacked=true;
  }
  int stackedHeight=0;
  mIsStacked=stacked;
  if (stacked) {
    for (    MDButton button : mButtons) {
      if (button != null && button.getVisibility() != View.GONE) {
        button.setStacked(true,false);
        measureChild(button,widthMeasureSpec,heightMeasureSpec);
        stackedHeight+=button.getMeasuredHeight();
        hasButtons=true;
      }
    }
  }
  int availableHeight=height;
  int fullPadding=0;
  int minPadding=0;
  if (hasButtons) {
    if (mIsStacked) {
      availableHeight-=stackedHeight;
      fullPadding+=2 * mButtonPaddingFull;
      minPadding+=2 * mButtonPaddingFull;
    }
 else {
      availableHeight-=mButtonBarHeight;
      fullPadding+=2 * mButtonPaddingFull;
    }
  }
 else {
    fullPadding+=2 * mButtonPaddingFull;
  }
  if (isVisible(mTitleBar)) {
    mTitleBar.measure(MeasureSpec.makeMeasureSpec(width,MeasureSpec.EXACTLY),MeasureSpec.UNSPECIFIED);
    availableHeight-=mTitleBar.getMeasuredHeight();
  }
 else {
    fullPadding+=mNoTitlePaddingFull;
  }
  if (isVisible(mContent)) {
    mContent.measure(MeasureSpec.makeMeasureSpec(width,MeasureSpec.EXACTLY),MeasureSpec.makeMeasureSpec(availableHeight - minPadding,MeasureSpec.AT_MOST));
    if (mContent.getMeasuredHeight() <= availableHeight - fullPadding) {
      if (!mReducePaddingNoTitleNoButtons || isVisible(mTitleBar) || hasButtons) {
        mUseFullPadding=true;
        availableHeight-=mContent.getMeasuredHeight() + fullPadding;
      }
 else {
        mUseFullPadding=false;
        availableHeight-=mContent.getMeasuredHeight() + minPadding;
      }
    }
 else {
      mUseFullPadding=false;
      availableHeight=0;
    }
  }
  setMeasuredDimension(width,height - availableHeight);
}