nus-yam/ex-repair huggingface dataset:
Program: 395
Project: 395
Buggy source:
@Override public void onRestoreInstanceState(Parcelable state){
  if (!(state instanceof SavedState)) {
    super.onRestoreInstanceState(state);
    return;
  }
  SavedState ss=(SavedState)state;
  super.onRestoreInstanceState(ss.getSuperState());
  mTransportState=(ss.transportState);
  mAppWidgetToShow=ss.appWidgetToShow;
  setInsets(ss.insets);
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + mTransportState);
  post(mSwitchPageRunnable);
}

Fixed version (ground truth):
@Override public void onRestoreInstanceState(Parcelable state){
  if (!(state instanceof SavedState)) {
    super.onRestoreInstanceState(state);
    return;
  }
  SavedState ss=(SavedState)state;
  super.onRestoreInstanceState(ss.getSuperState());
  mTransportState=(ss.transportState);
  mAppWidgetToShow=ss.appWidgetToShow;
  setInsets(ss.insets);
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + mTransportState);
  mSwitchPageRunnable.run();
}
Program: 396
Project: 396
Buggy source:
private void showAppropriateWidgetPage(){
  int state=mTransportState;
  ensureTransportPresentOrRemoved(state);
  int pageToShow=getAppropriateWidgetPage(state);
  mAppWidgetContainer.setCurrentPage(pageToShow);
}

Fixed version (ground truth):
private void showAppropriateWidgetPage(){
  final int state=mTransportState;
  final boolean transportAdded=ensureTransportPresentOrRemoved(state);
  final int pageToShow=getAppropriateWidgetPage(state);
  if (!transportAdded) {
    mAppWidgetContainer.setCurrentPage(pageToShow);
  }
 else   if (state == TRANSPORT_VISIBLE) {
    post(new Runnable(){
      @Override public void run(){
        mAppWidgetContainer.setCurrentPage(pageToShow);
      }
    }
);
  }
}
Program: 398
Project: 398
Buggy source:
/** 
 * Sets the padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingLeft},   {@link #getPaddingTop},  {@link #getPaddingRight} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingLeft
 * @attr ref android.R.styleable#View_paddingRight
 * @attr ref android.R.styleable#View_paddingTop
 * @param left the left padding in pixels
 * @param top the top padding in pixels
 * @param right the right padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPadding(int left,int top,int right,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=UNDEFINED_PADDING;
  mUserPaddingEnd=UNDEFINED_PADDING;
  mUserPaddingLeftInitial=left;
  mUserPaddingRightInitial=right;
  internalSetPadding(left,top,right,bottom);
}

Fixed version (ground truth):
/** 
 * Sets the padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingLeft},   {@link #getPaddingTop},  {@link #getPaddingRight} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingLeft
 * @attr ref android.R.styleable#View_paddingRight
 * @attr ref android.R.styleable#View_paddingTop
 * @param left the left padding in pixels
 * @param top the top padding in pixels
 * @param right the right padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPadding(int left,int top,int right,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=UNDEFINED_PADDING;
  mUserPaddingEnd=UNDEFINED_PADDING;
  mUserPaddingLeftInitial=left;
  mUserPaddingRightInitial=right;
  mUseBackgroundPadding=false;
  internalSetPadding(left,top,right,bottom);
}
Program: 400
Project: 400
Buggy source:
/** 
 * Resolve all RTL related properties.
 * @return true if resolution of RTL properties has been done
 * @hide
 */
public boolean resolveRtlPropertiesIfNeeded(){
  if (!needRtlPropertiesResolution())   return false;
  if (!isLayoutDirectionResolved()) {
    resolveLayoutDirection();
    resolveLayoutParams();
  }
  if (!isTextDirectionResolved()) {
    resolveTextDirection();
  }
  if (!isTextAlignmentResolved()) {
    resolveTextAlignment();
  }
  if (!isPaddingResolved()) {
    resolvePadding();
  }
  if (!isDrawablesResolved()) {
    resolveDrawables();
  }
  onRtlPropertiesChanged(getLayoutDirection());
  return true;
}

Fixed version (ground truth):
/** 
 * Resolve all RTL related properties.
 * @return true if resolution of RTL properties has been done
 * @hide
 */
public boolean resolveRtlPropertiesIfNeeded(){
  if (!needRtlPropertiesResolution())   return false;
  if (!isLayoutDirectionResolved()) {
    resolveLayoutDirection();
    resolveLayoutParams();
  }
  if (!isTextDirectionResolved()) {
    resolveTextDirection();
  }
  if (!isTextAlignmentResolved()) {
    resolveTextAlignment();
  }
  if (!isDrawablesResolved()) {
    resolveDrawables();
  }
  if (!isPaddingResolved()) {
    resolvePadding();
  }
  onRtlPropertiesChanged(getLayoutDirection());
  return true;
}
Program: 401
Project: 401
Buggy source:
/** 
 * Sets the relative padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingStart},   {@link #getPaddingTop},  {@link #getPaddingEnd} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingStart
 * @attr ref android.R.styleable#View_paddingEnd
 * @attr ref android.R.styleable#View_paddingTop
 * @param start the start padding in pixels
 * @param top the top padding in pixels
 * @param end the end padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPaddingRelative(int start,int top,int end,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=start;
  mUserPaddingEnd=end;
switch (getLayoutDirection()) {
case LAYOUT_DIRECTION_RTL:
    mUserPaddingLeftInitial=end;
  mUserPaddingRightInitial=start;
internalSetPadding(end,top,start,bottom);
break;
case LAYOUT_DIRECTION_LTR:
default :
mUserPaddingLeftInitial=start;
mUserPaddingRightInitial=end;
internalSetPadding(start,top,end,bottom);
}
}

Fixed version (ground truth):
/** 
 * Sets the relative padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingStart},   {@link #getPaddingTop},  {@link #getPaddingEnd} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingStart
 * @attr ref android.R.styleable#View_paddingEnd
 * @attr ref android.R.styleable#View_paddingTop
 * @param start the start padding in pixels
 * @param top the top padding in pixels
 * @param end the end padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPaddingRelative(int start,int top,int end,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=start;
  mUserPaddingEnd=end;
  mUseBackgroundPadding=false;
switch (getLayoutDirection()) {
case LAYOUT_DIRECTION_RTL:
    mUserPaddingLeftInitial=end;
  mUserPaddingRightInitial=start;
internalSetPadding(end,top,start,bottom);
break;
case LAYOUT_DIRECTION_LTR:
default :
mUserPaddingLeftInitial=start;
mUserPaddingRightInitial=end;
internalSetPadding(start,top,end,bottom);
}
}
Program: 402
Project: 402
Buggy source:
/** 
 * Resolves padding depending on layout direction, if applicable, and recomputes internal padding values to adjust for scroll bars.
 * @hide
 */
