nus-yam/ex-repair huggingface dataset:
Program: 54016
Project: 54016
Buggy source:
private Viewport computeScrollViewport(float x,float y){
  Viewport maxViewport=getMaximumViewport();
  Viewport currentViewport=getCurrentViewport();
  Viewport scrollViewport=new Viewport(currentViewport);
  if (maxViewport.contains(x,y)) {
    final float width=currentViewport.width();
    final float height=currentViewport.height();
    final float halfWidth=width / 2;
    final float halfHeight=height / 2;
    float left=x - halfWidth;
    float top=y + halfHeight;
    left=Math.max(maxViewport.left,Math.min(left,maxViewport.right - width));
    top=Math.max(maxViewport.bottom + height,Math.min(top,maxViewport.top));
    scrollViewport.set(left,top,left + height,top - height);
  }
  return scrollViewport;
}

Fixed version (ground truth):
private Viewport computeScrollViewport(float x,float y){
  Viewport maxViewport=getMaximumViewport();
  Viewport currentViewport=getCurrentViewport();
  Viewport scrollViewport=new Viewport(currentViewport);
  if (maxViewport.contains(x,y)) {
    final float width=currentViewport.width();
    final float height=currentViewport.height();
    final float halfWidth=width / 2;
    final float halfHeight=height / 2;
    float left=x - halfWidth;
    float top=y + halfHeight;
    left=Math.max(maxViewport.left,Math.min(left,maxViewport.right - width));
    top=Math.max(maxViewport.bottom + height,Math.min(top,maxViewport.top));
    scrollViewport.set(left,top,left + width,top - height);
  }
  return scrollViewport;
}
Program: 54018
Project: 54018
Buggy source:
private void drawSeparationLines(Canvas canvas){
  final PieChartData data=dataProvider.getPieChartData();
  if (data.getValues().size() < 2) {
    return;
  }
  final float sliceScale=360f / maxSum;
  float lastAngle=rotation;
  final float circleRadius=originCircleOval.width() / 2f;
  final int sliceSpacing=ChartUtils.dp2px(density,data.getSlicesSpacing());
  separationLinesPaint.setStrokeWidth(sliceSpacing);
  for (  SliceValue sliceValue : data.getValues()) {
    final float angle=Math.abs(sliceValue.getValue()) * sliceScale;
    sliceVector.set((float)(Math.cos(Math.toRadians(lastAngle))),(float)(Math.sin(Math.toRadians(lastAngle))));
    normalizeVector(sliceVector);
    float x1=sliceVector.x * (circleRadius + touchAdditional) + originCircleOval.centerX();
    float y1=sliceVector.y * (circleRadius + touchAdditional) + originCircleOval.centerY();
    canvas.drawLine(originCircleOval.centerX(),originCircleOval.centerY(),x1,y1,separationLinesPaint);
    lastAngle+=angle;
  }
}

Fixed version (ground truth):
private void drawSeparationLines(Canvas canvas){
  final PieChartData data=dataProvider.getPieChartData();
  if (data.getValues().size() < 2) {
    return;
  }
  final float sliceScale=360f / maxSum;
  float lastAngle=rotation;
  final float circleRadius=originCircleOval.width() / 2f;
  final int sliceSpacing=ChartUtils.dp2px(density,data.getSlicesSpacing());
  separationLinesPaint.setStrokeWidth(sliceSpacing);
  for (  SliceValue sliceValue : data.getValues()) {
    final float angle=Math.abs(sliceValue.getValue()) * sliceScale;
    sliceVector.set((float)(Math.cos(Math.toRadians(lastAngle))),(float)(Math.sin(Math.toRadians(lastAngle))));
    normalizeVector(sliceVector);
    float x1=sliceVector.x * (circleRadius + touchAdditional) + originCircleOval.centerX();
    float y1=sliceVector.y * (circleRadius + touchAdditional) + originCircleOval.centerY();
    if (sliceSpacing > 0) {
      canvas.drawLine(originCircleOval.centerX(),originCircleOval.centerY(),x1,y1,separationLinesPaint);
    }
    lastAngle+=angle;
  }
}
Program: 54019
Project: 54019
Buggy source:
private void drawSeparationLines(Canvas canvas){
  final PieChartData data=dataProvider.getPieChartData();
  if (data.getValues().size() < 2) {
    return;
  }
  final float sliceScale=360f / maxSum;
  float lastAngle=rotation;
  final float circleRadius=originCircleOval.width() / 2f;
  final int sliceSpacing=ChartUtils.dp2px(density,data.getSlicesSpacing());
  separationLinesPaint.setStrokeWidth(sliceSpacing);
  for (  SliceValue sliceValue : data.getValues()) {
    final float angle=Math.abs(sliceValue.getValue()) * sliceScale;
    sliceVector.set((float)(Math.cos(Math.toRadians(lastAngle))),(float)(Math.sin(Math.toRadians(lastAngle))));
    normalizeVector(sliceVector);
    float x1=sliceVector.x * (circleRadius + touchAdditional) + originCircleOval.centerX();
    float y1=sliceVector.y * (circleRadius + touchAdditional) + originCircleOval.centerY();
    if (sliceSpacing > 0) {
      canvas.drawLine(originCircleOval.centerX(),originCircleOval.centerY(),x1,y1,separationLinesPaint);
    }
    lastAngle+=angle;
  }
}

Fixed version (ground truth):
private void drawSeparationLines(Canvas canvas){
  final PieChartData data=dataProvider.getPieChartData();
  if (data.getValues().size() < 2) {
    return;
  }
  final int sliceSpacing=ChartUtils.dp2px(density,data.getSlicesSpacing());
  if (sliceSpacing < 1) {
    return;
  }
  final float sliceScale=360f / maxSum;
  float lastAngle=rotation;
  final float circleRadius=originCircleOval.width() / 2f;
  separationLinesPaint.setStrokeWidth(sliceSpacing);
  for (  SliceValue sliceValue : data.getValues()) {
    final float angle=Math.abs(sliceValue.getValue()) * sliceScale;
    sliceVector.set((float)(Math.cos(Math.toRadians(lastAngle))),(float)(Math.sin(Math.toRadians(lastAngle))));
    normalizeVector(sliceVector);
    float x1=sliceVector.x * (circleRadius + touchAdditional) + originCircleOval.centerX();
    float y1=sliceVector.y * (circleRadius + touchAdditional) + originCircleOval.centerY();
    canvas.drawLine(originCircleOval.centerX(),originCircleOval.centerY(),x1,y1,separationLinesPaint);
    lastAngle+=angle;
  }
}
Program: 54020
Project: 54020
Buggy source:
public boolean fling(int velocityX,int velocityY,ChartComputator computator){
  computator.computeScrollSurfaceSize(surfaceSizeBuffer);
  scrollerStartViewport.set(computator.getCurrentViewport());
  int startX=(int)(surfaceSizeBuffer.x * (scrollerStartViewport.left - computator.getMaximumViewport().left) / computator.getMaximumViewport().width());
  int startY=(int)(surfaceSizeBuffer.y * (computator.getMaximumViewport().top - scrollerStartViewport.top) / computator.getMaximumViewport().height());
  scroller.abortAnimation();
  scroller.fling(startX,startY,velocityX,velocityY,0,surfaceSizeBuffer.x - computator.getContentRectMinusAllMargins().width(),0,surfaceSizeBuffer.y - computator.getContentRectMinusAllMargins().height());
  return true;
}

