Program: 54073
Project: 54073
Buggy source:
private void init(Context context,AttributeSet attrs){
  iconSize=getPixel(32);
  iconOuterWidth=getPixel(48);
  iconOuterHeight=getPixel(32);
  bottomSpacing=getResources().getDimensionPixelSize(R.dimen.inner_components_spacing);
  bottomEllipsisSize=getResources().getDimensionPixelSize(R.dimen.bottom_ellipsis_height);
  int[] textColorsAttrs=new int[]{android.R.attr.textColor,android.R.attr.textColorHint};
  TypedArray textColorsTypedArray=context.obtainStyledAttributes(attrs,textColorsAttrs);
  ColorStateList textColorStateList=textColorsTypedArray.getColorStateList(0);
  ColorStateList textColorHintStateList=textColorsTypedArray.getColorStateList(1);
  textColorsTypedArray.recycle();
  int defaultBaseColor;
  TypedValue baseColorTypedValue=new TypedValue();
  context.getTheme().resolveAttribute(android.R.attr.windowBackground,baseColorTypedValue,true);
  defaultBaseColor=Colors.getBaseColor(baseColorTypedValue.data);
  TypedArray typedArray=context.obtainStyledAttributes(attrs,R.styleable.MaterialEditText);
  baseColor=typedArray.getColor(R.styleable.MaterialEditText_met_baseColor,defaultBaseColor);
  setBaseColor(baseColor,textColorStateList,textColorHintStateList);
  int defaultPrimaryColor;
  TypedValue primaryColorTypedValue=new TypedValue();
  try {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
      context.getTheme().resolveAttribute(android.R.attr.colorPrimary,primaryColorTypedValue,true);
      defaultPrimaryColor=primaryColorTypedValue.data;
    }
 else {
      throw new RuntimeException("String_Node_Str");
    }
  }
 catch (  Exception e) {
    try {
      int colorPrimaryId=getResources().getIdentifier("String_Node_Str","String_Node_Str",getContext().getPackageName());
      if (colorPrimaryId != 0) {
        context.getTheme().resolveAttribute(colorPrimaryId,primaryColorTypedValue,true);
        defaultPrimaryColor=primaryColorTypedValue.data;
      }
 else {
        throw new RuntimeException("String_Node_Str");
      }
    }
 catch (    Exception e1) {
      defaultPrimaryColor=baseColor;
    }
  }
  primaryColor=typedArray.getColor(R.styleable.MaterialEditText_met_primaryColor,defaultPrimaryColor);
  setFloatingLabelInternal(typedArray.getInt(R.styleable.MaterialEditText_met_floatingLabel,0));
  errorColor=typedArray.getColor(R.styleable.MaterialEditText_met_errorColor,Color.parseColor("String_Node_Str"));
  minCharacters=typedArray.getInt(R.styleable.MaterialEditText_met_minCharacters,0);
  maxCharacters=typedArray.getInt(R.styleable.MaterialEditText_met_maxCharacters,0);
  singleLineEllipsis=typedArray.getBoolean(R.styleable.MaterialEditText_met_singleLineEllipsis,false);
  helperText=typedArray.getString(R.styleable.MaterialEditText_met_helperText);
  helperTextColor=typedArray.getColor(R.styleable.MaterialEditText_met_helperTextColor,-1);
  minBottomTextLines=typedArray.getInt(R.styleable.MaterialEditText_met_minBottomTextLines,0);
  String fontPathForAccent=typedArray.getString(R.styleable.MaterialEditText_met_accentTypeface);
  if (fontPathForAccent != null && !isInEditMode()) {
    accentTypeface=getCustomTypeface(fontPathForAccent);
    textPaint.setTypeface(accentTypeface);
  }
  String fontPathForView=typedArray.getString(R.styleable.MaterialEditText_met_typeface);
  if (fontPathForView != null && !isInEditMode()) {
    typeface=getCustomTypeface(fontPathForView);
    setTypeface(typeface);
  }
  floatingLabelText=typedArray.getString(R.styleable.MaterialEditText_met_floatingLabelText);
  if (floatingLabelText == null) {
    floatingLabelText=getHint();
  }
  floatingLabelSpacing=typedArray.getDimensionPixelSize(R.styleable.MaterialEditText_met_floatingLabelSpacing,bottomSpacing);
  floatingLabelTextSize=typedArray.getDimensionPixelSize(R.styleable.MaterialEditText_met_floatingLabelTextSize,getResources().getDimensionPixelSize(R.dimen.floating_label_text_size));
  floatingLabelTextColor=typedArray.getColor(R.styleable.MaterialEditText_met_floatingLabelTextColor,-1);
  bottomTextSize=typedArray.getDimensionPixelSize(R.styleable.MaterialEditText_met_bottomTextSize,getResources().getDimensionPixelSize(R.dimen.bottom_text_size));
  hideUnderline=typedArray.getBoolean(R.styleable.MaterialEditText_met_hideUnderline,false);
  underlineColor=typedArray.getColor(R.styleable.MaterialEditText_met_underlineColor,-1);
  autoValidate=typedArray.getBoolean(R.styleable.MaterialEditText_met_autoValidate,false);
  iconLeftBitmaps=generateIconBitmaps(typedArray.getResourceId(R.styleable.MaterialEditText_met_iconLeft,-1));
  iconRightBitmaps=generateIconBitmaps(typedArray.getResourceId(R.styleable.MaterialEditText_met_iconRight,-1));
  showClearButton=typedArray.getBoolean(R.styleable.MaterialEditText_met_clearButton,false);
  clearButtonBitmaps=generateIconBitmaps(R.drawable.met_ic_clear);
  closeButtonBitmaps=generateIconBitmaps(R.drawable.met_ic_close);
  iconPadding=typedArray.getDimensionPixelSize(R.styleable.MaterialEditText_met_iconPadding,getPixel(16));
  floatingLabelAlwaysShown=typedArray.getBoolean(R.styleable.MaterialEditText_met_floatingLabelAlwaysShown,false);
  helperTextAlwaysShown=typedArray.getBoolean(R.styleable.MaterialEditText_met_helperTextAlwaysShown,false);
  typedArray.recycle();
  int[] paddings=new int[]{android.R.attr.padding,android.R.attr.paddingLeft,android.R.attr.paddingTop,android.R.attr.paddingRight,android.R.attr.paddingBottom};
  TypedArray paddingsTypedArray=context.obtainStyledAttributes(attrs,paddings);
  int padding=paddingsTypedArray.getDimensionPixelSize(0,0);
  innerPaddingLeft=paddingsTypedArray.getDimensionPixelSize(1,padding);
  innerPaddingTop=paddingsTypedArray.getDimensionPixelSize(2,padding);
  innerPaddingRight=paddingsTypedArray.getDimensionPixelSize(3,padding);
  innerPaddingBottom=paddingsTypedArray.getDimensionPixelSize(4,padding);
  paddingsTypedArray.recycle();
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
    setBackground(null);
  }
 else {
    setBackgroundDrawable(null);
  }
  if (singleLineEllipsis) {
    TransformationMethod transformationMethod=getTransformationMethod();
    setSingleLine();
    setTransformationMethod(transformationMethod);
  }
  initMinBottomLines();
  initPadding();
  initText(textColorHintStateList);
  initFloatingLabel();
  initTextWatcher();
  checkCharactersCount();
}

