Program: 25489
Project: 25489
Buggy source:
public SlidingUpPanelLayout(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  if (isInEditMode()) {
    mShadowDrawable=null;
    mDragHelper=null;
    return;
  }
  Interpolator scrollerInterpolator=null;
  if (attrs != null) {
    TypedArray defAttrs=context.obtainStyledAttributes(attrs,DEFAULT_ATTRS);
    if (defAttrs != null) {
      int gravity=defAttrs.getInt(0,Gravity.NO_GRAVITY);
      setGravity(gravity);
    }
    defAttrs.recycle();
    TypedArray ta=context.obtainStyledAttributes(attrs,R.styleable.SlidingUpPanelLayout);
    if (ta != null) {
      mPanelHeight=ta.getDimensionPixelSize(R.styleable.SlidingUpPanelLayout_umanoPanelHeight,-1);
      mShadowHeight=ta.getDimensionPixelSize(R.styleable.SlidingUpPanelLayout_umanoShadowHeight,-1);
      mParallaxOffset=ta.getDimensionPixelSize(R.styleable.SlidingUpPanelLayout_umanoParallaxOffset,-1);
      mMinFlingVelocity=ta.getInt(R.styleable.SlidingUpPanelLayout_umanoFlingVelocity,DEFAULT_MIN_FLING_VELOCITY);
      mCoveredFadeColor=ta.getColor(R.styleable.SlidingUpPanelLayout_umanoFadeColor,DEFAULT_FADE_COLOR);
      mDragViewResId=ta.getResourceId(R.styleable.SlidingUpPanelLayout_umanoDragView,-1);
      mScrollableViewResId=ta.getResourceId(R.styleable.SlidingUpPanelLayout_umanoScrollableView,-1);
      mOverlayContent=ta.getBoolean(R.styleable.SlidingUpPanelLayout_umanoOverlay,DEFAULT_OVERLAY_FLAG);
      mClipPanel=ta.getBoolean(R.styleable.SlidingUpPanelLayout_umanoClipPanel,DEFAULT_CLIP_PANEL_FLAG);
      mAnchorPoint=ta.getFloat(R.styleable.SlidingUpPanelLayout_umanoAnchorPoint,DEFAULT_ANCHOR_POINT);
      mSlideState=PanelState.values()[ta.getInt(R.styleable.SlidingUpPanelLayout_umanoInitialState,DEFAULT_SLIDE_STATE.ordinal())];
      int interpolatorResId=ta.getResourceId(R.styleable.SlidingUpPanelLayout_umanoScrollInterpolator,-1);
      if (interpolatorResId != -1) {
        scrollerInterpolator=AnimationUtils.loadInterpolator(context,interpolatorResId);
      }
    }
    ta.recycle();
  }
  final float density=context.getResources().getDisplayMetrics().density;
  if (mPanelHeight == -1) {
    mPanelHeight=(int)(DEFAULT_PANEL_HEIGHT * density + 0.5f);
  }
  if (mShadowHeight == -1) {
    mShadowHeight=(int)(DEFAULT_SHADOW_HEIGHT * density + 0.5f);
  }
  if (mParallaxOffset == -1) {
    mParallaxOffset=(int)(DEFAULT_PARALLAX_OFFSET * density);
  }
  if (mShadowHeight > 0) {
    if (mIsSlidingUp) {
      mShadowDrawable=getResources().getDrawable(R.drawable.above_shadow);
    }
 else {
      mShadowDrawable=getResources().getDrawable(R.drawable.below_shadow);
    }
  }
 else {
    mShadowDrawable=null;
  }
  setWillNotDraw(false);
  mDragHelper=ViewDragHelper.create(this,0.5f,scrollerInterpolator,new DragHelperCallback());
  mDragHelper.setMinVelocity(mMinFlingVelocity * density);
  mIsTouchEnabled=true;
}

Fixed version (ground truth):
public SlidingUpPanelLayout(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  if (isInEditMode()) {
    mShadowDrawable=null;
    mDragHelper=null;
    return;
  }
  Interpolator scrollerInterpolator=null;
  if (attrs != null) {
    TypedArray defAttrs=context.obtainStyledAttributes(attrs,DEFAULT_ATTRS);
    if (defAttrs != null) {
      int gravity=defAttrs.getInt(0,Gravity.NO_GRAVITY);
      setGravity(gravity);
      defAttrs.recycle();
    }
    TypedArray ta=context.obtainStyledAttributes(attrs,R.styleable.SlidingUpPanelLayout);
    if (ta != null) {
      mPanelHeight=ta.getDimensionPixelSize(R.styleable.SlidingUpPanelLayout_umanoPanelHeight,-1);
      mShadowHeight=ta.getDimensionPixelSize(R.styleable.SlidingUpPanelLayout_umanoShadowHeight,-1);
      mParallaxOffset=ta.getDimensionPixelSize(R.styleable.SlidingUpPanelLayout_umanoParallaxOffset,-1);
      mMinFlingVelocity=ta.getInt(R.styleable.SlidingUpPanelLayout_umanoFlingVelocity,DEFAULT_MIN_FLING_VELOCITY);
      mCoveredFadeColor=ta.getColor(R.styleable.SlidingUpPanelLayout_umanoFadeColor,DEFAULT_FADE_COLOR);
      mDragViewResId=ta.getResourceId(R.styleable.SlidingUpPanelLayout_umanoDragView,-1);
      mScrollableViewResId=ta.getResourceId(R.styleable.SlidingUpPanelLayout_umanoScrollableView,-1);
      mOverlayContent=ta.getBoolean(R.styleable.SlidingUpPanelLayout_umanoOverlay,DEFAULT_OVERLAY_FLAG);
      mClipPanel=ta.getBoolean(R.styleable.SlidingUpPanelLayout_umanoClipPanel,DEFAULT_CLIP_PANEL_FLAG);
      mAnchorPoint=ta.getFloat(R.styleable.SlidingUpPanelLayout_umanoAnchorPoint,DEFAULT_ANCHOR_POINT);
      mSlideState=PanelState.values()[ta.getInt(R.styleable.SlidingUpPanelLayout_umanoInitialState,DEFAULT_SLIDE_STATE.ordinal())];
      int interpolatorResId=ta.getResourceId(R.styleable.SlidingUpPanelLayout_umanoScrollInterpolator,-1);
      if (interpolatorResId != -1) {
        scrollerInterpolator=AnimationUtils.loadInterpolator(context,interpolatorResId);
      }
      ta.recycle();
    }
  }
  final float density=context.getResources().getDisplayMetrics().density;
  if (mPanelHeight == -1) {
    mPanelHeight=(int)(DEFAULT_PANEL_HEIGHT * density + 0.5f);
  }
  if (mShadowHeight == -1) {
    mShadowHeight=(int)(DEFAULT_SHADOW_HEIGHT * density + 0.5f);
  }
  if (mParallaxOffset == -1) {
    mParallaxOffset=(int)(DEFAULT_PARALLAX_OFFSET * density);
  }
  if (mShadowHeight > 0) {
    if (mIsSlidingUp) {
      mShadowDrawable=getResources().getDrawable(R.drawable.above_shadow);
    }
 else {
      mShadowDrawable=getResources().getDrawable(R.drawable.below_shadow);
    }
  }
 else {
    mShadowDrawable=null;
  }
  setWillNotDraw(false);
  mDragHelper=ViewDragHelper.create(this,0.5f,scrollerInterpolator,new DragHelperCallback());
  mDragHelper.setMinVelocity(mMinFlingVelocity * density);
  mIsTouchEnabled=true;
}