nus-yam/ex-repair huggingface dataset:
Program: 88796
Project: 88796
Buggy source:
@Override public void onPageScrolled(final int position,final float positionOffset,int positionOffsetPixels){
  PageLayout current=getRootView(position);
  PageLayout next=getRootView(position + 1);
  current.setScaleBoth(CarouselConfig.BIG_SCALE - CarouselConfig.DIFF_SCALE * positionOffset);
  if (next != null) {
    next.setScaleBoth(CarouselConfig.SMALL_SCALE + CarouselConfig.DIFF_SCALE * positionOffset);
  }
}

Fixed version (ground truth):
@Override public void onPageScrolled(final int position,final float positionOffset,int positionOffsetPixels){
  PageLayout current=getRootView(position);
  PageLayout next=getRootView(position + 1);
  if (current != null) {
    current.setScaleBoth(CarouselConfig.BIG_SCALE - CarouselConfig.DIFF_SCALE * positionOffset);
  }
  if (next != null) {
    next.setScaleBoth(CarouselConfig.SMALL_SCALE + CarouselConfig.DIFF_SCALE * positionOffset);
  }
}
Program: 88797
Project: 88797
Buggy source:
private CarouselConfig(Parcel in){
  scaleX=in.readFloat();
  scaleY=in.readFloat();
  orientation=in.readInt();
  visiblePages=in.readInt();
  pagerId=in.readInt();
}

Fixed version (ground truth):
private CarouselConfig(Parcel in){
  scaleX=in.readFloat();
  scaleY=in.readFloat();
  orientation=in.readInt();
  pageMargin=in.readInt();
  pageLimit=in.readInt();
  pagerId=in.readInt();
}
Program: 88798
Project: 88798
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + scaleX + "String_Node_Str"+ scaleY+ "String_Node_Str"+ orientation+ "String_Node_Str"+ visiblePages+ "String_Node_Str"+ pagerId;
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + scaleX + "String_Node_Str"+ scaleY+ "String_Node_Str"+ orientation+ "String_Node_Str"+ pageMargin+ "String_Node_Str"+ pageLimit+ "String_Node_Str"+ pagerId;
}
Program: 88799
Project: 88799
Buggy source:
@Override public void writeToParcel(Parcel out,int flags){
  out.writeFloat(scaleX);
  out.writeFloat(scaleY);
  out.writeInt(orientation);
  out.writeInt(visiblePages);
  out.writeInt(pagerId);
}

Fixed version (ground truth):
@Override public void writeToParcel(Parcel out,int flags){
  out.writeFloat(scaleX);
  out.writeFloat(scaleY);
  out.writeInt(orientation);
  out.writeInt(pageMargin);
  out.writeInt(pageLimit);
  out.writeInt(pagerId);
}
Program: 88800
Project: 88800
Buggy source:
private PageLayout getRootView(int position){
  String tag=CarouselViewPager.getConfig().getPageFragmentTag(position);
  Fragment f=mFragmentManager.findFragmentByTag(tag);
  if (f != null && f.getView() != null) {
    return (PageLayout)f.getView().findViewById(R.id.root);
  }
  return null;
}

Fixed version (ground truth):
private PageLayout getRootView(int position){
  String tag=CarouselConfig.getInstance().getPageFragmentTag(position);
  Fragment f=mFragmentManager.findFragmentByTag(tag);
  if (f != null && f.getView() != null) {
    return (PageLayout)f.getView().findViewById(R.id.root);
  }
  return null;
}
Program: 88801
Project: 88801
Buggy source:
@Override public void onPageSelected(int position){
}

Fixed version (ground truth):
@Override public void onPageSelected(int position){
  int scalingPages=CarouselConfig.getInstance().pageLimit;
  if (scalingPages == 0) {
    return;
  }
 else {
    scalingPages--;
  }
  if (scalingPages > 2) {
    int oneSidePages=(scalingPages - 2) / 2;
    for (int i=0; i < oneSidePages; i++) {
      PageLayout prevSidePage=getRootView(position - 1 - (i + 1));
      if (prevSidePage != null) {
        prevSidePage.setScaleBoth(CarouselConfig.SMALL_SCALE);
      }
      PageLayout nextSidePage=getRootView(position + 1 + (i + 1));
      if (nextSidePage != null) {
        nextSidePage.setScaleBoth(CarouselConfig.SMALL_SCALE);
      }
    }
  }
}
Program: 88802
Project: 88802
Buggy source:
@Override public Fragment getItem(int position){
  float scale=(position == mFirstPage) ? CarouselConfig.BIG_SCALE : CarouselConfig.SMALL_SCALE;
  position=position % mPages;
  return PageFragment.newInstance(mItems.get(position),scale);
}

Fixed version (ground truth):
@Override public Fragment getItem(int position){
  position=position % mPages;
  return PageFragment.newInstance(mItems.get(position),CarouselConfig.SMALL_SCALE);
}
Program: 88803
Project: 88803
Buggy source:
@Override public void onPageScrolled(int position,float positionOffset,int positionOffsetPixels){
  if (positionOffset >= 0.0f && positionOffset <= 1.0f) {
    PageLayout current=getRootView(position);
    current.setScaleBoth(CarouselConfig.BIG_SCALE - CarouselConfig.DIFF_SCALE * positionOffset);
    PageLayout next=getRootView(position + 1);
    PageLayout prev=getRootView(position - 1);
    current.setScaleBoth(CarouselConfig.BIG_SCALE - CarouselConfig.DIFF_SCALE * positionOffset);
    if (next != null) {
      next.setScaleBoth(CarouselConfig.SMALL_SCALE + CarouselConfig.DIFF_SCALE * positionOffset);
    }
    if (prev != null) {
      prev.setScaleBoth(CarouselConfig.SMALL_SCALE + CarouselConfig.DIFF_SCALE * positionOffset);
    }
  }
}

Fixed version (ground truth):
@Override public void onPageScrolled(final int position,final float positionOffset,int positionOffsetPixels){
  PageLayout current=getRootView(position);
  PageLayout next=getRootView(position + 1);
  current.setScaleBoth(CarouselConfig.BIG_SCALE - CarouselConfig.DIFF_SCALE * positionOffset);
  if (next != null) {
    next.setScaleBoth(CarouselConfig.SMALL_SCALE + CarouselConfig.DIFF_SCALE * positionOffset);
  }
}
Program: 88805
Project: 88805
Buggy source:
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  mViewPagerWidth=MeasureSpec.getSize(widthMeasureSpec);
  mViewPagerHeight=MeasureSpec.getSize(heightMeasureSpec);
  if (sConfig.orientation == CarouselConfig.VERTICAL) {
    setRotation(90);
    sConfig.scaleX=(float)mViewPagerHeight / mViewPagerWidth;
    sConfig.scaleY=(float)mViewPagerWidth / mViewPagerHeight;
    setScaleX(sConfig.scaleX);
    setScaleY(sConfig.scaleY);
  }
  setMeasuredDimension(mViewPagerWidth,mViewPagerHeight);
  try {
    calculatePageLimitAndMargin();
  }
 catch (  CarouselConfigException e) {
    Log.e(TAG,e.toString());
  }
  setOffscreenPageLimit(mPageLimit);
  setPageMargin(mPageMargin);
  super.onMeasure(widthMeasureSpec,heightMeasureSpec);
}

