Program: 38959
Project: 38959
Buggy source:
/** 
 * Smoothly animate the current display colors to the new value.
 */
private synchronized void animateDisplayColor(float[] targetColors){
  int[] currentInts=mHardware.getDisplayColorCalibration();
  float[] currentColors=new float[]{(float)currentInts[0] / (float)mMaxColor,(float)currentInts[1] / (float)mMaxColor,(float)currentInts[2] / (float)mMaxColor};
  if (currentColors[0] == targetColors[0] && currentColors[1] == targetColors[1] && currentColors[2] == targetColors[2]) {
    return;
  }
  long duration=(long)(750 * (Math.max(Math.max(Math.abs(currentColors[0] - targetColors[0]),Math.abs(currentColors[1] - targetColors[1])),Math.abs(currentColors[2] - targetColors[2]))));
  if (DEBUG) {
    Slog.d(TAG,"String_Node_Str" + Arrays.toString(currentColors) + "String_Node_Str"+ Arrays.toString(targetColors)+ "String_Node_Str"+ duration);
  }
  if (mAnimator != null) {
    mAnimator.cancel();
    mAnimator.removeAllUpdateListeners();
  }
  mAnimator=ValueAnimator.ofObject(new FloatArrayEvaluator(new float[3]),currentColors,targetColors);
  mAnimator.setDuration(duration);
  mAnimator.setInterpolator(new LinearInterpolator());
  mAnimator.addUpdateListener(new AnimatorUpdateListener(){
    @Override public void onAnimationUpdate(    final ValueAnimator animation){
synchronized (DisplayHardwareController.this) {
        float[] value=(float[])animation.getAnimatedValue();
        mHardware.setDisplayColorCalibration(new int[]{(int)(value[0] * mMaxColor),(int)(value[1] * mMaxColor),(int)(value[2] * mMaxColor)});
        screenRefresh();
      }
    }
  }
);
  mAnimator.start();
}

Fixed version (ground truth):
/** 
 * Smoothly animate the current display colors to the new value.
 */
private synchronized void animateDisplayColor(float[] targetColors){
  int[] currentInts=mHardware.getDisplayColorCalibration();
  float[] currentColors=new float[]{(float)currentInts[0] / (float)mMaxColor,(float)currentInts[1] / (float)mMaxColor,(float)currentInts[2] / (float)mMaxColor};
  if (currentColors[0] == targetColors[0] && currentColors[1] == targetColors[1] && currentColors[2] == targetColors[2]) {
    return;
  }
  long duration=(long)(750 * (Math.max(Math.max(Math.abs(currentColors[0] - targetColors[0]),Math.abs(currentColors[1] - targetColors[1])),Math.abs(currentColors[2] - targetColors[2]))));
  if (DEBUG) {
    Slog.d(TAG,"String_Node_Str" + Arrays.toString(currentColors) + "String_Node_Str"+ Arrays.toString(targetColors)+ "String_Node_Str"+ duration);
  }
  if (mAnimator != null) {
    mAnimator.cancel();
    mAnimator.removeAllUpdateListeners();
  }
  mAnimator=ValueAnimator.ofObject(new FloatArrayEvaluator(new float[3]),currentColors,targetColors);
  mAnimator.setDuration(duration);
  mAnimator.setInterpolator(new LinearInterpolator());
  mAnimator.addUpdateListener(new AnimatorUpdateListener(){
    @Override public void onAnimationUpdate(    final ValueAnimator animation){
synchronized (DisplayHardwareController.this) {
        if (isScreenOn()) {
          float[] value=(float[])animation.getAnimatedValue();
          mHardware.setDisplayColorCalibration(new int[]{(int)(value[0] * mMaxColor),(int)(value[1] * mMaxColor),(int)(value[2] * mMaxColor)});
          screenRefresh();
        }
      }
    }
  }
);
  mAnimator.start();
}