Program: 88845
Project: 88845
Buggy source:
private void setUpButtons(){
  final Button xClose=(Button)container.findViewById(R.id.xClose);
  xClose.setTransformationMethod(null);
  LinearLayout ctasContainer=(LinearLayout)container.findViewById(R.id.modal_buttons_container);
  LinearLayout.LayoutParams layout_params=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  layout_params.setMargins(px(),px(),px(),px());
  ctasContainer.setLayoutParams(layout_params);
  LinearLayout.LayoutParams params=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  params.weight=1.0f;
  params.width=0;
  params.height=Math.round(mViewMessage.getTextSize() * 2.66F);
  params.setMargins(Math.round(mViewMessage.getTextSize() * 0.66F),Math.round(mViewMessage.getTextSize() * 0.66F),Math.round(mViewMessage.getTextSize() * 0.66F),Math.round(mViewMessage.getTextSize() * 0.66F));
  Typeface boldLato=Typeface.createFromAsset(mContext.getAssets(),"String_Node_Str");
  for (  final LQInAppMessage.Cta cta : mModalModel.getCtas()) {
    final Button ctaBtn=new Button(mContext);
    ctaBtn.setBackgroundResource(R.drawable.buttonshape);
    ctaBtn.setLayoutParams(params);
    ctaBtn.setTypeface(boldLato);
    ctaBtn.setTransformationMethod(null);
    if (cta.getButtonText().length() > 14)     ctaBtn.setText(cta.getButtonText().substring(0,14));
 else     ctaBtn.setText(cta.getButtonText());
    ctaBtn.setTextSize(TypedValue.COMPLEX_UNIT_PX,getButtonTextSize());
    ctaBtn.getBackground().setColorFilter(Color.parseColor(cta.getButtonColor()),PorterDuff.Mode.SRC_IN);
    ctaBtn.setTextColor(Color.parseColor(cta.getButtonTextColor()));
    if (Build.VERSION.SDK_INT > 15) {
      ctaBtn.setOnTouchListener(new View.OnTouchListener(){
        Rect mRect;
        @Override public boolean onTouch(        View v,        MotionEvent event){
          if (event.getAction() == MotionEvent.ACTION_DOWN) {
            mRect=new Rect(ctaBtn.getLeft(),ctaBtn.getTop(),ctaBtn.getRight(),ctaBtn.getBottom());
            ViewHelper.setAlpha(ctaBtn,0.7F);
          }
          if (event.getAction() == MotionEvent.ACTION_UP) {
            ViewHelper.setAlpha(ctaBtn,1);
          }
          if (event.getAction() == MotionEvent.ACTION_MOVE && !mRect.contains(ctaBtn.getLeft() + (int)event.getX(),ctaBtn.getTop() + (int)event.getY())) {
            ViewHelper.setAlpha(ctaBtn,1);
          }
          return false;
        }
      }
);
    }
    ctaBtn.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        Intent mIntent=new Intent(Intent.ACTION_VIEW);
        if (cta.getDeepLink() != null) {
          try {
            mIntent.setData(Uri.parse(cta.getDeepLink()));
            Liquid.getInstance().trackCta(cta);
            mContext.startActivity(mIntent);
          }
 catch (          Exception e) {
            LQLog.infoVerbose("String_Node_Str");
          }
        }
        mPopupWindow.dismiss();
      }
    }
);
    ctasContainer.addView(ctaBtn);
  }
  xClose.setTextColor(Color.parseColor(mModalModel.getTitleColor()));
  xClose.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      Liquid.getInstance().trackDismiss(mModalModel);
      mPopupWindow.dismiss();
    }
  }
);
}

Fixed version (ground truth):
private void setUpButtons(){
  final Button xClose=(Button)container.findViewById(R.id.xClose);
  xClose.setTransformationMethod(null);
  LinearLayout ctasContainer=(LinearLayout)container.findViewById(R.id.modal_buttons_container);
  LinearLayout.LayoutParams layout_params=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  layout_params.setMargins(px(),px(),px(),px());
  ctasContainer.setLayoutParams(layout_params);
  LinearLayout.LayoutParams params=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  params.weight=1.0f;
  params.width=0;
  params.height=Math.round(mViewMessage.getTextSize() * 2.66F);
  params.setMargins(Math.round(mViewMessage.getTextSize() * 0.66F),Math.round(mViewMessage.getTextSize() * 0.66F),Math.round(mViewMessage.getTextSize() * 0.66F),Math.round(mViewMessage.getTextSize() * 0.66F));
  Typeface boldLato=Typeface.createFromAsset(mContext.getAssets(),"String_Node_Str");
  for (  final LQInAppMessage.Cta cta : mModalModel.getCtas()) {
    final Button ctaBtn=new Button(mContext);
    ctaBtn.setBackgroundResource(R.drawable.buttonshape);
    ctaBtn.setLayoutParams(params);
    ctaBtn.setTypeface(boldLato);
    ctaBtn.setTransformationMethod(null);
    if (cta.getButtonText().length() > 14)     ctaBtn.setText(cta.getButtonText().substring(0,14));
 else     ctaBtn.setText(cta.getButtonText());
    ctaBtn.setTextSize(TypedValue.COMPLEX_UNIT_PX,getButtonTextSize());
    ctaBtn.getBackground().setColorFilter(Color.parseColor(cta.getButtonColor()),PorterDuff.Mode.SRC_IN);
    ctaBtn.setTextColor(Color.parseColor(cta.getButtonTextColor()));
    if (Build.VERSION.SDK_INT > 15) {
      ctaBtn.setOnTouchListener(new View.OnTouchListener(){
        Rect mRect;
        @Override public boolean onTouch(        View v,        MotionEvent event){
          if (event.getAction() == MotionEvent.ACTION_DOWN) {
            mRect=new Rect(ctaBtn.getLeft(),ctaBtn.getTop(),ctaBtn.getRight(),ctaBtn.getBottom());
            ViewHelper.setAlpha(ctaBtn,0.7F);
          }
          if (event.getAction() == MotionEvent.ACTION_UP) {
            ViewHelper.setAlpha(ctaBtn,1);
          }
          if (event.getAction() == MotionEvent.ACTION_MOVE && !mRect.contains(ctaBtn.getLeft() + (int)event.getX(),ctaBtn.getTop() + (int)event.getY())) {
            ViewHelper.setAlpha(ctaBtn,1);
          }
          return false;
        }
      }
);
    }
    ctaBtn.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        Intent mIntent=new Intent(Intent.ACTION_VIEW);
        if (cta.getDeepLink() != null) {
          try {
            mIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            mIntent.setData(Uri.parse(cta.getDeepLink()));
            Liquid.getInstance().trackCta(cta);
            mContext.startActivity(mIntent);
          }
 catch (          Exception e) {
            LQLog.infoVerbose("String_Node_Str");
          }
        }
        mPopupWindow.dismiss();
      }
    }
);
    ctasContainer.addView(ctaBtn);
  }
  xClose.setTextColor(Color.parseColor(mModalModel.getTitleColor()));
  xClose.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      Liquid.getInstance().trackDismiss(mModalModel);
      mPopupWindow.dismiss();
    }
  }
);
}