Fixed version (ground truth):
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  mViewPagerWidth=MeasureSpec.getSize(widthMeasureSpec);
  mViewPagerHeight=MeasureSpec.getSize(heightMeasureSpec);
  if (mConfig.orientation == CarouselConfig.VERTICAL) {
    setRotation(90);
    mConfig.scaleX=(float)mViewPagerHeight / mViewPagerWidth;
    mConfig.scaleY=(float)mViewPagerWidth / mViewPagerHeight;
    setScaleX(mConfig.scaleX);
    setScaleY(mConfig.scaleY);
  }
  setMeasuredDimension(mViewPagerWidth,mViewPagerHeight);
  try {
    calculatePageLimitAndMargin();
  }
 catch (  CarouselConfigException e) {
    Log.e(TAG,e.toString());
  }
  setOffscreenPageLimit(mPageLimit);
  setPageMargin(mPageMargin);
  super.onMeasure(widthMeasureSpec,heightMeasureSpec);
  if (DEBUG) {
    Log.d(TAG,mConfig.toString());
  }
}
Program: 88806
Project: 88806
Buggy source:
public CarouselViewPager(Context context,AttributeSet attrs){
  super(context,attrs);
  sConfig.pagerId=getId();
  mResources=context.getResources();
  DisplayMetrics metrics=mResources.getDisplayMetrics();
  mMinOffset*=metrics.density;
  TypedArray a=context.obtainStyledAttributes(attrs,R.styleable.CarouselViewPager);
  try {
    if (a != null) {
      sConfig.orientation=a.getInt(R.styleable.CarouselViewPager_android_orientation,CarouselConfig.HORIZONTAL);
    }
  }
  finally {
    if (a != null) {
      a.recycle();
    }
  }
}

Fixed version (ground truth):
public CarouselViewPager(Context context,AttributeSet attrs){
  super(context,attrs);
  mConfig=CarouselConfig.getInstance();
  mConfig.pagerId=getId();
  mResources=context.getResources();
  DisplayMetrics metrics=mResources.getDisplayMetrics();
  mMinOffset*=metrics.density;
  TypedArray a=context.obtainStyledAttributes(attrs,R.styleable.CarouselViewPager);
  try {
    if (a != null) {
      mConfig.orientation=a.getInt(R.styleable.CarouselViewPager_android_orientation,CarouselConfig.HORIZONTAL);
    }
  }
  finally {
    if (a != null) {
      a.recycle();
    }
  }
}
Program: 88807
Project: 88807
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  final int size=5;
  ArrayList<PageItem> items=new ArrayList<PageItem>(size);
  for (int i=0; i < size; i++) {
    items.add(new PageItem("String_Node_Str" + i));
  }
  mViewPager=(CarouselViewPager)findViewById(R.id.carousel_pager);
  mPagerAdapter=new CarouselPagerAdapter(getSupportFragmentManager(),items);
  mViewPager.setAdapter(mPagerAdapter);
  mViewPager.setOnPageChangeListener(mPagerAdapter);
  mViewPager.setCurrentItem(mPagerAdapter.getFirstPage());
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  final int size=100;
  ArrayList<PageItem> items=new ArrayList<PageItem>(size);
  for (int i=0; i < size; i++) {
    items.add(new PageItem("String_Node_Str" + i));
  }
  mViewPager=(CarouselViewPager)findViewById(R.id.carousel_pager);
  mPagerAdapter=new CarouselPagerAdapter(getSupportFragmentManager(),items);
  mViewPager.setAdapter(mPagerAdapter);
  mViewPager.setOnPageChangeListener(mPagerAdapter);
  mViewPager.setCurrentItem(mPagerAdapter.getFirstPage());
}
Program: 88808
Project: 88808
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  if (container == null) {
    return null;
  }
  LinearLayout layout=(LinearLayout)inflater.inflate(R.layout.page,container,false);
  PageItem item=getArguments().getParcelable("String_Node_Str");
  float scale=getArguments().getFloat("String_Node_Str");
  TextView title=(TextView)layout.findViewById(R.id.title);
  title.setText(item.getTitle());
  PageLayout root=(PageLayout)layout.findViewById(R.id.root);
  root.setScaleBoth(scale);
  CarouselConfig config=CarouselViewPager.getConfig();
  if (config.orientation == CarouselConfig.VERTICAL) {
    layout.setScaleX(1.0f / config.scaleY);
    layout.setScaleY(1.0f / config.scaleX);
    layout.setRotation(-90);
  }
  return layout;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  if (container == null) {
    return null;
  }
  LinearLayout layout=(LinearLayout)inflater.inflate(R.layout.page,container,false);
  PageItem item=getArguments().getParcelable("String_Node_Str");
  float scale=getArguments().getFloat("String_Node_Str");
  TextView title=(TextView)layout.findViewById(R.id.title);
  title.setText(item.getTitle());
  PageLayout root=(PageLayout)layout.findViewById(R.id.root);
  root.setScaleBoth(scale);
  CarouselConfig config=CarouselConfig.getInstance();
  if (config.orientation == CarouselConfig.VERTICAL) {
    layout.setScaleX(1.0f / config.scaleY);
    layout.setScaleY(1.0f / config.scaleX);
    layout.setRotation(-90);
  }
  return layout;
}
Program: 88809
Project: 88809
Buggy source:
public CarouselPagerAdapter(Context context,FragmentManager fragmentManager,int pagerId,ArrayList<PageItem> items){
  super(fragmentManager);
  mContext=context;
  mFragmentManager=fragmentManager;
  mPagerId=pagerId;
  if (items == null) {
    mItems=new ArrayList<PageItem>(0);
  }
 else {
    mItems=items;
  }
  mPages=mItems.size();
  mFirstPage=mPages * LOOPS / 2;
}

Fixed version (ground truth):
public CarouselPagerAdapter(FragmentManager fragmentManager,ArrayList<PageItem> items){
  super(fragmentManager);
  mFragmentManager=fragmentManager;
  if (items == null) {
    mItems=new ArrayList<PageItem>(0);
  }
 else {
    mItems=items;
  }
  mPages=mItems.size();
  mFirstPage=mPages * CarouselConfig.LOOPS / 2;
}
Program: 88810
Project: 88810
Buggy source:
private PageLayout getRootView(int position){
  Fragment f=mFragmentManager.findFragmentByTag(getFragmentTag(position));
  if (f != null && f.getView() != null) {
    return (PageLayout)f.getView().findViewById(R.id.root);
  }
  return null;
}

