Program: 41355
Project: 41355
Buggy source:
private void initialize(Context context,AttributeSet attrs,int defStyle){
  if (isInEditMode()) {
    return;
  }
  setFocusableInTouchMode(true);
  setFocusable(true);
  ColorStateList textColor=null;
  ColorStateList hintColor=null;
  int errorColor=Color.RED;
  int textSize=SpToPixels(context,15);
  if (attrs != null) {
    TypedArray attributes=context.obtainStyledAttributes(attrs,R.styleable.TestSwipeCardEntry,defStyle,0);
    textColor=attributes.getColorStateList(R.styleable.TestSwipeCardEntry_android_textColor);
    textSize=attributes.getDimensionPixelSize(R.styleable.TestSwipeCardEntry_android_textSize,textSize);
    hintColor=attributes.getColorStateList(R.styleable.TestSwipeCardEntry_android_textColorHint);
    attributes.recycle();
  }
  if (textColor == null) {
    textColor=ColorStateList.valueOf(0xFF000000);
  }
  if (hintColor == null) {
    textColor=ColorStateList.valueOf(0xFF7F7F7F);
  }
  setOnKeyListener(new OnKeyListener(){
    @Override public boolean onKey(    View v,    int keyCode,    KeyEvent event){
      if (event.getAction() == KeyEvent.ACTION_DOWN) {
        processKeyEvent(event.getKeyCode());
      }
      return true;
    }
  }
);
  final Resources resources=getResources();
  mTextPaint=new TextPaint();
  mTextPaint.setTextSize(textSize);
  mTextPaint.setAntiAlias(true);
  mTextPaint.setColor(textColor.getDefaultColor());
  mHintPaint=new TextPaint(mTextPaint);
  mHintPaint.setColor(hintColor.getDefaultColor());
  mErrorPaint=new TextPaint(mTextPaint);
  mErrorPaint.setColor(errorColor);
  mNumber=new SpannableStringBuilder();
  mMonth=new SpannableStringBuilder();
  mYear=new SpannableStringBuilder();
  mCVC=new SpannableStringBuilder();
  mNumberFormatted=new SpannableStringBuilder();
  mExpiryFormatted=new SpannableStringBuilder();
  mAnimator=ValueAnimator.ofFloat(0.0f,0.0f);
  mAnimator.setDuration(500);
  mAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(){
    @Override public void onAnimationUpdate(    ValueAnimator animation){
      postInvalidate();
    }
  }
);
  mBitmapPaint=new Paint();
  mBitmapPaint.setStyle(Paint.Style.FILL_AND_STROKE);
  setCardType(CardType.UNKNOWN);
  mMode=Mode.NUMBER;
}

Fixed version (ground truth):
private void initialize(Context context,AttributeSet attrs,int defStyle){
  if (isInEditMode()) {
    return;
  }
  setFocusableInTouchMode(true);
  setFocusable(true);
  ColorStateList textColor=null;
  ColorStateList hintColor=null;
  int errorColor=Color.RED;
  int textSize=SpToPixels(context,15);
  if (attrs != null) {
    TypedArray attributes=context.obtainStyledAttributes(attrs,R.styleable.TestSwipeCardEntry,defStyle,0);
    textColor=attributes.getColorStateList(R.styleable.TestSwipeCardEntry_android_textColor);
    textSize=attributes.getDimensionPixelSize(R.styleable.TestSwipeCardEntry_android_textSize,textSize);
    hintColor=attributes.getColorStateList(R.styleable.TestSwipeCardEntry_android_textColorHint);
    attributes.recycle();
  }
  if (textColor == null) {
    textColor=ColorStateList.valueOf(0xFF000000);
  }
  if (hintColor == null) {
    textColor=ColorStateList.valueOf(0xFF7F7F7F);
  }
  setOnKeyListener(new OnKeyListener(){
    @Override public boolean onKey(    View v,    int keyCode,    KeyEvent event){
      if (event.getAction() == KeyEvent.ACTION_DOWN) {
        processKeyEvent(event.getKeyCode());
      }
      return true;
    }
  }
);
  final Resources resources=getResources();
  mTextPaint=new TextPaint();
  mTextPaint.setTextSize(textSize);
  mTextPaint.setAntiAlias(true);
  mTextPaint.setColor(textColor.getDefaultColor());
  mTextPaint.setTypeface(Typeface.MONOSPACE);
  mHintPaint=new TextPaint(mTextPaint);
  mHintPaint.setColor(hintColor.getDefaultColor());
  mErrorPaint=new TextPaint(mTextPaint);
  mErrorPaint.setColor(errorColor);
  mNumber=new SpannableStringBuilder();
  mMonth=new SpannableStringBuilder();
  mYear=new SpannableStringBuilder();
  mCVC=new SpannableStringBuilder();
  mNumberFormatted=new SpannableStringBuilder();
  mExpiryFormatted=new SpannableStringBuilder();
  mAnimator=ValueAnimator.ofFloat(0.0f,0.0f);
  mAnimator.setDuration(500);
  mAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(){
    @Override public void onAnimationUpdate(    ValueAnimator animation){
      postInvalidate();
    }
  }
);
  mBitmapPaint=new Paint();
  mBitmapPaint.setStyle(Paint.Style.FILL_AND_STROKE);
  setCardType(CardType.UNKNOWN);
  mMode=Mode.NUMBER;
}