nus-yam/ex-repair huggingface dataset:
Program: 195810
Project: 195810
Buggy source:
public void updateEmptyShadeView(boolean visible){
  int oldVisibility=mEmptyShadeView.willBeGone() ? GONE : mEmptyShadeView.getVisibility();
  int newVisibility=visible ? VISIBLE : GONE;
  if (oldVisibility != newVisibility) {
    if (newVisibility != GONE) {
      if (mEmptyShadeView.willBeGone()) {
        mEmptyShadeView.cancelAnimation();
      }
 else {
        mEmptyShadeView.setInvisible();
      }
      mEmptyShadeView.setVisibility(newVisibility);
      mEmptyShadeView.setWillBeGone(false);
      updateContentHeight();
      notifyHeightChangeListener(mDismissView);
    }
 else {
      mEmptyShadeView.setWillBeGone(true);
      mEmptyShadeView.performVisibilityAnimation(false,new Runnable(){
        @Override public void run(){
          mEmptyShadeView.setVisibility(GONE);
          mEmptyShadeView.setWillBeGone(false);
          updateContentHeight();
          notifyHeightChangeListener(mDismissView);
        }
      }
);
    }
  }
}

Fixed version (ground truth):
public void updateEmptyShadeView(boolean visible){
  int oldVisibility=mEmptyShadeView.willBeGone() ? GONE : mEmptyShadeView.getVisibility();
  int newVisibility=visible ? VISIBLE : GONE;
  if (oldVisibility != newVisibility) {
    if (newVisibility != GONE) {
      if (mEmptyShadeView.willBeGone()) {
        mEmptyShadeView.cancelAnimation();
      }
 else {
        mEmptyShadeView.setInvisible();
      }
      mEmptyShadeView.setVisibility(newVisibility);
      mEmptyShadeView.setWillBeGone(false);
      updateContentHeight();
      notifyHeightChangeListener(mDismissView);
    }
 else {
      Runnable onFinishedRunnable=new Runnable(){
        @Override public void run(){
          mEmptyShadeView.setVisibility(GONE);
          mEmptyShadeView.setWillBeGone(false);
          updateContentHeight();
          notifyHeightChangeListener(mDismissView);
        }
      }
;
      if (mAnimationsEnabled) {
        mEmptyShadeView.setWillBeGone(true);
        mEmptyShadeView.performVisibilityAnimation(false,onFinishedRunnable);
      }
 else {
        mEmptyShadeView.setInvisible();
        onFinishedRunnable.run();
      }
    }
  }
}
Program: 195811
Project: 195811
Buggy source:
public void setDark(boolean dark,boolean fade,long delay){
  super.setDark(dark,fade,delay);
  if (mDark == dark) {
    return;
  }
  mDark=dark;
  if (!dark && fade) {
    if (mActivated) {
      mBackgroundDimmed.setVisibility(View.VISIBLE);
      mBackgroundNormal.setVisibility(View.VISIBLE);
    }
 else {
      mBackgroundDimmed.setVisibility(View.VISIBLE);
      mBackgroundNormal.setVisibility(View.INVISIBLE);
    }
    fadeDarkToDimmed(delay);
  }
 else {
    updateBackground();
  }
}

Fixed version (ground truth):
public void setDark(boolean dark,boolean fade,long delay){
  super.setDark(dark,fade,delay);
  if (mDark == dark) {
    return;
  }
  mDark=dark;
  if (!dark && fade) {
    if (mActivated) {
      mBackgroundDimmed.setVisibility(View.VISIBLE);
      mBackgroundNormal.setVisibility(View.VISIBLE);
    }
 else     if (mDimmed) {
      mBackgroundDimmed.setVisibility(View.VISIBLE);
      mBackgroundNormal.setVisibility(View.INVISIBLE);
    }
 else {
      mBackgroundDimmed.setVisibility(View.INVISIBLE);
      mBackgroundNormal.setVisibility(View.VISIBLE);
    }
    fadeInFromDark(delay);
  }
 else {
    updateBackground();
  }
}
Program: 195812
Project: 195812
Buggy source:
@Override public void createAnimation(final LockPatternView.CellState animatedCell,long delay,long duration,float translationY,final boolean appearing,Interpolator interpolator,final Runnable finishListener){
  if (appearing) {
    animatedCell.scale=0.0f;
  }
  animatedCell.translateY=appearing ? translationY : 0;
  ValueAnimator animator=ValueAnimator.ofFloat(animatedCell.translateY,appearing ? 0 : translationY);
  animator.setInterpolator(interpolator);
  animator.setDuration(duration);
  animator.setStartDelay(delay);
  animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(){
    @Override public void onAnimationUpdate(    ValueAnimator animation){
      float animatedFraction=animation.getAnimatedFraction();
      if (appearing) {
        animatedCell.scale=animatedFraction;
      }
 else {
        animatedCell.alpha=1 - animatedFraction;
      }
      animatedCell.translateY=(float)animation.getAnimatedValue();
      mLockPatternView.invalidate();
    }
  }
);
  if (finishListener != null) {
    animator.addListener(new AnimatorListenerAdapter(){
      @Override public void onAnimationEnd(      Animator animation){
        finishListener.run();
      }
    }
);
    mAppearAnimationUtils.createAnimation(mEcaView,delay,duration,translationY,appearing,interpolator,null);
  }
  animator.start();
  mLockPatternView.invalidate();
}

Fixed version (ground truth):
@Override public void createAnimation(final LockPatternView.CellState animatedCell,long delay,long duration,float translationY,final boolean appearing,Interpolator interpolator,final Runnable finishListener){
  if (appearing) {
    animatedCell.scale=0.0f;
    animatedCell.alpha=1.0f;
  }
  animatedCell.translateY=appearing ? translationY : 0;
  ValueAnimator animator=ValueAnimator.ofFloat(animatedCell.translateY,appearing ? 0 : translationY);
  animator.setInterpolator(interpolator);
  animator.setDuration(duration);
  animator.setStartDelay(delay);
  animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(){
    @Override public void onAnimationUpdate(    ValueAnimator animation){
      float animatedFraction=animation.getAnimatedFraction();
      if (appearing) {
        animatedCell.scale=animatedFraction;
      }
 else {
        animatedCell.alpha=1 - animatedFraction;
      }
      animatedCell.translateY=(float)animation.getAnimatedValue();
      mLockPatternView.invalidate();
    }
  }
);
  if (finishListener != null) {
    animator.addListener(new AnimatorListenerAdapter(){
      @Override public void onAnimationEnd(      Animator animation){
        finishListener.run();
      }
    }
);
    mAppearAnimationUtils.createAnimation(mEcaView,delay,duration,translationY,appearing,interpolator,null);
  }
  animator.start();
  mLockPatternView.invalidate();
}
Program: 195813
Project: 195813
Buggy source:
/** 
 * @hide
 */