Fixed version (ground truth):
private PageLayout getRootView(int position){
  String tag=CarouselViewPager.getConfig().getPageFragmentTag(position);
  Fragment f=mFragmentManager.findFragmentByTag(tag);
  if (f != null && f.getView() != null) {
    return (PageLayout)f.getView().findViewById(R.id.root);
  }
  return null;
}
Program: 88811
Project: 88811
Buggy source:
@Override public Fragment getItem(int position){
  float scale=(position == mFirstPage) ? BIG_SCALE : SMALL_SCALE;
  position=position % mPages;
  return PageFragment.newInstance(mContext,mItems.get(position),scale);
}

Fixed version (ground truth):
@Override public Fragment getItem(int position){
  float scale=(position == mFirstPage) ? CarouselConfig.BIG_SCALE : CarouselConfig.SMALL_SCALE;
  position=position % mPages;
  return PageFragment.newInstance(mItems.get(position),scale);
}
Program: 88812
Project: 88812
Buggy source:
@Override public void onPageScrolled(int position,float positionOffset,int positionOffsetPixels){
  if (positionOffset >= 0.0f && positionOffset <= 1.0f) {
    PageLayout current=getRootView(position);
    PageLayout next=getRootView(position + 1);
    PageLayout prev=getRootView(position - 1);
    current.setScaleBoth(BIG_SCALE - DIFF_SCALE * positionOffset);
    if (next != null) {
      next.setScaleBoth(SMALL_SCALE + DIFF_SCALE * positionOffset);
    }
    if (prev != null) {
      prev.setScaleBoth(SMALL_SCALE + DIFF_SCALE * positionOffset);
    }
  }
}

Fixed version (ground truth):
@Override public void onPageScrolled(int position,float positionOffset,int positionOffsetPixels){
  if (positionOffset >= 0.0f && positionOffset <= 1.0f) {
    PageLayout current=getRootView(position);
    current.setScaleBoth(CarouselConfig.BIG_SCALE - CarouselConfig.DIFF_SCALE * positionOffset);
    PageLayout next=getRootView(position + 1);
    PageLayout prev=getRootView(position - 1);
    current.setScaleBoth(CarouselConfig.BIG_SCALE - CarouselConfig.DIFF_SCALE * positionOffset);
    if (next != null) {
      next.setScaleBoth(CarouselConfig.SMALL_SCALE + CarouselConfig.DIFF_SCALE * positionOffset);
    }
    if (prev != null) {
      prev.setScaleBoth(CarouselConfig.SMALL_SCALE + CarouselConfig.DIFF_SCALE * positionOffset);
    }
  }
}
Program: 88813
Project: 88813
Buggy source:
@Override public int getCount(){
  return mPages * LOOPS;
}

Fixed version (ground truth):
@Override public int getCount(){
  return mPages * CarouselConfig.LOOPS;
}
Program: 88814
Project: 88814
Buggy source:
@Override public boolean onSingleTapConfirmed(MotionEvent e){
  if (getCarouselAdapter() != null) {
    getCarouselAdapter().sendSingleTap(mTouchedView,mTouchedItem);
  }
  dispatchTouchEvent(e);
  mTouchedView=null;
  mTouchedItem=null;
  return true;
}

Fixed version (ground truth):
@Override public boolean onSingleTapConfirmed(MotionEvent e){
  if (getCarouselAdapter() != null) {
    getCarouselAdapter().sendSingleTap(mTouchedView,mTouchedItem);
  }
  mTouchedView=null;
  mTouchedItem=null;
  return true;
}
Program: 88816
Project: 88816
Buggy source:
@Override public boolean onDoubleTap(MotionEvent e){
  if (getCarouselAdapter() != null) {
    getCarouselAdapter().sendDoubleTap(mTouchedView,mTouchedItem);
  }
  dispatchTouchEvent(e);
  mTouchedView=null;
  mTouchedItem=null;
  return true;
}

Fixed version (ground truth):
@Override public boolean onDoubleTap(MotionEvent e){
  if (getCarouselAdapter() != null) {
    getCarouselAdapter().sendDoubleTap(mTouchedView,mTouchedItem);
  }
  mTouchedView=null;
  mTouchedItem=null;
  return true;
}
Program: 88818
Project: 88818
Buggy source:
public CarouselPagerAdapter(FragmentManager fragmentManager,CarouselViewPager viewPager,OnPageClickListener callback,ArrayList<PageItem> items){
  super(fragmentManager);
  mConfig=CarouselConfig.getInstance();
  mFragmentManager=fragmentManager;
  mViewPager=viewPager;
  mCallback=callback;
  if (items == null) {
    mItems=new ArrayList<PageItem>(0);
  }
 else {
    mItems=items;
  }
  mPagesCount=mItems.size();
  if (mConfig.infinite) {
    mFirstPosition=mPagesCount * CarouselConfig.LOOPS / 2;
  }
}

Fixed version (ground truth):
public CarouselPagerAdapter(FragmentManager fragmentManager,OnPageClickListener callback,ArrayList<PageItem> items){
  super(fragmentManager);
  mConfig=CarouselConfig.getInstance();
  mFragmentManager=fragmentManager;
  mCallback=callback;
  if (items == null) {
    mItems=new ArrayList<PageItem>(0);
  }
 else {
    mItems=items;
  }
  mPagesCount=mItems.size();
  if (mConfig.infinite) {
    mFirstPosition=mPagesCount * CarouselConfig.LOOPS / 2;
  }
}
Program: 88819
Project: 88819
Buggy source:
@Override public void onPageSelected(int position){
  int scalingPages=CarouselConfig.getInstance().pageLimit;
  if (scalingPages == 0) {
    return;
  }
  if (mConfig.scrollScalingMode == CarouselConfig.SCROLL_MODE_BIG_CURRENT) {
    scaleAdjacentPages(position,scalingPages,mConfig.smallScale);
  }
 else   if (mConfig.scrollScalingMode == CarouselConfig.SCROLL_MODE_NONE) {
    scaleAdjacentPages(position,scalingPages,mConfig.bigScale);
  }
}

