Program: 33469
Project: 33469
Buggy source:
@Override public void onStateChange(State state){
  if (DEBUG)   Log.d("String_Node_Str","String_Node_Str" + state);
  int stateCode=state.getRefreshState();
  float percent=state.getPercent();
switch (stateCode) {
case CustomSwipeRefreshLayout.State.STATE_NORMAL:
    if (percent > 0.5f) {
      setImageRotation((percent - 0.5f) * 180 / 0.5f);
      mMainTextView.setTextColor(Color.argb(0xff,(int)((percent - 0.5f) * 255 / 0.5f),0,0));
    }
 else {
      setImageRotation(0);
      mMainTextView.setTextColor(Color.BLACK);
    }
  if (mState != CustomSwipeRefreshLayout.State.STATE_NORMAL) {
    mImageView.setVisibility(View.VISIBLE);
    mProgressBar.setVisibility(View.INVISIBLE);
    mMainTextView.setText("String_Node_Str");
  }
break;
case CustomSwipeRefreshLayout.State.STATE_READY:
if (mState != CustomSwipeRefreshLayout.State.STATE_READY) {
mImageView.setVisibility(View.VISIBLE);
mProgressBar.setVisibility(View.INVISIBLE);
setImageRotation(180);
mMainTextView.setText("String_Node_Str");
mMainTextView.setTextColor(Color.RED);
}
break;
case CustomSwipeRefreshLayout.State.STATE_REFRESHING:
if (mState != CustomSwipeRefreshLayout.State.STATE_REFRESHING) {
mImageView.setVisibility(View.INVISIBLE);
mProgressBar.setVisibility(View.VISIBLE);
mMainTextView.setText("String_Node_Str");
mMainTextView.setTextColor(Color.RED);
}
break;
case CustomSwipeRefreshLayout.State.STATE_COMPLETE:
if (mState != CustomSwipeRefreshLayout.State.STATE_COMPLETE) {
setImageRotation(0);
mImageView.setVisibility(View.INVISIBLE);
mProgressBar.setVisibility(View.INVISIBLE);
if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.HONEYCOMB) {
Integer colorFrom=Color.RED;
Integer colorTo=Color.BLACK;
ValueAnimator colorAnimation=ValueAnimator.ofObject(new ArgbEvaluator(),colorFrom,colorTo);
colorAnimation.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(){
@Override public void onAnimationUpdate(ValueAnimator animator){
mMainTextView.setTextColor((Integer)animator.getAnimatedValue());
}
}
);
colorAnimation.setDuration(1000);
colorAnimation.start();
}
 else {
mMainTextView.setTextColor(Color.BLACK);
}
}
mMainTextView.setText("String_Node_Str");
break;
default :
}
mSubTextView.setText(String.format("String_Node_Str",STATE_MAP.get(stateCode),percent));
mState=stateCode;
}

Fixed version (ground truth):
@Override public void onStateChange(State state){
  if (DEBUG)   Log.d("String_Node_Str","String_Node_Str" + state);
  int stateCode=state.getRefreshState();
  float percent=state.getPercent();
switch (stateCode) {
case CustomSwipeRefreshLayout.State.STATE_NORMAL:
    if (percent > 0.5f) {
      setImageRotation((percent - 0.5f) * 180 / 0.5f);
      mMainTextView.setTextColor(Color.argb(0xff,(int)((percent - 0.5f) * 255 / 0.5f),0,0));
    }
 else {
      setImageRotation(0);
      mMainTextView.setTextColor(Color.BLACK);
    }
  if (mState != CustomSwipeRefreshLayout.State.STATE_NORMAL) {
    mImageView.setVisibility(View.VISIBLE);
    mProgressBar.setVisibility(View.INVISIBLE);
    mMainTextView.setText("String_Node_Str");
  }
break;
case CustomSwipeRefreshLayout.State.STATE_READY:
if (mState != CustomSwipeRefreshLayout.State.STATE_READY) {
mImageView.setVisibility(View.VISIBLE);
mProgressBar.setVisibility(View.INVISIBLE);
setImageRotation(180);
mMainTextView.setText("String_Node_Str");
mMainTextView.setTextColor(Color.RED);
}
break;
case CustomSwipeRefreshLayout.State.STATE_REFRESHING:
if (mState != CustomSwipeRefreshLayout.State.STATE_REFRESHING) {
mImageView.clearAnimation();
mImageView.setVisibility(View.INVISIBLE);
mProgressBar.setVisibility(View.VISIBLE);
mMainTextView.setText("String_Node_Str");
mMainTextView.setTextColor(Color.RED);
}
break;
case CustomSwipeRefreshLayout.State.STATE_COMPLETE:
if (mState != CustomSwipeRefreshLayout.State.STATE_COMPLETE) {
mImageView.setVisibility(View.INVISIBLE);
mProgressBar.setVisibility(View.INVISIBLE);
if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.HONEYCOMB) {
Integer colorFrom=Color.RED;
Integer colorTo=Color.BLACK;
ValueAnimator colorAnimation=ValueAnimator.ofObject(new ArgbEvaluator(),colorFrom,colorTo);
colorAnimation.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(){
@Override public void onAnimationUpdate(ValueAnimator animator){
mMainTextView.setTextColor((Integer)animator.getAnimatedValue());
}
}
);
colorAnimation.setDuration(1000);
colorAnimation.start();
}
 else {
mMainTextView.setTextColor(Color.BLACK);
}
}
mMainTextView.setText("String_Node_Str");
break;
default :
}
mSubTextView.setText(String.format("String_Node_Str",STATE_MAP.get(stateCode),percent));
mState=stateCode;
}