Fixed version (ground truth):
public boolean fling(int velocityX,int velocityY,ChartComputator computator){
  computator.computeScrollSurfaceSize(surfaceSizeBuffer);
  scrollerStartViewport.set(computator.getCurrentViewport());
  int startX=(int)(surfaceSizeBuffer.x * (scrollerStartViewport.left - computator.getMaximumViewport().left) / computator.getMaximumViewport().width());
  int startY=(int)(surfaceSizeBuffer.y * (computator.getMaximumViewport().top - scrollerStartViewport.top) / computator.getMaximumViewport().height());
  scroller.abortAnimation();
  final int width=computator.getContentRectMinusAllMargins().width();
  final int height=computator.getContentRectMinusAllMargins().height();
  scroller.fling(startX,startY,velocityX,velocityY,0,surfaceSizeBuffer.x - width + 1,0,surfaceSizeBuffer.y - height + 1);
  return true;
}
Program: 54022
Project: 54022
Buggy source:
public void setValues(List<PointValue> values){
  if (null == values) {
    this.values=Collections.emptyList();
  }
 else {
    this.values=values;
  }
}

Fixed version (ground truth):
public void setValues(List<PointValue> values){
  if (null == values) {
    this.values=new ArrayList<PointValue>();
  }
 else {
    this.values=values;
  }
}
Program: 54023
Project: 54023
Buggy source:
/** 
 * Checks if new viewport doesn't exceed max available viewport.
 */
public void constrainViewport(float left,float top,float right,float bottom){
  if (right - left < minViewportWidth) {
    right=left + minViewportWidth;
    if (left < maxViewport.left) {
      left=maxViewport.left;
      right=left + minViewportWidth;
    }
 else     if (right > maxViewport.right) {
      right=maxViewport.right;
      left=right - minViewportWidth;
    }
  }
  if (top - bottom < minViewportHeight) {
    bottom=top - minViewportHeight;
    if (top > maxViewport.top) {
      top=maxViewport.top;
      bottom=top - minViewportHeight;
    }
 else     if (bottom < maxViewport.bottom) {
      bottom=maxViewport.bottom;
      top=bottom + minViewportHeight;
    }
  }
  currentViewport.left=Math.max(maxViewport.left,left);
  currentViewport.top=Math.min(maxViewport.top,top);
  currentViewport.right=Math.min(maxViewport.right,right);
  currentViewport.bottom=Math.max(maxViewport.bottom,bottom);
}

Fixed version (ground truth):
/** 
 * Checks if new viewport doesn't exceed max available viewport.
 */
public void constrainViewport(float left,float top,float right,float bottom){
  if (Utils.almostEqual(maxViewport.left,left)) {
    left=maxViewport.left;
  }
  if (Utils.almostEqual(maxViewport.right,right)) {
    right=maxViewport.right;
  }
  if (Utils.almostEqual(maxViewport.top,top)) {
    top=maxViewport.top;
  }
  if (Utils.almostEqual(maxViewport.bottom,bottom)) {
    bottom=maxViewport.bottom;
  }
  if (right - left < minViewportWidth) {
    right=left + minViewportWidth;
    if (left < maxViewport.left) {
      left=maxViewport.left;
      right=left + minViewportWidth;
    }
 else     if (right > maxViewport.right) {
      right=maxViewport.right;
      left=right - minViewportWidth;
    }
  }
  if (top - bottom < minViewportHeight) {
    bottom=top - minViewportHeight;
    if (top > maxViewport.top) {
      top=maxViewport.top;
      bottom=top - minViewportHeight;
    }
 else     if (bottom < maxViewport.bottom) {
      bottom=maxViewport.bottom;
      top=bottom + minViewportHeight;
    }
  }
  currentViewport.left=Math.max(maxViewport.left,left);
  currentViewport.top=Math.min(maxViewport.top,top);
  currentViewport.right=Math.min(maxViewport.right,right);
  currentViewport.bottom=Math.max(maxViewport.bottom,bottom);
}
Program: 54024
Project: 54024
Buggy source:
public void setCenterText2(String centerText2){
  this.centerText2=centerText2;
}

Fixed version (ground truth):
/** 
 * Note that centerText2 will be drawn only if centerText1 is not empty/null.
 */
public void setCenterText2(String centerText2){
  this.centerText2=centerText2;
}
Program: 54025
Project: 54025
Buggy source:
/** 
 * Draw center circle with text if   {@link PieChartData#hasCenterCircle()} is set true.
 */
private void drawCenterCircle(Canvas canvas){
  final PieChartData data=dataProvider.getPieChartData();
  final float circleRadius=orginCircleOval.width() / 2f;
  final float centerRadius=circleRadius * data.getCenterCircleScale();
  final float centerX=orginCircleOval.centerX();
  final float centerY=orginCircleOval.centerY();
  canvas.drawCircle(centerX,centerY,centerRadius,centerCirclePaint);
  if (!TextUtils.isEmpty(data.getCenterText1())) {
    final int text1Bottom=Math.abs(centerCircleText1FontMetrics.bottom);
    if (!TextUtils.isEmpty(data.getCenterText2())) {
      final int text2Height=Math.abs(centerCircleText2FontMetrics.ascent);
      canvas.drawText(data.getCenterText1(),centerX,centerY - text1Bottom,centerCircleText1Paint);
      canvas.drawText(data.getCenterText2(),centerX,centerY + text2Height,centerCircleText2Paint);
    }
 else {
      canvas.drawText(data.getCenterText1(),centerX,centerY + text1Bottom,centerCircleText1Paint);
    }
  }
}

Fixed version (ground truth):
/** 
 * Draw center circle with text if   {@link PieChartData#hasCenterCircle()} is set true.
 */