Fixed version (ground truth):
@Override public void onPageSelected(int position){
  mCurrentPosition=position;
  int scalingPages=CarouselConfig.getInstance().pageLimit;
  if (scalingPages == 0) {
    return;
  }
  if (mConfig.scrollScalingMode == CarouselConfig.SCROLL_MODE_BIG_CURRENT) {
    scaleAdjacentPages(position,scalingPages,mConfig.smallScale);
  }
 else   if (mConfig.scrollScalingMode == CarouselConfig.SCROLL_MODE_NONE) {
    scaleAdjacentPages(position,scalingPages,mConfig.bigScale);
  }
}
Program: 88820
Project: 88820
Buggy source:
@Override public void onPageScrollStateChanged(int state){
switch (state) {
case CarouselViewPager.SCROLL_STATE_IDLE:
{
      if (mDragging) {
        int scalingPages=CarouselConfig.getInstance().pageLimit;
        if (scalingPages == 0) {
          return;
        }
        if (mConfig.scrollScalingMode == CarouselConfig.SCROLL_MODE_BIG_ALL) {
          scaleAdjacentPages(mViewPager.getCurrentItem(),scalingPages,mConfig.smallScale);
        }
        mDragging=false;
      }
      break;
    }
case CarouselViewPager.SCROLL_STATE_SETTLING:
{
    break;
  }
case CarouselViewPager.SCROLL_STATE_DRAGGING:
{
  mDragging=true;
  if (mConfig.scrollScalingMode == CarouselConfig.SCROLL_MODE_BIG_ALL) {
    int position=mViewPager.getCurrentItem();
    int scalingPages=CarouselConfig.getInstance().pageLimit;
    scaleAdjacentPages(position,scalingPages,mConfig.bigScale);
  }
  break;
}
}
}

Fixed version (ground truth):
@Override public void onPageScrollStateChanged(int state){
  if (state == CarouselViewPager.SCROLL_STATE_IDLE) {
    int scalingPages=CarouselConfig.getInstance().pageLimit;
    if (scalingPages == 0) {
      return;
    }
    if (mConfig.scrollScalingMode == CarouselConfig.SCROLL_MODE_BIG_ALL) {
      scaleAdjacentPages(mCurrentPosition,scalingPages,mConfig.smallScale);
    }
  }
}
Program: 88821
Project: 88821
Buggy source:
@Override public void onPageScrolled(int position,float positionOffset,int positionOffsetPixels){
switch (mConfig.scrollScalingMode) {
case CarouselConfig.SCROLL_MODE_BIG_CURRENT:
{
      PageLayout current=getPageView(position);
      PageLayout next=getPageView(position + 1);
      if (current != null) {
        current.setScaleBoth(mConfig.bigScale - mConfig.getDiffScale() * positionOffset);
      }
      if (next != null) {
        next.setScaleBoth(mConfig.smallScale + mConfig.getDiffScale() * positionOffset);
      }
      break;
    }
case CarouselConfig.SCROLL_MODE_BIG_ALL:
{
    PageLayout current=getPageView(position);
    if (current != null) {
      current.setScaleBoth(mConfig.bigScale);
    }
    break;
  }
case CarouselConfig.SCROLL_MODE_NONE:
{
  break;
}
}
}

Fixed version (ground truth):
@Override public void onPageScrolled(int position,float positionOffset,int positionOffsetPixels){
switch (mConfig.scrollScalingMode) {
case CarouselConfig.SCROLL_MODE_BIG_CURRENT:
{
      PageLayout current=getPageView(position);
      PageLayout next=getPageView(position + 1);
      if (current != null) {
        current.setScaleBoth(mConfig.bigScale - mConfig.getDiffScale() * positionOffset);
      }
      if (next != null) {
        next.setScaleBoth(mConfig.smallScale + mConfig.getDiffScale() * positionOffset);
      }
      break;
    }
case CarouselConfig.SCROLL_MODE_BIG_ALL:
{
    PageLayout current=getPageView(position);
    if (current != null) {
      current.setScaleBoth(mConfig.bigScale);
    }
    if (positionOffset > 0.0f) {
      scaleAdjacentPages(position,mConfig.pageLimit,mConfig.bigScale);
    }
    break;
  }
case CarouselConfig.SCROLL_MODE_NONE:
{
  break;
}
}
}
Program: 88822
Project: 88822
Buggy source:
@Override public void onRestoreInstanceState(Parcelable state){
  if (!(state instanceof CarouselState)) {
    super.onRestoreInstanceState(state);
    return;
  }
  CarouselState ss=(CarouselState)state;
  super.onRestoreInstanceState(ss.getSuperState());
  if (getAdapter() == null) {
    return;
  }
  if (ss.infinite && !mConfig.infinite) {
    int offset=ss.position - ss.itemsCount / 2;
    if (offset > 0) {
      setCurrentItem(offset);
    }
 else     if (offset < 0) {
      setCurrentItem(ss.itemsCount / CarouselConfig.LOOPS + offset);
    }
  }
 else   if (!ss.infinite && mConfig.infinite) {
    setCurrentItem(ss.itemsCount * CarouselConfig.LOOPS / 2 + ss.position);
  }
 else {
    setCurrentItem(ss.position);
  }
}

Fixed version (ground truth):
@Override public void onRestoreInstanceState(Parcelable state){
  if (!(state instanceof CarouselState)) {
    super.onRestoreInstanceState(state);
    return;
  }
  CarouselState ss=(CarouselState)state;
  super.onRestoreInstanceState(ss.getSuperState());
  if (getAdapter() == null) {
    return;
  }
  if (ss.infinite && !mConfig.infinite) {
    int itemsCount=getAdapter().getCount();
    if (itemsCount == 0) {
      return;
    }
    int offset=(ss.position - ss.itemsCount / 2) % itemsCount;
    if (offset >= 0) {
      setCurrentItem(offset);
    }
 else {
      setCurrentItem(ss.itemsCount / CarouselConfig.LOOPS + offset);
    }
  }
 else   if (!ss.infinite && mConfig.infinite) {
    setCurrentItem(ss.itemsCount * CarouselConfig.LOOPS / 2 + ss.position);
  }
 else {
    setCurrentItem(ss.position);
  }
}
Program: 88824
Project: 88824
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  final int size=100;
  ArrayList<PageItem> items=new ArrayList<PageItem>(size);
  for (int i=0; i < size; i++) {
    items.add(new PageItem("String_Node_Str" + i));
  }
  mViewPager=(CarouselViewPager)findViewById(R.id.carousel_pager);
  mPagerAdapter=new CarouselPagerAdapter(getSupportFragmentManager(),mViewPager,this,items);
  mViewPager.setAdapter(mPagerAdapter);
  mViewPager.setOnPageChangeListener(mPagerAdapter);
  mViewPager.setCurrentItem(mPagerAdapter.getFirstPosition());
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  final int size=20;
  ArrayList<PageItem> items=new ArrayList<PageItem>(size);
  for (int i=0; i < size; i++) {
    items.add(new PageItem("String_Node_Str" + i));
  }
  mViewPager=(CarouselViewPager)findViewById(R.id.carousel_pager);
  mPagerAdapter=new CarouselPagerAdapter(getSupportFragmentManager(),this,items);
  mViewPager.setAdapter(mPagerAdapter);
  mViewPager.setOnPageChangeListener(mPagerAdapter);
  mViewPager.setCurrentItem(mPagerAdapter.getFirstPosition());
}
Program: 88826
Project: 88826
Buggy source:
public boolean mustBeProtect(final String s){
  if (s == null)   return false;
  int len=s.length();
  if (len == 0)   return true;
  if (s.trim() != s)   return true;
  char ch=s.charAt(0);
  if (isSpecial(ch) || isUnicode(ch))   return true;
  for (int i=1; i < len; i++) {
    ch=s.charAt(i);
    if (isSpecialClose(ch) || isUnicode(ch))     return true;
  }
  if (isKeyword(s))   return true;
  ch=s.charAt(0);
  if (ch >= '0' && ch <= '9' || ch == '-') {
    int p=1;
    for (; p < len; p++) {
      ch=s.charAt(p);
      if (ch < '0' || ch > '9')       break;
    }
    if (p == len)     return true;
    if (ch == '.') {
      p++;
      for (; p < len; p++) {
        ch=s.charAt(p);
        if (ch < '0' || ch > '9')         break;
      }
    }
    if (p == len)     return true;
    if (ch != 'E' || ch != 'e')     return false;
    p++;
    if (p == len)     return false;
    ch=s.charAt(p);
    if (ch == '+' || ch == '-') {
      ch++;
      if (p == len)       return false;
      ch=s.charAt(p);
    }
    if (ch == '+' || ch == '-') {
      ch++;
      if (p == len)       return false;
    }
    for (; p < len; p++) {
      ch=s.charAt(p);
      if (ch < '0' || ch > '9')       break;
    }
    if (p == len)     return true;
    return false;
  }
  return false;
}