public void resolvePadding(){
  final int resolvedLayoutDirection=getLayoutDirection();
  if (!isRtlCompatibilityMode()) {
switch (resolvedLayoutDirection) {
case LAYOUT_DIRECTION_RTL:
      if (mUserPaddingStart != UNDEFINED_PADDING) {
        mUserPaddingRight=mUserPaddingStart;
      }
 else {
        mUserPaddingRight=mUserPaddingRightInitial;
      }
    if (mUserPaddingEnd != UNDEFINED_PADDING) {
      mUserPaddingLeft=mUserPaddingEnd;
    }
 else {
      mUserPaddingLeft=mUserPaddingLeftInitial;
    }
  break;
case LAYOUT_DIRECTION_LTR:
default :
if (mUserPaddingStart != UNDEFINED_PADDING) {
  mUserPaddingLeft=mUserPaddingStart;
}
 else {
  mUserPaddingLeft=mUserPaddingLeftInitial;
}
if (mUserPaddingEnd != UNDEFINED_PADDING) {
mUserPaddingRight=mUserPaddingEnd;
}
 else {
mUserPaddingRight=mUserPaddingRightInitial;
}
}
mUserPaddingBottom=(mUserPaddingBottom >= 0) ? mUserPaddingBottom : mPaddingBottom;
}
internalSetPadding(mUserPaddingLeft,mPaddingTop,mUserPaddingRight,mUserPaddingBottom);
onRtlPropertiesChanged(resolvedLayoutDirection);
mPrivateFlags2|=PFLAG2_PADDING_RESOLVED;
}

Fixed version (ground truth):
/** 
 * Resolves padding depending on layout direction, if applicable, and recomputes internal padding values to adjust for scroll bars.
 * @hide
 */
public void resolvePadding(){
  final int resolvedLayoutDirection=getLayoutDirection();
  if (!isRtlCompatibilityMode()) {
    if (mBackground != null && mUseBackgroundPadding) {
      Rect padding=sThreadLocal.get();
      if (padding == null) {
        padding=new Rect();
        sThreadLocal.set(padding);
      }
      mBackground.getPadding(padding);
      mUserPaddingLeftInitial=padding.left;
      mUserPaddingRightInitial=padding.right;
    }
switch (resolvedLayoutDirection) {
case LAYOUT_DIRECTION_RTL:
      if (mUserPaddingStart != UNDEFINED_PADDING) {
        mUserPaddingRight=mUserPaddingStart;
      }
 else {
        mUserPaddingRight=mUserPaddingRightInitial;
      }
    if (mUserPaddingEnd != UNDEFINED_PADDING) {
      mUserPaddingLeft=mUserPaddingEnd;
    }
 else {
      mUserPaddingLeft=mUserPaddingLeftInitial;
    }
  break;
case LAYOUT_DIRECTION_LTR:
default :
if (mUserPaddingStart != UNDEFINED_PADDING) {
  mUserPaddingLeft=mUserPaddingStart;
}
 else {
  mUserPaddingLeft=mUserPaddingLeftInitial;
}
if (mUserPaddingEnd != UNDEFINED_PADDING) {
mUserPaddingRight=mUserPaddingEnd;
}
 else {
mUserPaddingRight=mUserPaddingRightInitial;
}
}
mUserPaddingBottom=(mUserPaddingBottom >= 0) ? mUserPaddingBottom : mPaddingBottom;
}
internalSetPadding(mUserPaddingLeft,mPaddingTop,mUserPaddingRight,mUserPaddingBottom);
onRtlPropertiesChanged(resolvedLayoutDirection);
mPrivateFlags2|=PFLAG2_PADDING_RESOLVED;
}
Program: 403
Project: 403
Buggy source:
/** 
 * @hide
 */
@Override public Insets getOpticalInsets(){
  return (mCurrDrawable == null) ? Insets.NONE : mCurrDrawable.getOpticalInsets();
}

Fixed version (ground truth):
/** 
 * @hide
 */
@Override public Insets getOpticalInsets(){
  return mInsets;
}
Program: 405
Project: 405
Buggy source:
@Override public boolean getPadding(Rect padding){
  final Rect r=mDrawableContainerState.getConstantPadding();
  if (r != null) {
    padding.set(r);
    return true;
  }
  if (mCurrDrawable != null) {
    return mCurrDrawable.getPadding(padding);
  }
 else {
    return super.getPadding(padding);
  }
}

