Program: 88815
Project: 88815
Buggy source:
public CarouselViewPager(Context context,AttributeSet attrs){
  super(context,attrs);
  mConfig=CarouselConfig.getInstance();
  mConfig.pagerId=getId();
  mResources=context.getResources();
  DisplayMetrics dm=mResources.getDisplayMetrics();
  TypedArray a=context.obtainStyledAttributes(attrs,R.styleable.CarouselViewPager);
  try {
    if (a != null) {
      mConfig.orientation=a.getInt(R.styleable.CarouselViewPager_android_orientation,CarouselConfig.HORIZONTAL);
      mConfig.infinite=a.getBoolean(R.styleable.CarouselViewPager_infinite,true);
      mConfig.scrollScalingMode=a.getInt(R.styleable.CarouselViewPager_scrollScalingMode,CarouselConfig.SCROLL_MODE_BIG_CURRENT);
      float bigScale=a.getFloat(R.styleable.CarouselViewPager_bigScale,CarouselConfig.DEFAULT_BIG_SCALE);
      if (bigScale > 1.0f || bigScale < 0.0f) {
        bigScale=CarouselConfig.DEFAULT_BIG_SCALE;
        Log.w(TAG,"String_Node_Str" + CarouselConfig.DEFAULT_BIG_SCALE + "String_Node_Str");
      }
      mConfig.bigScale=bigScale;
      float smallScale=a.getFloat(R.styleable.CarouselViewPager_smallScale,CarouselConfig.DEFAULT_SMALL_SCALE);
      if (smallScale > 1.0f || smallScale < 0.0f) {
        smallScale=CarouselConfig.DEFAULT_SMALL_SCALE;
        Log.w(TAG,"String_Node_Str" + CarouselConfig.DEFAULT_SMALL_SCALE + "String_Node_Str");
      }
 else       if (smallScale > bigScale) {
        smallScale=bigScale;
        Log.w(TAG,"String_Node_Str" + bigScale + "String_Node_Str");
      }
      mConfig.smallScale=smallScale;
      mMinPagesOffset=(int)a.getDimension(R.styleable.CarouselViewPager_minPagesOffset,TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,20,dm));
      mSidePagesVisiblePart=a.getFloat(R.styleable.CarouselViewPager_sidePagesVisiblePart,DEFAULT_SIDE_PAGES_VISIBLE_PART);
    }
  }
  finally {
    if (a != null) {
      a.recycle();
    }
  }
  mGestureListener=new SimpleOnGestureListener(){
    @Override public boolean onSingleTapConfirmed(    MotionEvent e){
      if (getCarouselAdapter() != null) {
        getCarouselAdapter().sendSingleTap(mTouchedView,mTouchedItem);
      }
      dispatchTouchEvent(e);
      mTouchedView=null;
      mTouchedItem=null;
      return true;
    }
    @Override public boolean onDoubleTap(    MotionEvent e){
      if (getCarouselAdapter() != null) {
        getCarouselAdapter().sendDoubleTap(mTouchedView,mTouchedItem);
      }
      dispatchTouchEvent(e);
      mTouchedView=null;
      mTouchedItem=null;
      return true;
    }
  }
;
  mGestureDetector=new GestureDetector(context,mGestureListener);
}

Fixed version (ground truth):
public CarouselViewPager(Context context,AttributeSet attrs){
  super(context,attrs);
  mConfig=CarouselConfig.getInstance();
  mConfig.pagerId=getId();
  mResources=context.getResources();
  DisplayMetrics dm=mResources.getDisplayMetrics();
  TypedArray a=context.obtainStyledAttributes(attrs,R.styleable.CarouselViewPager);
  try {
    if (a != null) {
      mConfig.orientation=a.getInt(R.styleable.CarouselViewPager_android_orientation,CarouselConfig.HORIZONTAL);
      mConfig.infinite=a.getBoolean(R.styleable.CarouselViewPager_infinite,true);
      mConfig.scrollScalingMode=a.getInt(R.styleable.CarouselViewPager_scrollScalingMode,CarouselConfig.SCROLL_MODE_BIG_CURRENT);
      float bigScale=a.getFloat(R.styleable.CarouselViewPager_bigScale,CarouselConfig.DEFAULT_BIG_SCALE);
      if (bigScale > 1.0f || bigScale < 0.0f) {
        bigScale=CarouselConfig.DEFAULT_BIG_SCALE;
        Log.w(TAG,"String_Node_Str" + CarouselConfig.DEFAULT_BIG_SCALE + "String_Node_Str");
      }
      mConfig.bigScale=bigScale;
      float smallScale=a.getFloat(R.styleable.CarouselViewPager_smallScale,CarouselConfig.DEFAULT_SMALL_SCALE);
      if (smallScale > 1.0f || smallScale < 0.0f) {
        smallScale=CarouselConfig.DEFAULT_SMALL_SCALE;
        Log.w(TAG,"String_Node_Str" + CarouselConfig.DEFAULT_SMALL_SCALE + "String_Node_Str");
      }
 else       if (smallScale > bigScale) {
        smallScale=bigScale;
        Log.w(TAG,"String_Node_Str" + bigScale + "String_Node_Str");
      }
      mConfig.smallScale=smallScale;
      mMinPagesOffset=(int)a.getDimension(R.styleable.CarouselViewPager_minPagesOffset,TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,20,dm));
      mSidePagesVisiblePart=a.getFloat(R.styleable.CarouselViewPager_sidePagesVisiblePart,DEFAULT_SIDE_PAGES_VISIBLE_PART);
    }
  }
  finally {
    if (a != null) {
      a.recycle();
    }
  }
  mGestureListener=new SimpleOnGestureListener(){
    @Override public boolean onSingleTapConfirmed(    MotionEvent e){
      if (getCarouselAdapter() != null) {
        getCarouselAdapter().sendSingleTap(mTouchedView,mTouchedItem);
      }
      mTouchedView=null;
      mTouchedItem=null;
      return true;
    }
    @Override public boolean onDoubleTap(    MotionEvent e){
      if (getCarouselAdapter() != null) {
        getCarouselAdapter().sendDoubleTap(mTouchedView,mTouchedItem);
      }
      mTouchedView=null;
      mTouchedItem=null;
      return true;
    }
  }
;
  mGestureDetector=new GestureDetector(context,mGestureListener);
}