private void drawCenterCircle(Canvas canvas){
  final PieChartData data=dataProvider.getPieChartData();
  final float circleRadius=orginCircleOval.width() / 2f;
  final float centerRadius=circleRadius * data.getCenterCircleScale();
  final float centerX=orginCircleOval.centerX();
  final float centerY=orginCircleOval.centerY();
  canvas.drawCircle(centerX,centerY,centerRadius,centerCirclePaint);
  if (!TextUtils.isEmpty(data.getCenterText1())) {
    final int text1Height=Math.abs(centerCircleText1FontMetrics.ascent);
    if (!TextUtils.isEmpty(data.getCenterText2())) {
      final int text2Height=Math.abs(centerCircleText2FontMetrics.ascent);
      canvas.drawText(data.getCenterText1(),centerX,centerY - text1Height * 0.2f,centerCircleText1Paint);
      canvas.drawText(data.getCenterText2(),centerX,centerY + text2Height,centerCircleText2Paint);
    }
 else {
      canvas.drawText(data.getCenterText1(),centerX,centerY + text1Height / 4,centerCircleText1Paint);
    }
  }
}
Program: 54026
Project: 54026
Buggy source:
public void set(SelectedValue selectedValue){
  this.firstIndex=selectedValue.getFirstIndex();
  this.secondIndex=selectedValue.getSecondIndex();
}