Fixed version (ground truth):
public boolean mustBeProtect(final String s){
  if (s == null)   return false;
  int len=s.length();
  if (len == 0)   return true;
  if (s.trim() != s)   return true;
  char ch=s.charAt(0);
  if (isSpecial(ch) || isUnicode(ch))   return true;
  for (int i=1; i < len; i++) {
    ch=s.charAt(i);
    if (isSpecialClose(ch) || isUnicode(ch))     return true;
  }
  if (isKeyword(s))   return true;
  ch=s.charAt(0);
  if (ch >= '0' && ch <= '9' || ch == '-') {
    int p=1;
    for (; p < len; p++) {
      ch=s.charAt(p);
      if (ch < '0' || ch > '9')       break;
    }
    if (p == len)     return true;
    if (ch == '.') {
      p++;
    }
    for (; p < len; p++) {
      ch=s.charAt(p);
      if (ch < '0' || ch > '9')       break;
    }
    if (p == len)     return true;
    if (ch == 'E' || ch == 'e') {
      p++;
      if (p == len)       return false;
      ch=s.charAt(p);
      if (ch == '+' || ch == '-') {
        p++;
        ch=s.charAt(p);
      }
    }
    if (p == len)     return false;
    for (; p < len; p++) {
      ch=s.charAt(p);
      if (ch < '0' || ch > '9')       break;
    }
    if (p == len)     return true;
    return false;
  }
  return false;
}
Program: 88828
Project: 88828
Buggy source:
public static void testInvalidJson(String json,int permissifMode,int execptionType) throws Exception {
  JSONParser p=new JSONParser(execptionType);
  try {
    p.parse(json);
    TestCase.assertFalse("String_Node_Str" + json,true);
  }
 catch (  ParseException e) {
    if (execptionType == -1)     execptionType=e.getErrorType();
    TestCase.assertEquals(execptionType,e.getErrorType());
  }
}

Fixed version (ground truth):
public static void testInvalidJson(String json,int permissifMode,int execptionType) throws Exception {
  JSONParser p=new JSONParser(permissifMode);
  try {
    p.parse(json);
    TestCase.assertFalse("String_Node_Str" + json,true);
  }
 catch (  ParseException e) {
    if (execptionType == -1)     execptionType=e.getErrorType();
    TestCase.assertEquals(execptionType,e.getErrorType());
  }
}
Program: 88830
Project: 88830
Buggy source:
protected void extractString(int beginIndex,int endIndex){
  xs=new String(in,beginIndex,endIndex);
}

Fixed version (ground truth):
protected void extractString(int beginIndex,int endIndex){
  xs=new String(in,beginIndex,endIndex - beginIndex);
}
Program: 88831
Project: 88831
Buggy source:
/** 
 * Escape special chars form String including /
 * @param s - Must not be null.
 * @param sb
 */
public static void escape(String s,Appendable sb){
  try {
    for (int i=0; i < s.length(); i++) {
      char ch=s.charAt(i);
switch (ch) {
case '"':
        sb.append("String_Node_Str");
      break;
case '\\':
    sb.append("String_Node_Str");
  break;
case '\b':
sb.append("String_Node_Str");
break;
case '\f':
sb.append("String_Node_Str");
break;
case '\n':
sb.append("String_Node_Str");
break;
case '\r':
sb.append("String_Node_Str");
break;
case '\t':
sb.append("String_Node_Str");
break;
case '/':
sb.append("String_Node_Str");
break;
default :
if ((ch >= '\u0000' && ch <= '\u001F') || (ch >= '\u007F' && ch <= '\u009F') || (ch >= '\u2000' && ch <= '\u20FF')) {
sb.append("String_Node_Str");
String hex="String_Node_Str";
sb.append(hex.charAt(ch >> 12 & 0x0F));
sb.append(hex.charAt(ch >> 8 & 0x0F));
sb.append(hex.charAt(ch >> 4 & 0x0F));
sb.append(hex.charAt(ch >> 0 & 0x0F));
}
 else {
sb.append(ch);
}
}
}
}
 catch (IOException e) {
throw new RuntimeException("String_Node_Str");
}
}

Fixed version (ground truth):
/** 
 * Escape special chars form String including /
 * @param s - Must not be null.
 * @param sb
 */
