Program: 92516
Project: 92516
Buggy source:
@SuppressLint("String_Node_Str") protected MaterialDialog(Builder builder){
  super(getTheme(builder));
  mBuilder=builder;
  if (!mBuilder.useCustomFonts) {
    if (mBuilder.mediumFont == null)     mBuilder.mediumFont=TypefaceHelper.get(getContext(),"String_Node_Str");
    if (mBuilder.regularFont == null)     mBuilder.regularFont=TypefaceHelper.get(getContext(),"String_Node_Str");
  }
  final LayoutInflater inflater=LayoutInflater.from(mBuilder.context);
  this.view=inflater.inflate(R.layout.md_dialog,null);
  this.setCancelable(builder.cancelable);
  if (mBuilder.backgroundColor == 0)   mBuilder.backgroundColor=DialogUtils.resolveColor(mBuilder.context,R.attr.md_background_color);
  if (mBuilder.backgroundColor != 0)   this.view.setBackgroundColor(mBuilder.backgroundColor);
  mBuilder.positiveColor=DialogUtils.resolveColor(mBuilder.context,R.attr.md_positive_color,mBuilder.positiveColor);
  mBuilder.neutralColor=DialogUtils.resolveColor(mBuilder.context,R.attr.md_neutral_color,mBuilder.neutralColor);
  mBuilder.negativeColor=DialogUtils.resolveColor(mBuilder.context,R.attr.md_negative_color,mBuilder.negativeColor);
  title=(TextView)view.findViewById(R.id.title);
  icon=(ImageView)view.findViewById(R.id.icon);
  titleFrame=view.findViewById(R.id.titleFrame);
  content=(TextView)view.findViewById(R.id.content);
  if (mBuilder.mIndeterminateProgress || mBuilder.mProgress > -2) {
    mBuilder.customView=inflater.inflate(mBuilder.mIndeterminateProgress ? R.layout.md_progress_dialog_indeterminate : R.layout.md_progress_dialog,(ViewGroup)this.view,false);
    mProgress=(ProgressBar)mBuilder.customView.findViewById(android.R.id.progress);
    content=(TextView)mBuilder.customView.findViewById(android.R.id.message);
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
      Drawable indDraw=mProgress.getIndeterminateDrawable();
      if (indDraw != null) {
        indDraw.setColorFilter(mBuilder.accentColor,PorterDuff.Mode.SRC_ATOP);
        mProgress.setIndeterminateDrawable(indDraw);
      }
      Drawable regDraw=mProgress.getProgressDrawable();
      if (regDraw != null) {
        regDraw.setColorFilter(mBuilder.accentColor,PorterDuff.Mode.SRC_ATOP);
        mProgress.setProgressDrawable(regDraw);
      }
    }
    if (!mBuilder.mIndeterminateProgress) {
      mProgress.setProgress(0);
      mProgress.setMax(mBuilder.mProgressMax);
      mProgressLabel=(TextView)mBuilder.customView.findViewById(R.id.label);
      mProgressLabel.setText("String_Node_Str");
    }
    int bottomPadding=(int)getContext().getResources().getDimension(R.dimen.md_dialog_frame_margin);
    int topPadding=builder.title == null ? bottomPadding : (int)getContext().getResources().getDimension(R.dimen.md_progressdialog_paddingwithtitle);
    mBuilder.customView.setPadding(mBuilder.customView.getPaddingLeft(),topPadding,mBuilder.customView.getPaddingRight(),bottomPadding);
  }
  content.setText(builder.content);
  content.setMovementMethod(new LinkMovementMethod());
  setTypeface(content,mBuilder.regularFont);
  content.setLineSpacing(0f,builder.contentLineSpacingMultiplier);
  if (mBuilder.positiveColor == 0) {
    content.setLinkTextColor(DialogUtils.resolveColor(getContext(),android.R.attr.textColorPrimary));
  }
 else {
    content.setLinkTextColor(mBuilder.positiveColor);
  }
  title.setGravity(gravityIntToGravity(builder.titleGravity));
  if (builder.contentColorSet) {
    content.setTextColor(builder.contentColor);
  }
 else {
    final int fallback=DialogUtils.resolveColor(getContext(),android.R.attr.textColorSecondary);
    final int contentColor=DialogUtils.resolveColor(getContext(),R.attr.md_content_color,fallback);
    content.setTextColor(contentColor);
  }
  if (builder.itemColorSet) {
    defaultItemColor=builder.itemColor;
  }
 else   if (builder.theme == Theme.LIGHT) {
    defaultItemColor=Color.BLACK;
  }
 else {
    defaultItemColor=Color.WHITE;
  }
  if (mBuilder.customView != null) {
    invalidateCustomViewAssociations();
    FrameLayout frame=(FrameLayout)view.findViewById(R.id.customViewFrame);
    customViewFrame=frame;
    View innerView=mBuilder.customView;
    if (mBuilder.wrapCustomViewInScroll) {
      final Resources r=getContext().getResources();
      final int framePadding=r.getDimensionPixelSize(R.dimen.md_dialog_frame_margin);
      final ScrollView sv=new ScrollView(getContext());
      int paddingTop;
      int paddingBottom;
      if (titleFrame.getVisibility() != View.GONE)       paddingTop=r.getDimensionPixelSize(R.dimen.md_content_vertical_padding);
 else       paddingTop=r.getDimensionPixelSize(R.dimen.md_dialog_frame_margin);
      if (hasActionButtons())       paddingBottom=r.getDimensionPixelSize(R.dimen.md_content_vertical_padding);
 else       paddingBottom=r.getDimensionPixelSize(R.dimen.md_dialog_frame_margin);
      sv.setPadding(0,paddingTop,0,paddingBottom);
      sv.setClipToPadding(false);
      innerView.setPadding(framePadding,0,framePadding,0);
      sv.addView(innerView,new ScrollView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT));
      innerView=sv;
    }
    frame.addView(innerView,new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT));
  }
 else {
    invalidateCustomViewAssociations();
  }
  if (mBuilder.listCallbackMulti != null)   selectedIndicesList=new ArrayList<>();
  boolean adapterProvided=mBuilder.adapter != null;
  if (mBuilder.items != null && mBuilder.items.length > 0 || adapterProvided) {
    listView=(ListView)view.findViewById(R.id.contentListView);
    listView.setSelector(getListSelector());
    if (!adapterProvided) {
      if (mBuilder.listCallbackSingle != null) {
        listType=ListType.SINGLE;
      }
 else       if (mBuilder.listCallbackMulti != null) {
        listType=ListType.MULTI;
        if (mBuilder.selectedIndices != null) {
          selectedIndicesList=new ArrayList<>(Arrays.asList(mBuilder.selectedIndices));
        }
      }
 else {
        listType=ListType.REGULAR;
      }
      mBuilder.adapter=new MaterialDialogAdapter(mBuilder.context,ListType.getLayoutForType(listType),R.id.title,mBuilder.items);
    }
  }
  if (builder.icon != null) {
    icon.setVisibility(View.VISIBLE);
    icon.setImageDrawable(builder.icon);
  }
 else {
    Drawable d=DialogUtils.resolveDrawable(mBuilder.context,R.attr.md_icon);
    if (d != null) {
      icon.setVisibility(View.VISIBLE);
      icon.setImageDrawable(d);
    }
 else {
      icon.setVisibility(View.GONE);
    }
  }
  if (builder.title == null) {
    titleFrame.setVisibility(View.GONE);
  }
 else {
    title.setText(builder.title);
    setTypeface(title,mBuilder.mediumFont);
    if (builder.titleColorSet) {
      title.setTextColor(builder.titleColor);
    }
 else {
      final int fallback=DialogUtils.resolveColor(getContext(),android.R.attr.textColorPrimary);
      title.setTextColor(DialogUtils.resolveColor(getContext(),R.attr.md_title_color,fallback));
    }
    content.setGravity(gravityIntToGravity(builder.contentGravity));
  }
  if (builder.showListener != null) {
    setOnShowListener(builder.showListener);
  }
  if (builder.cancelListener != null) {
    setOnCancelListener(builder.cancelListener);
  }
  if (builder.dismissListener != null) {
    setOnDismissListener(builder.dismissListener);
  }
  if (builder.keyListener != null) {
    setOnKeyListener(builder.keyListener);
  }
  updateFramePadding();
  invalidateActions();
  setOnShowListenerInternal();
  setViewInternal(view);
  view.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener(){
    @Override public void onGlobalLayout(){
      if (view.getMeasuredWidth() > 0) {
        invalidateCustomViewAssociations();
      }
    }
  }
);
  if (builder.theme == Theme.LIGHT && Build.VERSION.SDK_INT <= Build.VERSION_CODES.GINGERBREAD_MR1) {
    setInverseBackgroundForced(true);
    if (!builder.titleColorSet)     title.setTextColor(Color.BLACK);
    if (!builder.contentColorSet)     content.setTextColor(Color.BLACK);
  }
}