Fixed version (ground truth):
public void set(SelectedValue selectedValue){
  this.firstIndex=selectedValue.firstIndex;
  this.secondIndex=selectedValue.secondIndex;
  this.thirdIndex=selectedValue.thirdIndex;
}
Program: 54027
Project: 54027
Buggy source:
public boolean isSet(){
  if (getFirstIndex() >= 0 && getSecondIndex() >= 0) {
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
public boolean isSet(){
  if (firstIndex >= 0 && secondIndex >= 0 && thirdIndex >= 0) {
    return true;
  }
 else {
    return false;
  }
}
Program: 54028
Project: 54028
Buggy source:
public void clear(){
  set(Integer.MIN_VALUE,Integer.MIN_VALUE);
  this.dataType=Integer.MIN_VALUE;
}

Fixed version (ground truth):
public void clear(){
  set(Integer.MIN_VALUE,Integer.MIN_VALUE,Integer.MIN_VALUE);
}
Program: 54029
Project: 54029
Buggy source:
public SelectedValue(int firstIndex,int secondIndex){
  set(firstIndex,secondIndex);
}

Fixed version (ground truth):
public SelectedValue(int firstIndex,int secondIndex,int dataType){
  set(firstIndex,secondIndex,dataType);
}
Program: 54030
Project: 54030
Buggy source:
public void computePoint(float t,float[] startPoints,PointF outPoint){
  if (startPoints.length != pointsNumber) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  System.arraycopy(points[0],0,startPoints,0,pointsNumber);
  for (int i=1, pointsIndex=pointsNumber; i < curveDegree; ++i, pointsIndex-=2) {
    for (int indexX=0, indexY=1; indexY < pointsIndex; indexX+=2, indexY+=2) {
      points[i][indexX]=(1 - t) * points[i - 1][indexX] + t * points[i - 1][indexX + 2];
      points[i][indexY]=(1 - t) * points[i - 1][indexY] + t * points[i - 1][indexY + 2];
    }
  }
  outPoint.set(points[curveDegree - 1][0],points[curveDegree - 1][1]);
}

Fixed version (ground truth):
public void computePoint(float t,float[] startPoints,PointF outPoint){
  if (startPoints.length != pointsNumber) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  System.arraycopy(startPoints,0,points[0],0,pointsNumber);
  for (int i=1, pointsIndex=pointsNumber - 2; i < curveDegree; ++i, pointsIndex-=2) {
    for (int indexX=0, indexY=1; indexY <= pointsIndex; indexX+=2, indexY+=2) {
      points[i][indexX]=(1 - t) * points[i - 1][indexX] + t * points[i - 1][indexX + 2];
      points[i][indexY]=(1 - t) * points[i - 1][indexY] + t * points[i - 1][indexY + 2];
    }
  }
  outPoint.set(points[curveDegree - 1][0],points[curveDegree - 1][1]);
}
Program: 54031
Project: 54031
Buggy source:
public void setData(final ColumnChartData data){
  mData=data;
  mData.calculateBoundaries();
  mChartCalculator.calculateViewport();
  mChartCalculator.calculateContentArea(getWidth(),getHeight(),getPaddingLeft(),getPaddingTop(),getPaddingRight(),getPaddingBottom());
  mChartCalculator.setAxesMargin(mAxesRenderer.getAxisXHeight(0),mAxesRenderer.getAxisYWidth(0));
  ViewCompat.postInvalidateOnAnimation(ColumnChartView.this);
}

Fixed version (ground truth):
public void setData(final ColumnChartData data){
  mData=data;
  mData.calculateBoundaries();
  mChartCalculator.calculateViewport();
  mChartCalculator.calculateContentArea(getWidth(),getHeight(),getPaddingLeft(),getPaddingTop(),getPaddingRight(),getPaddingBottom());
  mAxesRenderer.initRenderer();
  mChartCalculator.setAxesMargin(mAxesRenderer.getAxisXHeight(),mAxesRenderer.getAxisYWidth());
  ViewCompat.postInvalidateOnAnimation(ColumnChartView.this);
}
Program: 54032
Project: 54032
Buggy source:
@Override protected void onSizeChanged(int width,int height,int oldWidth,int oldHeight){
  super.onSizeChanged(width,height,oldWidth,oldHeight);
  mChartCalculator.calculateViewport();
  mChartCalculator.calculateContentArea(getWidth(),getHeight(),getPaddingLeft(),getPaddingTop(),getPaddingRight(),getPaddingBottom());
  mChartCalculator.setAxesMargin(mAxesRenderer.getAxisXHeight(0),mAxesRenderer.getAxisYWidth(0));
}

Fixed version (ground truth):
@Override protected void onSizeChanged(int width,int height,int oldWidth,int oldHeight){
  super.onSizeChanged(width,height,oldWidth,oldHeight);
  mChartCalculator.calculateViewport();
  mChartCalculator.calculateContentArea(getWidth(),getHeight(),getPaddingLeft(),getPaddingTop(),getPaddingRight(),getPaddingBottom());
  mChartCalculator.setAxesMargin(mAxesRenderer.getAxisXHeight(),mAxesRenderer.getAxisYWidth());
}
Program: 54033
Project: 54033
Buggy source:
protected void onStart(){
  mDialogView.startAnimation(mModalInAnim);
  playAnimation();
}

Fixed version (ground truth):
protected void onStart(){
  getWindow().getDecorView().getBackground().setAlpha(255);
  mDialogView.startAnimation(mModalInAnim);
  playAnimation();
}
Program: 54034
Project: 54034
Buggy source:
public SweetAlertDialog(Context context,int alertType){
  super(context,R.style.alert_dialog);
  setCancelable(true);
  setCanceledOnTouchOutside(false);
  mAlertType=alertType;
  mErrorInAnim=OptAnimationLoader.loadAnimation(getContext(),R.anim.error_frame_in);
  mErrorXInAnim=OptAnimationLoader.loadAnimation(getContext(),R.anim.error_x_in);
  mSuccessBowAnim=OptAnimationLoader.loadAnimation(getContext(),R.anim.success_bow_roate);
  mSuccessLayoutAnimSet=(AnimationSet)OptAnimationLoader.loadAnimation(getContext(),R.anim.success_mask_layout);
  mScaleInAnim=(AnimationSet)OptAnimationLoader.loadAnimation(getContext(),R.anim.dialog_scale_in);
  mScaleOutAnim=(AnimationSet)OptAnimationLoader.loadAnimation(getContext(),R.anim.dialog_scale_out);
  mScaleOutAnim.setAnimationListener(new Animation.AnimationListener(){
    @Override public void onAnimationStart(    Animation animation){
    }
    @Override public void onAnimationEnd(    Animation animation){
      mDialogView.setVisibility(View.GONE);
      mDialogView.post(new Runnable(){
        @Override public void run(){
          SweetAlertDialog.super.dismiss();
        }
      }
);
    }
    @Override public void onAnimationRepeat(    Animation animation){
    }
  }
);
}

Fixed version (ground truth):
public SweetAlertDialog(Context context,int alertType){
  super(context,R.style.alert_dialog);
  setCancelable(true);
  setCanceledOnTouchOutside(false);
  mAlertType=alertType;
  mErrorInAnim=OptAnimationLoader.loadAnimation(getContext(),R.anim.error_frame_in);
  mErrorXInAnim=(AnimationSet)OptAnimationLoader.loadAnimation(getContext(),R.anim.error_x_in);
  if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.GINGERBREAD_MR1) {
    List<Animation> childAnims=mErrorXInAnim.getAnimations();
    int idx=0;
    for (; idx < childAnims.size(); idx++) {
      if (childAnims.get(idx) instanceof AlphaAnimation) {
        break;
      }
    }
    if (idx < childAnims.size()) {
      childAnims.remove(idx);
    }
  }
  mSuccessBowAnim=OptAnimationLoader.loadAnimation(getContext(),R.anim.success_bow_roate);
  mSuccessLayoutAnimSet=(AnimationSet)OptAnimationLoader.loadAnimation(getContext(),R.anim.success_mask_layout);
  mScaleInAnim=(AnimationSet)OptAnimationLoader.loadAnimation(getContext(),R.anim.dialog_scale_in);
  mScaleOutAnim=(AnimationSet)OptAnimationLoader.loadAnimation(getContext(),R.anim.dialog_scale_out);
  mScaleOutAnim.setAnimationListener(new Animation.AnimationListener(){
    @Override public void onAnimationStart(    Animation animation){
    }
    @Override public void onAnimationEnd(    Animation animation){
      mDialogView.setVisibility(View.GONE);
      mDialogView.post(new Runnable(){
        @Override public void run(){
          SweetAlertDialog.super.dismiss();
        }
      }
);
    }
    @Override public void onAnimationRepeat(    Animation animation){
    }
  }
);
}
Program: 54036
Project: 54036
Buggy source:
public void setValidateOnFocusLost(boolean validateOnFocusLost){
  this.validateOnFocusLost=validateOnFocusLost;
}

Fixed version (ground truth):
public void setValidateOnFocusLost(boolean validate){
  this.validateOnFocusLost=validate;
}
Program: 54039
Project: 54039
Buggy source:
public void setValidateOnFocusLost(boolean validateOnFocusLost){
  this.validateOnFocusLost=validateOnFocusLost;
}

Fixed version (ground truth):
public void setValidateOnFocusLost(boolean validate){
  this.validateOnFocusLost=validate;
}
Program: 54040
Project: 54040
Buggy source:
@Override public boolean onTouchEvent(MotionEvent event){
  if (singleLineEllipsis && getScrollX() > 0 && event.getAction() == MotionEvent.ACTION_DOWN && event.getX() < getPixel(4 * 5) && event.getY() > getHeight() - extraPaddingBottom - innerPaddingBottom && event.getY() < getHeight() - innerPaddingBottom) {
    setSelection(0);
    return false;
  }
  if (hasFocus() && showClearButton) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
      if (insideClearButton(event)) {
        clearButtonTouched=true;
        clearButtonClicking=true;
      }
    return true;
case MotionEvent.ACTION_MOVE:
  if (clearButtonClicking && !insideClearButton(event)) {
    clearButtonClicking=false;
  }
if (clearButtonTouched) {
  return true;
}
break;
case MotionEvent.ACTION_UP:
if (clearButtonClicking) {
if (!TextUtils.isEmpty(getText())) {
setText(null);
}
clearButtonClicking=false;
}
if (clearButtonTouched) {
clearButtonTouched=false;
return true;
}
clearButtonTouched=false;
break;
case MotionEvent.ACTION_CANCEL:
clearButtonTouched=false;
clearButtonClicking=false;
break;
}
}
return super.onTouchEvent(event);
}