public static void escape(String s,Appendable sb){
  try {
    int len=s.length();
    for (int i=0; i < len; i++) {
      char ch=s.charAt(i);
switch (ch) {
case '"':
        sb.append("String_Node_Str");
      break;
case '\\':
    sb.append("String_Node_Str");
  break;
case '\b':
sb.append("String_Node_Str");
break;
case '\f':
sb.append("String_Node_Str");
break;
case '\n':
sb.append("String_Node_Str");
break;
case '\r':
sb.append("String_Node_Str");
break;
case '\t':
sb.append("String_Node_Str");
break;
case '/':
sb.append("String_Node_Str");
break;
default :
if ((ch >= '\u0000' && ch <= '\u001F') || (ch >= '\u007F' && ch <= '\u009F') || (ch >= '\u2000' && ch <= '\u20FF')) {
sb.append("String_Node_Str");
String hex="String_Node_Str";
sb.append(hex.charAt(ch >> 12 & 0x0F));
sb.append(hex.charAt(ch >> 8 & 0x0F));
sb.append(hex.charAt(ch >> 4 & 0x0F));
sb.append(hex.charAt(ch >> 0 & 0x0F));
}
 else {
sb.append(ch);
}
}
}
}
 catch (IOException e) {
throw new RuntimeException("String_Node_Str");
}
}
Program: 88832
Project: 88832
Buggy source:
public boolean mustBeProtect(String s){
  if (s == null)   return false;
  int len=s.length();
  if (len == 0)   return true;
  if (s.trim() != s)   return true;
  char ch=s.charAt(0);
  if (isSpecial(ch) || isUnicode(ch))   return true;
  for (int i=1; i < len; i++) {
    ch=s.charAt(i);
    if (isSpecialClose(ch) || isUnicode(ch))     return true;
  }
  if (isKeyword(s))   return true;
  ch=s.charAt(0);
  if (ch >= '0' && ch <= '9' || ch == '-') {
    int p=1;
    for (; p < s.length(); p++) {
      ch=s.charAt(p);
      if (ch < '0' || ch > '9')       break;
    }
    if (p == s.length())     return true;
    if (ch == '.') {
      p++;
      for (; p < s.length(); p++) {
        ch=s.charAt(p);
        if (ch < '0' || ch > '9')         break;
      }
    }
    if (p == s.length())     return true;
    if (ch != 'E' || ch != 'e')     return false;
    p++;
    if (p == s.length())     return false;
    ch=s.charAt(p);
    if (ch == '+' || ch == '-') {
      ch++;
      if (p == s.length())       return false;
      ch=s.charAt(p);
    }
    if (ch == '+' || ch == '-') {
      ch++;
      if (p == s.length())       return false;
    }
    for (; p < s.length(); p++) {
      ch=s.charAt(p);
      if (ch < '0' || ch > '9')       break;
    }
    if (p == s.length())     return true;
    return false;
  }
  return false;
}

Fixed version (ground truth):
public boolean mustBeProtect(final String s){
  if (s == null)   return false;
  int len=s.length();
  if (len == 0)   return true;
  if (s.trim() != s)   return true;
  char ch=s.charAt(0);
  if (isSpecial(ch) || isUnicode(ch))   return true;
  for (int i=1; i < len; i++) {
    ch=s.charAt(i);
    if (isSpecialClose(ch) || isUnicode(ch))     return true;
  }
  if (isKeyword(s))   return true;
  ch=s.charAt(0);
  if (ch >= '0' && ch <= '9' || ch == '-') {
    int p=1;
    for (; p < len; p++) {
      ch=s.charAt(p);
      if (ch < '0' || ch > '9')       break;
    }
    if (p == len)     return true;
    if (ch == '.') {
      p++;
      for (; p < len; p++) {
        ch=s.charAt(p);
        if (ch < '0' || ch > '9')         break;
      }
    }
    if (p == len)     return true;
    if (ch != 'E' || ch != 'e')     return false;
    p++;
    if (p == len)     return false;
    ch=s.charAt(p);
    if (ch == '+' || ch == '-') {
      ch++;
      if (p == len)       return false;
      ch=s.charAt(p);
    }
    if (ch == '+' || ch == '-') {
      ch++;
      if (p == len)       return false;
    }
    for (; p < len; p++) {
      ch=s.charAt(p);
      if (ch < '0' || ch > '9')       break;
    }
    if (p == len)     return true;
    return false;
  }
  return false;
}
Program: 88833
Project: 88833
Buggy source:
/** 
 * Escape special chars form String including /
 * @param s - Must not be null.
 * @param sb
 */
public void escape(String s,Appendable sb){
  try {
    for (int i=0; i < s.length(); i++) {
      char ch=s.charAt(i);
switch (ch) {
case '"':
        sb.append("String_Node_Str");
      break;
case '\\':
    sb.append("String_Node_Str");
  break;
case '\b':
sb.append("String_Node_Str");
break;
case '\f':
sb.append("String_Node_Str");
break;
case '\n':
sb.append("String_Node_Str");
break;
case '\r':
sb.append("String_Node_Str");
break;
case '\t':
sb.append("String_Node_Str");
break;
case '/':
sb.append("String_Node_Str");
break;
default :
if ((ch >= '\u0000' && ch <= '\u001F') || (ch >= '\u007F' && ch <= '\u009F') || (ch >= '\u2000' && ch <= '\u20FF')) {
sb.append("String_Node_Str");
String hex="String_Node_Str";
sb.append(hex.charAt(ch >> 12 & 0x0F));
sb.append(hex.charAt(ch >> 8 & 0x0F));
sb.append(hex.charAt(ch >> 4 & 0x0F));
sb.append(hex.charAt(ch >> 0 & 0x0F));
}
 else {
sb.append(ch);
}
}
}
}
 catch (IOException e) {
throw new RuntimeException("String_Node_Str");
}
}

Fixed version (ground truth):
/** 
 * Escape special chars form String including /
 * @param s - Must not be null.
 * @param sb
 */
public void escape(String s,Appendable sb){
  try {
    int len=s.length();
    for (int i=0; i < len; i++) {
      char ch=s.charAt(i);
switch (ch) {
case '"':
        sb.append("String_Node_Str");
      break;
case '\\':
    sb.append("String_Node_Str");
  break;
case '\b':
sb.append("String_Node_Str");
break;
case '\f':
sb.append("String_Node_Str");
break;
case '\n':
sb.append("String_Node_Str");
break;
case '\r':
sb.append("String_Node_Str");
break;
case '\t':
sb.append("String_Node_Str");
break;
case '/':
sb.append("String_Node_Str");
break;
default :
if ((ch >= '\u0000' && ch <= '\u001F') || (ch >= '\u007F' && ch <= '\u009F') || (ch >= '\u2000' && ch <= '\u20FF')) {
sb.append("String_Node_Str");
String hex="String_Node_Str";
sb.append(hex.charAt(ch >> 12 & 0x0F));
sb.append(hex.charAt(ch >> 8 & 0x0F));
sb.append(hex.charAt(ch >> 4 & 0x0F));
sb.append(hex.charAt(ch >> 0 & 0x0F));
}
 else {
sb.append(ch);
}
}
}
}
 catch (IOException e) {
throw new RuntimeException("String_Node_Str");
}
}
Program: 88834
Project: 88834
Buggy source:
/** 
 * Same as read() in memory parssing
 */
protected void readS(){
  if (++pos >= len)   this.c=EOI;
 else   this.c=(char)in[pos];
}

Fixed version (ground truth):
/** 
 * Same as read() in memory parsing
 */