Fixed version (ground truth):
@Override public boolean getPadding(Rect padding){
  final Rect r=mDrawableContainerState.getConstantPadding();
  boolean result=true;
  if (r != null) {
    padding.set(r);
  }
 else {
    if (mCurrDrawable != null) {
      result=mCurrDrawable.getPadding(padding);
    }
 else {
      result=super.getPadding(padding);
    }
  }
  if (needsMirroring()) {
    final int left=padding.left;
    final int right=padding.right;
    padding.left=right;
    padding.right=left;
  }
  return result;
}
Program: 406
Project: 406
Buggy source:
/** 
 * Sets the padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingLeft},   {@link #getPaddingTop},  {@link #getPaddingRight} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingLeft
 * @attr ref android.R.styleable#View_paddingRight
 * @attr ref android.R.styleable#View_paddingTop
 * @param left the left padding in pixels
 * @param top the top padding in pixels
 * @param right the right padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPadding(int left,int top,int right,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=UNDEFINED_PADDING;
  mUserPaddingEnd=UNDEFINED_PADDING;
  mUserPaddingLeftInitial=left;
  mUserPaddingRightInitial=right;
  internalSetPadding(left,top,right,bottom);
}

Fixed version (ground truth):
/** 
 * Sets the padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingLeft},   {@link #getPaddingTop},  {@link #getPaddingRight} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingLeft
 * @attr ref android.R.styleable#View_paddingRight
 * @attr ref android.R.styleable#View_paddingTop
 * @param left the left padding in pixels
 * @param top the top padding in pixels
 * @param right the right padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPadding(int left,int top,int right,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=UNDEFINED_PADDING;
  mUserPaddingEnd=UNDEFINED_PADDING;
  mUserPaddingLeftInitial=left;
  mUserPaddingRightInitial=right;
  mUseBackgroundPadding=false;
  internalSetPadding(left,top,right,bottom);
}
Program: 408
Project: 408
Buggy source:
/** 
 * Resolve all RTL related properties.
 * @return true if resolution of RTL properties has been done
 * @hide
 */
public boolean resolveRtlPropertiesIfNeeded(){
  if (!needRtlPropertiesResolution())   return false;
  if (!isLayoutDirectionResolved()) {
    resolveLayoutDirection();
    resolveLayoutParams();
  }
  if (!isTextDirectionResolved()) {
    resolveTextDirection();
  }
  if (!isTextAlignmentResolved()) {
    resolveTextAlignment();
  }
  if (!isPaddingResolved()) {
    resolvePadding();
  }
  if (!isDrawablesResolved()) {
    resolveDrawables();
  }
  onRtlPropertiesChanged(getLayoutDirection());
  return true;
}

Fixed version (ground truth):
/** 
 * Resolve all RTL related properties.
 * @return true if resolution of RTL properties has been done
 * @hide
 */
public boolean resolveRtlPropertiesIfNeeded(){
  if (!needRtlPropertiesResolution())   return false;
  if (!isLayoutDirectionResolved()) {
    resolveLayoutDirection();
    resolveLayoutParams();
  }
  if (!isTextDirectionResolved()) {
    resolveTextDirection();
  }
  if (!isTextAlignmentResolved()) {
    resolveTextAlignment();
  }
  if (!isDrawablesResolved()) {
    resolveDrawables();
  }
  if (!isPaddingResolved()) {
    resolvePadding();
  }
  onRtlPropertiesChanged(getLayoutDirection());
  return true;
}
Program: 409
Project: 409
Buggy source:
/** 
 * Sets the relative padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingStart},   {@link #getPaddingTop},  {@link #getPaddingEnd} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingStart
 * @attr ref android.R.styleable#View_paddingEnd
 * @attr ref android.R.styleable#View_paddingTop
 * @param start the start padding in pixels
 * @param top the top padding in pixels
 * @param end the end padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPaddingRelative(int start,int top,int end,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=start;
  mUserPaddingEnd=end;
switch (getLayoutDirection()) {
case LAYOUT_DIRECTION_RTL:
    mUserPaddingLeftInitial=end;
  mUserPaddingRightInitial=start;
internalSetPadding(end,top,start,bottom);
break;
case LAYOUT_DIRECTION_LTR:
default :
mUserPaddingLeftInitial=start;
mUserPaddingRightInitial=end;
internalSetPadding(start,top,end,bottom);
}
}

Fixed version (ground truth):
/** 
 * Sets the relative padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingStart},   {@link #getPaddingTop},  {@link #getPaddingEnd} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingStart
 * @attr ref android.R.styleable#View_paddingEnd
 * @attr ref android.R.styleable#View_paddingTop
 * @param start the start padding in pixels
 * @param top the top padding in pixels
 * @param end the end padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPaddingRelative(int start,int top,int end,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=start;
  mUserPaddingEnd=end;
  mUseBackgroundPadding=false;
switch (getLayoutDirection()) {
case LAYOUT_DIRECTION_RTL:
    mUserPaddingLeftInitial=end;
  mUserPaddingRightInitial=start;
internalSetPadding(end,top,start,bottom);
break;
case LAYOUT_DIRECTION_LTR:
default :
mUserPaddingLeftInitial=start;
mUserPaddingRightInitial=end;
internalSetPadding(start,top,end,bottom);
}
}
Program: 410
Project: 410
Buggy source:
/** 
 * Resolves padding depending on layout direction, if applicable, and recomputes internal padding values to adjust for scroll bars.
 * @hide
 */
public void resolvePadding(){
  final int resolvedLayoutDirection=getLayoutDirection();
  if (!isRtlCompatibilityMode()) {
switch (resolvedLayoutDirection) {
case LAYOUT_DIRECTION_RTL:
      if (mUserPaddingStart != UNDEFINED_PADDING) {
        mUserPaddingRight=mUserPaddingStart;
      }
 else {
        mUserPaddingRight=mUserPaddingRightInitial;
      }
    if (mUserPaddingEnd != UNDEFINED_PADDING) {
      mUserPaddingLeft=mUserPaddingEnd;
    }
 else {
      mUserPaddingLeft=mUserPaddingLeftInitial;
    }
  break;
case LAYOUT_DIRECTION_LTR:
default :
if (mUserPaddingStart != UNDEFINED_PADDING) {
  mUserPaddingLeft=mUserPaddingStart;
}
 else {
  mUserPaddingLeft=mUserPaddingLeftInitial;
}
if (mUserPaddingEnd != UNDEFINED_PADDING) {
mUserPaddingRight=mUserPaddingEnd;
}
 else {
mUserPaddingRight=mUserPaddingRightInitial;
}
}
mUserPaddingBottom=(mUserPaddingBottom >= 0) ? mUserPaddingBottom : mPaddingBottom;
}
internalSetPadding(mUserPaddingLeft,mPaddingTop,mUserPaddingRight,mUserPaddingBottom);
onRtlPropertiesChanged(resolvedLayoutDirection);
mPrivateFlags2|=PFLAG2_PADDING_RESOLVED;
}