Fixed version (ground truth):
@Override public boolean onTouchEvent(MotionEvent event){
  if (singleLineEllipsis && getScrollX() > 0 && event.getAction() == MotionEvent.ACTION_DOWN && event.getX() < getPixel(4 * 5) && event.getY() > getHeight() - extraPaddingBottom - innerPaddingBottom && event.getY() < getHeight() - innerPaddingBottom) {
    setSelection(0);
    return false;
  }
  if (hasFocus() && showClearButton) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
      if (insideClearButton(event)) {
        clearButtonTouched=true;
        clearButtonClicking=true;
        return true;
      }
case MotionEvent.ACTION_MOVE:
    if (clearButtonClicking && !insideClearButton(event)) {
      clearButtonClicking=false;
    }
  if (clearButtonTouched) {
    return true;
  }
break;
case MotionEvent.ACTION_UP:
if (clearButtonClicking) {
if (!TextUtils.isEmpty(getText())) {
  setText(null);
}
clearButtonClicking=false;
}
if (clearButtonTouched) {
clearButtonTouched=false;
return true;
}
clearButtonTouched=false;
break;
case MotionEvent.ACTION_CANCEL:
clearButtonTouched=false;
clearButtonClicking=false;
break;
}
}
return super.onTouchEvent(event);
}
Program: 54041
Project: 54041
Buggy source:
@Override public boolean onTouchEvent(MotionEvent event){
  if (singleLineEllipsis && getScrollX() > 0 && event.getAction() == MotionEvent.ACTION_DOWN && event.getX() < getPixel(4 * 5) && event.getY() > getHeight() - extraPaddingBottom - innerPaddingBottom && event.getY() < getHeight() - innerPaddingBottom) {
    setSelection(0);
    return false;
  }
  if (hasFocus() && showClearButton) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
      if (insideClearButton(event)) {
        clearButtonTouched=true;
        clearButtonClicking=true;
      }
    return true;
case MotionEvent.ACTION_MOVE:
  if (clearButtonClicking && !insideClearButton(event)) {
    clearButtonClicking=false;
  }
if (clearButtonTouched) {
  return true;
}
break;
case MotionEvent.ACTION_UP:
if (clearButtonClicking) {
if (!TextUtils.isEmpty(getText())) {
setText(null);
}
clearButtonClicking=false;
}
if (clearButtonTouched) {
clearButtonTouched=false;
return true;
}
clearButtonTouched=false;
break;
case MotionEvent.ACTION_CANCEL:
clearButtonTouched=false;
clearButtonClicking=false;
break;
}
}
return super.onTouchEvent(event);
}

Fixed version (ground truth):
@Override public boolean onTouchEvent(MotionEvent event){
  if (singleLineEllipsis && getScrollX() > 0 && event.getAction() == MotionEvent.ACTION_DOWN && event.getX() < getPixel(4 * 5) && event.getY() > getHeight() - extraPaddingBottom - innerPaddingBottom && event.getY() < getHeight() - innerPaddingBottom) {
    setSelection(0);
    return false;
  }
  if (hasFocus() && showClearButton) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
      if (insideClearButton(event)) {
        clearButtonTouched=true;
        clearButtonClicking=true;
        return true;
      }
case MotionEvent.ACTION_MOVE:
    if (clearButtonClicking && !insideClearButton(event)) {
      clearButtonClicking=false;
    }
  if (clearButtonTouched) {
    return true;
  }
break;
case MotionEvent.ACTION_UP:
if (clearButtonClicking) {
if (!TextUtils.isEmpty(getText())) {
  setText(null);
}
clearButtonClicking=false;
}
if (clearButtonTouched) {
clearButtonTouched=false;
return true;
}
clearButtonTouched=false;
break;
case MotionEvent.ACTION_CANCEL:
clearButtonTouched=false;
clearButtonClicking=false;
break;
}
}
return super.onTouchEvent(event);
}
Program: 54042
Project: 54042
Buggy source:
@Override public boolean onTouchEvent(MotionEvent event){
  if (singleLineEllipsis && getScrollX() > 0 && event.getAction() == MotionEvent.ACTION_DOWN && event.getX() < getPixel(4 * 5) && event.getY() > getHeight() - extraPaddingBottom - innerPaddingBottom && event.getY() < getHeight() - innerPaddingBottom) {
    setSelection(0);
    return false;
  }
  if (hasFocus() && showClearButton) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
      if (insideClearButton(event)) {
        clearButtonTouched=true;
        clearButtonClicking=true;
      }
    return true;
case MotionEvent.ACTION_MOVE:
  if (clearButtonClicking && !insideClearButton(event)) {
    clearButtonClicking=false;
  }
if (clearButtonTouched) {
  return true;
}
break;
case MotionEvent.ACTION_UP:
if (clearButtonClicking) {
if (!TextUtils.isEmpty(getText())) {
setText(null);
}
clearButtonClicking=false;
}
if (clearButtonTouched) {
clearButtonTouched=false;
return true;
}
clearButtonTouched=false;
break;
case MotionEvent.ACTION_CANCEL:
clearButtonTouched=false;
clearButtonClicking=false;
break;
}
}
return super.onTouchEvent(event);
}

