Program: 197890
Project: 197890
Buggy source:
/** 
 * Start an animation to the given viewState
 */
private void startAnimations(final ExpandableView child,StackScrollState.ViewState viewState,StackScrollState finalState,int i){
  int childVisibility=child.getVisibility();
  boolean wasVisible=childVisibility == View.VISIBLE;
  final float alpha=viewState.alpha;
  if (!wasVisible && alpha != 0 && !viewState.gone) {
    child.setVisibility(View.VISIBLE);
  }
  boolean yTranslationChanging=child.getTranslationY() != viewState.yTranslation;
  boolean zTranslationChanging=child.getTranslationZ() != viewState.zTranslation;
  boolean scaleChanging=child.getScaleX() != viewState.scale;
  boolean alphaChanging=alpha != child.getAlpha();
  boolean heightChanging=viewState.height != child.getActualHeight();
  boolean topInsetChanging=viewState.clipTopAmount != child.getClipTopAmount();
  boolean wasAdded=mNewAddChildren.contains(child);
  boolean hasDelays=mAnimationFilter.hasDelays;
  boolean isDelayRelevant=yTranslationChanging || zTranslationChanging || scaleChanging|| alphaChanging|| heightChanging|| topInsetChanging;
  long delay=0;
  long duration=mCurrentLength;
  if (hasDelays && isDelayRelevant || wasAdded) {
    delay=mCurrentAdditionalDelay + calculateChildAnimationDelay(viewState,finalState);
  }
  if (wasAdded && mAnimationFilter.hasGoToFullShadeEvent) {
    child.setTranslationY(child.getTranslationY() + mGoToFullShadeAppearingTranslation);
    yTranslationChanging=true;
    float longerDurationFactor=viewState.notGoneIndex - mCurrentLastNotAddedIndex;
    longerDurationFactor=(float)Math.pow(longerDurationFactor,0.7f);
    duration=ANIMATION_DURATION_APPEAR_DISAPPEAR + 50 + (long)(100 * longerDurationFactor);
  }
  if (yTranslationChanging) {
    startYTranslationAnimation(child,viewState,duration,delay);
  }
  if (zTranslationChanging) {
    startZTranslationAnimation(child,viewState,duration,delay);
  }
  if (scaleChanging) {
    startScaleAnimation(child,viewState,duration);
  }
  if (alphaChanging && child.getTranslationX() == 0) {
    startAlphaAnimation(child,viewState,duration,delay);
  }
  if (heightChanging) {
    startHeightAnimation(child,viewState,duration,delay);
  }
  if (topInsetChanging) {
    startInsetAnimation(child,viewState,duration,delay);
  }
  child.setDimmed(viewState.dimmed,mAnimationFilter.animateDimmed && !wasAdded);
  child.setDark(viewState.dark,mAnimationFilter.animateDark);
  child.setBelowSpeedBump(viewState.belowSpeedBump);
  child.setHideSensitive(viewState.hideSensitive,mAnimationFilter.animateHideSensitive && !wasAdded,delay,duration);
  child.setScrimAmount(viewState.scrimAmount);
  if (wasAdded) {
    child.performAddAnimation(delay,mCurrentLength);
  }
  if (child instanceof SpeedBumpView) {
    finalState.performSpeedBumpAnimation(i,(SpeedBumpView)child,viewState,delay + duration);
  }
}

Fixed version (ground truth):
/** 
 * Start an animation to the given viewState
 */
private void startAnimations(final ExpandableView child,StackScrollState.ViewState viewState,StackScrollState finalState,int i){
  int childVisibility=child.getVisibility();
  boolean wasVisible=childVisibility == View.VISIBLE;
  final float alpha=viewState.alpha;
  if (!wasVisible && alpha != 0 && !viewState.gone) {
    child.setVisibility(View.VISIBLE);
  }
  boolean yTranslationChanging=child.getTranslationY() != viewState.yTranslation;
  boolean zTranslationChanging=child.getTranslationZ() != viewState.zTranslation;
  boolean scaleChanging=child.getScaleX() != viewState.scale;
  boolean alphaChanging=alpha != child.getAlpha();
  boolean heightChanging=viewState.height != child.getActualHeight();
  boolean topInsetChanging=viewState.clipTopAmount != child.getClipTopAmount();
  boolean wasAdded=mNewAddChildren.contains(child);
  boolean hasDelays=mAnimationFilter.hasDelays;
  boolean isDelayRelevant=yTranslationChanging || zTranslationChanging || scaleChanging|| alphaChanging|| heightChanging|| topInsetChanging;
  boolean noAnimation=wasAdded && !mAnimationFilter.hasGoToFullShadeEvent;
  long delay=0;
  long duration=mCurrentLength;
  if (hasDelays && isDelayRelevant || wasAdded) {
    delay=mCurrentAdditionalDelay + calculateChildAnimationDelay(viewState,finalState);
  }
  if (wasAdded && mAnimationFilter.hasGoToFullShadeEvent) {
    child.setTranslationY(child.getTranslationY() + mGoToFullShadeAppearingTranslation);
    yTranslationChanging=true;
    float longerDurationFactor=viewState.notGoneIndex - mCurrentLastNotAddedIndex;
    longerDurationFactor=(float)Math.pow(longerDurationFactor,0.7f);
    duration=ANIMATION_DURATION_APPEAR_DISAPPEAR + 50 + (long)(100 * longerDurationFactor);
  }
  if (yTranslationChanging) {
    if (noAnimation) {
      child.setTranslationY(viewState.yTranslation);
    }
 else {
      startYTranslationAnimation(child,viewState,duration,delay);
    }
  }
  if (zTranslationChanging) {
    if (noAnimation) {
      child.setTranslationZ(viewState.zTranslation);
    }
 else {
      startZTranslationAnimation(child,viewState,duration,delay);
    }
  }
  if (scaleChanging) {
    if (noAnimation) {
      child.setScaleX(viewState.scale);
      child.setScaleY(viewState.scale);
    }
 else {
      startScaleAnimation(child,viewState,duration);
    }
  }
  if (alphaChanging && child.getTranslationX() == 0) {
    if (noAnimation) {
      child.setAlpha(viewState.alpha);
    }
 else {
      startAlphaAnimation(child,viewState,duration,delay);
    }
  }
  if (heightChanging && child.getActualHeight() != 0) {
    if (noAnimation) {
      child.setActualHeight(viewState.height,false);
    }
 else {
      startHeightAnimation(child,viewState,duration,delay);
    }
  }
  if (topInsetChanging) {
    if (noAnimation) {
      child.setClipTopAmount(viewState.clipTopAmount);
    }
 else {
      startInsetAnimation(child,viewState,duration,delay);
    }
  }
  child.setDimmed(viewState.dimmed,mAnimationFilter.animateDimmed && !wasAdded && !noAnimation);
  child.setDark(viewState.dark,mAnimationFilter.animateDark && !noAnimation);
  child.setBelowSpeedBump(viewState.belowSpeedBump);
  child.setHideSensitive(viewState.hideSensitive,mAnimationFilter.animateHideSensitive && !wasAdded && !noAnimation,delay,duration);
  child.setScrimAmount(viewState.scrimAmount);
  if (wasAdded) {
    child.performAddAnimation(delay,mCurrentLength);
  }
  if (child instanceof SpeedBumpView) {
    finalState.performSpeedBumpAnimation(i,(SpeedBumpView)child,viewState,delay + duration);
  }
}