protected void readS(){
  if (++pos >= len)   this.c=EOI;
 else   this.c=(char)in[pos];
}
Program: 88835
Project: 88835
Buggy source:
abstract protected void read() throws IOException ;

Fixed version (ground truth):
/** 
 * Read one char in this.c
 * @throws IOException
 */
abstract protected void read() throws IOException ;
Program: 88837
Project: 88837
Buggy source:
protected void read(){
  if (++pos >= len)   this.c=EOI;
 else   this.c=in.charAt(pos);
}

Fixed version (ground truth):
/** 
 * Read next char or END OF INPUT
 */
protected void read(){
  if (++pos >= len)   this.c=EOI;
 else   this.c=in.charAt(pos);
}
Program: 88838
Project: 88838
Buggy source:
/** 
 * Same as read() in memory parssing
 */
protected void readS(){
  if (++pos >= len)   this.c=EOI;
 else   this.c=in.charAt(pos);
}

Fixed version (ground truth):
/** 
 * Same as read() in memory parsing
 */
protected void readS(){
  if (++pos >= len)   this.c=EOI;
 else   this.c=in.charAt(pos);
}
Program: 88839
Project: 88839
Buggy source:
@Override public void open(Map conf,TopologyContext context,SpoutOutputCollector _collector){
  collector=_collector;
  ConsumerConfig config=new ConsumerConfig();
  try {
    consumer=new Consumer(topic,group,config);
  }
 catch (  LionException e) {
    throw new RuntimeException(e);
  }
  stream=consumer.getStream();
  fetchThread=new Thread(new Handler());
  fetchThread.start();
}

Fixed version (ground truth):
@Override public void open(Map conf,TopologyContext context,SpoutOutputCollector _collector){
  collector=_collector;
  ConsumerConfig config=new ConsumerConfig();
  try {
    consumer=new Consumer(topic,group,config);
  }
 catch (  LionException e) {
    throw new RuntimeException(e);
  }
  stream=consumer.getStream();
  fetchThread=new FetchThread();
  fetchThread.start();
}
Program: 88841
Project: 88841
Buggy source:
public boolean runCollection(String colFilename,String envFilename,String folderName,boolean haltOnError) throws Exception {
  System.out.println("String_Node_Str");
  PostmanRunResult runResult=new PostmanRunResult();
  PostmanReader reader=new PostmanReader();
  PostmanCollection c=reader.readCollectionFile(colFilename);
  c.init();
  PostmanEnvironment e=reader.readEnvironmentFile(envFilename);
  e.init();
  PostmanFolder folder=null;
  if (folderName != null && !folderName.isEmpty()) {
    folder=c.folderLookup.get(folderName);
  }
  PostmanVariables var=new PostmanVariables(e);
  PostmanRequestRunner runner=new PostmanRequestRunner(var,haltOnError);
  boolean isSuccessful=true;
  if (folder != null) {
    isSuccessful=runFolder(haltOnError,runner,var,c,folder,runResult);
  }
 else {
    for (    PostmanFolder pf : c.folders) {
      isSuccessful=runFolder(haltOnError,runner,var,c,pf,runResult) && isSuccessful;
      if (haltOnError && !isSuccessful) {
        return isSuccessful;
      }
    }
  }
  System.out.println("String_Node_Str");
  System.out.println(runResult);
  return isSuccessful;
}

Fixed version (ground truth):
public PostmanRunResult runCollection(String colFilename,String envFilename,String folderName,boolean haltOnError) throws Exception {
  System.out.println("String_Node_Str");
  PostmanRunResult runResult=new PostmanRunResult();
  PostmanReader reader=new PostmanReader();
  PostmanCollection c=reader.readCollectionFile(colFilename);
  c.init();
  PostmanEnvironment e=reader.readEnvironmentFile(envFilename);
  e.init();
  PostmanFolder folder=null;
  if (folderName != null && !folderName.isEmpty()) {
    folder=c.folderLookup.get(folderName);
  }
  PostmanVariables var=new PostmanVariables(e);
  PostmanRequestRunner runner=new PostmanRequestRunner(var,haltOnError);
  boolean isSuccessful=true;
  if (folder != null) {
    isSuccessful=runFolder(haltOnError,runner,var,c,folder,runResult);
  }
 else {
    for (    PostmanFolder pf : c.folders) {
      isSuccessful=runFolder(haltOnError,runner,var,c,pf,runResult) && isSuccessful;
      if (haltOnError && !isSuccessful) {
        return runResult;
      }
    }
  }
  System.out.println("String_Node_Str");
  System.out.println(runResult);
  return runResult;
}
Program: 88842
Project: 88842
Buggy source:
@Override public void handleError(ClientHttpResponse response) throws IOException {
  logger.error("String_Node_Str");
  if (response != null) {
    logger.error("String_Node_Str" + response.getStatusCode().value());
    InputStream responseBody=response.getBody();
    if (responseBody != null) {
      StringWriter writer=new StringWriter();
      IOUtils.copy(responseBody,writer,"String_Node_Str");
      String body=writer.toString();
      logger.error("String_Node_Str" + body);
    }
  }
  if (haltOnError) {
    throw new HaltTestFolderException();
  }
}

Fixed version (ground truth):
@Override public void handleError(ClientHttpResponse response) throws IOException {
  if (response != null) {
    logger.warn("String_Node_Str" + response.getStatusCode().value());
    if (response.getStatusCode().series() == Series.SERVER_ERROR) {
      logger.error("String_Node_Str");
      InputStream responseBody=response.getBody();
      if (responseBody != null) {
        StringWriter writer=new StringWriter();
        IOUtils.copy(responseBody,writer,"String_Node_Str");
        String body=writer.toString();
        logger.error("String_Node_Str" + body);
      }
    }
  }
  if (haltOnError) {
    throw new HaltTestFolderException();
  }
}
Program: 88843
Project: 88843
Buggy source:
public HttpHeaders getHeaders(PostmanVariables var){
  String h=var.replace(headers);
  String[] splitHeads=h.split("String_Node_Str");
  HttpHeaders result=new HttpHeaders();
  for (  String hp : splitHeads) {
    String[] pair=hp.split("String_Node_Str");
    String key=pair[0].trim();
    String val=pair[1].trim();
    result.set(key,val);
  }
  return result;
}

Fixed version (ground truth):
public HttpHeaders getHeaders(PostmanVariables var){
  HttpHeaders result=new HttpHeaders();
  if (this.headers == null || this.headers.isEmpty()) {
    return result;
  }
  String h=var.replace(headers);
  String[] splitHeads=h.split("String_Node_Str");
  for (  String hp : splitHeads) {
    String[] pair=hp.split("String_Node_Str");
    String key=pair[0].trim();
    String val=pair[1].trim();
    result.set(key,val);
  }
  return result;
}
Program: 88844
Project: 88844
Buggy source:
/** 
 * Replace all {{dynamic variable}} in orig string with values found in the environment. If variable is not found, replace it with constant string "UNDEFINED".
 * @param orig
 * @return
 */