public void callActivityOnNewIntent(Activity activity,ReferrerIntent intent){
  final String oldReferrer=activity.mReferrer;
  try {
    activity.mReferrer=intent.mReferrer;
    callActivityOnNewIntent(activity,new Intent(intent));
  }
  finally {
    activity.mReferrer=oldReferrer;
  }
}

Fixed version (ground truth):
/** 
 * @hide
 */
public void callActivityOnNewIntent(Activity activity,ReferrerIntent intent){
  final String oldReferrer=activity.mReferrer;
  try {
    if (intent != null) {
      activity.mReferrer=intent.mReferrer;
    }
    callActivityOnNewIntent(activity,intent != null ? new Intent(intent) : null);
  }
  finally {
    activity.mReferrer=oldReferrer;
  }
}
Program: 195815
Project: 195815
Buggy source:
private void toUriFragment(StringBuilder uri,String scheme,String defAction,String defPackage,int flags){
  StringBuilder frag=new StringBuilder(128);
  toUriInner(frag,scheme,defAction,defPackage,flags);
  if (mSelector != null) {
    uri.append("String_Node_Str");
    mSelector.toUriInner(frag,mSelector.mData != null ? mSelector.mData.getScheme() : null,null,null,flags);
  }
  if (frag.length() > 0) {
    uri.append("String_Node_Str");
    uri.append(frag);
    uri.append("String_Node_Str");
  }
}

Fixed version (ground truth):
private void toUriFragment(StringBuilder uri,String scheme,String defAction,String defPackage,int flags){
  StringBuilder frag=new StringBuilder(128);
  toUriInner(frag,scheme,defAction,defPackage,flags);
  if (mSelector != null) {
    frag.append("String_Node_Str");
    mSelector.toUriInner(frag,mSelector.mData != null ? mSelector.mData.getScheme() : null,null,null,flags);
  }
  if (frag.length() > 0) {
    uri.append("String_Node_Str");
    uri.append(frag);
    uri.append("String_Node_Str");
  }
}
Program: 195816
Project: 195816
Buggy source:
private void moveToRunningState(){
  mState=STATE_RUNNING;
  nStart(mNativePtr.get(),this);
  notifyStartListeners();
}

Fixed version (ground truth):
private void moveToRunningState(){
  mState=STATE_RUNNING;
  if (mNativePtr != null) {
    nStart(mNativePtr.get());
  }
  notifyStartListeners();
}
Program: 195817
Project: 195817
Buggy source:
@Override public void cancel(){
  if (mState != STATE_PREPARE && mState != STATE_FINISHED) {
    if (mState == STATE_DELAYED) {
      getHelper().removeDelayedAnimation(this);
      moveToRunningState();
    }
    nEnd(mNativePtr.get());
    final ArrayList<AnimatorListener> listeners=cloneListeners();
    final int numListeners=listeners == null ? 0 : listeners.size();
    for (int i=0; i < numListeners; i++) {
      listeners.get(i).onAnimationCancel(this);
    }
    if (mViewTarget != null) {
      mViewTarget.invalidateViewProperty(true,false);
    }
  }
}

Fixed version (ground truth):
@Override public void cancel(){
  if (mState != STATE_PREPARE && mState != STATE_FINISHED) {
    if (mState == STATE_DELAYED) {
      getHelper().removeDelayedAnimation(this);
      moveToRunningState();
    }
    final ArrayList<AnimatorListener> listeners=cloneListeners();
    final int numListeners=listeners == null ? 0 : listeners.size();
    for (int i=0; i < numListeners; i++) {
      listeners.get(i).onAnimationCancel(this);
    }
    end();
  }
}
Program: 195818
Project: 195818
Buggy source:
protected void onFinished(){
  if (mState == STATE_DELAYED) {
    getHelper().removeDelayedAnimation(this);
    notifyStartListeners();
  }
  mState=STATE_FINISHED;
  final ArrayList<AnimatorListener> listeners=cloneListeners();
  final int numListeners=listeners == null ? 0 : listeners.size();
  for (int i=0; i < numListeners; i++) {
    listeners.get(i).onAnimationEnd(this);
  }
  mNativePtr.release();
  mNativePtr=null;
}

Fixed version (ground truth):
protected void onFinished(){
  if (mState == STATE_PREPARE) {
    releaseNativePtr();
    return;
  }
  if (mState == STATE_DELAYED) {
    getHelper().removeDelayedAnimation(this);
    notifyStartListeners();
  }
  mState=STATE_FINISHED;
  final ArrayList<AnimatorListener> listeners=cloneListeners();
  final int numListeners=listeners == null ? 0 : listeners.size();
  for (int i=0; i < numListeners; i++) {
    listeners.get(i).onAnimationEnd(this);
  }
  releaseNativePtr();
}
Program: 195819
Project: 195819
Buggy source:
private void setTarget(RenderNode node){
  if (mTarget != null) {
    throw new IllegalStateException("String_Node_Str");
  }
  mTarget=node;
  mTarget.addAnimator(this);
}

Fixed version (ground truth):
private void setTarget(RenderNode node){
  checkMutable();
  if (mTarget != null) {
    throw new IllegalStateException("String_Node_Str");
  }
  nSetListener(mNativePtr.get(),this);
  mTarget=node;
  mTarget.addAnimator(this);
}
Program: 195820
Project: 195820
Buggy source:
@Override public void end(){
  if (mState != STATE_FINISHED) {
    if (mState < STATE_RUNNING) {
      getHelper().removeDelayedAnimation(this);
      doStart();
    }
    nEnd(mNativePtr.get());
    if (mViewTarget != null) {
      mViewTarget.invalidateViewProperty(true,false);
    }
  }
}

Fixed version (ground truth):
@Override public void end(){
  if (mState != STATE_FINISHED) {
    if (mState < STATE_RUNNING) {
      getHelper().removeDelayedAnimation(this);
      doStart();
    }
    if (mNativePtr != null) {
      nEnd(mNativePtr.get());
      if (mViewTarget != null) {
        mViewTarget.invalidateViewProperty(true,false);
      }
    }
 else {
      onFinished();
    }
  }
}
Program: 195821
Project: 195821
Buggy source:
private void checkMutable(){
  if (mState != STATE_PREPARE) {
    throw new IllegalStateException("String_Node_Str");
  }
}