Fixed version (ground truth):
@SuppressLint("String_Node_Str") protected MaterialDialog(Builder builder){
  super(getTheme(builder));
  mBuilder=builder;
  if (!mBuilder.useCustomFonts) {
    if (mBuilder.mediumFont == null)     mBuilder.mediumFont=TypefaceHelper.get(getContext(),"String_Node_Str");
    if (mBuilder.regularFont == null)     mBuilder.regularFont=TypefaceHelper.get(getContext(),"String_Node_Str");
  }
  final LayoutInflater inflater=LayoutInflater.from(mBuilder.context);
  this.view=inflater.inflate(R.layout.md_dialog,null);
  this.setCancelable(builder.cancelable);
  if (mBuilder.backgroundColor == 0)   mBuilder.backgroundColor=DialogUtils.resolveColor(mBuilder.context,R.attr.md_background_color);
  if (mBuilder.backgroundColor != 0)   this.view.setBackgroundColor(mBuilder.backgroundColor);
  mBuilder.positiveColor=DialogUtils.resolveColor(mBuilder.context,R.attr.md_positive_color,mBuilder.positiveColor);
  mBuilder.neutralColor=DialogUtils.resolveColor(mBuilder.context,R.attr.md_neutral_color,mBuilder.neutralColor);
  mBuilder.negativeColor=DialogUtils.resolveColor(mBuilder.context,R.attr.md_negative_color,mBuilder.negativeColor);
  title=(TextView)view.findViewById(R.id.title);
  icon=(ImageView)view.findViewById(R.id.icon);
  titleFrame=view.findViewById(R.id.titleFrame);
  content=(TextView)view.findViewById(R.id.content);
  if (mBuilder.mIndeterminateProgress || mBuilder.mProgress > -2) {
    mBuilder.customView=inflater.inflate(mBuilder.mIndeterminateProgress ? R.layout.md_progress_dialog_indeterminate : R.layout.md_progress_dialog,(ViewGroup)this.view,false);
    mProgress=(ProgressBar)mBuilder.customView.findViewById(android.R.id.progress);
    content=(TextView)mBuilder.customView.findViewById(android.R.id.message);
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
      Drawable indDraw=mProgress.getIndeterminateDrawable();
      if (indDraw != null) {
        indDraw.setColorFilter(mBuilder.accentColor,PorterDuff.Mode.SRC_ATOP);
        mProgress.setIndeterminateDrawable(indDraw);
      }
      Drawable regDraw=mProgress.getProgressDrawable();
      if (regDraw != null) {
        regDraw.setColorFilter(mBuilder.accentColor,PorterDuff.Mode.SRC_ATOP);
        mProgress.setProgressDrawable(regDraw);
      }
    }
    if (!mBuilder.mIndeterminateProgress) {
      mProgress.setProgress(0);
      mProgress.setMax(mBuilder.mProgressMax);
      mProgressLabel=(TextView)mBuilder.customView.findViewById(R.id.label);
      mProgressLabel.setText("String_Node_Str");
    }
    int bottomPadding=(int)getContext().getResources().getDimension(R.dimen.md_dialog_frame_margin);
    int topPadding=builder.title == null ? bottomPadding : (int)getContext().getResources().getDimension(R.dimen.md_progressdialog_paddingwithtitle);
    mBuilder.customView.setPadding(mBuilder.customView.getPaddingLeft(),topPadding,mBuilder.customView.getPaddingRight(),bottomPadding);
  }
  content.setText(builder.content);
  content.setMovementMethod(new LinkMovementMethod());
  setTypeface(content,mBuilder.regularFont);
  content.setLineSpacing(0f,builder.contentLineSpacingMultiplier);
  if (mBuilder.positiveColor == 0) {
    content.setLinkTextColor(DialogUtils.resolveColor(getContext(),android.R.attr.textColorPrimary));
  }
 else {
    content.setLinkTextColor(mBuilder.positiveColor);
  }
  title.setGravity(gravityIntToGravity(builder.titleGravity));
  if (builder.contentColorSet) {
    content.setTextColor(builder.contentColor);
  }
 else {
    final int fallback=DialogUtils.resolveColor(getContext(),android.R.attr.textColorSecondary);
    final int contentColor=DialogUtils.resolveColor(getContext(),R.attr.md_content_color,fallback);
    content.setTextColor(contentColor);
  }
  if (builder.itemColorSet) {
    defaultItemColor=builder.itemColor;
  }
 else   if (builder.theme == Theme.LIGHT) {
    defaultItemColor=Color.BLACK;
  }
 else {
    defaultItemColor=Color.WHITE;
  }
  if (mBuilder.customView != null) {
    invalidateCustomViewAssociations();
    FrameLayout frame=(FrameLayout)view.findViewById(R.id.customViewFrame);
    customViewFrame=frame;
    View innerView=mBuilder.customView;
    if (mBuilder.wrapCustomViewInScroll) {
      final Resources r=getContext().getResources();
      final int framePadding=r.getDimensionPixelSize(R.dimen.md_dialog_frame_margin);
      final ScrollView sv=new ScrollView(getContext());
      int paddingTop;
      int paddingBottom;
      if (titleFrame.getVisibility() != View.GONE)       paddingTop=r.getDimensionPixelSize(R.dimen.md_content_vertical_padding);
 else       paddingTop=r.getDimensionPixelSize(R.dimen.md_dialog_frame_margin);
      if (hasActionButtons())       paddingBottom=r.getDimensionPixelSize(R.dimen.md_content_vertical_padding);
 else       paddingBottom=r.getDimensionPixelSize(R.dimen.md_dialog_frame_margin);
      sv.setClipToPadding(false);
      if (innerView instanceof EditText) {
        sv.setPadding(framePadding,paddingTop,framePadding,paddingBottom);
      }
 else {
        sv.setPadding(0,paddingTop,0,paddingBottom);
        innerView.setPadding(framePadding,0,framePadding,0);
      }
      sv.addView(innerView,new ScrollView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT));
      innerView=sv;
    }
    frame.addView(innerView,new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT));
  }
 else {
    invalidateCustomViewAssociations();
  }
  if (mBuilder.listCallbackMulti != null)   selectedIndicesList=new ArrayList<>();
  boolean adapterProvided=mBuilder.adapter != null;
  if (mBuilder.items != null && mBuilder.items.length > 0 || adapterProvided) {
    listView=(ListView)view.findViewById(R.id.contentListView);
    listView.setSelector(getListSelector());
    if (!adapterProvided) {
      if (mBuilder.listCallbackSingle != null) {
        listType=ListType.SINGLE;
      }
 else       if (mBuilder.listCallbackMulti != null) {
        listType=ListType.MULTI;
        if (mBuilder.selectedIndices != null) {
          selectedIndicesList=new ArrayList<>(Arrays.asList(mBuilder.selectedIndices));
        }
      }
 else {
        listType=ListType.REGULAR;
      }
      mBuilder.adapter=new MaterialDialogAdapter(mBuilder.context,ListType.getLayoutForType(listType),R.id.title,mBuilder.items);
    }
  }
  if (builder.icon != null) {
    icon.setVisibility(View.VISIBLE);
    icon.setImageDrawable(builder.icon);
  }
 else {
    Drawable d=DialogUtils.resolveDrawable(mBuilder.context,R.attr.md_icon);
    if (d != null) {
      icon.setVisibility(View.VISIBLE);
      icon.setImageDrawable(d);
    }
 else {
      icon.setVisibility(View.GONE);
    }
  }
  if (builder.title == null) {
    titleFrame.setVisibility(View.GONE);
  }
 else {
    title.setText(builder.title);
    setTypeface(title,mBuilder.mediumFont);
    if (builder.titleColorSet) {
      title.setTextColor(builder.titleColor);
    }
 else {
      final int fallback=DialogUtils.resolveColor(getContext(),android.R.attr.textColorPrimary);
      title.setTextColor(DialogUtils.resolveColor(getContext(),R.attr.md_title_color,fallback));
    }
    content.setGravity(gravityIntToGravity(builder.contentGravity));
  }
  if (builder.showListener != null) {
    setOnShowListener(builder.showListener);
  }
  if (builder.cancelListener != null) {
    setOnCancelListener(builder.cancelListener);
  }
  if (builder.dismissListener != null) {
    setOnDismissListener(builder.dismissListener);
  }
  if (builder.keyListener != null) {
    setOnKeyListener(builder.keyListener);
  }
  updateFramePadding();
  invalidateActions();
  setOnShowListenerInternal();
  setViewInternal(view);
  view.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener(){
    @Override public void onGlobalLayout(){
      if (view.getMeasuredWidth() > 0) {
        invalidateCustomViewAssociations();
      }
    }
  }
);
  if (builder.theme == Theme.LIGHT && Build.VERSION.SDK_INT <= Build.VERSION_CODES.GINGERBREAD_MR1) {
    setInverseBackgroundForced(true);
    if (!builder.titleColorSet)     title.setTextColor(Color.BLACK);
    if (!builder.contentColorSet)     content.setTextColor(Color.BLACK);
  }
}