public String replace(String orig){
  List<String> allMatches=new ArrayList<String>();
  Matcher m=Pattern.compile(POSTMAN_EXP).matcher(orig);
  while (m.find()) {
    allMatches.add(m.group());
  }
  String result=orig;
  for (  String var : allMatches) {
    String varVal=getVal(var);
    result=result.replace((CharSequence)var,(CharSequence)varVal);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Replace all {{dynamic variable}} in orig string with values found in the environment. If variable is not found, replace it with constant string "UNDEFINED".
 * @param orig
 * @return
 */
public String replace(String orig){
  if (orig == null || orig.isEmpty()) {
    return orig;
  }
  List<String> allMatches=new ArrayList<String>();
  Matcher m=Pattern.compile(POSTMAN_EXP).matcher(orig);
  while (m.find()) {
    allMatches.add(m.group());
  }
  String result=orig;
  for (  String var : allMatches) {
    String varVal=getVal(var);
    result=result.replace((CharSequence)var,(CharSequence)varVal);
  }
  return result;
}
Program: 88846
Project: 88846
Buggy source:
@Override public void onClick(View v){
  Intent mIntent=new Intent(Intent.ACTION_VIEW);
  if (cta.getDeepLink() != null) {
    try {
      mIntent.setData(Uri.parse(cta.getDeepLink()));
      Liquid.getInstance().trackCta(cta);
      mContext.startActivity(mIntent);
    }
 catch (    Exception e) {
      LQLog.infoVerbose("String_Node_Str");
    }
  }
  mPopupWindow.dismiss();
}

Fixed version (ground truth):
@Override public void onClick(View v){
  Intent mIntent=new Intent(Intent.ACTION_VIEW);
  if (cta.getDeepLink() != null) {
    try {
      mIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
      mIntent.setData(Uri.parse(cta.getDeepLink()));
      Liquid.getInstance().trackCta(cta);
      mContext.startActivity(mIntent);
    }
 catch (    Exception e) {
      LQLog.infoVerbose("String_Node_Str");
    }
  }
  mPopupWindow.dismiss();
}
Program: 88847
Project: 88847
Buggy source:
public void setUpButton(){
  final ImageView mArrowButton=(ImageView)container.findViewById(R.id.slideUpArrowButton);
  for (  final LQInAppMessage.Cta cta : mSlideModel.getCtas()) {
    Drawable myArrow=ContextCompat.getDrawable(mContext,R.drawable.arrow);
    myArrow.setColorFilter(Color.parseColor(cta.getButtonColor()),PorterDuff.Mode.SRC_IN);
    ((ImageView)container.findViewById(R.id.slideUpArrowButton)).setImageDrawable(myArrow);
    mArrowButton.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        Intent mIntent=new Intent(Intent.ACTION_VIEW);
        if (cta.getDeepLink() != null) {
          try {
            mIntent.setData(Uri.parse(cta.getDeepLink()));
            Liquid.getInstance().trackCta(cta);
            mContext.startActivity(mIntent);
          }
 catch (          Exception e) {
            LQLog.infoVerbose("String_Node_Str");
          }
        }
        mPopupWindow.dismiss();
      }
    }
);
  }
}

Fixed version (ground truth):
public void setUpButton(){
  final ImageView mArrowButton=(ImageView)container.findViewById(R.id.slideUpArrowButton);
  for (  final LQInAppMessage.Cta cta : mSlideModel.getCtas()) {
    Drawable myArrow=ContextCompat.getDrawable(mContext,R.drawable.arrow);
    myArrow.setColorFilter(Color.parseColor(cta.getButtonColor()),PorterDuff.Mode.SRC_IN);
    ((ImageView)container.findViewById(R.id.slideUpArrowButton)).setImageDrawable(myArrow);
    mArrowButton.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        Intent mIntent=new Intent(Intent.ACTION_VIEW);
        if (cta.getDeepLink() != null) {
          try {
            mIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            mIntent.setData(Uri.parse(cta.getDeepLink()));
            Liquid.getInstance().trackCta(cta);
            mContext.startActivity(mIntent);
          }
 catch (          Exception e) {
            LQLog.infoVerbose("String_Node_Str");
          }
        }
        mPopupWindow.dismiss();
      }
    }
);
  }
}
Program: 88848
Project: 88848
Buggy source:
private void activityResumedCallback(Activity activity){
  mCurrentActivity=activity;
  mInstance.attachActivity(activity);
  mHttpQueuer.startFlushTimer();
}

Fixed version (ground truth):
private void activityResumedCallback(Activity activity){
  mCurrentActivity=activity;
  requestInappMessages();
  showInAppMessages();
  mInstance.attachActivity(activity);
  mHttpQueuer.startFlushTimer();
}
Program: 88849
Project: 88849
Buggy source:
/** 
 * Generate a random unique id
 * @return
 */
public static String newIdentifier(){
  String uid=UUID.randomUUID().toString().toUpperCase(Locale.ENGLISH);
  long timeSince1970=Calendar.getInstance().getTimeInMillis();
  return uid + "String_Node_Str" + String.valueOf(timeSince1970).substring(0,10);
}

Fixed version (ground truth):
/** 
 * Generate a random unique id
 * @return
 */
public static String newIdentifier(){
  String uid=UUID.randomUUID().toString().toUpperCase(Locale.ENGLISH);
  String epoch=LiquidTools.tenCharEpoch(Calendar.getInstance().getTimeInMillis());
  return uid + "String_Node_Str" + epoch;
}
Program: 88850
Project: 88850
Buggy source:
private void reset(final boolean soft){
  mQueue.execute(new Runnable(){
    @Override public void run(){
      mCurrentSession=null;
      mDevice=new LQDevice(mContext,LIQUID_VERSION);
      mEnterBackgroundtime=null;
      mLoadedLiquidPackage=new LQLiquidPackage();
      mAppliedValues=new HashMap<String,LQValue>();
      if (!soft) {
        mHttpQueuer=new LQQueuer(mContext,mApiToken);
      }
      resetUser();
    }
  }
);
}

Fixed version (ground truth):
private void reset(final boolean soft){
  mQueue.execute(new Runnable(){
    @Override public void run(){
      mDevice=new LQDevice(mContext,LIQUID_VERSION);
      mEnterBackgroundtime=null;
      mLoadedLiquidPackage=new LQLiquidPackage();
      mAppliedValues=new HashMap<String,LQValue>();
      if (!soft) {
        mHttpQueuer=new LQQueuer(mContext,mApiToken);
      }
      resetUser();
      newSession(true);
    }
  }
);
}