Fixed version (ground truth):
private void checkMutable(){
  if (mState != STATE_PREPARE) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (mNativePtr == null) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str");
  }
}
Program: 195822
Project: 195822
Buggy source:
@Override public void start(){
  if (mTarget == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (mState != STATE_PREPARE) {
    throw new IllegalStateException("String_Node_Str");
  }
  mState=STATE_DELAYED;
  applyInterpolator();
  if (mStartDelay <= 0 || !mUiThreadHandlesDelay) {
    nSetStartDelay(mNativePtr.get(),mStartDelay);
    doStart();
  }
 else {
    getHelper().addDelayedAnimation(this);
  }
}

Fixed version (ground truth):
@Override public void start(){
  if (mTarget == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (mState != STATE_PREPARE) {
    throw new IllegalStateException("String_Node_Str");
  }
  mState=STATE_DELAYED;
  applyInterpolator();
  if (mNativePtr == null) {
    cancel();
  }
 else   if (mStartDelay <= 0 || !mUiThreadHandlesDelay) {
    nSetStartDelay(mNativePtr.get(),mStartDelay);
    doStart();
  }
 else {
    getHelper().addDelayedAnimation(this);
  }
}
Program: 195823
Project: 195823
Buggy source:
private static native void nStart(long animPtr,RenderNodeAnimator finishListener);

Fixed version (ground truth):
private static native void nStart(long animPtr);
Program: 195824
Project: 195824
Buggy source:
private void moveToRunningState(){
  mState=STATE_RUNNING;
  nStart(mNativePtr.get(),this);
  notifyStartListeners();
}

Fixed version (ground truth):
private void moveToRunningState(){
  mState=STATE_RUNNING;
  if (mNativePtr != null) {
    nStart(mNativePtr.get());
  }
  notifyStartListeners();
}
Program: 195825
Project: 195825
Buggy source:
@Override public void cancel(){
  if (mState != STATE_PREPARE && mState != STATE_FINISHED) {
    if (mState == STATE_DELAYED) {
      getHelper().removeDelayedAnimation(this);
      moveToRunningState();
    }
    nEnd(mNativePtr.get());
    final ArrayList<AnimatorListener> listeners=cloneListeners();
    final int numListeners=listeners == null ? 0 : listeners.size();
    for (int i=0; i < numListeners; i++) {
      listeners.get(i).onAnimationCancel(this);
    }
    if (mViewTarget != null) {
      mViewTarget.invalidateViewProperty(true,false);
    }
  }
}

Fixed version (ground truth):
@Override public void cancel(){
  if (mState != STATE_PREPARE && mState != STATE_FINISHED) {
    if (mState == STATE_DELAYED) {
      getHelper().removeDelayedAnimation(this);
      moveToRunningState();
    }
    final ArrayList<AnimatorListener> listeners=cloneListeners();
    final int numListeners=listeners == null ? 0 : listeners.size();
    for (int i=0; i < numListeners; i++) {
      listeners.get(i).onAnimationCancel(this);
    }
    end();
  }
}
Program: 195826
Project: 195826
Buggy source:
protected void onFinished(){
  if (mState == STATE_DELAYED) {
    getHelper().removeDelayedAnimation(this);
    notifyStartListeners();
  }
  mState=STATE_FINISHED;
  final ArrayList<AnimatorListener> listeners=cloneListeners();
  final int numListeners=listeners == null ? 0 : listeners.size();
  for (int i=0; i < numListeners; i++) {
    listeners.get(i).onAnimationEnd(this);
  }
  mNativePtr.release();
  mNativePtr=null;
}

Fixed version (ground truth):
protected void onFinished(){
  if (mState == STATE_PREPARE) {
    releaseNativePtr();
    return;
  }
  if (mState == STATE_DELAYED) {
    getHelper().removeDelayedAnimation(this);
    notifyStartListeners();
  }
  mState=STATE_FINISHED;
  final ArrayList<AnimatorListener> listeners=cloneListeners();
  final int numListeners=listeners == null ? 0 : listeners.size();
  for (int i=0; i < numListeners; i++) {
    listeners.get(i).onAnimationEnd(this);
  }
  releaseNativePtr();
}
Program: 195827
Project: 195827
Buggy source:
private void setTarget(RenderNode node){
  if (mTarget != null) {
    throw new IllegalStateException("String_Node_Str");
  }
  mTarget=node;
  mTarget.addAnimator(this);
}

Fixed version (ground truth):
private void setTarget(RenderNode node){
  checkMutable();
  if (mTarget != null) {
    throw new IllegalStateException("String_Node_Str");
  }
  nSetListener(mNativePtr.get(),this);
  mTarget=node;
  mTarget.addAnimator(this);
}
Program: 195828
Project: 195828
Buggy source:
@Override public void end(){
  if (mState != STATE_FINISHED) {
    if (mState < STATE_RUNNING) {
      getHelper().removeDelayedAnimation(this);
      doStart();
    }
    nEnd(mNativePtr.get());
    if (mViewTarget != null) {
      mViewTarget.invalidateViewProperty(true,false);
    }
  }
}

Fixed version (ground truth):
@Override public void end(){
  if (mState != STATE_FINISHED) {
    if (mState < STATE_RUNNING) {
      getHelper().removeDelayedAnimation(this);
      doStart();
    }
    if (mNativePtr != null) {
      nEnd(mNativePtr.get());
      if (mViewTarget != null) {
        mViewTarget.invalidateViewProperty(true,false);
      }
    }
 else {
      onFinished();
    }
  }
}
Program: 195829
Project: 195829
Buggy source:
private void checkMutable(){
  if (mState != STATE_PREPARE) {
    throw new IllegalStateException("String_Node_Str");
  }
}

Fixed version (ground truth):
private void checkMutable(){
  if (mState != STATE_PREPARE) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (mNativePtr == null) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str");
  }
}
Program: 195830
Project: 195830
Buggy source:
@Override public void start(){
  if (mTarget == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (mState != STATE_PREPARE) {
    throw new IllegalStateException("String_Node_Str");
  }
  mState=STATE_DELAYED;
  applyInterpolator();
  if (mStartDelay <= 0 || !mUiThreadHandlesDelay) {
    nSetStartDelay(mNativePtr.get(),mStartDelay);
    doStart();
  }
 else {
    getHelper().addDelayedAnimation(this);
  }
}

Fixed version (ground truth):
@Override public void start(){
  if (mTarget == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (mState != STATE_PREPARE) {
    throw new IllegalStateException("String_Node_Str");
  }
  mState=STATE_DELAYED;
  applyInterpolator();
  if (mNativePtr == null) {
    cancel();
  }
 else   if (mStartDelay <= 0 || !mUiThreadHandlesDelay) {
    nSetStartDelay(mNativePtr.get(),mStartDelay);
    doStart();
  }
 else {
    getHelper().addDelayedAnimation(this);
  }
}
Program: 195831
Project: 195831
Buggy source:
private static native void nStart(long animPtr,RenderNodeAnimator finishListener);

Fixed version (ground truth):
private static native void nStart(long animPtr);
Program: 195832
Project: 195832
Buggy source:
private void moveToRunningState(){
  mState=STATE_RUNNING;
  nStart(mNativePtr.get(),this);
  notifyStartListeners();
}

Fixed version (ground truth):
private void moveToRunningState(){
  mState=STATE_RUNNING;
  if (mNativePtr != null) {
    nStart(mNativePtr.get());
  }
  notifyStartListeners();
}
Program: 195833
Project: 195833
Buggy source:
@Override public void cancel(){
  if (mState != STATE_PREPARE && mState != STATE_FINISHED) {
    if (mState == STATE_DELAYED) {
      getHelper().removeDelayedAnimation(this);
      moveToRunningState();
    }
    nEnd(mNativePtr.get());
    final ArrayList<AnimatorListener> listeners=cloneListeners();
    final int numListeners=listeners == null ? 0 : listeners.size();
    for (int i=0; i < numListeners; i++) {
      listeners.get(i).onAnimationCancel(this);
    }
    if (mViewTarget != null) {
      mViewTarget.invalidateViewProperty(true,false);
    }
  }
}

Fixed version (ground truth):
@Override public void cancel(){
  if (mState != STATE_PREPARE && mState != STATE_FINISHED) {
    if (mState == STATE_DELAYED) {
      getHelper().removeDelayedAnimation(this);
      moveToRunningState();
    }
    final ArrayList<AnimatorListener> listeners=cloneListeners();
    final int numListeners=listeners == null ? 0 : listeners.size();
    for (int i=0; i < numListeners; i++) {
      listeners.get(i).onAnimationCancel(this);
    }
    end();
  }
}
Program: 195834
Project: 195834
Buggy source:
protected void onFinished(){
  if (mState == STATE_DELAYED) {
    getHelper().removeDelayedAnimation(this);
    notifyStartListeners();
  }
  mState=STATE_FINISHED;
  final ArrayList<AnimatorListener> listeners=cloneListeners();
  final int numListeners=listeners == null ? 0 : listeners.size();
  for (int i=0; i < numListeners; i++) {
    listeners.get(i).onAnimationEnd(this);
  }
  mNativePtr.release();
  mNativePtr=null;
}

Fixed version (ground truth):
protected void onFinished(){
  if (mState == STATE_PREPARE) {
    releaseNativePtr();
    return;
  }
  if (mState == STATE_DELAYED) {
    getHelper().removeDelayedAnimation(this);
    notifyStartListeners();
  }
  mState=STATE_FINISHED;
  final ArrayList<AnimatorListener> listeners=cloneListeners();
  final int numListeners=listeners == null ? 0 : listeners.size();
  for (int i=0; i < numListeners; i++) {
    listeners.get(i).onAnimationEnd(this);
  }
  releaseNativePtr();
}
Program: 195835
Project: 195835
Buggy source:
private void setTarget(RenderNode node){
  if (mTarget != null) {
    throw new IllegalStateException("String_Node_Str");
  }
  mTarget=node;
  mTarget.addAnimator(this);
}

Fixed version (ground truth):
private void setTarget(RenderNode node){
  checkMutable();
  if (mTarget != null) {
    throw new IllegalStateException("String_Node_Str");
  }
  nSetListener(mNativePtr.get(),this);
  mTarget=node;
  mTarget.addAnimator(this);
}
Program: 195836
Project: 195836
Buggy source:
@Override public void end(){
  if (mState != STATE_FINISHED) {
    if (mState < STATE_RUNNING) {
      getHelper().removeDelayedAnimation(this);
      doStart();
    }
    nEnd(mNativePtr.get());
    if (mViewTarget != null) {
      mViewTarget.invalidateViewProperty(true,false);
    }
  }
}

Fixed version (ground truth):
@Override public void end(){
  if (mState != STATE_FINISHED) {
    if (mState < STATE_RUNNING) {
      getHelper().removeDelayedAnimation(this);
      doStart();
    }
    if (mNativePtr != null) {
      nEnd(mNativePtr.get());
      if (mViewTarget != null) {
        mViewTarget.invalidateViewProperty(true,false);
      }
    }
 else {
      onFinished();
    }
  }
}
Program: 195837
Project: 195837
Buggy source:
private void checkMutable(){
  if (mState != STATE_PREPARE) {
    throw new IllegalStateException("String_Node_Str");
  }
}

Fixed version (ground truth):
private void checkMutable(){
  if (mState != STATE_PREPARE) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (mNativePtr == null) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str");
  }
}
Program: 195838
Project: 195838
Buggy source:
@Override public void start(){
  if (mTarget == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (mState != STATE_PREPARE) {
    throw new IllegalStateException("String_Node_Str");
  }
  mState=STATE_DELAYED;
  applyInterpolator();
  if (mStartDelay <= 0 || !mUiThreadHandlesDelay) {
    nSetStartDelay(mNativePtr.get(),mStartDelay);
    doStart();
  }
 else {
    getHelper().addDelayedAnimation(this);
  }
}

Fixed version (ground truth):
@Override public void start(){
  if (mTarget == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (mState != STATE_PREPARE) {
    throw new IllegalStateException("String_Node_Str");
  }
  mState=STATE_DELAYED;
  applyInterpolator();
  if (mNativePtr == null) {
    cancel();
  }
 else   if (mStartDelay <= 0 || !mUiThreadHandlesDelay) {
    nSetStartDelay(mNativePtr.get(),mStartDelay);
    doStart();
  }
 else {
    getHelper().addDelayedAnimation(this);
  }
}
Program: 195839
Project: 195839
Buggy source:
private static native void nStart(long animPtr,RenderNodeAnimator finishListener);

Fixed version (ground truth):
private static native void nStart(long animPtr);
Program: 195840
Project: 195840
Buggy source:
private void moveToRunningState(){
  mState=STATE_RUNNING;
  nStart(mNativePtr.get(),this);
  notifyStartListeners();
}

Fixed version (ground truth):
private void moveToRunningState(){
  mState=STATE_RUNNING;
  if (mNativePtr != null) {
    nStart(mNativePtr.get());
  }
  notifyStartListeners();
}
Program: 195841
Project: 195841
Buggy source:
@Override public void cancel(){
  if (mState != STATE_PREPARE && mState != STATE_FINISHED) {
    if (mState == STATE_DELAYED) {
      getHelper().removeDelayedAnimation(this);
      moveToRunningState();
    }
    nEnd(mNativePtr.get());
    final ArrayList<AnimatorListener> listeners=cloneListeners();
    final int numListeners=listeners == null ? 0 : listeners.size();
    for (int i=0; i < numListeners; i++) {
      listeners.get(i).onAnimationCancel(this);
    }
    if (mViewTarget != null) {
      mViewTarget.invalidateViewProperty(true,false);
    }
  }
}

Fixed version (ground truth):
@Override public void cancel(){
  if (mState != STATE_PREPARE && mState != STATE_FINISHED) {
    if (mState == STATE_DELAYED) {
      getHelper().removeDelayedAnimation(this);
      moveToRunningState();
    }
    final ArrayList<AnimatorListener> listeners=cloneListeners();
    final int numListeners=listeners == null ? 0 : listeners.size();
    for (int i=0; i < numListeners; i++) {
      listeners.get(i).onAnimationCancel(this);
    }
    end();
  }
}
Program: 195842
Project: 195842
Buggy source:
protected void onFinished(){
  if (mState == STATE_DELAYED) {
    getHelper().removeDelayedAnimation(this);
    notifyStartListeners();
  }
  mState=STATE_FINISHED;
  final ArrayList<AnimatorListener> listeners=cloneListeners();
  final int numListeners=listeners == null ? 0 : listeners.size();
  for (int i=0; i < numListeners; i++) {
    listeners.get(i).onAnimationEnd(this);
  }
  mNativePtr.release();
  mNativePtr=null;
}

Fixed version (ground truth):
protected void onFinished(){
  if (mState == STATE_PREPARE) {
    releaseNativePtr();
    return;
  }
  if (mState == STATE_DELAYED) {
    getHelper().removeDelayedAnimation(this);
    notifyStartListeners();
  }
  mState=STATE_FINISHED;
  final ArrayList<AnimatorListener> listeners=cloneListeners();
  final int numListeners=listeners == null ? 0 : listeners.size();
  for (int i=0; i < numListeners; i++) {
    listeners.get(i).onAnimationEnd(this);
  }
  releaseNativePtr();
}
Program: 195843
Project: 195843
Buggy source:
private void setTarget(RenderNode node){
  if (mTarget != null) {
    throw new IllegalStateException("String_Node_Str");
  }
  mTarget=node;
  mTarget.addAnimator(this);
}

Fixed version (ground truth):
private void setTarget(RenderNode node){
  checkMutable();
  if (mTarget != null) {
    throw new IllegalStateException("String_Node_Str");
  }
  nSetListener(mNativePtr.get(),this);
  mTarget=node;
  mTarget.addAnimator(this);
}
Program: 195844
Project: 195844
Buggy source:
@Override public void end(){
  if (mState != STATE_FINISHED) {
    if (mState < STATE_RUNNING) {
      getHelper().removeDelayedAnimation(this);
      doStart();
    }
    nEnd(mNativePtr.get());
    if (mViewTarget != null) {
      mViewTarget.invalidateViewProperty(true,false);
    }
  }
}

Fixed version (ground truth):
@Override public void end(){
  if (mState != STATE_FINISHED) {
    if (mState < STATE_RUNNING) {
      getHelper().removeDelayedAnimation(this);
      doStart();
    }
    if (mNativePtr != null) {
      nEnd(mNativePtr.get());
      if (mViewTarget != null) {
        mViewTarget.invalidateViewProperty(true,false);
      }
    }
 else {
      onFinished();
    }
  }
}
Program: 195845
Project: 195845
Buggy source:
private void checkMutable(){
  if (mState != STATE_PREPARE) {
    throw new IllegalStateException("String_Node_Str");
  }
}

Fixed version (ground truth):
private void checkMutable(){
  if (mState != STATE_PREPARE) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (mNativePtr == null) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str");
  }
}
Program: 195846
Project: 195846
Buggy source:
@Override public void start(){
  if (mTarget == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (mState != STATE_PREPARE) {
    throw new IllegalStateException("String_Node_Str");
  }
  mState=STATE_DELAYED;
  applyInterpolator();
  if (mStartDelay <= 0 || !mUiThreadHandlesDelay) {
    nSetStartDelay(mNativePtr.get(),mStartDelay);
    doStart();
  }
 else {
    getHelper().addDelayedAnimation(this);
  }
}

Fixed version (ground truth):
@Override public void start(){
  if (mTarget == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (mState != STATE_PREPARE) {
    throw new IllegalStateException("String_Node_Str");
  }
  mState=STATE_DELAYED;
  applyInterpolator();
  if (mNativePtr == null) {
    cancel();
  }
 else   if (mStartDelay <= 0 || !mUiThreadHandlesDelay) {
    nSetStartDelay(mNativePtr.get(),mStartDelay);
    doStart();
  }
 else {
    getHelper().addDelayedAnimation(this);
  }
}
Program: 195847
Project: 195847
Buggy source:
private static native void nStart(long animPtr,RenderNodeAnimator finishListener);

Fixed version (ground truth):
private static native void nStart(long animPtr);
Program: 195848
Project: 195848
Buggy source:
private void moveToRunningState(){
  mState=STATE_RUNNING;
  nStart(mNativePtr.get(),this);
  notifyStartListeners();
}

Fixed version (ground truth):
private void moveToRunningState(){
  mState=STATE_RUNNING;
  if (mNativePtr != null) {
    nStart(mNativePtr.get());
  }
  notifyStartListeners();
}
Program: 195849
Project: 195849
Buggy source:
@Override public void cancel(){
  if (mState != STATE_PREPARE && mState != STATE_FINISHED) {
    if (mState == STATE_DELAYED) {
      getHelper().removeDelayedAnimation(this);
      moveToRunningState();
    }
    nEnd(mNativePtr.get());
    final ArrayList<AnimatorListener> listeners=cloneListeners();
    final int numListeners=listeners == null ? 0 : listeners.size();
    for (int i=0; i < numListeners; i++) {
      listeners.get(i).onAnimationCancel(this);
    }
    if (mViewTarget != null) {
      mViewTarget.invalidateViewProperty(true,false);
    }
  }
}

Fixed version (ground truth):
@Override public void cancel(){
  if (mState != STATE_PREPARE && mState != STATE_FINISHED) {
    if (mState == STATE_DELAYED) {
      getHelper().removeDelayedAnimation(this);
      moveToRunningState();
    }
    final ArrayList<AnimatorListener> listeners=cloneListeners();
    final int numListeners=listeners == null ? 0 : listeners.size();
    for (int i=0; i < numListeners; i++) {
      listeners.get(i).onAnimationCancel(this);
    }
    end();
  }
}
Program: 195850
Project: 195850
Buggy source:
protected void onFinished(){
  if (mState == STATE_DELAYED) {
    getHelper().removeDelayedAnimation(this);
    notifyStartListeners();
  }
  mState=STATE_FINISHED;
  final ArrayList<AnimatorListener> listeners=cloneListeners();
  final int numListeners=listeners == null ? 0 : listeners.size();
  for (int i=0; i < numListeners; i++) {
    listeners.get(i).onAnimationEnd(this);
  }
  mNativePtr.release();
  mNativePtr=null;
}

Fixed version (ground truth):
protected void onFinished(){
  if (mState == STATE_PREPARE) {
    releaseNativePtr();
    return;
  }
  if (mState == STATE_DELAYED) {
    getHelper().removeDelayedAnimation(this);
    notifyStartListeners();
  }
  mState=STATE_FINISHED;
  final ArrayList<AnimatorListener> listeners=cloneListeners();
  final int numListeners=listeners == null ? 0 : listeners.size();
  for (int i=0; i < numListeners; i++) {
    listeners.get(i).onAnimationEnd(this);
  }
  releaseNativePtr();
}
Program: 195851
Project: 195851
Buggy source:
private void setTarget(RenderNode node){
  if (mTarget != null) {
    throw new IllegalStateException("String_Node_Str");
  }
  mTarget=node;
  mTarget.addAnimator(this);
}

Fixed version (ground truth):
private void setTarget(RenderNode node){
  checkMutable();
  if (mTarget != null) {
    throw new IllegalStateException("String_Node_Str");
  }
  nSetListener(mNativePtr.get(),this);
  mTarget=node;
  mTarget.addAnimator(this);
}
Program: 195852
Project: 195852
Buggy source:
@Override public void end(){
  if (mState != STATE_FINISHED) {
    if (mState < STATE_RUNNING) {
      getHelper().removeDelayedAnimation(this);
      doStart();
    }
    nEnd(mNativePtr.get());
    if (mViewTarget != null) {
      mViewTarget.invalidateViewProperty(true,false);
    }
  }
}

Fixed version (ground truth):
@Override public void end(){
  if (mState != STATE_FINISHED) {
    if (mState < STATE_RUNNING) {
      getHelper().removeDelayedAnimation(this);
      doStart();
    }
    if (mNativePtr != null) {
      nEnd(mNativePtr.get());
      if (mViewTarget != null) {
        mViewTarget.invalidateViewProperty(true,false);
      }
    }
 else {
      onFinished();
    }
  }
}
Program: 195853
Project: 195853
Buggy source:
private void checkMutable(){
  if (mState != STATE_PREPARE) {
    throw new IllegalStateException("String_Node_Str");
  }
}

Fixed version (ground truth):
private void checkMutable(){
  if (mState != STATE_PREPARE) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (mNativePtr == null) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str");
  }
}
Program: 195854
Project: 195854
Buggy source:
@Override public void start(){
  if (mTarget == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (mState != STATE_PREPARE) {
    throw new IllegalStateException("String_Node_Str");
  }
  mState=STATE_DELAYED;
  applyInterpolator();
  if (mStartDelay <= 0 || !mUiThreadHandlesDelay) {
    nSetStartDelay(mNativePtr.get(),mStartDelay);
    doStart();
  }
 else {
    getHelper().addDelayedAnimation(this);
  }
}

Fixed version (ground truth):
@Override public void start(){
  if (mTarget == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (mState != STATE_PREPARE) {
    throw new IllegalStateException("String_Node_Str");
  }
  mState=STATE_DELAYED;
  applyInterpolator();
  if (mNativePtr == null) {
    cancel();
  }
 else   if (mStartDelay <= 0 || !mUiThreadHandlesDelay) {
    nSetStartDelay(mNativePtr.get(),mStartDelay);
    doStart();
  }
 else {
    getHelper().addDelayedAnimation(this);
  }
}
Program: 195855
Project: 195855
Buggy source:
private static native void nStart(long animPtr,RenderNodeAnimator finishListener);

Fixed version (ground truth):
private static native void nStart(long animPtr);
Program: 195856
Project: 195856
Buggy source:
private static Calendar tomorrowMidnight(){
  Calendar calendar=Calendar.getInstance();
  calendar.setTimeInMillis(System.currentTimeMillis());
  calendar.set(Calendar.HOUR_OF_DAY,0);
  calendar.set(Calendar.MINUTE,0);
  calendar.set(Calendar.SECOND,0);
  calendar.set(Calendar.MILLISECOND,0);
  calendar.add(Calendar.DAY_OF_MONTH,1);
  return calendar;
}

Fixed version (ground truth):
private static Calendar tomorrowMidnight(){
  Calendar calendar=Calendar.getInstance();
  calendar.setTimeInMillis(System.currentTimeMillis());
  calendar.set(Calendar.HOUR_OF_DAY,3);
  calendar.set(Calendar.MINUTE,0);
  calendar.set(Calendar.SECOND,0);
  calendar.set(Calendar.MILLISECOND,0);
  calendar.add(Calendar.DAY_OF_MONTH,1);
  return calendar;
}
Program: 195857
Project: 195857
Buggy source:
@Override public boolean onStartJob(JobParameters params){
  mJobParams=params;
  MountService ms=MountService.sSelf;
  if (ms != null) {
synchronized (mFinishCallback) {
      mStarted=true;
    }
    ms.runIdleMaintenance(mFinishCallback);
  }
  return ms != null;
}

Fixed version (ground truth):
@Override public boolean onStartJob(JobParameters params){
  try {
    ActivityManagerNative.getDefault().performIdleMaintenance();
  }
 catch (  RemoteException e) {
  }
  mJobParams=params;
  MountService ms=MountService.sSelf;
  if (ms != null) {
synchronized (mFinishCallback) {
      mStarted=true;
    }
    ms.runIdleMaintenance(mFinishCallback);
  }
  return ms != null;
}
Program: 195861
Project: 195861
Buggy source:
private static Calendar tomorrowMidnight(){
  Calendar calendar=Calendar.getInstance();
  calendar.setTimeInMillis(System.currentTimeMillis());
  calendar.set(Calendar.HOUR_OF_DAY,0);
  calendar.set(Calendar.MINUTE,0);
  calendar.set(Calendar.SECOND,0);
  calendar.set(Calendar.MILLISECOND,0);
  calendar.add(Calendar.DAY_OF_MONTH,1);
  return calendar;
}

Fixed version (ground truth):
private static Calendar tomorrowMidnight(){
  Calendar calendar=Calendar.getInstance();
  calendar.setTimeInMillis(System.currentTimeMillis());
  calendar.set(Calendar.HOUR_OF_DAY,3);
  calendar.set(Calendar.MINUTE,0);
  calendar.set(Calendar.SECOND,0);
  calendar.set(Calendar.MILLISECOND,0);
  calendar.add(Calendar.DAY_OF_MONTH,1);
  return calendar;
}
Program: 195862
Project: 195862
Buggy source:
@Override public boolean onStartJob(JobParameters params){
  mJobParams=params;
  MountService ms=MountService.sSelf;
  if (ms != null) {
synchronized (mFinishCallback) {
      mStarted=true;
    }
    ms.runIdleMaintenance(mFinishCallback);
  }
  return ms != null;
}

Fixed version (ground truth):
@Override public boolean onStartJob(JobParameters params){
  try {
    ActivityManagerNative.getDefault().performIdleMaintenance();
  }
 catch (  RemoteException e) {
  }
  mJobParams=params;
  MountService ms=MountService.sSelf;
  if (ms != null) {
synchronized (mFinishCallback) {
      mStarted=true;
    }
    ms.runIdleMaintenance(mFinishCallback);
  }
  return ms != null;
}
Program: 195864
Project: 195864
Buggy source:
private static Calendar tomorrowMidnight(){
  Calendar calendar=Calendar.getInstance();
  calendar.setTimeInMillis(System.currentTimeMillis());
  calendar.set(Calendar.HOUR_OF_DAY,0);
  calendar.set(Calendar.MINUTE,0);
  calendar.set(Calendar.SECOND,0);
  calendar.set(Calendar.MILLISECOND,0);
  calendar.add(Calendar.DAY_OF_MONTH,1);
  return calendar;
}

Fixed version (ground truth):
private static Calendar tomorrowMidnight(){
  Calendar calendar=Calendar.getInstance();
  calendar.setTimeInMillis(System.currentTimeMillis());
  calendar.set(Calendar.HOUR_OF_DAY,3);
  calendar.set(Calendar.MINUTE,0);
  calendar.set(Calendar.SECOND,0);
  calendar.set(Calendar.MILLISECOND,0);
  calendar.add(Calendar.DAY_OF_MONTH,1);
  return calendar;
}
Program: 195865
Project: 195865
Buggy source:
@Override public boolean onStartJob(JobParameters params){
  mJobParams=params;
  MountService ms=MountService.sSelf;
  if (ms != null) {
synchronized (mFinishCallback) {
      mStarted=true;
    }
    ms.runIdleMaintenance(mFinishCallback);
  }
  return ms != null;
}

Fixed version (ground truth):
@Override public boolean onStartJob(JobParameters params){
  try {
    ActivityManagerNative.getDefault().performIdleMaintenance();
  }
 catch (  RemoteException e) {
  }
  mJobParams=params;
  MountService ms=MountService.sSelf;
  if (ms != null) {
synchronized (mFinishCallback) {
      mStarted=true;
    }
    ms.runIdleMaintenance(mFinishCallback);
  }
  return ms != null;
}
Program: 195867
Project: 195867
Buggy source:
private static Calendar tomorrowMidnight(){
  Calendar calendar=Calendar.getInstance();
  calendar.setTimeInMillis(System.currentTimeMillis());
  calendar.set(Calendar.HOUR_OF_DAY,0);
  calendar.set(Calendar.MINUTE,0);
  calendar.set(Calendar.SECOND,0);
  calendar.set(Calendar.MILLISECOND,0);
  calendar.add(Calendar.DAY_OF_MONTH,1);
  return calendar;
}

Fixed version (ground truth):
private static Calendar tomorrowMidnight(){
  Calendar calendar=Calendar.getInstance();
  calendar.setTimeInMillis(System.currentTimeMillis());
  calendar.set(Calendar.HOUR_OF_DAY,3);
  calendar.set(Calendar.MINUTE,0);
  calendar.set(Calendar.SECOND,0);
  calendar.set(Calendar.MILLISECOND,0);
  calendar.add(Calendar.DAY_OF_MONTH,1);
  return calendar;
}
Program: 195868
Project: 195868
Buggy source:
@Override public boolean onStartJob(JobParameters params){
  mJobParams=params;
  MountService ms=MountService.sSelf;
  if (ms != null) {
synchronized (mFinishCallback) {
      mStarted=true;
    }
    ms.runIdleMaintenance(mFinishCallback);
  }
  return ms != null;
}

Fixed version (ground truth):
@Override public boolean onStartJob(JobParameters params){
  try {
    ActivityManagerNative.getDefault().performIdleMaintenance();
  }
 catch (  RemoteException e) {
  }
  mJobParams=params;
  MountService ms=MountService.sSelf;
  if (ms != null) {
synchronized (mFinishCallback) {
      mStarted=true;
    }
    ms.runIdleMaintenance(mFinishCallback);
  }
  return ms != null;
}
Program: 195876
Project: 195876
Buggy source:
private static Calendar tomorrowMidnight(){
  Calendar calendar=Calendar.getInstance();
  calendar.setTimeInMillis(System.currentTimeMillis());
  calendar.set(Calendar.HOUR_OF_DAY,0);
  calendar.set(Calendar.MINUTE,0);
  calendar.set(Calendar.SECOND,0);
  calendar.set(Calendar.MILLISECOND,0);
  calendar.add(Calendar.DAY_OF_MONTH,1);
  return calendar;
}

Fixed version (ground truth):
private static Calendar tomorrowMidnight(){
  Calendar calendar=Calendar.getInstance();
  calendar.setTimeInMillis(System.currentTimeMillis());
  calendar.set(Calendar.HOUR_OF_DAY,3);
  calendar.set(Calendar.MINUTE,0);
  calendar.set(Calendar.SECOND,0);
  calendar.set(Calendar.MILLISECOND,0);
  calendar.add(Calendar.DAY_OF_MONTH,1);
  return calendar;
}
Program: 195877
Project: 195877
Buggy source:
@Override public boolean onStartJob(JobParameters params){
  mJobParams=params;
  MountService ms=MountService.sSelf;
  if (ms != null) {
synchronized (mFinishCallback) {
      mStarted=true;
    }
    ms.runIdleMaintenance(mFinishCallback);
  }
  return ms != null;
}

Fixed version (ground truth):
@Override public boolean onStartJob(JobParameters params){
  try {
    ActivityManagerNative.getDefault().performIdleMaintenance();
  }
 catch (  RemoteException e) {
  }
  mJobParams=params;
  MountService ms=MountService.sSelf;
  if (ms != null) {
synchronized (mFinishCallback) {
      mStarted=true;
    }
    ms.runIdleMaintenance(mFinishCallback);
  }
  return ms != null;
}
Program: 195881
Project: 195881
Buggy source:
@LayoutlibDelegate static int getAmOrPmKeyCode(int amOrPm){
}

Fixed version (ground truth):
@LayoutlibDelegate static int getAmOrPmKeyCode(TimePickerSpinnerDelegate tpsd,int amOrPm){
}
Program: 195884
Project: 195884
Buggy source:
@LayoutlibDelegate static int getAmOrPmKeyCode(int amOrPm){
}

Fixed version (ground truth):
@LayoutlibDelegate static int getAmOrPmKeyCode(TimePickerSpinnerDelegate tpsd,int amOrPm){
}
Program: 195886
Project: 195886
Buggy source:
private void deliverNewIntents(ActivityClientRecord r,List<ReferrerIntent> intents){
  final int N=intents.size();
  for (int i=0; i < N; i++) {
    Intent intent=intents.get(i);
    intent.setExtrasClassLoader(r.activity.getClassLoader());
    intent.prepareToEnterProcess();
    r.activity.mFragments.noteStateNotSaved();
    mInstrumentation.callActivityOnNewIntent(r.activity,intent);
  }
}

Fixed version (ground truth):
private void deliverNewIntents(ActivityClientRecord r,List<ReferrerIntent> intents){
  final int N=intents.size();
  for (int i=0; i < N; i++) {
    ReferrerIntent intent=intents.get(i);
    intent.setExtrasClassLoader(r.activity.getClassLoader());
    intent.prepareToEnterProcess();
    r.activity.mFragments.noteStateNotSaved();
    mInstrumentation.callActivityOnNewIntent(r.activity,intent);
  }
}
Program: 195887
Project: 195887
Buggy source:
/** 
 * Perform calling of an activity's   {@link Activity#onNewIntent}method.  The default implementation simply calls through to that method.
 * @param activity The activity receiving a new Intent.
 * @param intent The new intent being received.
 */
public void callActivityOnNewIntent(Activity activity,Intent intent){
  final String oldReferrer=activity.mReferrer;
  try {
    try {
      activity.mReferrer=((ReferrerIntent)intent).mReferrer;
    }
 catch (    ClassCastException e) {
      activity.mReferrer=null;
    }
    activity.onNewIntent(intent);
  }
  finally {
    activity.mReferrer=oldReferrer;
  }
}

Fixed version (ground truth):
/** 
 * @hide
 */
public void callActivityOnNewIntent(Activity activity,ReferrerIntent intent){
  final String oldReferrer=activity.mReferrer;
  try {
    activity.mReferrer=intent.mReferrer;
    callActivityOnNewIntent(activity,new Intent(intent));
  }
  finally {
    activity.mReferrer=oldReferrer;
  }
}
Program: 195888
Project: 195888
Buggy source:
private void deliverNewIntents(ActivityClientRecord r,List<ReferrerIntent> intents){
  final int N=intents.size();
  for (int i=0; i < N; i++) {
    Intent intent=intents.get(i);
    intent.setExtrasClassLoader(r.activity.getClassLoader());
    intent.prepareToEnterProcess();
    r.activity.mFragments.noteStateNotSaved();
    mInstrumentation.callActivityOnNewIntent(r.activity,intent);
  }
}

Fixed version (ground truth):
private void deliverNewIntents(ActivityClientRecord r,List<ReferrerIntent> intents){
  final int N=intents.size();
  for (int i=0; i < N; i++) {
    ReferrerIntent intent=intents.get(i);
    intent.setExtrasClassLoader(r.activity.getClassLoader());
    intent.prepareToEnterProcess();
    r.activity.mFragments.noteStateNotSaved();
    mInstrumentation.callActivityOnNewIntent(r.activity,intent);
  }
}
Program: 195889
Project: 195889
Buggy source:
/** 
 * Perform calling of an activity's   {@link Activity#onNewIntent}method.  The default implementation simply calls through to that method.
 * @param activity The activity receiving a new Intent.
 * @param intent The new intent being received.
 */
public void callActivityOnNewIntent(Activity activity,Intent intent){
  final String oldReferrer=activity.mReferrer;
  try {
    try {
      activity.mReferrer=((ReferrerIntent)intent).mReferrer;
    }
 catch (    ClassCastException e) {
      activity.mReferrer=null;
    }
    activity.onNewIntent(intent);
  }
  finally {
    activity.mReferrer=oldReferrer;
  }
}

Fixed version (ground truth):
/** 
 * @hide
 */
public void callActivityOnNewIntent(Activity activity,ReferrerIntent intent){
  final String oldReferrer=activity.mReferrer;
  try {
    activity.mReferrer=intent.mReferrer;
    callActivityOnNewIntent(activity,new Intent(intent));
  }
  finally {
    activity.mReferrer=oldReferrer;
  }
}
Program: 195890
Project: 195890
Buggy source:
private void deliverNewIntents(ActivityClientRecord r,List<ReferrerIntent> intents){
  final int N=intents.size();
  for (int i=0; i < N; i++) {
    Intent intent=intents.get(i);
    intent.setExtrasClassLoader(r.activity.getClassLoader());
    intent.prepareToEnterProcess();
    r.activity.mFragments.noteStateNotSaved();
    mInstrumentation.callActivityOnNewIntent(r.activity,intent);
  }
}

Fixed version (ground truth):
private void deliverNewIntents(ActivityClientRecord r,List<ReferrerIntent> intents){
  final int N=intents.size();
  for (int i=0; i < N; i++) {
    ReferrerIntent intent=intents.get(i);
    intent.setExtrasClassLoader(r.activity.getClassLoader());
    intent.prepareToEnterProcess();
    r.activity.mFragments.noteStateNotSaved();
    mInstrumentation.callActivityOnNewIntent(r.activity,intent);
  }
}
Program: 195891
Project: 195891
Buggy source:
/** 
 * Perform calling of an activity's   {@link Activity#onNewIntent}method.  The default implementation simply calls through to that method.
 * @param activity The activity receiving a new Intent.
 * @param intent The new intent being received.
 */
public void callActivityOnNewIntent(Activity activity,Intent intent){
  final String oldReferrer=activity.mReferrer;
  try {
    try {
      activity.mReferrer=((ReferrerIntent)intent).mReferrer;
    }
 catch (    ClassCastException e) {
      activity.mReferrer=null;
    }
    activity.onNewIntent(intent);
  }
  finally {
    activity.mReferrer=oldReferrer;
  }
}

Fixed version (ground truth):
/** 
 * @hide
 */
public void callActivityOnNewIntent(Activity activity,ReferrerIntent intent){
  final String oldReferrer=activity.mReferrer;
  try {
    activity.mReferrer=intent.mReferrer;
    callActivityOnNewIntent(activity,new Intent(intent));
  }
  finally {
    activity.mReferrer=oldReferrer;
  }
}