Fixed version (ground truth):
/** 
 * Resolves padding depending on layout direction, if applicable, and recomputes internal padding values to adjust for scroll bars.
 * @hide
 */
public void resolvePadding(){
  final int resolvedLayoutDirection=getLayoutDirection();
  if (!isRtlCompatibilityMode()) {
    if (mBackground != null && mUseBackgroundPadding) {
      Rect padding=sThreadLocal.get();
      if (padding == null) {
        padding=new Rect();
        sThreadLocal.set(padding);
      }
      mBackground.getPadding(padding);
      mUserPaddingLeftInitial=padding.left;
      mUserPaddingRightInitial=padding.right;
    }
switch (resolvedLayoutDirection) {
case LAYOUT_DIRECTION_RTL:
      if (mUserPaddingStart != UNDEFINED_PADDING) {
        mUserPaddingRight=mUserPaddingStart;
      }
 else {
        mUserPaddingRight=mUserPaddingRightInitial;
      }
    if (mUserPaddingEnd != UNDEFINED_PADDING) {
      mUserPaddingLeft=mUserPaddingEnd;
    }
 else {
      mUserPaddingLeft=mUserPaddingLeftInitial;
    }
  break;
case LAYOUT_DIRECTION_LTR:
default :
if (mUserPaddingStart != UNDEFINED_PADDING) {
  mUserPaddingLeft=mUserPaddingStart;
}
 else {
  mUserPaddingLeft=mUserPaddingLeftInitial;
}
if (mUserPaddingEnd != UNDEFINED_PADDING) {
mUserPaddingRight=mUserPaddingEnd;
}
 else {
mUserPaddingRight=mUserPaddingRightInitial;
}
}
mUserPaddingBottom=(mUserPaddingBottom >= 0) ? mUserPaddingBottom : mPaddingBottom;
}
internalSetPadding(mUserPaddingLeft,mPaddingTop,mUserPaddingRight,mUserPaddingBottom);
onRtlPropertiesChanged(resolvedLayoutDirection);
mPrivateFlags2|=PFLAG2_PADDING_RESOLVED;
}
Program: 411
Project: 411
Buggy source:
/** 
 * @hide
 */
@Override public Insets getOpticalInsets(){
  return (mCurrDrawable == null) ? Insets.NONE : mCurrDrawable.getOpticalInsets();
}

Fixed version (ground truth):
/** 
 * @hide
 */
@Override public Insets getOpticalInsets(){
  return mInsets;
}
Program: 413
Project: 413
Buggy source:
@Override public boolean getPadding(Rect padding){
  final Rect r=mDrawableContainerState.getConstantPadding();
  if (r != null) {
    padding.set(r);
    return true;
  }
  if (mCurrDrawable != null) {
    return mCurrDrawable.getPadding(padding);
  }
 else {
    return super.getPadding(padding);
  }
}

Fixed version (ground truth):
@Override public boolean getPadding(Rect padding){
  final Rect r=mDrawableContainerState.getConstantPadding();
  boolean result=true;
  if (r != null) {
    padding.set(r);
  }
 else {
    if (mCurrDrawable != null) {
      result=mCurrDrawable.getPadding(padding);
    }
 else {
      result=super.getPadding(padding);
    }
  }
  if (needsMirroring()) {
    final int left=padding.left;
    final int right=padding.right;
    padding.left=right;
    padding.right=left;
  }
  return result;
}
Program: 414
Project: 414
Buggy source:
/** 
 * Sets the padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingLeft},   {@link #getPaddingTop},  {@link #getPaddingRight} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingLeft
 * @attr ref android.R.styleable#View_paddingRight
 * @attr ref android.R.styleable#View_paddingTop
 * @param left the left padding in pixels
 * @param top the top padding in pixels
 * @param right the right padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPadding(int left,int top,int right,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=UNDEFINED_PADDING;
  mUserPaddingEnd=UNDEFINED_PADDING;
  mUserPaddingLeftInitial=left;
  mUserPaddingRightInitial=right;
  internalSetPadding(left,top,right,bottom);
}

Fixed version (ground truth):
/** 
 * Sets the padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingLeft},   {@link #getPaddingTop},  {@link #getPaddingRight} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingLeft
 * @attr ref android.R.styleable#View_paddingRight
 * @attr ref android.R.styleable#View_paddingTop
 * @param left the left padding in pixels
 * @param top the top padding in pixels
 * @param right the right padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPadding(int left,int top,int right,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=UNDEFINED_PADDING;
  mUserPaddingEnd=UNDEFINED_PADDING;
  mUserPaddingLeftInitial=left;
  mUserPaddingRightInitial=right;
  mUseBackgroundPadding=false;
  internalSetPadding(left,top,right,bottom);
}
Program: 416
Project: 416
Buggy source:
/** 
 * Resolve all RTL related properties.
 * @return true if resolution of RTL properties has been done
 * @hide
 */
public boolean resolveRtlPropertiesIfNeeded(){
  if (!needRtlPropertiesResolution())   return false;
  if (!isLayoutDirectionResolved()) {
    resolveLayoutDirection();
    resolveLayoutParams();
  }
  if (!isTextDirectionResolved()) {
    resolveTextDirection();
  }
  if (!isTextAlignmentResolved()) {
    resolveTextAlignment();
  }
  if (!isPaddingResolved()) {
    resolvePadding();
  }
  if (!isDrawablesResolved()) {
    resolveDrawables();
  }
  onRtlPropertiesChanged(getLayoutDirection());
  return true;
}

