nus-yam/ex-repair huggingface dataset:
Program: 54124
Project: 54124
Buggy source:
@Override public Animator createAnimator(ViewGroup sceneRoot,TransitionValues startValues,TransitionValues endValues){
  if (startValues == null || endValues == null) {
    return null;
  }
  final View view=endValues.view;
  Drawable startBackground=(Drawable)startValues.values.get(PROPNAME_BACKGROUND);
  Drawable endBackground=(Drawable)endValues.values.get(PROPNAME_BACKGROUND);
  if (startBackground instanceof ColorDrawable && endBackground instanceof ColorDrawable) {
    ColorDrawable startColor=(ColorDrawable)startBackground;
    ColorDrawable endColor=(ColorDrawable)endBackground;
    if (startColor.getColor() != endColor.getColor()) {
      endColor.setColor(startColor.getColor());
      return ObjectAnimator.ofObject(endColor,COLORDRAWABLE_COLOR,new ArgbEvaluator(),startColor.getColor(),endColor.getColor());
    }
  }
  if (view instanceof TextView) {
    TextView textView=(TextView)view;
    int start=(Integer)startValues.values.get(PROPNAME_TEXT_COLOR);
    int end=(Integer)endValues.values.get(PROPNAME_TEXT_COLOR);
    if (start != end) {
      textView.setTextColor(end);
      return ObjectAnimator.ofObject(textView,TEXTVIEW_TEXT_COLOR,new ArgbEvaluator(),start,end);
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public Animator createAnimator(ViewGroup sceneRoot,TransitionValues startValues,TransitionValues endValues){
  if (startValues == null || endValues == null) {
    return null;
  }
  final View view=endValues.view;
  Drawable startBackground=(Drawable)startValues.values.get(PROPNAME_BACKGROUND);
  Drawable endBackground=(Drawable)endValues.values.get(PROPNAME_BACKGROUND);
  if (startBackground instanceof ColorDrawable && endBackground instanceof ColorDrawable) {
    ColorDrawable startColor=(ColorDrawable)startBackground;
    ColorDrawable endColor=(ColorDrawable)endBackground;
    if (startColor.getColor() != endColor.getColor()) {
      final int finalColor=endColor.getColor();
      endColor.setColor(startColor.getColor());
      return ObjectAnimator.ofObject(endColor,COLORDRAWABLE_COLOR,new ArgbEvaluator(),startColor.getColor(),finalColor);
    }
  }
  if (view instanceof TextView) {
    TextView textView=(TextView)view;
    int start=(Integer)startValues.values.get(PROPNAME_TEXT_COLOR);
    int end=(Integer)endValues.values.get(PROPNAME_TEXT_COLOR);
    if (start != end) {
      textView.setTextColor(end);
      return ObjectAnimator.ofObject(textView,TEXTVIEW_TEXT_COLOR,new ArgbEvaluator(),start,end);
    }
  }
  return null;
}
Program: 54126
Project: 54126
Buggy source:
/** 
 * This is where all of the work of a transition/scene-change is orchestrated. This method captures the start values for the given transition, exits the current Scene, enters the new scene, captures the end values for the transition, and finally plays the resulting values-populated transition.
 * @param scene      The scene being entered
 * @param transition The transition to play for this scene change
 */
private static void changeScene(Scene scene,Transition transition){
  final ViewGroup sceneRoot=scene.getSceneRoot();
  if (!sPendingTransitions.contains(sceneRoot)) {
    sPendingTransitions.add(sceneRoot);
    Transition transitionClone=null;
    if (isTransitionsAllowed()) {
      if (transition != null) {
        transitionClone=transition.clone();
        transitionClone.setSceneRoot(sceneRoot);
      }
      Scene oldScene=Scene.getCurrentScene(sceneRoot);
      if (oldScene != null && transitionClone != null && oldScene.isCreatedFromLayoutResource()) {
        transitionClone.setCanRemoveViews(true);
      }
    }
    sceneChangeSetup(sceneRoot,transitionClone);
    scene.enter();
    sceneChangeRunTransition(sceneRoot,transitionClone);
  }
}

Fixed version (ground truth):
/** 
 * This is where all of the work of a transition/scene-change is orchestrated. This method captures the start values for the given transition, exits the current Scene, enters the new scene, captures the end values for the transition, and finally plays the resulting values-populated transition.
 * @param scene      The scene being entered
 * @param transition The transition to play for this scene change
 */
private static void changeScene(Scene scene,Transition transition){
  final ViewGroup sceneRoot=scene.getSceneRoot();
  if (!sPendingTransitions.contains(sceneRoot)) {
    Transition transitionClone=null;
    if (isTransitionsAllowed()) {
      sPendingTransitions.add(sceneRoot);
      if (transition != null) {
        transitionClone=transition.clone();
        transitionClone.setSceneRoot(sceneRoot);
      }
      Scene oldScene=Scene.getCurrentScene(sceneRoot);
      if (oldScene != null && transitionClone != null && oldScene.isCreatedFromLayoutResource()) {
        transitionClone.setCanRemoveViews(true);
      }
    }
    sceneChangeSetup(sceneRoot,transitionClone);
    scene.enter();
    sceneChangeRunTransition(sceneRoot,transitionClone);
  }
}
Program: 54127
Project: 54127
Buggy source:
@Override public Animator createAnimator(ViewGroup sceneRoot,TransitionValues startValues,TransitionValues endValues){
  if (startValues == null || endValues == null) {
    return null;
  }
  final View view=endValues.view;
  float startRotation=(Float)startValues.values.get(PROPNAME_ROTATION);
  float endRotation=(Float)endValues.values.get(PROPNAME_ROTATION);
  if (startRotation != endRotation) {
    view.setRotation(startRotation);
    return ObjectAnimator.ofFloat(view,"String_Node_Str",startRotation,endRotation);
  }
  return null;
}

Fixed version (ground truth):
@Override public Animator createAnimator(ViewGroup sceneRoot,TransitionValues startValues,TransitionValues endValues){
  if (startValues == null || endValues == null) {
    return null;
  }
  final View view=endValues.view;
  float startRotation=(Float)startValues.values.get(PROPNAME_ROTATION);
  float endRotation=(Float)endValues.values.get(PROPNAME_ROTATION);
  if (startRotation != endRotation) {
    view.setRotation(startRotation);
    return ObjectAnimator.ofFloat(view,View.ROTATION,startRotation,endRotation);
  }
  return null;
}
Program: 54128
Project: 54128
Buggy source:
public static void initializeOverlay(View sceneRoot){
  IMPL.initializeOverlay(sceneRoot);
}

Fixed version (ground truth):
public static void initializeOverlay(ViewGroup sceneRoot){
  IMPL.initializeOverlay(sceneRoot);
}
Program: 54129
Project: 54129
Buggy source:
public static ViewOverlayPreJellybean getOverlay(View sceneRoot){
  View group=sceneRoot;
  while (group != null && !(group.getId() == android.R.id.content)) {
    group=(View)group.getParent();
  }
  ViewOverlayPreJellybean viewOverlayPreJellybean=null;
  if (group != null) {
    for (int i=0; i < ((FrameLayout)group).getChildCount(); i++) {
      View childAt=((FrameLayout)group).getChildAt(i);
      if (childAt instanceof ViewOverlayPreJellybean) {
        viewOverlayPreJellybean=(ViewOverlayPreJellybean)childAt;
        break;
      }
    }
    if (viewOverlayPreJellybean == null) {
      viewOverlayPreJellybean=new ViewOverlayPreJellybean(sceneRoot.getContext());
      final FrameLayout.LayoutParams params=new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT);
      params.gravity=Gravity.FILL;
      ((FrameLayout)group).addView(viewOverlayPreJellybean,params);
    }
  }
  return viewOverlayPreJellybean;
}

Fixed version (ground truth):
public static ViewOverlayPreJellybean getOverlay(ViewGroup sceneRoot){
  if (sceneRoot != null) {
    ViewGroup group=sceneRoot;
    while (group.getId() != android.R.id.content && group.getParent() != null && group.getParent() instanceof ViewGroup) {
      group=(ViewGroup)group.getParent();
    }
    for (int i=0; i < group.getChildCount(); i++) {
      View child=group.getChildAt(i);
      if (child instanceof ViewOverlayPreJellybean) {
        return (ViewOverlayPreJellybean)child;
      }
    }
    final FrameLayout.LayoutParams params=new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT);
    params.gravity=Gravity.FILL;
    ViewOverlayPreJellybean viewOverlay=new ViewOverlayPreJellybean(sceneRoot.getContext());
    group.addView(viewOverlay,params);
    return viewOverlay;
  }
 else {
    return null;
  }
}
Program: 54130
Project: 54130
Buggy source:
@Override public TransitionSet setInterpolator(TimeInterpolator interpolator){
  return (TransitionSet)super.setInterpolator(interpolator);
}

Fixed version (ground truth):
@Override public TransitionSet setInterpolator(TimeInterpolator interpolator){
  super.setInterpolator(interpolator);
  if (mInterpolator != null && mTransitions != null) {
    int numTransitions=mTransitions.size();
    for (int i=0; i < numTransitions; ++i) {
      mTransitions.get(i).setInterpolator(mInterpolator);
    }
  }
  return this;
}
Program: 54131
Project: 54131
Buggy source:
@Override public TransitionSet clone(){
  TransitionSet clone=(TransitionSet)super.clone();
  clone.mTransitions=new ArrayList<Transition>();
  int numTransitions=mTransitions.size();
  for (int i=0; i < numTransitions; ++i) {
    Transition transition=(Transition)mTransitions.get(i).clone();
    long duration=transition.getDuration();
    clone.addTransition(transition);
    transition.setDuration(duration);
  }
  return clone;
}

Fixed version (ground truth):
@Override public TransitionSet clone(){
  TransitionSet clone=(TransitionSet)super.clone();
  clone.mTransitions=new ArrayList<Transition>();
  int numTransitions=mTransitions.size();
  for (int i=0; i < numTransitions; ++i) {
    clone.addTransitionInternal(mTransitions.get(i).clone());
  }
  return clone;
}
Program: 54132
Project: 54132
Buggy source:
/** 
 * Adds child transition to this set. The order in which this child transition is added relative to other child transitions that are added, in addition to the   {@link #getOrdering() ordering} property, determines theorder in which the transitions are started. <p/> <p>If this transitionSet has a  {@link #getDuration() duration} set on it, thechild transition will inherit that duration. Transitions are assumed to have a maximum of one transitionSet parent.</p>
 * @param transition A non-null child transition to be added to this set.
 * @return This transitionSet object.
 */
public TransitionSet addTransition(Transition transition){
  if (transition != null) {
    mTransitions.add(transition);
    transition.mParent=this;
    if (mDuration >= 0) {
      transition.setDuration(mDuration);
    }
  }
  return this;
}

Fixed version (ground truth):
/** 
 * Adds child transition to this set. The order in which this child transition is added relative to other child transitions that are added, in addition to the   {@link #getOrdering() ordering} property, determines theorder in which the transitions are started. <p/> <p>If this transitionSet has a  {@link #getDuration() duration} set on it, thechild transition will inherit that duration. Transitions are assumed to have a maximum of one transitionSet parent.</p>
 * @param transition A non-null child transition to be added to this set.
 * @return This transitionSet object.
 */
public TransitionSet addTransition(Transition transition){
  if (transition != null) {
    addTransitionInternal(transition);
    if (mDuration >= 0) {
      transition.setDuration(mDuration);
    }
    if (mInterpolator != null) {
      transition.setInterpolator(mInterpolator);
    }
  }
  return this;
}
Program: 54134
Project: 54134
Buggy source:
/** 
 * Pauses this transition, sending out calls to   {@link TransitionListener#onTransitionPause(Transition)} to all listenersand pausing all running animators started by this transition.
 * @hide
 */
public void pause(View sceneRoot){
  if (!mEnded) {
    ArrayMap<Animator,AnimationInfo> runningAnimators=getRunningAnimators();
    int numOldAnims=runningAnimators.size();
    if (sceneRoot != null) {
      Object windowId=ViewUtils.getWindowId(sceneRoot);
      for (int i=numOldAnims - 1; i >= 0; i--) {
        AnimationInfo info=runningAnimators.valueAt(i);
        if (info.view != null && windowId != null && Objects.equal(windowId,info.windowId)) {
          Animator anim=runningAnimators.keyAt(i);
          AnimatorUtils.pause(anim);
        }
      }
    }
    if (mListeners != null && mListeners.size() > 0) {
      ArrayList<TransitionListener> tmpListeners=(ArrayList<TransitionListener>)mListeners.clone();
      int numListeners=tmpListeners.size();
      for (int i=0; i < numListeners; ++i) {
        tmpListeners.get(i).onTransitionPause(this);
      }
    }
    mPaused=true;
  }
}

Fixed version (ground truth):
/** 
 * Pauses this transition, sending out calls to   {@link TransitionListener#onTransitionPause(Transition)} to all listenersand pausing all running animators started by this transition.
 * @hide
 */
public void pause(View sceneRoot){
  if (!mEnded) {
synchronized (sRunningAnimators) {
      ArrayMap<Animator,AnimationInfo> runningAnimators=getRunningAnimators();
      int numOldAnims=runningAnimators.size();
      if (sceneRoot != null) {
        Object windowId=ViewUtils.getWindowId(sceneRoot);
        for (int i=numOldAnims - 1; i >= 0; i--) {
          AnimationInfo info=runningAnimators.valueAt(i);
          if (info.view != null && windowId != null && Objects.equal(windowId,info.windowId)) {
            Animator anim=runningAnimators.keyAt(i);
            AnimatorUtils.pause(anim);
          }
        }
      }
    }
    if (mListeners != null && mListeners.size() > 0) {
      ArrayList<TransitionListener> tmpListeners=(ArrayList<TransitionListener>)mListeners.clone();
      int numListeners=tmpListeners.size();
      for (int i=0; i < numListeners; ++i) {
        tmpListeners.get(i).onTransitionPause(this);
      }
    }
    mPaused=true;
  }
}
Program: 54137
Project: 54137
Buggy source:
@Override public void onTransitionEnd(Transition transition){
  ArrayList<Transition> currentTransitions=runningTransitions.get(sceneRoot);
  currentTransitions.remove(transition);
  transition.onEndOfAllTransitions();
}

Fixed version (ground truth):
@Override public void onTransitionEnd(Transition transition){
  ArrayList<Transition> currentTransitions=runningTransitions.get(sceneRoot);
  currentTransitions.remove(transition);
}
Program: 54138
Project: 54138
Buggy source:
public boolean onPreDraw(){
  sceneRoot.getViewTreeObserver().removeOnPreDrawListener(this);
  sPendingTransitions.remove(sceneRoot);
  final ArrayMap<ViewGroup,ArrayList<Transition>> runningTransitions=getRunningTransitions();
  ArrayList<Transition> currentTransitions=runningTransitions.get(sceneRoot);
  ArrayList<Transition> previousRunningTransitions=null;
  if (currentTransitions == null) {
    currentTransitions=new ArrayList<Transition>();
    runningTransitions.put(sceneRoot,currentTransitions);
  }
 else   if (currentTransitions.size() > 0) {
    previousRunningTransitions=new ArrayList<Transition>(currentTransitions);
  }
  currentTransitions.add(transition);
  transition.addListener(new Transition.TransitionListenerAdapter(){
    @Override public void onTransitionEnd(    Transition transition){
      ArrayList<Transition> currentTransitions=runningTransitions.get(sceneRoot);
      currentTransitions.remove(transition);
      transition.onEndOfAllTransitions();
    }
  }
);
  transition.captureValues(sceneRoot,false);
  if (previousRunningTransitions != null) {
    for (    Transition runningTransition : previousRunningTransitions) {
      runningTransition.resume(sceneRoot);
    }
  }
  transition.playTransition(sceneRoot);
  return true;
}

Fixed version (ground truth):
public boolean onPreDraw(){
  sceneRoot.getViewTreeObserver().removeOnPreDrawListener(this);
  sPendingTransitions.remove(sceneRoot);
  final ArrayMap<ViewGroup,ArrayList<Transition>> runningTransitions=getRunningTransitions();
  ArrayList<Transition> currentTransitions=runningTransitions.get(sceneRoot);
  ArrayList<Transition> previousRunningTransitions=null;
  if (currentTransitions == null) {
    currentTransitions=new ArrayList<Transition>();
    runningTransitions.put(sceneRoot,currentTransitions);
  }
 else   if (currentTransitions.size() > 0) {
    previousRunningTransitions=new ArrayList<Transition>(currentTransitions);
  }
  currentTransitions.add(transition);
  transition.addListener(new Transition.TransitionListenerAdapter(){
    @Override public void onTransitionEnd(    Transition transition){
      ArrayList<Transition> currentTransitions=runningTransitions.get(sceneRoot);
      currentTransitions.remove(transition);
    }
  }
);
  transition.captureValues(sceneRoot,false);
  if (previousRunningTransitions != null) {
    for (    Transition runningTransition : previousRunningTransitions) {
      runningTransition.resume(sceneRoot);
    }
  }
  transition.playTransition(sceneRoot);
  return true;
}
Program: 54139
Project: 54139
Buggy source:
@Override public void onAnimationEnd(Animator animation){
  if (!mCanceled) {
    if (!isForcedVisibility) {
      mFinalViewToKeep=finalViewToKeep;
      mFinalVisibility=finalVisibility;
    }
    ViewUtils.setTransitionAlpha(finalViewToKeep,0);
  }
}

Fixed version (ground truth):
@Override public void onAnimationEnd(Animator animation){
  if (!mCanceled) {
    if (isForcedVisibility) {
      ViewUtils.setTransitionAlpha(finalViewToKeep,0);
    }
 else {
      finalViewToKeep.setVisibility(finalVisibility);
    }
  }
}
Program: 54140
Project: 54140
Buggy source:
public static void suppressLayout(ViewGroup group,boolean suppress){
  IMPL.suppressLayout(group,suppress);
}

Fixed version (ground truth):
public static void suppressLayout(ViewGroup group,boolean suppress){
  if (group != null) {
    IMPL.suppressLayout(group,suppress);
  }
}
Program: 54141
Project: 54141
Buggy source:
private ObjectAnimator createMatrixAnimator(final ImageView imageView,Matrix startMatrix,final Matrix endMatrix){
  return AnimatorUtils.ofObject(new ImageAnimator(imageView),new TransitionUtils.MatrixEvaluator(),startMatrix,endMatrix);
}

Fixed version (ground truth):
private ObjectAnimator createMatrixAnimator(final ImageView imageView,Matrix startMatrix,final Matrix endMatrix){
  return AnimatorUtils.ofObject(new ImageAnimator(imageView),new MatrixUtils.MatrixEvaluator(),startMatrix,endMatrix);
}
Program: 54142
Project: 54142
Buggy source:
private ObjectAnimator createNullAnimator(ImageView imageView){
  return createMatrixAnimator(imageView,null,null);
}

Fixed version (ground truth):
private ObjectAnimator createNullAnimator(ImageView imageView){
  return AnimatorUtils.ofObject(new ImageAnimator(imageView),new MatrixUtils.NullMatrixEvaluator(),MatrixUtils.IDENTITY_MATRIX,MatrixUtils.IDENTITY_MATRIX);
}
Program: 54144
Project: 54144
Buggy source:
public static void animateTransform(ImageView imageView,Matrix matrix){
  Drawable drawable=imageView.getDrawable();
  if (matrix == null) {
    drawable.setBounds(0,0,imageView.getWidth(),imageView.getHeight());
  }
 else {
    drawable.setBounds(0,0,drawable.getIntrinsicWidth(),drawable.getIntrinsicHeight());
    Matrix drawMatrix=imageView.getImageMatrix();
    drawMatrix.set(matrix);
    ReflectionUtils.setFieldValue(imageView,FIELD_DRAW_MATRIX,drawMatrix);
  }
  imageView.invalidate();
}

Fixed version (ground truth):
public static void animateTransform(ImageView imageView,Matrix matrix){
  Drawable drawable=imageView.getDrawable();
  if (matrix == null || drawable.getIntrinsicWidth() == -1 || drawable.getIntrinsicHeight() == -1) {
    drawable.setBounds(0,0,imageView.getWidth(),imageView.getHeight());
  }
 else {
    drawable.setBounds(0,0,drawable.getIntrinsicWidth(),drawable.getIntrinsicHeight());
    Matrix drawMatrix=imageView.getImageMatrix();
    drawMatrix.set(matrix);
    ReflectionUtils.setFieldValue(imageView,FIELD_DRAW_MATRIX,drawMatrix);
  }
  imageView.invalidate();
}
Program: 54145
Project: 54145
Buggy source:
/** 
 * Returns a Scene described by the resource file associated with the given <code>layoutId</code> parameter. If such a Scene has already been created, that same Scene will be returned. This caching of layoutId-based scenes enables sharing of common scenes between those created in code and those referenced by   {@link TransitionManager} XML resource files.
 * @param sceneRoot The root of the hierarchy in which scene changesand transitions will take place.
 * @param layoutId The id of a standard layout resource file.
 * @param context The context used in the process of inflatingthe layout resource.
 * @return
 */
public static Scene getSceneForLayout(ViewGroup sceneRoot,int layoutId,Context context){
  SparseArray<Scene> scenes=sScenes.get();
  if (scenes == null) {
    scenes=new SparseArray<Scene>();
    sScenes.set(scenes);
  }
  Scene scene=scenes.get(layoutId);
  if (scene != null) {
    return scene;
  }
 else {
    scene=new Scene(sceneRoot,layoutId,context);
    scenes.put(layoutId,scene);
    return scene;
  }
}

Fixed version (ground truth):
/** 
 * Returns a Scene described by the resource file associated with the given <code>layoutId</code> parameter. If such a Scene has already been created, that same Scene will be returned. This caching of layoutId-based scenes enables sharing of common scenes between those created in code and those referenced by   {@link TransitionManager} XML resource files.
 * @param sceneRoot The root of the hierarchy in which scene changesand transitions will take place.
 * @param layoutId The id of a standard layout resource file.
 * @param context The context used in the process of inflatingthe layout resource.
 * @return
 */
public static Scene getSceneForLayout(ViewGroup sceneRoot,int layoutId,Context context){
  SparseArray<Scene> scenes=sScenes.get();
  if (scenes == null) {
    scenes=new SparseArray<Scene>();
    sScenes.set(scenes);
  }
  Scene scene=scenes.get(layoutId);
  if (scene != null) {
    scene.mSceneRoot=sceneRoot;
    return scene;
  }
 else {
    scene=new Scene(sceneRoot,layoutId,context);
    scenes.put(layoutId,scene);
    return scene;
  }
}
Program: 54146
Project: 54146
Buggy source:
/** 
 * Perform inflation from XML and apply a class-specific base style from a theme attribute or style resource. This constructor of Transition allows subclasses to use their own base style when they are inflating.
 * @param context The Context the transition is running in, through which it canaccess the current theme, resources, etc.
 * @param attrs The attributes of the XML tag that is inflating the transition.
 */
public Transition(Context context,AttributeSet attrs){
  TypedArray a=context.obtainStyledAttributes(attrs,R.styleable.Transition);
  long duration=a.getInt(R.styleable.Transition_duration,-1);
  if (duration >= 0) {
    setDuration(duration);
  }
  long startDelay=a.getInt(R.styleable.Transition_startDelay,-1);
  if (startDelay > 0) {
    setStartDelay(startDelay);
  }
  final int resID=a.getResourceId(R.styleable.Animator_interpolator,0);
  if (resID > 0) {
    setInterpolator(AnimationUtils.loadInterpolator(context,resID));
  }
  String matchOrder=a.getString(R.styleable.Transition_matchOrder);
  if (matchOrder != null) {
    setMatchOrder(parseMatchOrder(matchOrder));
  }
  a.recycle();
}

Fixed version (ground truth):
/** 
 * Perform inflation from XML and apply a class-specific base style from a theme attribute or style resource. This constructor of Transition allows subclasses to use their own base style when they are inflating.
 * @param context The Context the transition is running in, through which it canaccess the current theme, resources, etc.
 * @param attrs The attributes of the XML tag that is inflating the transition.
 */
public Transition(Context context,AttributeSet attrs){
  TypedArray a=context.obtainStyledAttributes(attrs,R.styleable.Transition);
  long duration=a.getInt(R.styleable.Transition_android_duration,-1);
  if (duration >= 0) {
    setDuration(duration);
  }
  long startDelay=a.getInt(R.styleable.Transition_startDelay,-1);
  if (startDelay > 0) {
    setStartDelay(startDelay);
  }
  final int resID=a.getResourceId(R.styleable.Animator_android_interpolator,0);
  if (resID > 0) {
    setInterpolator(AnimationUtils.loadInterpolator(context,resID));
  }
  String matchOrder=a.getString(R.styleable.Transition_matchOrder);
  if (matchOrder != null) {
    setMatchOrder(parseMatchOrder(matchOrder));
  }
  a.recycle();
}
Program: 54148
Project: 54148
Buggy source:
@Override public void onTransitionEnd(Transition transition){
  ArrayList<Transition> currentTransitions=runningTransitions.get(sceneRoot);
  currentTransitions.remove(transition);
}

Fixed version (ground truth):
@Override public void onTransitionEnd(Transition transition){
  ArrayList<Transition> currentTransitions=runningTransitions.get(sceneRoot);
  currentTransitions.remove(transition);
  transition.onEndOfAllTransitions();
}
Program: 54149
Project: 54149
Buggy source:
public boolean onPreDraw(){
  sceneRoot.getViewTreeObserver().removeOnPreDrawListener(this);
  sPendingTransitions.remove(sceneRoot);
  final ArrayMap<ViewGroup,ArrayList<Transition>> runningTransitions=getRunningTransitions();
  ArrayList<Transition> currentTransitions=runningTransitions.get(sceneRoot);
  ArrayList<Transition> previousRunningTransitions=null;
  if (currentTransitions == null) {
    currentTransitions=new ArrayList<Transition>();
    runningTransitions.put(sceneRoot,currentTransitions);
  }
 else   if (currentTransitions.size() > 0) {
    previousRunningTransitions=new ArrayList<Transition>(currentTransitions);
  }
  currentTransitions.add(transition);
  transition.addListener(new Transition.TransitionListenerAdapter(){
    @Override public void onTransitionEnd(    Transition transition){
      ArrayList<Transition> currentTransitions=runningTransitions.get(sceneRoot);
      currentTransitions.remove(transition);
    }
  }
);
  transition.captureValues(sceneRoot,false);
  if (previousRunningTransitions != null) {
    for (    Transition runningTransition : previousRunningTransitions) {
      runningTransition.resume(sceneRoot);
    }
  }
  transition.playTransition(sceneRoot);
  return true;
}

Fixed version (ground truth):
public boolean onPreDraw(){
  sceneRoot.getViewTreeObserver().removeOnPreDrawListener(this);
  sPendingTransitions.remove(sceneRoot);
  final ArrayMap<ViewGroup,ArrayList<Transition>> runningTransitions=getRunningTransitions();
  ArrayList<Transition> currentTransitions=runningTransitions.get(sceneRoot);
  ArrayList<Transition> previousRunningTransitions=null;
  if (currentTransitions == null) {
    currentTransitions=new ArrayList<Transition>();
    runningTransitions.put(sceneRoot,currentTransitions);
  }
 else   if (currentTransitions.size() > 0) {
    previousRunningTransitions=new ArrayList<Transition>(currentTransitions);
  }
  currentTransitions.add(transition);
  transition.addListener(new Transition.TransitionListenerAdapter(){
    @Override public void onTransitionEnd(    Transition transition){
      ArrayList<Transition> currentTransitions=runningTransitions.get(sceneRoot);
      currentTransitions.remove(transition);
      transition.onEndOfAllTransitions();
    }
  }
);
  transition.captureValues(sceneRoot,false);
  if (previousRunningTransitions != null) {
    for (    Transition runningTransition : previousRunningTransitions) {
      runningTransition.resume(sceneRoot);
    }
  }
  transition.playTransition(sceneRoot);
  return true;
}
Program: 54150
Project: 54150
Buggy source:
@Override public void onAnimationEnd(Animator animation){
  if (!mCanceled) {
    if (isForcedVisibility) {
      ViewUtils.setTransitionAlpha(finalViewToKeep,0);
    }
 else {
      finalViewToKeep.setVisibility(finalVisibility);
    }
  }
}

Fixed version (ground truth):
@Override public void onAnimationEnd(Animator animation){
  if (!mCanceled) {
    if (!isForcedVisibility) {
      mFinalViewToKeep=finalViewToKeep;
      mFinalVisibility=finalVisibility;
    }
    ViewUtils.setTransitionAlpha(finalViewToKeep,0);
  }
}
Program: 54151
Project: 54151
Buggy source:
private void initDefaultHeaderOffset(Rect headerMargins,RecyclerView recyclerView,View header,View firstView,int orientation){
  int translationX, translationY;
  mDimensionCalculator.initMargins(mTempRect1,header);
  if (orientation == LinearLayoutManager.VERTICAL) {
    translationX=firstView.getLeft() + mTempRect1.left;
    translationY=Math.max(firstView.getTop() - header.getHeight() - mTempRect1.bottom,getListTop(recyclerView) + mTempRect1.top);
  }
 else {
    translationY=firstView.getTop() + mTempRect1.top;
    translationX=Math.max(firstView.getLeft() - header.getWidth() - mTempRect1.right,getListLeft(recyclerView) + mTempRect1.left);
  }
  headerMargins.set(translationX,translationY,translationX + header.getWidth(),translationY + header.getHeight());
}

Fixed version (ground truth):
private void initDefaultHeaderOffset(Rect headerMargins,RecyclerView recyclerView,View header,View firstView,int orientation){
  int translationX, translationY;
  mDimensionCalculator.initMargins(mTempRect1,header);
  ViewGroup.LayoutParams layoutParams=firstView.getLayoutParams();
  int leftMargin=0;
  int topMargin=0;
  if (layoutParams instanceof ViewGroup.MarginLayoutParams) {
    ViewGroup.MarginLayoutParams marginLayoutParams=(ViewGroup.MarginLayoutParams)layoutParams;
    leftMargin=marginLayoutParams.leftMargin;
    topMargin=marginLayoutParams.topMargin;
  }
  if (orientation == LinearLayoutManager.VERTICAL) {
    translationX=firstView.getLeft() - leftMargin + mTempRect1.left;
    translationY=Math.max(firstView.getTop() - topMargin - header.getHeight()- mTempRect1.bottom,getListTop(recyclerView) + mTempRect1.top);
  }
 else {
    translationY=firstView.getTop() - topMargin + mTempRect1.top;
    translationX=Math.max(firstView.getLeft() - leftMargin - header.getWidth()- mTempRect1.right,getListLeft(recyclerView) + mTempRect1.left);
  }
  headerMargins.set(translationX,translationY,translationX + header.getWidth(),translationY + header.getHeight());
}
Program: 54152
Project: 54152
Buggy source:
private void initDefaultHeaderOffset(Rect headerMargins,RecyclerView recyclerView,View header,View firstView,int orientation){
  int translationX, translationY;
  mDimensionCalculator.initMargins(mTempRect1,header);
  if (orientation == LinearLayoutManager.VERTICAL) {
    translationX=firstView.getLeft() + mTempRect1.left;
    translationY=Math.max(firstView.getTop() - header.getHeight() - mTempRect1.bottom,getListTop(recyclerView) + mTempRect1.top);
  }
 else {
    translationY=firstView.getTop() + mTempRect1.top;
    translationX=Math.max(firstView.getLeft() - header.getWidth() - mTempRect1.right,getListLeft(recyclerView) + mTempRect1.left);
  }
  headerMargins.set(translationX,translationY,translationX + header.getWidth(),translationY + header.getHeight());
}

Fixed version (ground truth):
private void initDefaultHeaderOffset(Rect headerMargins,RecyclerView recyclerView,View header,View firstView,int orientation){
  int translationX, translationY;
  mDimensionCalculator.initMargins(mTempRect1,header);
  ViewGroup.LayoutParams layoutParams=firstView.getLayoutParams();
  int leftMargin=0;
  int topMargin=0;
  if (layoutParams instanceof ViewGroup.MarginLayoutParams) {
    ViewGroup.MarginLayoutParams marginLayoutParams=(ViewGroup.MarginLayoutParams)layoutParams;
    leftMargin=marginLayoutParams.leftMargin;
    topMargin=marginLayoutParams.topMargin;
  }
  if (orientation == LinearLayoutManager.VERTICAL) {
    translationX=firstView.getLeft() - leftMargin + mTempRect1.left;
    translationY=Math.max(firstView.getTop() - topMargin - header.getHeight()- mTempRect1.bottom,getListTop(recyclerView) + mTempRect1.top);
  }
 else {
    translationY=firstView.getTop() - topMargin + mTempRect1.top;
    translationX=Math.max(firstView.getLeft() - leftMargin - header.getWidth()- mTempRect1.right,getListLeft(recyclerView) + mTempRect1.left);
  }
  headerMargins.set(translationX,translationY,translationX + header.getWidth(),translationY + header.getHeight());
}
Program: 54153
Project: 54153
Buggy source:
public void drawHorizontal(Canvas c,RecyclerView parent){
  final int top=parent.getPaddingTop();
  final int bottom=parent.getHeight() - parent.getPaddingBottom();
  final int childCount=parent.getChildCount();
  for (int i=0; i < childCount; i++) {
    final View child=parent.getChildAt(i);
    final RecyclerView.LayoutParams params=(RecyclerView.LayoutParams)child.getLayoutParams();
    final int left=child.getRight() + params.rightMargin;
    final int right=left + mDivider.getIntrinsicHeight();
    mDivider.setBounds(left,top,right,bottom);
    mDivider.draw(c);
  }
}

Fixed version (ground truth):
public void drawHorizontal(Canvas c,RecyclerView parent){
  final int top=parent.getPaddingTop();
  final int bottom=parent.getHeight() - parent.getPaddingBottom();
  final int recyclerViewLeft=parent.getPaddingLeft();
  final int recyclerViewRight=parent.getWidth() - parent.getPaddingRight();
  final int childCount=parent.getChildCount();
  for (int i=0; i < childCount; i++) {
    final View child=parent.getChildAt(i);
    final RecyclerView.LayoutParams params=(RecyclerView.LayoutParams)child.getLayoutParams();
    final int left=Math.max(recyclerViewLeft,child.getRight() + params.rightMargin);
    final int right=Math.min(recyclerViewRight,left + mDivider.getIntrinsicHeight());
    mDivider.setBounds(left,top,right,bottom);
    mDivider.draw(c);
  }
}
Program: 54154
Project: 54154
Buggy source:
public void drawVertical(Canvas c,RecyclerView parent){
  final int left=parent.getPaddingLeft();
  final int right=parent.getWidth() - parent.getPaddingRight();
  final int childCount=parent.getChildCount();
  for (int i=0; i < childCount; i++) {
    final View child=parent.getChildAt(i);
    final RecyclerView.LayoutParams params=(RecyclerView.LayoutParams)child.getLayoutParams();
    final int top=child.getBottom() + params.bottomMargin;
    final int bottom=top + mDivider.getIntrinsicHeight();
    mDivider.setBounds(left,top,right,bottom);
    mDivider.draw(c);
  }
}

Fixed version (ground truth):
public void drawVertical(Canvas c,RecyclerView parent){
  final int left=parent.getPaddingLeft();
  final int right=parent.getWidth() - parent.getPaddingRight();
  final int recyclerViewTop=parent.getPaddingTop();
  final int recyclerViewBottom=parent.getHeight() - parent.getPaddingBottom();
  final int childCount=parent.getChildCount();
  for (int i=0; i < childCount; i++) {
    final View child=parent.getChildAt(i);
    final RecyclerView.LayoutParams params=(RecyclerView.LayoutParams)child.getLayoutParams();
    final int top=Math.max(recyclerViewTop,child.getBottom() + params.bottomMargin);
    final int bottom=Math.min(recyclerViewBottom,top + mDivider.getIntrinsicHeight());
    mDivider.setBounds(left,top,right,bottom);
    mDivider.draw(c);
  }
}
Program: 54155
Project: 54155
Buggy source:
@Override protected void onDraw(Canvas canvas){
  super.onDraw(canvas);
  float startAngle=270 - arcAngle / 2f;
  float finishedSweepAngle=progress / (float)getMax() * arcAngle;
  float finishedStartAngle=startAngle;
  paint.setColor(unfinishedStrokeColor);
  canvas.drawArc(rectF,startAngle,arcAngle,false,paint);
  paint.setColor(finishedStrokeColor);
  canvas.drawArc(rectF,finishedStartAngle,finishedSweepAngle,false,paint);
  String text=String.valueOf(getProgress());
  if (!TextUtils.isEmpty(text)) {
    textPaint.setColor(textColor);
    textPaint.setTextSize(textSize);
    float textHeight=textPaint.descent() + textPaint.ascent();
    float textBaseline=(getHeight() - textHeight) / 2.0f;
    canvas.drawText(text,(getWidth() - textPaint.measureText(text)) / 2.0f,textBaseline,textPaint);
    textPaint.setTextSize(suffixTextSize);
    float suffixHeight=textPaint.descent() + textPaint.ascent();
    canvas.drawText(suffixText,getWidth() / 2.0f + textPaint.measureText(text) + suffixTextPadding,textBaseline + textHeight - suffixHeight,textPaint);
  }
  if (!TextUtils.isEmpty(getBottomText())) {
    textPaint.setTextSize(bottomTextSize);
    float bottomTextBaseline=getHeight() - arcBottomHeight - (textPaint.descent() + textPaint.ascent()) / 2;
    canvas.drawText(getBottomText(),(getWidth() - textPaint.measureText(getBottomText())) / 2.0f,bottomTextBaseline,textPaint);
  }
}

Fixed version (ground truth):
@Override protected void onDraw(Canvas canvas){
  super.onDraw(canvas);
  float startAngle=270 - arcAngle / 2f;
  float finishedSweepAngle=progress / (float)getMax() * arcAngle;
  float finishedStartAngle=startAngle;
  paint.setColor(unfinishedStrokeColor);
  canvas.drawArc(rectF,startAngle,arcAngle,false,paint);
  paint.setColor(finishedStrokeColor);
  canvas.drawArc(rectF,finishedStartAngle,finishedSweepAngle,false,paint);
  String text=String.valueOf(getProgress());
  if (!TextUtils.isEmpty(text)) {
    textPaint.setColor(textColor);
    textPaint.setTextSize(textSize);
    float textHeight=textPaint.descent() + textPaint.ascent();
    float textBaseline=(getHeight() - textHeight) / 2.0f;
    canvas.drawText(text,(getWidth() - textPaint.measureText(text)) / 2.0f,textBaseline,textPaint);
    textPaint.setTextSize(suffixTextSize);
    float suffixHeight=textPaint.descent() + textPaint.ascent();
    canvas.drawText(suffixText,getWidth() / 2.0f + textPaint.measureText(text) + suffixTextPadding,textBaseline + textHeight - suffixHeight,textPaint);
  }
  if (arcBottomHeight == 0) {
    float radius=getWidth() / 2f;
    float angle=(360 - arcAngle) / 2f;
    arcBottomHeight=radius * (float)(1 - Math.cos(angle / 180 * Math.PI));
  }
  if (!TextUtils.isEmpty(getBottomText())) {
    textPaint.setTextSize(bottomTextSize);
    float bottomTextBaseline=getHeight() - arcBottomHeight - (textPaint.descent() + textPaint.ascent()) / 2;
    canvas.drawText(getBottomText(),(getWidth() - textPaint.measureText(getBottomText())) / 2.0f,bottomTextBaseline,textPaint);
  }
}
Program: 54156
Project: 54156
Buggy source:
@Override protected void onRestoreInstanceState(Parcelable state){
  if (state instanceof Bundle) {
    final Bundle bundle=(Bundle)state;
    textColor=bundle.getInt(INSTANCE_TEXT_COLOR);
    textSize=bundle.getFloat(INSTANCE_TEXT_SIZE);
    innerBottomTextSize=bundle.getFloat(INSTANCE_INNER_BOTTOM_TEXT_SIZE);
    innerBottomText=bundle.getString(INSTANCE_INNER_BOTTOM_TEXT);
    innerBottomTextColor=bundle.getInt(INSTANCE_INNER_BOTTOM_TEXT_COLOR);
    finishedStrokeColor=bundle.getInt(INSTANCE_FINISHED_STROKE_COLOR);
    unfinishedStrokeColor=bundle.getInt(INSTANCE_UNFINISHED_STROKE_COLOR);
    finishedStrokeWidth=bundle.getFloat(INSTANCE_FINISHED_STROKE_WIDTH);
    unfinishedStrokeWidth=bundle.getFloat(INSTANCE_UNFINISHED_STROKE_WIDTH);
    innerBackgroundColor=bundle.getInt(INSTANCE_BACKGROUND_COLOR);
    initPainters();
    setMax(bundle.getInt(INSTANCE_MAX));
    setProgress(bundle.getFloat(INSTANCE_PROGRESS));
    prefixText=bundle.getString(INSTANCE_PREFIX);
    suffixText=bundle.getString(INSTANCE_SUFFIX);
    text=bundle.getString(INSTANCE_TEXT);
    super.onRestoreInstanceState(bundle.getParcelable(INSTANCE_STATE));
    return;
  }
  super.onRestoreInstanceState(state);
}

Fixed version (ground truth):
@Override protected void onRestoreInstanceState(Parcelable state){
  if (state instanceof Bundle) {
    final Bundle bundle=(Bundle)state;
    textColor=bundle.getInt(INSTANCE_TEXT_COLOR);
    textSize=bundle.getFloat(INSTANCE_TEXT_SIZE);
    innerBottomTextSize=bundle.getFloat(INSTANCE_INNER_BOTTOM_TEXT_SIZE);
    innerBottomText=bundle.getString(INSTANCE_INNER_BOTTOM_TEXT);
    innerBottomTextColor=bundle.getInt(INSTANCE_INNER_BOTTOM_TEXT_COLOR);
    finishedStrokeColor=bundle.getInt(INSTANCE_FINISHED_STROKE_COLOR);
    unfinishedStrokeColor=bundle.getInt(INSTANCE_UNFINISHED_STROKE_COLOR);
    finishedStrokeWidth=bundle.getFloat(INSTANCE_FINISHED_STROKE_WIDTH);
    unfinishedStrokeWidth=bundle.getFloat(INSTANCE_UNFINISHED_STROKE_WIDTH);
    innerBackgroundColor=bundle.getInt(INSTANCE_BACKGROUND_COLOR);
    attributeResourceId=bundle.getInt(INSTANCE_INNER_DRAWABLE);
    initPainters();
    setMax(bundle.getInt(INSTANCE_MAX));
    setProgress(bundle.getFloat(INSTANCE_PROGRESS));
    prefixText=bundle.getString(INSTANCE_PREFIX);
    suffixText=bundle.getString(INSTANCE_SUFFIX);
    text=bundle.getString(INSTANCE_TEXT);
    super.onRestoreInstanceState(bundle.getParcelable(INSTANCE_STATE));
    return;
  }
  super.onRestoreInstanceState(state);
}
Program: 54158
Project: 54158
Buggy source:
@Override protected Parcelable onSaveInstanceState(){
  final Bundle bundle=new Bundle();
  bundle.putParcelable(INSTANCE_STATE,super.onSaveInstanceState());
  bundle.putInt(INSTANCE_TEXT_COLOR,getTextColor());
  bundle.putFloat(INSTANCE_TEXT_SIZE,getTextSize());
  bundle.putFloat(INSTANCE_INNER_BOTTOM_TEXT_SIZE,getInnerBottomTextSize());
  bundle.putFloat(INSTANCE_INNER_BOTTOM_TEXT_COLOR,getInnerBottomTextColor());
  bundle.putString(INSTANCE_INNER_BOTTOM_TEXT,getInnerBottomText());
  bundle.putInt(INSTANCE_INNER_BOTTOM_TEXT_COLOR,getInnerBottomTextColor());
  bundle.putInt(INSTANCE_FINISHED_STROKE_COLOR,getFinishedStrokeColor());
  bundle.putInt(INSTANCE_UNFINISHED_STROKE_COLOR,getUnfinishedStrokeColor());
  bundle.putInt(INSTANCE_MAX,getMax());
  bundle.putFloat(INSTANCE_PROGRESS,getProgress());
  bundle.putString(INSTANCE_SUFFIX,getSuffixText());
  bundle.putString(INSTANCE_PREFIX,getPrefixText());
  bundle.putString(INSTANCE_TEXT,getText());
  bundle.putFloat(INSTANCE_FINISHED_STROKE_WIDTH,getFinishedStrokeWidth());
  bundle.putFloat(INSTANCE_UNFINISHED_STROKE_WIDTH,getUnfinishedStrokeWidth());
  bundle.putInt(INSTANCE_BACKGROUND_COLOR,getInnerBackgroundColor());
  return bundle;
}

Fixed version (ground truth):
@Override protected Parcelable onSaveInstanceState(){
  final Bundle bundle=new Bundle();
  bundle.putParcelable(INSTANCE_STATE,super.onSaveInstanceState());
  bundle.putInt(INSTANCE_TEXT_COLOR,getTextColor());
  bundle.putFloat(INSTANCE_TEXT_SIZE,getTextSize());
  bundle.putFloat(INSTANCE_INNER_BOTTOM_TEXT_SIZE,getInnerBottomTextSize());
  bundle.putFloat(INSTANCE_INNER_BOTTOM_TEXT_COLOR,getInnerBottomTextColor());
  bundle.putString(INSTANCE_INNER_BOTTOM_TEXT,getInnerBottomText());
  bundle.putInt(INSTANCE_INNER_BOTTOM_TEXT_COLOR,getInnerBottomTextColor());
  bundle.putInt(INSTANCE_FINISHED_STROKE_COLOR,getFinishedStrokeColor());
  bundle.putInt(INSTANCE_UNFINISHED_STROKE_COLOR,getUnfinishedStrokeColor());
  bundle.putInt(INSTANCE_MAX,getMax());
  bundle.putFloat(INSTANCE_PROGRESS,getProgress());
  bundle.putString(INSTANCE_SUFFIX,getSuffixText());
  bundle.putString(INSTANCE_PREFIX,getPrefixText());
  bundle.putString(INSTANCE_TEXT,getText());
  bundle.putFloat(INSTANCE_FINISHED_STROKE_WIDTH,getFinishedStrokeWidth());
  bundle.putFloat(INSTANCE_UNFINISHED_STROKE_WIDTH,getUnfinishedStrokeWidth());
  bundle.putInt(INSTANCE_BACKGROUND_COLOR,getInnerBackgroundColor());
  bundle.putInt(INSTANCE_INNER_DRAWABLE,getAttributeResourceId());
  return bundle;
}
Program: 54159
Project: 54159
Buggy source:
protected void initByAttributes(TypedArray attributes){
  finishedStrokeColor=attributes.getColor(R.styleable.ArcProgress_arc_finished_color,default_finished_color);
  unfinishedStrokeColor=attributes.getColor(R.styleable.ArcProgress_arc_unfinished_color,default_unfinished_color);
  textColor=attributes.getColor(R.styleable.ArcProgress_arc_text_color,default_text_color);
  textSize=attributes.getDimension(R.styleable.ArcProgress_arc_text_size,default_text_size);
  arcAngle=attributes.getDimension(R.styleable.ArcProgress_arc_angle,default_arc_angle);
  setMax(attributes.getInt(R.styleable.ArcProgress_arc_max,default_max));
  setProgress(attributes.getInt(R.styleable.ArcProgress_arc_progress,0));
  strokeWidth=attributes.getDimension(R.styleable.ArcProgress_arc_stroke_width,default_stroke_width);
  suffixTextSize=attributes.getDimension(R.styleable.ArcProgress_arc_suffix_text_size,default_suffix_text_size);
  suffixText=TextUtils.isEmpty(attributes.getString(R.styleable.ArcProgress_arc_suffix_text)) ? default_suffix_text : attributes.getString(R.styleable.ArcProgress_arc_suffix_text);
  suffixTextPadding=attributes.getDimension(R.styleable.ArcProgress_arc_suffix_text_padding,default_suffix_padding);
  bottomTextSize=attributes.getDimension(R.styleable.ArcProgress_arc_bottom_text_size,default_bottom_text_size);
  bottomText=attributes.getString(R.styleable.ArcProgress_arc_bottom_text);
}

Fixed version (ground truth):
protected void initByAttributes(TypedArray attributes){
  finishedStrokeColor=attributes.getColor(R.styleable.ArcProgress_arc_finished_color,default_finished_color);
  unfinishedStrokeColor=attributes.getColor(R.styleable.ArcProgress_arc_unfinished_color,default_unfinished_color);
  textColor=attributes.getColor(R.styleable.ArcProgress_arc_text_color,default_text_color);
  textSize=attributes.getDimension(R.styleable.ArcProgress_arc_text_size,default_text_size);
  arcAngle=attributes.getFloat(R.styleable.ArcProgress_arc_angle,default_arc_angle);
  setMax(attributes.getInt(R.styleable.ArcProgress_arc_max,default_max));
  setProgress(attributes.getInt(R.styleable.ArcProgress_arc_progress,0));
  strokeWidth=attributes.getDimension(R.styleable.ArcProgress_arc_stroke_width,default_stroke_width);
  suffixTextSize=attributes.getDimension(R.styleable.ArcProgress_arc_suffix_text_size,default_suffix_text_size);
  suffixText=TextUtils.isEmpty(attributes.getString(R.styleable.ArcProgress_arc_suffix_text)) ? default_suffix_text : attributes.getString(R.styleable.ArcProgress_arc_suffix_text);
  suffixTextPadding=attributes.getDimension(R.styleable.ArcProgress_arc_suffix_text_padding,default_suffix_padding);
  bottomTextSize=attributes.getDimension(R.styleable.ArcProgress_arc_bottom_text_size,default_bottom_text_size);
  bottomText=attributes.getString(R.styleable.ArcProgress_arc_bottom_text);
}
Program: 54160
Project: 54160
Buggy source:
@Override public void generateConvertMethod(PsiElementFactory factory,PsiClass cls,ClassEntity classEntity){
  super.generateConvertMethod(factory,cls,classEntity);
  createMethod(factory,Constant.autoValueMethodTemplate.replace("String_Node_Str",cls.getName()).trim(),cls);
}

Fixed version (ground truth):
@Override public void generateConvertMethod(PsiElementFactory factory,PsiClass cls,ClassEntity classEntity){
  super.generateConvertMethod(factory,cls,classEntity);
  if (PsiClassUtil.isClassAvailableForProject(cls.getProject(),"String_Node_Str")) {
    String qualifiedName=cls.getQualifiedName();
    String autoAdapter=qualifiedName.substring(mainPackage.length(),qualifiedName.length());
    createMethod(factory,Constant.autoValueMethodTemplate.replace("String_Node_Str",classEntity.getClassName()).replace("String_Node_Str",getAutoAdpaterClass(autoAdapter)).trim(),cls);
  }
}
Program: 54161
Project: 54161
Buggy source:
public void process(ClassEntity classEntity,PsiElementFactory factory,PsiClass cls,IProcessor visitor){
  if (cls.getChildren() != null) {
    for (    PsiElement e : cls.getChildren()) {
      logPsiElement(e);
    }
  }
  onStarProcess(classEntity,factory,cls,visitor);
  for (  FieldEntity fieldEntity : classEntity.getFields()) {
    generateField(factory,fieldEntity,cls,classEntity);
  }
  for (  ClassEntity innerClass : classEntity.getInnerClasss()) {
    generateClass(factory,innerClass,cls,visitor);
  }
  generateGetterAndSetter(factory,cls,classEntity);
  generateConvertMethod(factory,cls,classEntity);
  onEndProcess(classEntity,factory,cls,visitor);
}

Fixed version (ground truth):
public void process(ClassEntity classEntity,PsiElementFactory factory,PsiClass cls,IProcessor visitor){
  mainPackage=PsiClassUtil.getPackage(cls);
  onStarProcess(classEntity,factory,cls,visitor);
  for (  FieldEntity fieldEntity : classEntity.getFields()) {
    generateField(factory,fieldEntity,cls,classEntity);
  }
  for (  ClassEntity innerClass : classEntity.getInnerClasss()) {
    generateClass(factory,innerClass,cls,visitor);
  }
  generateGetterAndSetter(factory,cls,classEntity);
  generateConvertMethod(factory,cls,classEntity);
  onEndProcess(classEntity,factory,cls,visitor);
}