Fixed version (ground truth):
@Override public boolean onTouchEvent(MotionEvent event){
  if (singleLineEllipsis && getScrollX() > 0 && event.getAction() == MotionEvent.ACTION_DOWN && event.getX() < getPixel(4 * 5) && event.getY() > getHeight() - extraPaddingBottom - innerPaddingBottom && event.getY() < getHeight() - innerPaddingBottom) {
    setSelection(0);
    return false;
  }
  if (hasFocus() && showClearButton) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
      if (insideClearButton(event)) {
        clearButtonTouched=true;
        clearButtonClicking=true;
        return true;
      }
case MotionEvent.ACTION_MOVE:
    if (clearButtonClicking && !insideClearButton(event)) {
      clearButtonClicking=false;
    }
  if (clearButtonTouched) {
    return true;
  }
break;
case MotionEvent.ACTION_UP:
if (clearButtonClicking) {
if (!TextUtils.isEmpty(getText())) {
  setText(null);
}
clearButtonClicking=false;
}
if (clearButtonTouched) {
clearButtonTouched=false;
return true;
}
clearButtonTouched=false;
break;
case MotionEvent.ACTION_CANCEL:
clearButtonTouched=false;
clearButtonClicking=false;
break;
}
}
return super.onTouchEvent(event);
}
Program: 54048
Project: 54048
Buggy source:
@Override public void afterTextChanged(Editable s){
  if (floatingLabelEnabled) {
    if (s.length() == 0) {
      if (floatingLabelShown) {
        floatingLabelShown=false;
        getLabelAnimator().reverse();
      }
    }
 else     if (!floatingLabelShown) {
      floatingLabelShown=true;
      if (getLabelAnimator().isStarted()) {
        getLabelAnimator().reverse();
      }
 else {
        getLabelAnimator().start();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void afterTextChanged(Editable s){
  if (floatingLabelEnabled) {
    if (s.length() == 0) {
      if (floatingLabelShown) {
        floatingLabelShown=false;
        getLabelAnimator().reverse();
      }
    }
 else     if (!floatingLabelShown) {
      floatingLabelShown=true;
      getLabelAnimator().start();
    }
  }
}
Program: 54049
Project: 54049
Buggy source:
private void initFloatingLabel(){
  addTextChangedListener(new TextWatcher(){
    @Override public void beforeTextChanged(    CharSequence s,    int start,    int count,    int after){
    }
    @Override public void onTextChanged(    CharSequence s,    int start,    int before,    int count){
    }
    @Override public void afterTextChanged(    Editable s){
      if (floatingLabelEnabled) {
        if (s.length() == 0) {
          if (floatingLabelShown) {
            floatingLabelShown=false;
            getLabelAnimator().reverse();
          }
        }
 else         if (!floatingLabelShown) {
          floatingLabelShown=true;
          if (getLabelAnimator().isStarted()) {
            getLabelAnimator().reverse();
          }
 else {
            getLabelAnimator().start();
          }
        }
      }
    }
  }
);
  innerFocusChangeListener=new OnFocusChangeListener(){
    @Override public void onFocusChange(    View v,    boolean hasFocus){
      if (floatingLabelEnabled && highlightFloatingLabel) {
        if (hasFocus) {
          if (getLabelFocusAnimator().isStarted()) {
            getLabelFocusAnimator().reverse();
          }
 else {
            getLabelFocusAnimator().start();
          }
        }
 else {
          getLabelFocusAnimator().reverse();
        }
      }
      if (validateOnFocusLost && !hasFocus) {
        validate();
      }
      if (outerFocusChangeListener != null) {
        outerFocusChangeListener.onFocusChange(v,hasFocus);
      }
    }
  }
;
  super.setOnFocusChangeListener(innerFocusChangeListener);
}

Fixed version (ground truth):
private void initFloatingLabel(){
  addTextChangedListener(new TextWatcher(){
    @Override public void beforeTextChanged(    CharSequence s,    int start,    int count,    int after){
    }
    @Override public void onTextChanged(    CharSequence s,    int start,    int before,    int count){
    }
    @Override public void afterTextChanged(    Editable s){
      if (floatingLabelEnabled) {
        if (s.length() == 0) {
          if (floatingLabelShown) {
            floatingLabelShown=false;
            getLabelAnimator().reverse();
          }
        }
 else         if (!floatingLabelShown) {
          floatingLabelShown=true;
          getLabelAnimator().start();
        }
      }
    }
  }
);
  innerFocusChangeListener=new OnFocusChangeListener(){
    @Override public void onFocusChange(    View v,    boolean hasFocus){
      if (floatingLabelEnabled && highlightFloatingLabel) {
        if (hasFocus) {
          getLabelFocusAnimator().start();
        }
 else {
          getLabelFocusAnimator().reverse();
        }
      }
      if (validateOnFocusLost && !hasFocus) {
        validate();
      }
      if (outerFocusChangeListener != null) {
        outerFocusChangeListener.onFocusChange(v,hasFocus);
      }
    }
  }
;
  super.setOnFocusChangeListener(innerFocusChangeListener);
}
Program: 54050
Project: 54050
Buggy source:
@Override public void onFocusChange(View v,boolean hasFocus){
  if (floatingLabelEnabled && highlightFloatingLabel) {
    if (hasFocus) {
      if (getLabelFocusAnimator().isStarted()) {
        getLabelFocusAnimator().reverse();
      }
 else {
        getLabelFocusAnimator().start();
      }
    }
 else {
      getLabelFocusAnimator().reverse();
    }
  }
  if (validateOnFocusLost && !hasFocus) {
    validate();
  }
  if (outerFocusChangeListener != null) {
    outerFocusChangeListener.onFocusChange(v,hasFocus);
  }
}

Fixed version (ground truth):
@Override public void onFocusChange(View v,boolean hasFocus){
  if (floatingLabelEnabled && highlightFloatingLabel) {
    if (hasFocus) {
      getLabelFocusAnimator().start();
    }
 else {
      getLabelFocusAnimator().reverse();
    }
  }
  if (validateOnFocusLost && !hasFocus) {
    validate();
  }
  if (outerFocusChangeListener != null) {
    outerFocusChangeListener.onFocusChange(v,hasFocus);
  }
}
Program: 54051
Project: 54051
Buggy source:
@Override public void afterTextChanged(Editable s){
  if (floatingLabelEnabled) {
    if (s.length() == 0) {
      if (floatingLabelShown) {
        floatingLabelShown=false;
        getLabelAnimator().reverse();
      }
    }
 else     if (!floatingLabelShown) {
      floatingLabelShown=true;
      if (getLabelAnimator().isStarted()) {
        getLabelAnimator().reverse();
      }
 else {
        getLabelAnimator().start();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void afterTextChanged(Editable s){
  if (floatingLabelEnabled) {
    if (s.length() == 0) {
      if (floatingLabelShown) {
        floatingLabelShown=false;
        getLabelAnimator().reverse();
      }
    }
 else     if (!floatingLabelShown) {
      floatingLabelShown=true;
      getLabelAnimator().start();
    }
  }
}
Program: 54052
Project: 54052
Buggy source:
private void initFloatingLabel(){
  addTextChangedListener(new TextWatcher(){
    @Override public void beforeTextChanged(    CharSequence s,    int start,    int count,    int after){
    }
    @Override public void onTextChanged(    CharSequence s,    int start,    int before,    int count){
    }
    @Override public void afterTextChanged(    Editable s){
      if (floatingLabelEnabled) {
        if (s.length() == 0) {
          if (floatingLabelShown) {
            floatingLabelShown=false;
            getLabelAnimator().reverse();
          }
        }
 else         if (!floatingLabelShown) {
          floatingLabelShown=true;
          if (getLabelAnimator().isStarted()) {
            getLabelAnimator().reverse();
          }
 else {
            getLabelAnimator().start();
          }
        }
      }
    }
  }
);
  innerFocusChangeListener=new OnFocusChangeListener(){
    @Override public void onFocusChange(    View v,    boolean hasFocus){
      if (floatingLabelEnabled && highlightFloatingLabel) {
        if (hasFocus) {
          if (getLabelFocusAnimator().isStarted()) {
            getLabelFocusAnimator().reverse();
          }
 else {
            getLabelFocusAnimator().start();
          }
        }
 else {
          getLabelFocusAnimator().reverse();
        }
      }
      if (validateOnFocusLost && !hasFocus) {
        validate();
      }
      if (outerFocusChangeListener != null) {
        outerFocusChangeListener.onFocusChange(v,hasFocus);
      }
    }
  }
;
  super.setOnFocusChangeListener(innerFocusChangeListener);
}

Fixed version (ground truth):
private void initFloatingLabel(){
  addTextChangedListener(new TextWatcher(){
    @Override public void beforeTextChanged(    CharSequence s,    int start,    int count,    int after){
    }
    @Override public void onTextChanged(    CharSequence s,    int start,    int before,    int count){
    }
    @Override public void afterTextChanged(    Editable s){
      if (floatingLabelEnabled) {
        if (s.length() == 0) {
          if (floatingLabelShown) {
            floatingLabelShown=false;
            getLabelAnimator().reverse();
          }
        }
 else         if (!floatingLabelShown) {
          floatingLabelShown=true;
          getLabelAnimator().start();
        }
      }
    }
  }
);
  innerFocusChangeListener=new OnFocusChangeListener(){
    @Override public void onFocusChange(    View v,    boolean hasFocus){
      if (floatingLabelEnabled && highlightFloatingLabel) {
        if (hasFocus) {
          getLabelFocusAnimator().start();
        }
 else {
          getLabelFocusAnimator().reverse();
        }
      }
      if (validateOnFocusLost && !hasFocus) {
        validate();
      }
      if (outerFocusChangeListener != null) {
        outerFocusChangeListener.onFocusChange(v,hasFocus);
      }
    }
  }
;
  super.setOnFocusChangeListener(innerFocusChangeListener);
}
Program: 54053
Project: 54053
Buggy source:
@Override public void onFocusChange(View v,boolean hasFocus){
  if (floatingLabelEnabled && highlightFloatingLabel) {
    if (hasFocus) {
      if (getLabelFocusAnimator().isStarted()) {
        getLabelFocusAnimator().reverse();
      }
 else {
        getLabelFocusAnimator().start();
      }
    }
 else {
      getLabelFocusAnimator().reverse();
    }
  }
  if (validateOnFocusLost && !hasFocus) {
    validate();
  }
  if (outerFocusChangeListener != null) {
    outerFocusChangeListener.onFocusChange(v,hasFocus);
  }
}

Fixed version (ground truth):
@Override public void onFocusChange(View v,boolean hasFocus){
  if (floatingLabelEnabled && highlightFloatingLabel) {
    if (hasFocus) {
      getLabelFocusAnimator().start();
    }
 else {
      getLabelFocusAnimator().reverse();
    }
  }
  if (validateOnFocusLost && !hasFocus) {
    validate();
  }
  if (outerFocusChangeListener != null) {
    outerFocusChangeListener.onFocusChange(v,hasFocus);
  }
}
Program: 54054
Project: 54054
Buggy source:
@Override public void afterTextChanged(Editable s){
  if (floatingLabelEnabled) {
    if (s.length() == 0) {
      if (floatingLabelShown) {
        floatingLabelShown=false;
        getLabelAnimator().reverse();
      }
    }
 else     if (!floatingLabelShown) {
      floatingLabelShown=true;
      if (getLabelAnimator().isStarted()) {
        getLabelAnimator().reverse();
      }
 else {
        getLabelAnimator().start();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void afterTextChanged(Editable s){
  if (floatingLabelEnabled) {
    if (s.length() == 0) {
      if (floatingLabelShown) {
        floatingLabelShown=false;
        getLabelAnimator().reverse();
      }
    }
 else     if (!floatingLabelShown) {
      floatingLabelShown=true;
      getLabelAnimator().start();
    }
  }
}
Program: 54055
Project: 54055
Buggy source:
private void initFloatingLabel(){
  addTextChangedListener(new TextWatcher(){
    @Override public void beforeTextChanged(    CharSequence s,    int start,    int count,    int after){
    }
    @Override public void onTextChanged(    CharSequence s,    int start,    int before,    int count){
    }
    @Override public void afterTextChanged(    Editable s){
      if (floatingLabelEnabled) {
        if (s.length() == 0) {
          if (floatingLabelShown) {
            floatingLabelShown=false;
            getLabelAnimator().reverse();
          }
        }
 else         if (!floatingLabelShown) {
          floatingLabelShown=true;
          if (getLabelAnimator().isStarted()) {
            getLabelAnimator().reverse();
          }
 else {
            getLabelAnimator().start();
          }
        }
      }
    }
  }
);
  innerFocusChangeListener=new OnFocusChangeListener(){
    @Override public void onFocusChange(    View v,    boolean hasFocus){
      if (floatingLabelEnabled && highlightFloatingLabel) {
        if (hasFocus) {
          if (getLabelFocusAnimator().isStarted()) {
            getLabelFocusAnimator().reverse();
          }
 else {
            getLabelFocusAnimator().start();
          }
        }
 else {
          getLabelFocusAnimator().reverse();
        }
      }
      if (validateOnFocusLost && !hasFocus) {
        validate();
      }
      if (outerFocusChangeListener != null) {
        outerFocusChangeListener.onFocusChange(v,hasFocus);
      }
    }
  }
;
  super.setOnFocusChangeListener(innerFocusChangeListener);
}

Fixed version (ground truth):
private void initFloatingLabel(){
  addTextChangedListener(new TextWatcher(){
    @Override public void beforeTextChanged(    CharSequence s,    int start,    int count,    int after){
    }
    @Override public void onTextChanged(    CharSequence s,    int start,    int before,    int count){
    }
    @Override public void afterTextChanged(    Editable s){
      if (floatingLabelEnabled) {
        if (s.length() == 0) {
          if (floatingLabelShown) {
            floatingLabelShown=false;
            getLabelAnimator().reverse();
          }
        }
 else         if (!floatingLabelShown) {
          floatingLabelShown=true;
          getLabelAnimator().start();
        }
      }
    }
  }
);
  innerFocusChangeListener=new OnFocusChangeListener(){
    @Override public void onFocusChange(    View v,    boolean hasFocus){
      if (floatingLabelEnabled && highlightFloatingLabel) {
        if (hasFocus) {
          getLabelFocusAnimator().start();
        }
 else {
          getLabelFocusAnimator().reverse();
        }
      }
      if (validateOnFocusLost && !hasFocus) {
        validate();
      }
      if (outerFocusChangeListener != null) {
        outerFocusChangeListener.onFocusChange(v,hasFocus);
      }
    }
  }
;
  super.setOnFocusChangeListener(innerFocusChangeListener);
}
Program: 54056
Project: 54056
Buggy source:
@Override public void onFocusChange(View v,boolean hasFocus){
  if (floatingLabelEnabled && highlightFloatingLabel) {
    if (hasFocus) {
      if (getLabelFocusAnimator().isStarted()) {
        getLabelFocusAnimator().reverse();
      }
 else {
        getLabelFocusAnimator().start();
      }
    }
 else {
      getLabelFocusAnimator().reverse();
    }
  }
  if (validateOnFocusLost && !hasFocus) {
    validate();
  }
  if (outerFocusChangeListener != null) {
    outerFocusChangeListener.onFocusChange(v,hasFocus);
  }
}

Fixed version (ground truth):
@Override public void onFocusChange(View v,boolean hasFocus){
  if (floatingLabelEnabled && highlightFloatingLabel) {
    if (hasFocus) {
      getLabelFocusAnimator().start();
    }
 else {
      getLabelFocusAnimator().reverse();
    }
  }
  if (validateOnFocusLost && !hasFocus) {
    validate();
  }
  if (outerFocusChangeListener != null) {
    outerFocusChangeListener.onFocusChange(v,hasFocus);
  }
}
Program: 54063
Project: 54063
Buggy source:
private void resetTextColor(){
  if (textColorStateList == null) {
    textColorStateList=new ColorStateList(new int[][]{new int[]{android.R.attr.state_enabled},EMPTY_STATE_SET},new int[]{baseColor & 0x00ffffff | 0xdf000000,baseColor & 0x00ffffff | 0x44000000});
    super.setTextColor(textColorStateList);
  }
}

Fixed version (ground truth):
private void resetTextColor(){
  if (textColorStateList == null) {
    textColorStateList=new ColorStateList(new int[][]{new int[]{android.R.attr.state_enabled},EMPTY_STATE_SET},new int[]{baseColor & 0x00ffffff | 0xdf000000,baseColor & 0x00ffffff | 0x44000000});
    setTextColor(textColorStateList);
  }
 else {
    setTextColor(textColorStateList);
  }
}
Program: 54064
Project: 54064
Buggy source:
private void resetTextColor(){
  if (textColorStateList == null) {
    textColorStateList=new ColorStateList(new int[][]{new int[]{android.R.attr.state_enabled},EMPTY_STATE_SET},new int[]{baseColor & 0x00ffffff | 0xdf000000,baseColor & 0x00ffffff | 0x44000000});
    setTextColor(textColorStateList);
  }
}

Fixed version (ground truth):
private void resetTextColor(){
  if (textColorStateList == null) {
    textColorStateList=new ColorStateList(new int[][]{new int[]{android.R.attr.state_enabled},EMPTY_STATE_SET},new int[]{baseColor & 0x00ffffff | 0xdf000000,baseColor & 0x00ffffff | 0x44000000});
    setTextColor(textColorStateList);
  }
 else {
    setTextColor(textColorStateList);
  }
}
Program: 54065
Project: 54065
Buggy source:
private void resetTextColor(){
  if (textColorStateList == null) {
    textColorStateList=new ColorStateList(new int[][]{new int[]{android.R.attr.state_enabled},EMPTY_STATE_SET},new int[]{baseColor & 0x00ffffff | 0xdf000000,baseColor & 0x00ffffff | 0x44000000});
    super.setTextColor(textColorStateList);
  }
}

Fixed version (ground truth):
private void resetTextColor(){
  if (textColorStateList == null) {
    textColorStateList=new ColorStateList(new int[][]{new int[]{android.R.attr.state_enabled},EMPTY_STATE_SET},new int[]{baseColor & 0x00ffffff | 0xdf000000,baseColor & 0x00ffffff | 0x44000000});
    setTextColor(textColorStateList);
  }
 else {
    setTextColor(textColorStateList);
  }
}
Program: 54069
Project: 54069
Buggy source:
public void setBaseColor(int color,ColorStateList textColorStateList,ColorStateList textColorHintStateList){
  if (baseColor != color) {
    baseColor=color;
  }
  if (textColorStateList == null) {
    textColorStateList=new ColorStateList(new int[][]{new int[]{android.R.attr.state_enabled},EMPTY_STATE_SET},new int[]{baseColor & 0x00ffffff | 0xdf000000,baseColor & 0x00ffffff | 0x44000000});
    setTextColor(textColorStateList);
  }
  if (textColorHintStateList == null) {
    setHintTextColor(baseColor & 0x00ffffff | 0x44000000);
  }
 else {
    setHintTextColor(textColorHintStateList);
  }
  postInvalidate();
}

Fixed version (ground truth):
public void setBaseColor(int color){
  if (baseColor != color) {
    baseColor=color;
  }
  resetTextColor();
  resetHintTextColor();
  postInvalidate();
}
Program: 54071
Project: 54071
Buggy source:
private void initText(ColorStateList textColorHintStateList){
  if (!TextUtils.isEmpty(getText())) {
    CharSequence text=getText();
    setText(null);
    if (textColorHintStateList != null) {
      setHintTextColor(textColorHintStateList);
    }
 else {
      setHintTextColor(baseColor & 0x00ffffff | 0x44000000);
    }
    setText(text);
    setSelection(text.length());
    floatingLabelFraction=1;
    floatingLabelShown=true;
  }
 else {
    if (textColorHintStateList != null) {
      setHintTextColor(textColorHintStateList);
    }
 else {
      setHintTextColor(baseColor & 0x00ffffff | 0x44000000);
    }
  }
}

Fixed version (ground truth):
private void initText(){
  if (!TextUtils.isEmpty(getText())) {
    CharSequence text=getText();
    setText(null);
    if (textColorHintStateList != null) {
      setHintTextColor(textColorHintStateList);
    }
 else {
      setHintTextColor(baseColor & 0x00ffffff | 0x44000000);
    }
    setText(text);
    setSelection(text.length());
    floatingLabelFraction=1;
    floatingLabelShown=true;
  }
 else {
    if (textColorHintStateList != null) {
      setHintTextColor(textColorHintStateList);
    }
 else {
      setHintTextColor(baseColor & 0x00ffffff | 0x44000000);
    }
  }
}
Program: 54072
Project: 54072
Buggy source:
public void setBaseColor(int color,ColorStateList textColorStateList,ColorStateList textColorHintStateList){
  if (baseColor != color) {
    baseColor=color;
  }
  if (textColorStateList == null) {
    textColorStateList=new ColorStateList(new int[][]{new int[]{android.R.attr.state_enabled},EMPTY_STATE_SET},new int[]{baseColor & 0x00ffffff | 0xdf000000,baseColor & 0x00ffffff | 0x44000000});
    setTextColor(textColorStateList);
  }
  if (textColorHintStateList == null) {
    setHintTextColor(baseColor & 0x00ffffff | 0x44000000);
  }
 else {
    setHintTextColor(textColorHintStateList);
  }
  postInvalidate();
}

Fixed version (ground truth):
public void setBaseColor(int color){
  if (baseColor != color) {
    baseColor=color;
  }
  resetTextColor();
  resetHintTextColor();
  postInvalidate();
}