Fixed version (ground truth):
/** 
 * Resolve all RTL related properties.
 * @return true if resolution of RTL properties has been done
 * @hide
 */
public boolean resolveRtlPropertiesIfNeeded(){
  if (!needRtlPropertiesResolution())   return false;
  if (!isLayoutDirectionResolved()) {
    resolveLayoutDirection();
    resolveLayoutParams();
  }
  if (!isTextDirectionResolved()) {
    resolveTextDirection();
  }
  if (!isTextAlignmentResolved()) {
    resolveTextAlignment();
  }
  if (!isDrawablesResolved()) {
    resolveDrawables();
  }
  if (!isPaddingResolved()) {
    resolvePadding();
  }
  onRtlPropertiesChanged(getLayoutDirection());
  return true;
}
Program: 417
Project: 417
Buggy source:
/** 
 * Sets the relative padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingStart},   {@link #getPaddingTop},  {@link #getPaddingEnd} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingStart
 * @attr ref android.R.styleable#View_paddingEnd
 * @attr ref android.R.styleable#View_paddingTop
 * @param start the start padding in pixels
 * @param top the top padding in pixels
 * @param end the end padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPaddingRelative(int start,int top,int end,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=start;
  mUserPaddingEnd=end;
switch (getLayoutDirection()) {
case LAYOUT_DIRECTION_RTL:
    mUserPaddingLeftInitial=end;
  mUserPaddingRightInitial=start;
internalSetPadding(end,top,start,bottom);
break;
case LAYOUT_DIRECTION_LTR:
default :
mUserPaddingLeftInitial=start;
mUserPaddingRightInitial=end;
internalSetPadding(start,top,end,bottom);
}
}

Fixed version (ground truth):
/** 
 * Sets the relative padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingStart},   {@link #getPaddingTop},  {@link #getPaddingEnd} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingStart
 * @attr ref android.R.styleable#View_paddingEnd
 * @attr ref android.R.styleable#View_paddingTop
 * @param start the start padding in pixels
 * @param top the top padding in pixels
 * @param end the end padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPaddingRelative(int start,int top,int end,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=start;
  mUserPaddingEnd=end;
  mUseBackgroundPadding=false;
switch (getLayoutDirection()) {
case LAYOUT_DIRECTION_RTL:
    mUserPaddingLeftInitial=end;
  mUserPaddingRightInitial=start;
internalSetPadding(end,top,start,bottom);
break;
case LAYOUT_DIRECTION_LTR:
default :
mUserPaddingLeftInitial=start;
mUserPaddingRightInitial=end;
internalSetPadding(start,top,end,bottom);
}
}
Program: 418
Project: 418
Buggy source:
/** 
 * Resolves padding depending on layout direction, if applicable, and recomputes internal padding values to adjust for scroll bars.
 * @hide
 */
public void resolvePadding(){
  final int resolvedLayoutDirection=getLayoutDirection();
  if (!isRtlCompatibilityMode()) {
switch (resolvedLayoutDirection) {
case LAYOUT_DIRECTION_RTL:
      if (mUserPaddingStart != UNDEFINED_PADDING) {
        mUserPaddingRight=mUserPaddingStart;
      }
 else {
        mUserPaddingRight=mUserPaddingRightInitial;
      }
    if (mUserPaddingEnd != UNDEFINED_PADDING) {
      mUserPaddingLeft=mUserPaddingEnd;
    }
 else {
      mUserPaddingLeft=mUserPaddingLeftInitial;
    }
  break;
case LAYOUT_DIRECTION_LTR:
default :
if (mUserPaddingStart != UNDEFINED_PADDING) {
  mUserPaddingLeft=mUserPaddingStart;
}
 else {
  mUserPaddingLeft=mUserPaddingLeftInitial;
}
if (mUserPaddingEnd != UNDEFINED_PADDING) {
mUserPaddingRight=mUserPaddingEnd;
}
 else {
mUserPaddingRight=mUserPaddingRightInitial;
}
}
mUserPaddingBottom=(mUserPaddingBottom >= 0) ? mUserPaddingBottom : mPaddingBottom;
}
internalSetPadding(mUserPaddingLeft,mPaddingTop,mUserPaddingRight,mUserPaddingBottom);
onRtlPropertiesChanged(resolvedLayoutDirection);
mPrivateFlags2|=PFLAG2_PADDING_RESOLVED;
}

Fixed version (ground truth):
/** 
 * Resolves padding depending on layout direction, if applicable, and recomputes internal padding values to adjust for scroll bars.
 * @hide
 */
public void resolvePadding(){
  final int resolvedLayoutDirection=getLayoutDirection();
  if (!isRtlCompatibilityMode()) {
    if (mBackground != null && mUseBackgroundPadding) {
      Rect padding=sThreadLocal.get();
      if (padding == null) {
        padding=new Rect();
        sThreadLocal.set(padding);
      }
      mBackground.getPadding(padding);
      mUserPaddingLeftInitial=padding.left;
      mUserPaddingRightInitial=padding.right;
    }
switch (resolvedLayoutDirection) {
case LAYOUT_DIRECTION_RTL:
      if (mUserPaddingStart != UNDEFINED_PADDING) {
        mUserPaddingRight=mUserPaddingStart;
      }
 else {
        mUserPaddingRight=mUserPaddingRightInitial;
      }
    if (mUserPaddingEnd != UNDEFINED_PADDING) {
      mUserPaddingLeft=mUserPaddingEnd;
    }
 else {
      mUserPaddingLeft=mUserPaddingLeftInitial;
    }
  break;
case LAYOUT_DIRECTION_LTR:
default :
if (mUserPaddingStart != UNDEFINED_PADDING) {
  mUserPaddingLeft=mUserPaddingStart;
}
 else {
  mUserPaddingLeft=mUserPaddingLeftInitial;
}
if (mUserPaddingEnd != UNDEFINED_PADDING) {
mUserPaddingRight=mUserPaddingEnd;
}
 else {
mUserPaddingRight=mUserPaddingRightInitial;
}
}
mUserPaddingBottom=(mUserPaddingBottom >= 0) ? mUserPaddingBottom : mPaddingBottom;
}
internalSetPadding(mUserPaddingLeft,mPaddingTop,mUserPaddingRight,mUserPaddingBottom);
onRtlPropertiesChanged(resolvedLayoutDirection);
mPrivateFlags2|=PFLAG2_PADDING_RESOLVED;
}
Program: 419
Project: 419
Buggy source:
/** 
 * @hide
 */