Fixed version (ground truth):
private void init(Context context,AttributeSet attrs){
  iconSize=getPixel(32);
  iconOuterWidth=getPixel(48);
  iconOuterHeight=getPixel(32);
  bottomSpacing=getResources().getDimensionPixelSize(R.dimen.inner_components_spacing);
  bottomEllipsisSize=getResources().getDimensionPixelSize(R.dimen.bottom_ellipsis_height);
  int[] textColorsAttrs=new int[]{android.R.attr.textColor,android.R.attr.textColorHint};
  TypedArray textColorsTypedArray=context.obtainStyledAttributes(attrs,textColorsAttrs);
  textColorStateList=textColorsTypedArray.getColorStateList(0);
  textColorHintStateList=textColorsTypedArray.getColorStateList(1);
  textColorsTypedArray.recycle();
  int defaultBaseColor;
  TypedValue baseColorTypedValue=new TypedValue();
  context.getTheme().resolveAttribute(android.R.attr.windowBackground,baseColorTypedValue,true);
  defaultBaseColor=Colors.getBaseColor(baseColorTypedValue.data);
  TypedArray typedArray=context.obtainStyledAttributes(attrs,R.styleable.MaterialEditText);
  setBaseColor(typedArray.getColor(R.styleable.MaterialEditText_met_baseColor,defaultBaseColor));
  int defaultPrimaryColor;
  TypedValue primaryColorTypedValue=new TypedValue();
  try {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
      context.getTheme().resolveAttribute(android.R.attr.colorPrimary,primaryColorTypedValue,true);
      defaultPrimaryColor=primaryColorTypedValue.data;
    }
 else {
      throw new RuntimeException("String_Node_Str");
    }
  }
 catch (  Exception e) {
    try {
      int colorPrimaryId=getResources().getIdentifier("String_Node_Str","String_Node_Str",getContext().getPackageName());
      if (colorPrimaryId != 0) {
        context.getTheme().resolveAttribute(colorPrimaryId,primaryColorTypedValue,true);
        defaultPrimaryColor=primaryColorTypedValue.data;
      }
 else {
        throw new RuntimeException("String_Node_Str");
      }
    }
 catch (    Exception e1) {
      defaultPrimaryColor=baseColor;
    }
  }
  primaryColor=typedArray.getColor(R.styleable.MaterialEditText_met_primaryColor,defaultPrimaryColor);
  setFloatingLabelInternal(typedArray.getInt(R.styleable.MaterialEditText_met_floatingLabel,0));
  errorColor=typedArray.getColor(R.styleable.MaterialEditText_met_errorColor,Color.parseColor("String_Node_Str"));
  minCharacters=typedArray.getInt(R.styleable.MaterialEditText_met_minCharacters,0);
  maxCharacters=typedArray.getInt(R.styleable.MaterialEditText_met_maxCharacters,0);
  singleLineEllipsis=typedArray.getBoolean(R.styleable.MaterialEditText_met_singleLineEllipsis,false);
  helperText=typedArray.getString(R.styleable.MaterialEditText_met_helperText);
  helperTextColor=typedArray.getColor(R.styleable.MaterialEditText_met_helperTextColor,-1);
  minBottomTextLines=typedArray.getInt(R.styleable.MaterialEditText_met_minBottomTextLines,0);
  String fontPathForAccent=typedArray.getString(R.styleable.MaterialEditText_met_accentTypeface);
  if (fontPathForAccent != null && !isInEditMode()) {
    accentTypeface=getCustomTypeface(fontPathForAccent);
    textPaint.setTypeface(accentTypeface);
  }
  String fontPathForView=typedArray.getString(R.styleable.MaterialEditText_met_typeface);
  if (fontPathForView != null && !isInEditMode()) {
    typeface=getCustomTypeface(fontPathForView);
    setTypeface(typeface);
  }
  floatingLabelText=typedArray.getString(R.styleable.MaterialEditText_met_floatingLabelText);
  if (floatingLabelText == null) {
    floatingLabelText=getHint();
  }
  floatingLabelSpacing=typedArray.getDimensionPixelSize(R.styleable.MaterialEditText_met_floatingLabelSpacing,bottomSpacing);
  floatingLabelTextSize=typedArray.getDimensionPixelSize(R.styleable.MaterialEditText_met_floatingLabelTextSize,getResources().getDimensionPixelSize(R.dimen.floating_label_text_size));
  floatingLabelTextColor=typedArray.getColor(R.styleable.MaterialEditText_met_floatingLabelTextColor,-1);
  bottomTextSize=typedArray.getDimensionPixelSize(R.styleable.MaterialEditText_met_bottomTextSize,getResources().getDimensionPixelSize(R.dimen.bottom_text_size));
  hideUnderline=typedArray.getBoolean(R.styleable.MaterialEditText_met_hideUnderline,false);
  underlineColor=typedArray.getColor(R.styleable.MaterialEditText_met_underlineColor,-1);
  autoValidate=typedArray.getBoolean(R.styleable.MaterialEditText_met_autoValidate,false);
  iconLeftBitmaps=generateIconBitmaps(typedArray.getResourceId(R.styleable.MaterialEditText_met_iconLeft,-1));
  iconRightBitmaps=generateIconBitmaps(typedArray.getResourceId(R.styleable.MaterialEditText_met_iconRight,-1));
  showClearButton=typedArray.getBoolean(R.styleable.MaterialEditText_met_clearButton,false);
  clearButtonBitmaps=generateIconBitmaps(R.drawable.met_ic_clear);
  closeButtonBitmaps=generateIconBitmaps(R.drawable.met_ic_close);
  iconPadding=typedArray.getDimensionPixelSize(R.styleable.MaterialEditText_met_iconPadding,getPixel(16));
  floatingLabelAlwaysShown=typedArray.getBoolean(R.styleable.MaterialEditText_met_floatingLabelAlwaysShown,false);
  helperTextAlwaysShown=typedArray.getBoolean(R.styleable.MaterialEditText_met_helperTextAlwaysShown,false);
  typedArray.recycle();
  int[] paddings=new int[]{android.R.attr.padding,android.R.attr.paddingLeft,android.R.attr.paddingTop,android.R.attr.paddingRight,android.R.attr.paddingBottom};
  TypedArray paddingsTypedArray=context.obtainStyledAttributes(attrs,paddings);
  int padding=paddingsTypedArray.getDimensionPixelSize(0,0);
  innerPaddingLeft=paddingsTypedArray.getDimensionPixelSize(1,padding);
  innerPaddingTop=paddingsTypedArray.getDimensionPixelSize(2,padding);
  innerPaddingRight=paddingsTypedArray.getDimensionPixelSize(3,padding);
  innerPaddingBottom=paddingsTypedArray.getDimensionPixelSize(4,padding);
  paddingsTypedArray.recycle();
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
    setBackground(null);
  }
 else {
    setBackgroundDrawable(null);
  }
  if (singleLineEllipsis) {
    TransformationMethod transformationMethod=getTransformationMethod();
    setSingleLine();
    setTransformationMethod(transformationMethod);
  }
  initMinBottomLines();
  initPadding();
  initText();
  initFloatingLabel();
  initTextWatcher();
  checkCharactersCount();
}