Program: 162352
Project: 162352
Buggy source:
private void init(AttributeSet attrs,int defStyleAttr,int defStyleRes){
  if (attrs == null)   return;
  final Context context=getContext();
  final Resources resource=getResources();
  final float density=resource.getDisplayMetrics().density;
  final TypedArray a=context.obtainStyledAttributes(attrs,R.styleable.FloatActionButton,defStyleAttr,defStyleRes);
  ColorStateList bgColor=a.getColorStateList(R.styleable.FloatActionButton_gBackgroundColor);
  int touchColor=a.getColor(R.styleable.FloatActionButton_gTouchColor,Ui.TOUCH_PRESS_COLOR);
  boolean enabled=a.getBoolean(R.styleable.FloatActionButton_android_enabled,true);
  int shadowColor=a.getInt(R.styleable.FloatActionButton_shadowColor,0xFF000000);
  float shadowDx=a.getDimension(R.styleable.FloatActionButton_shadowDx,density * Ui.X_OFFSET);
  float shadowDy=a.getDimension(R.styleable.FloatActionButton_shadowDy,density * Ui.Y_OFFSET);
  float shadowR=a.getDimension(R.styleable.FloatActionButton_shadowRadius,(density * Ui.SHADOW_RADIUS));
  int shadowAlpha=a.getInt(R.styleable.FloatActionButton_shadowAlpha,0x20);
  float touchDurationRate=a.getFloat(R.styleable.ImageView_gTouchDurationRate,1.0f);
  int interceptEvent=a.getInt(R.styleable.FloatActionButton_gInterceptEvent,0x0001);
  a.recycle();
  setEnabled(enabled);
  if (bgColor == null) {
    bgColor=UiCompat.getColorStateList(resource,R.color.g_default_float_action_bg);
  }
  final float maxShadowOffset=Math.max(shadowDx,shadowDy);
  mShadowRadius=(int)(shadowR + 0.5);
  mShadowRadius+=maxShadowOffset;
  ShapeDrawable background=new ShapeDrawable(new OvalShadowShape(mShadowRadius,Ui.changeColorAlpha(shadowColor,0x70)));
  Paint paint=background.getPaint();
  if (!isInEditMode()) {
    paint.setShadowLayer(mShadowRadius - maxShadowOffset,shadowDx,shadowDy,Ui.changeColorAlpha(shadowColor,shadowAlpha));
  }
  UiCompat.setBackground(this,background);
  setBackgroundColor(bgColor);
  mTouchDrawable=new TouchEffectDrawable(new FloatEffect(),ColorStateList.valueOf(touchColor));
  mTouchDrawable.setCallback(this);
  mTouchDrawable.setInterceptEvent(interceptEvent);
  mTouchDrawable.setEnterDuration(touchDurationRate);
  mTouchDrawable.setExitDuration(touchDurationRate);
  setLayerType(LAYER_TYPE_SOFTWARE,paint);
  final int padding=mShadowRadius;
  setPadding(Math.max(padding,getPaddingLeft()),Math.max(padding,getPaddingTop()),Math.max(padding,getPaddingRight()),Math.max(padding,getPaddingBottom()));
}

Fixed version (ground truth):
private void init(AttributeSet attrs,int defStyleAttr,int defStyleRes){
  if (attrs == null)   return;
  final Context context=getContext();
  final Resources resource=getResources();
  final float density=resource.getDisplayMetrics().density;
  final TypedArray a=context.obtainStyledAttributes(attrs,R.styleable.FloatActionButton,defStyleAttr,defStyleRes);
  ColorStateList bgColor=a.getColorStateList(R.styleable.FloatActionButton_gBackgroundColor);
  int touchColor=a.getColor(R.styleable.FloatActionButton_gTouchColor,Ui.TOUCH_PRESS_COLOR);
  boolean enabled=a.getBoolean(R.styleable.FloatActionButton_android_enabled,true);
  int shadowColor=a.getInt(R.styleable.FloatActionButton_shadowColor,0xFF000000);
  float shadowDx=a.getDimension(R.styleable.FloatActionButton_shadowDx,density * Ui.X_OFFSET);
  float shadowDy=a.getDimension(R.styleable.FloatActionButton_shadowDy,density * Ui.Y_OFFSET);
  float shadowR=a.getDimension(R.styleable.FloatActionButton_shadowRadius,(density * Ui.SHADOW_RADIUS));
  int shadowAlpha=a.getInt(R.styleable.FloatActionButton_shadowAlpha,0x20);
  float touchDurationRate=a.getFloat(R.styleable.FloatActionButton_gTouchDurationRate,1.0f);
  int interceptEvent=a.getInt(R.styleable.FloatActionButton_gInterceptEvent,0x0001);
  a.recycle();
  setEnabled(enabled);
  if (bgColor == null) {
    bgColor=UiCompat.getColorStateList(resource,R.color.g_default_float_action_bg);
  }
  final float maxShadowOffset=Math.max(shadowDx,shadowDy);
  mShadowRadius=(int)(shadowR + 0.5);
  mShadowRadius+=maxShadowOffset;
  ShapeDrawable background=new ShapeDrawable(new OvalShadowShape(mShadowRadius,Ui.changeColorAlpha(shadowColor,0x70)));
  Paint paint=background.getPaint();
  if (!isInEditMode()) {
    paint.setShadowLayer(mShadowRadius - maxShadowOffset,shadowDx,shadowDy,Ui.changeColorAlpha(shadowColor,shadowAlpha));
  }
  UiCompat.setBackground(this,background);
  setBackgroundColor(bgColor);
  mTouchDrawable=new TouchEffectDrawable(new FloatEffect(),ColorStateList.valueOf(touchColor));
  mTouchDrawable.setCallback(this);
  mTouchDrawable.setInterceptEvent(interceptEvent);
  mTouchDrawable.setEnterDuration(touchDurationRate);
  mTouchDrawable.setExitDuration(touchDurationRate);
  setLayerType(LAYER_TYPE_SOFTWARE,paint);
  final int padding=mShadowRadius;
  setPadding(Math.max(padding,getPaddingLeft()),Math.max(padding,getPaddingTop()),Math.max(padding,getPaddingRight()),Math.max(padding,getPaddingBottom()));
}