@Override public Insets getOpticalInsets(){
  return (mCurrDrawable == null) ? Insets.NONE : mCurrDrawable.getOpticalInsets();
}

Fixed version (ground truth):
/** 
 * @hide
 */
@Override public Insets getOpticalInsets(){
  return mInsets;
}
Program: 421
Project: 421
Buggy source:
@Override public boolean getPadding(Rect padding){
  final Rect r=mDrawableContainerState.getConstantPadding();
  if (r != null) {
    padding.set(r);
    return true;
  }
  if (mCurrDrawable != null) {
    return mCurrDrawable.getPadding(padding);
  }
 else {
    return super.getPadding(padding);
  }
}

Fixed version (ground truth):
@Override public boolean getPadding(Rect padding){
  final Rect r=mDrawableContainerState.getConstantPadding();
  boolean result=true;
  if (r != null) {
    padding.set(r);
  }
 else {
    if (mCurrDrawable != null) {
      result=mCurrDrawable.getPadding(padding);
    }
 else {
      result=super.getPadding(padding);
    }
  }
  if (needsMirroring()) {
    final int left=padding.left;
    final int right=padding.right;
    padding.left=right;
    padding.right=left;
  }
  return result;
}
Program: 422
Project: 422
Buggy source:
private final boolean unscheduleServiceRestartLocked(ServiceRecord r){
  if (r.restartDelay == 0) {
    return false;
  }
  r.resetRestartCounter();
  mRestartingServices.remove(r);
  mAm.mHandler.removeCallbacks(r.restarter);
  return true;
}

Fixed version (ground truth):
private final boolean unscheduleServiceRestartLocked(ServiceRecord r,int callingUid){
  if (r.restartDelay == 0) {
    return false;
  }
  boolean removed=mRestartingServices.remove(r);
  if (removed || callingUid != r.appInfo.uid) {
    r.resetRestartCounter();
  }
  mAm.mHandler.removeCallbacks(r.restarter);
  return true;
}
Program: 427
Project: 427
Buggy source:
private final boolean unscheduleServiceRestartLocked(ServiceRecord r){
  if (r.restartDelay == 0) {
    return false;
  }
  r.resetRestartCounter();
  mRestartingServices.remove(r);
  mAm.mHandler.removeCallbacks(r.restarter);
  return true;
}

Fixed version (ground truth):
private final boolean unscheduleServiceRestartLocked(ServiceRecord r,int callingUid){
  if (r.restartDelay == 0) {
    return false;
  }
  boolean removed=mRestartingServices.remove(r);
  if (removed || callingUid != r.appInfo.uid) {
    r.resetRestartCounter();
  }
  mAm.mHandler.removeCallbacks(r.restarter);
  return true;
}
Program: 434
Project: 434
Buggy source:
private final boolean unscheduleServiceRestartLocked(ServiceRecord r){
  if (r.restartDelay == 0) {
    return false;
  }
  r.resetRestartCounter();
  mRestartingServices.remove(r);
  mAm.mHandler.removeCallbacks(r.restarter);
  return true;
}

Fixed version (ground truth):
private final boolean unscheduleServiceRestartLocked(ServiceRecord r,int callingUid){
  if (r.restartDelay == 0) {
    return false;
  }
  boolean removed=mRestartingServices.remove(r);
  if (removed || callingUid != r.appInfo.uid) {
    r.resetRestartCounter();
  }
  mAm.mHandler.removeCallbacks(r.restarter);
  return true;
}
Program: 441
Project: 441
Buggy source:
/** 
 * Sets the padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingLeft},   {@link #getPaddingTop},  {@link #getPaddingRight} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingLeft
 * @attr ref android.R.styleable#View_paddingRight
 * @attr ref android.R.styleable#View_paddingTop
 * @param left the left padding in pixels
 * @param top the top padding in pixels
 * @param right the right padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPadding(int left,int top,int right,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=UNDEFINED_PADDING;
  mUserPaddingEnd=UNDEFINED_PADDING;
  mUserPaddingLeftInitial=left;
  mUserPaddingRightInitial=right;
  internalSetPadding(left,top,right,bottom);
}

Fixed version (ground truth):
/** 
 * Sets the padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingLeft},   {@link #getPaddingTop},  {@link #getPaddingRight} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingLeft
 * @attr ref android.R.styleable#View_paddingRight
 * @attr ref android.R.styleable#View_paddingTop
 * @param left the left padding in pixels
 * @param top the top padding in pixels
 * @param right the right padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPadding(int left,int top,int right,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=UNDEFINED_PADDING;
  mUserPaddingEnd=UNDEFINED_PADDING;
  mUserPaddingLeftInitial=left;
  mUserPaddingRightInitial=right;
  mUseBackgroundPadding=false;
  internalSetPadding(left,top,right,bottom);
}
Program: 443
Project: 443
Buggy source:
/** 
 * Resolve all RTL related properties.
 * @return true if resolution of RTL properties has been done
 * @hide
 */
