Buggy code:
public class SimpleDialog extends Dialog { private TextView mMessage ; private SimpleDialog . InternalScrollView mScrollView ; private SimpleDialog . InternalListView mListView ; private SimpleDialog . InternalAdapter mAdapter ; private int mMessageTextAppearanceId ; private int mMessageTextColor ; private int mRadioButtonStyle ; private int mCheckBoxStyle ; private int mItemHeight ; private int mItemTextAppearance ; private int mMode ; private static final int MODE_NONE = 0 ; private static final int MODE_MESSAGE = 1 ; private static final int MODE_ITEMS = 2 ; private static final int MODE_MULTI_ITEMS = 3 ; public SimpleDialog ( Context context ) { } public SimpleDialog ( Context context , int style ) { } @ Override public Dialog applyStyle ( int resId ) { } @ Override public Dialog clearContent ( ) { } public Dialog message ( CharSequence message ) { } public Dialog message ( int id ) { } public Dialog messageTextAppearance ( int resId ) { } public Dialog messageTextColor ( int color ) { } public Dialog radioButtonStyle ( int resId ) { } public Dialog checkBoxStyle ( int resId ) { } public Dialog itemHeight ( int height ) { } public Dialog itemTextAppearance ( int resId ) { } private void initListView ( ) { } public Dialog items ( CharSequence [ ] items , int selectedIndex ) { } public Dialog multiChoiceItems ( CharSequence [ ] items , int ... selectedIndexes ) { } public int [ ] getSelectedIndexes ( ) { } public int getSelectedIndex ( ) { } private class InternalScrollView extends ScrollView { public InternalScrollView ( Context context ) { } @ Override protected void onLayout ( boolean changed , int l , int t , int r , int b ) { } } private class InternalListView extends ListView { public InternalListView ( Context context ) { } @ Override protected void onMeasure ( int widthMeasureSpec , int heightMeasureSpec ) { int heightMode = MeasureSpec . getMode ( heightMeasureSpec ) ; if ( heightMode == ( MeasureSpec . UNSPECIFIED ) ) { if ( ( mItemHeight ) != ( LayoutParams . WRAP_CONTENT ) ) <START_BUG> heightMeasureSpec = MeasureSpec . makeMeasureSpec ( ( ( mItemHeight ) * ( getAdapter ( ) . getCount ( ) ) ) , EXACTLY ) ; <END_BUG> } super . onMeasure ( widthMeasureSpec , heightMeasureSpec ) ; } @ Override protected void onLayout ( boolean changed , int l , int t , int r , int b ) { } } private class InternalAdapter extends BaseAdapter implements CompoundButton . OnCheckedChangeListener { private CharSequence [ ] mItems ; private boolean [ ] mSelected ; private int mLastSelectedIndex ; public void setItems ( CharSequence [ ] items , int ... selectedIndexes ) { } public int getLastSelectedIndex ( ) { } public int [ ] getSelectedIndexes ( ) { } @ Override public int getCount ( ) { } @ Override public Object getItem ( int position ) { } @ Override public long getItemId ( int position ) { } @ Override public View getView ( int position , View convertView , ViewGroup parent ) { } @ Override public void onCheckedChanged ( android . widget . CompoundButton v , boolean isChecked ) { } } }

Fix:
heightMeasureSpec = MeasureSpec . makeMeasureSpec ( ( ( ( ( mItemHeight ) * ( getAdapter ( ) . getCount ( ) ) ) + ( getPaddingTop ( ) ) ) + ( getPaddingBottom ( ) ) ) , EXACTLY ) ;