Program: 187224
Project: 187224
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(layout,null);
  if (this.layout == R.layout.fragment_add_clips) {
    mAddClipsViewPager=(ViewPager)view.findViewById(R.id.viewPager);
    mAddClipsViewPager.setPageMargin(-75);
    mAddClipsViewPager.setPageMarginDrawable(R.drawable.ic_action_forward_gray);
    mAddClipsViewPager.setAdapter(mAddClipsPagerAdapter);
    mAddClipsViewPager.setOnPageChangeListener(new OnPageChangeListener(){
      int mDragAtEnd=0;
      @Override public void onPageScrollStateChanged(      int state){
      }
      @Override public void onPageScrolled(      int position,      float positionOffset,      int positionOffsetPixels){
        if (((position + 1) == mTemplate.getScenes().size()) && positionOffset == 0 & positionOffsetPixels == 0) {
          mDragAtEnd++;
          if (mDragAtEnd > 5) {
            AlertDialog.Builder builder=new AlertDialog.Builder(mActivity);
            builder.setMessage(R.string.add_new_clip_to_the_scene_).setPositiveButton(R.string.yes,new DialogInterface.OnClickListener(){
              @Override public void onClick(              DialogInterface dialog,              int which){
                ((SceneEditorActivity)mActivity).addShotToScene();
              }
            }
).setNegativeButton(R.string.no,null).show();
            mDragAtEnd=0;
          }
        }
 else {
          mDragAtEnd=0;
        }
      }
      @Override public void onPageSelected(      int position){
        mActivity.mMPM.mClipIndex=position;
      }
    }
);
  }
  return view;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(layout,null);
  if (this.layout == R.layout.fragment_add_clips) {
    mAddClipsViewPager=(ViewPager)view.findViewById(R.id.viewPager);
    mAddClipsViewPager.setPageMargin(-75);
    mAddClipsViewPager.setPageMarginDrawable(R.drawable.ic_action_forward_gray);
    mAddClipsViewPager.setAdapter(mAddClipsPagerAdapter);
    mAddClipsViewPager.setOnPageChangeListener(new OnPageChangeListener(){
      int mDragAtEnd=0;
      @Override public void onPageScrollStateChanged(      int state){
      }
      @Override public void onPageScrolled(      int position,      float positionOffset,      int positionOffsetPixels){
        if (((position + 1) == mTemplate.getScene(0).getClips().size()) && positionOffset == 0 & positionOffsetPixels == 0) {
          mDragAtEnd++;
          if (mDragAtEnd > 5) {
            AlertDialog.Builder builder=new AlertDialog.Builder(mActivity);
            builder.setMessage(R.string.add_new_clip_to_the_scene_).setPositiveButton(R.string.yes,new DialogInterface.OnClickListener(){
              @Override public void onClick(              DialogInterface dialog,              int which){
                ((SceneEditorActivity)mActivity).addShotToScene();
              }
            }
).setNegativeButton(R.string.no,null).show();
            mDragAtEnd=0;
          }
        }
 else {
          mDragAtEnd=0;
        }
      }
      @Override public void onPageSelected(      int position){
        mActivity.mMPM.mClipIndex=position;
      }
    }
);
  }
  return view;
}