public boolean resolveRtlPropertiesIfNeeded(){
  if (!needRtlPropertiesResolution())   return false;
  if (!isLayoutDirectionResolved()) {
    resolveLayoutDirection();
    resolveLayoutParams();
  }
  if (!isTextDirectionResolved()) {
    resolveTextDirection();
  }
  if (!isTextAlignmentResolved()) {
    resolveTextAlignment();
  }
  if (!isPaddingResolved()) {
    resolvePadding();
  }
  if (!isDrawablesResolved()) {
    resolveDrawables();
  }
  onRtlPropertiesChanged(getLayoutDirection());
  return true;
}

Fixed version (ground truth):
/** 
 * Resolve all RTL related properties.
 * @return true if resolution of RTL properties has been done
 * @hide
 */
public boolean resolveRtlPropertiesIfNeeded(){
  if (!needRtlPropertiesResolution())   return false;
  if (!isLayoutDirectionResolved()) {
    resolveLayoutDirection();
    resolveLayoutParams();
  }
  if (!isTextDirectionResolved()) {
    resolveTextDirection();
  }
  if (!isTextAlignmentResolved()) {
    resolveTextAlignment();
  }
  if (!isDrawablesResolved()) {
    resolveDrawables();
  }
  if (!isPaddingResolved()) {
    resolvePadding();
  }
  onRtlPropertiesChanged(getLayoutDirection());
  return true;
}
Program: 444
Project: 444
Buggy source:
/** 
 * Sets the relative padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingStart},   {@link #getPaddingTop},  {@link #getPaddingEnd} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingStart
 * @attr ref android.R.styleable#View_paddingEnd
 * @attr ref android.R.styleable#View_paddingTop
 * @param start the start padding in pixels
 * @param top the top padding in pixels
 * @param end the end padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPaddingRelative(int start,int top,int end,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=start;
  mUserPaddingEnd=end;
switch (getLayoutDirection()) {
case LAYOUT_DIRECTION_RTL:
    mUserPaddingLeftInitial=end;
  mUserPaddingRightInitial=start;
internalSetPadding(end,top,start,bottom);
break;
case LAYOUT_DIRECTION_LTR:
default :
mUserPaddingLeftInitial=start;
mUserPaddingRightInitial=end;
internalSetPadding(start,top,end,bottom);
}
}

Fixed version (ground truth):
/** 
 * Sets the relative padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingStart},   {@link #getPaddingTop},  {@link #getPaddingEnd} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingStart
 * @attr ref android.R.styleable#View_paddingEnd
 * @attr ref android.R.styleable#View_paddingTop
 * @param start the start padding in pixels
 * @param top the top padding in pixels
 * @param end the end padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPaddingRelative(int start,int top,int end,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=start;
  mUserPaddingEnd=end;
  mUseBackgroundPadding=false;
switch (getLayoutDirection()) {
case LAYOUT_DIRECTION_RTL:
    mUserPaddingLeftInitial=end;
  mUserPaddingRightInitial=start;
internalSetPadding(end,top,start,bottom);
break;
case LAYOUT_DIRECTION_LTR:
default :
mUserPaddingLeftInitial=start;
mUserPaddingRightInitial=end;
internalSetPadding(start,top,end,bottom);
}
}
Program: 445
Project: 445
Buggy source:
/** 
 * Resolves padding depending on layout direction, if applicable, and recomputes internal padding values to adjust for scroll bars.
 * @hide
 */
public void resolvePadding(){
  final int resolvedLayoutDirection=getLayoutDirection();
  if (!isRtlCompatibilityMode()) {
switch (resolvedLayoutDirection) {
case LAYOUT_DIRECTION_RTL:
      if (mUserPaddingStart != UNDEFINED_PADDING) {
        mUserPaddingRight=mUserPaddingStart;
      }
 else {
        mUserPaddingRight=mUserPaddingRightInitial;
      }
    if (mUserPaddingEnd != UNDEFINED_PADDING) {
      mUserPaddingLeft=mUserPaddingEnd;
    }
 else {
      mUserPaddingLeft=mUserPaddingLeftInitial;
    }
  break;
case LAYOUT_DIRECTION_LTR:
default :
if (mUserPaddingStart != UNDEFINED_PADDING) {
  mUserPaddingLeft=mUserPaddingStart;
}
 else {
  mUserPaddingLeft=mUserPaddingLeftInitial;
}
if (mUserPaddingEnd != UNDEFINED_PADDING) {
mUserPaddingRight=mUserPaddingEnd;
}
 else {
mUserPaddingRight=mUserPaddingRightInitial;
}
}
mUserPaddingBottom=(mUserPaddingBottom >= 0) ? mUserPaddingBottom : mPaddingBottom;
}
internalSetPadding(mUserPaddingLeft,mPaddingTop,mUserPaddingRight,mUserPaddingBottom);
onRtlPropertiesChanged(resolvedLayoutDirection);
mPrivateFlags2|=PFLAG2_PADDING_RESOLVED;
}

Fixed version (ground truth):
/** 
 * Resolves padding depending on layout direction, if applicable, and recomputes internal padding values to adjust for scroll bars.
 * @hide
 */
public void resolvePadding(){
  final int resolvedLayoutDirection=getLayoutDirection();
  if (!isRtlCompatibilityMode()) {
    if (mBackground != null && mUseBackgroundPadding) {
      Rect padding=sThreadLocal.get();
      if (padding == null) {
        padding=new Rect();
        sThreadLocal.set(padding);
      }
      mBackground.getPadding(padding);
      mUserPaddingLeftInitial=padding.left;
      mUserPaddingRightInitial=padding.right;
    }
switch (resolvedLayoutDirection) {
case LAYOUT_DIRECTION_RTL:
      if (mUserPaddingStart != UNDEFINED_PADDING) {
        mUserPaddingRight=mUserPaddingStart;
      }
 else {
        mUserPaddingRight=mUserPaddingRightInitial;
      }
    if (mUserPaddingEnd != UNDEFINED_PADDING) {
      mUserPaddingLeft=mUserPaddingEnd;
    }
 else {
      mUserPaddingLeft=mUserPaddingLeftInitial;
    }
  break;
case LAYOUT_DIRECTION_LTR:
default :
if (mUserPaddingStart != UNDEFINED_PADDING) {
  mUserPaddingLeft=mUserPaddingStart;
}
 else {
  mUserPaddingLeft=mUserPaddingLeftInitial;
}
if (mUserPaddingEnd != UNDEFINED_PADDING) {
mUserPaddingRight=mUserPaddingEnd;
}
 else {
mUserPaddingRight=mUserPaddingRightInitial;
}
}
mUserPaddingBottom=(mUserPaddingBottom >= 0) ? mUserPaddingBottom : mPaddingBottom;
}
internalSetPadding(mUserPaddingLeft,mPaddingTop,mUserPaddingRight,mUserPaddingBottom);
onRtlPropertiesChanged(resolvedLayoutDirection);
mPrivateFlags2|=PFLAG2_PADDING_RESOLVED;
}
Program: 446
Project: 446
Buggy source:
/** 
 * @hide
 */
@Override public Insets getOpticalInsets(){
  return (mCurrDrawable == null) ? Insets.NONE : mCurrDrawable.getOpticalInsets();
}

Fixed version (ground truth):
/** 
 * @hide
 */
@Override public Insets getOpticalInsets(){
  return mInsets;
}
Program: 448
Project: 448
Buggy source:
@Override public boolean getPadding(Rect padding){
  final Rect r=mDrawableContainerState.getConstantPadding();
  if (r != null) {
    padding.set(r);
    return true;
  }
  if (mCurrDrawable != null) {
    return mCurrDrawable.getPadding(padding);
  }
 else {
    return super.getPadding(padding);
  }
}

Fixed version (ground truth):
@Override public boolean getPadding(Rect padding){
  final Rect r=mDrawableContainerState.getConstantPadding();
  boolean result=true;
  if (r != null) {
    padding.set(r);
  }
 else {
    if (mCurrDrawable != null) {
      result=mCurrDrawable.getPadding(padding);
    }
 else {
      result=super.getPadding(padding);
    }
  }
  if (needsMirroring()) {
    final int left=padding.left;
    final int right=padding.right;
    padding.left=right;
    padding.right=left;
  }
  return result;
}
Program: 449
Project: 449
Buggy source:
/** 
 * Sets the padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingLeft},   {@link #getPaddingTop},  {@link #getPaddingRight} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingLeft
 * @attr ref android.R.styleable#View_paddingRight
 * @attr ref android.R.styleable#View_paddingTop
 * @param left the left padding in pixels
 * @param top the top padding in pixels
 * @param right the right padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPadding(int left,int top,int right,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=UNDEFINED_PADDING;
  mUserPaddingEnd=UNDEFINED_PADDING;
  mUserPaddingLeftInitial=left;
  mUserPaddingRightInitial=right;
  internalSetPadding(left,top,right,bottom);
}

Fixed version (ground truth):
/** 
 * Sets the padding. The view may add on the space required to display the scrollbars, depending on the style and visibility of the scrollbars. So the values returned from   {@link #getPaddingLeft},   {@link #getPaddingTop},  {@link #getPaddingRight} and {@link #getPaddingBottom} may be differentfrom the values set in this call.
 * @attr ref android.R.styleable#View_padding
 * @attr ref android.R.styleable#View_paddingBottom
 * @attr ref android.R.styleable#View_paddingLeft
 * @attr ref android.R.styleable#View_paddingRight
 * @attr ref android.R.styleable#View_paddingTop
 * @param left the left padding in pixels
 * @param top the top padding in pixels
 * @param right the right padding in pixels
 * @param bottom the bottom padding in pixels
 */
public void setPadding(int left,int top,int right,int bottom){
  resetResolvedPadding();
  mUserPaddingStart=UNDEFINED_PADDING;
  mUserPaddingEnd=UNDEFINED_PADDING;
  mUserPaddingLeftInitial=left;
  mUserPaddingRightInitial=right;
  mUseBackgroundPadding=false;
  internalSetPadding(left,top,right,bottom);
}
Program: 451
Project: 451
Buggy source:
/** 
 * Resolve all RTL related properties.
 * @return true if resolution of RTL properties has been done
 * @hide
 */
public boolean resolveRtlPropertiesIfNeeded(){
  if (!needRtlPropertiesResolution())   return false;
  if (!isLayoutDirectionResolved()) {
    resolveLayoutDirection();
    resolveLayoutParams();
  }
  if (!isTextDirectionResolved()) {
    resolveTextDirection();
  }
  if (!isTextAlignmentResolved()) {
    resolveTextAlignment();
  }
  if (!isPaddingResolved()) {
    resolvePadding();
  }
  if (!isDrawablesResolved()) {
    resolveDrawables();
  }
  onRtlPropertiesChanged(getLayoutDirection());
  return true;
}

Fixed version (ground truth):
/** 
 * Resolve all RTL related properties.
 * @return true if resolution of RTL properties has been done
 * @hide
 */
public boolean resolveRtlPropertiesIfNeeded(){
  if (!needRtlPropertiesResolution())   return false;
  if (!isLayoutDirectionResolved()) {
    resolveLayoutDirection();
    resolveLayoutParams();
  }
  if (!isTextDirectionResolved()) {
    resolveTextDirection();
  }
  if (!isTextAlignmentResolved()) {
    resolveTextAlignment();
  }
  if (!isDrawablesResolved()) {
    resolveDrawables();
  }
  if (!isPaddingResolved()) {
    resolvePadding();
  }
  onRtlPropertiesChanged(getLayoutDirection());
  return true;
}