nus-yam/ex-repair huggingface dataset:
Program: 919
Project: 919
Buggy source:
/** 
 * Creates a view into which preview text can be placed.
 */
private TextView createPreviewTextView(Context context,TypedArray ta){
  final LayoutParams params=new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
  final Resources res=context.getResources();
  final int minSize=res.getDimensionPixelSize(R.dimen.fastscroll_overlay_size);
  final ColorStateList textColor=ta.getColorStateList(TEXT_COLOR);
  final float textSize=res.getDimension(R.dimen.fastscroll_overlay_text_size);
  final TextView textView=new TextView(context);
  textView.setLayoutParams(params);
  textView.setTextColor(textColor);
  textView.setTextSize(textSize);
  textView.setSingleLine(true);
  textView.setEllipsize(TruncateAt.MIDDLE);
  textView.setGravity(Gravity.CENTER);
  textView.setAlpha(0f);
  textView.setLayoutDirection(mList.getLayoutDirection());
  return textView;
}

Fixed version (ground truth):
/** 
 * Creates a view into which preview text can be placed.
 */
private TextView createPreviewTextView(Context context,TypedArray ta){
  final LayoutParams params=new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
  final Resources res=context.getResources();
  final int minSize=res.getDimensionPixelSize(R.dimen.fastscroll_overlay_size);
  final ColorStateList textColor=ta.getColorStateList(TEXT_COLOR);
  final float textSize=res.getDimensionPixelSize(R.dimen.fastscroll_overlay_text_size);
  final TextView textView=new TextView(context);
  textView.setLayoutParams(params);
  textView.setTextColor(textColor);
  textView.setTextSize(TypedValue.COMPLEX_UNIT_PX,textSize);
  textView.setSingleLine(true);
  textView.setEllipsize(TruncateAt.MIDDLE);
  textView.setGravity(Gravity.CENTER);
  textView.setAlpha(0f);
  textView.setLayoutDirection(mList.getLayoutDirection());
  return textView;
}
Program: 920
Project: 920
Buggy source:
public void setTextSize(float size){
  final DisplayMetrics metrics=getContext().getResources().getDisplayMetrics();
  final float pixels=TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP,size,metrics);
  if (mTextPaint.getTextSize() != size) {
    mTextPaint.setTextSize(size);
    mInnerPaddingX=(int)(size * INNER_PADDING_RATIO + 0.5f);
    mHasMeasurements=false;
    forceLayout();
  }
}

Fixed version (ground truth):
/** 
 * Sets the text size in pixels.
 * @param size the text size in pixels
 */
public void setTextSize(float size){
  if (mTextPaint.getTextSize() != size) {
    mTextPaint.setTextSize(size);
    mInnerPaddingX=(int)(size * INNER_PADDING_RATIO + 0.5f);
    mHasMeasurements=false;
    forceLayout();
  }
}
Program: 921
Project: 921
Buggy source:
public SubtitleView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs);
  final Theme theme=context.getTheme();
  final TypedArray a=theme.obtainStyledAttributes(attrs,android.R.styleable.TextView,defStyle,0);
  CharSequence text="String_Node_Str";
  int textSize=15;
  final int n=a.getIndexCount();
  for (int i=0; i < n; i++) {
    int attr=a.getIndex(i);
switch (attr) {
case android.R.styleable.TextView_text:
      text=a.getText(attr);
    break;
case android.R.styleable.TextView_lineSpacingExtra:
  mSpacingAdd=a.getDimensionPixelSize(attr,(int)mSpacingAdd);
break;
case android.R.styleable.TextView_lineSpacingMultiplier:
mSpacingMult=a.getFloat(attr,mSpacingMult);
break;
case android.R.styleable.TextAppearance_textSize:
textSize=a.getDimensionPixelSize(attr,textSize);
break;
}
}
final Resources res=getContext().getResources();
final DisplayMetrics m=res.getDisplayMetrics();
mCornerRadius=res.getDimension(com.android.internal.R.dimen.subtitle_corner_radius);
mOutlineWidth=res.getDimension(com.android.internal.R.dimen.subtitle_outline_width);
mShadowRadius=res.getDimension(com.android.internal.R.dimen.subtitle_shadow_radius);
mShadowOffsetX=res.getDimension(com.android.internal.R.dimen.subtitle_shadow_offset);
mShadowOffsetY=mShadowOffsetX;
mTextPaint=new TextPaint();
mTextPaint.setAntiAlias(true);
mTextPaint.setSubpixelText(true);
mPaint=new Paint();
mPaint.setAntiAlias(true);
setText(text);
setTextSize(textSize);
}

Fixed version (ground truth):
public SubtitleView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs);
  final Theme theme=context.getTheme();
  final TypedArray a=theme.obtainStyledAttributes(attrs,android.R.styleable.TextView,defStyle,0);
  CharSequence text="String_Node_Str";
  int textSize=15;
  final int n=a.getIndexCount();
  for (int i=0; i < n; i++) {
    int attr=a.getIndex(i);
switch (attr) {
case android.R.styleable.TextView_text:
      text=a.getText(attr);
    break;
case android.R.styleable.TextView_lineSpacingExtra:
  mSpacingAdd=a.getDimensionPixelSize(attr,(int)mSpacingAdd);
break;
case android.R.styleable.TextView_lineSpacingMultiplier:
mSpacingMult=a.getFloat(attr,mSpacingMult);
break;
case android.R.styleable.TextAppearance_textSize:
textSize=a.getDimensionPixelSize(attr,textSize);
break;
}
}
final Resources res=getContext().getResources();
final DisplayMetrics m=res.getDisplayMetrics();
mCornerRadius=res.getDimensionPixelSize(com.android.internal.R.dimen.subtitle_corner_radius);
mOutlineWidth=res.getDimensionPixelSize(com.android.internal.R.dimen.subtitle_outline_width);
mShadowRadius=res.getDimensionPixelSize(com.android.internal.R.dimen.subtitle_shadow_radius);
mShadowOffsetX=res.getDimensionPixelSize(com.android.internal.R.dimen.subtitle_shadow_offset);
mShadowOffsetY=mShadowOffsetX;
mTextPaint=new TextPaint();
mTextPaint.setAntiAlias(true);
mTextPaint.setSubpixelText(true);
mPaint=new Paint();
mPaint.setAntiAlias(true);
setText(text);
setTextSize(textSize);
}
Program: 922
Project: 922
Buggy source:
/** 
 * Creates a view into which preview text can be placed.
 */
private TextView createPreviewTextView(Context context,TypedArray ta){
  final LayoutParams params=new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
  final Resources res=context.getResources();
  final int minSize=res.getDimensionPixelSize(R.dimen.fastscroll_overlay_size);
  final ColorStateList textColor=ta.getColorStateList(TEXT_COLOR);
  final float textSize=res.getDimension(R.dimen.fastscroll_overlay_text_size);
  final TextView textView=new TextView(context);
  textView.setLayoutParams(params);
  textView.setTextColor(textColor);
  textView.setTextSize(textSize);
  textView.setSingleLine(true);
  textView.setEllipsize(TruncateAt.MIDDLE);
  textView.setGravity(Gravity.CENTER);
  textView.setAlpha(0f);
  textView.setLayoutDirection(mList.getLayoutDirection());
  return textView;
}

Fixed version (ground truth):
/** 
 * Creates a view into which preview text can be placed.
 */
private TextView createPreviewTextView(Context context,TypedArray ta){
  final LayoutParams params=new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
  final Resources res=context.getResources();
  final int minSize=res.getDimensionPixelSize(R.dimen.fastscroll_overlay_size);
  final ColorStateList textColor=ta.getColorStateList(TEXT_COLOR);
  final float textSize=res.getDimensionPixelSize(R.dimen.fastscroll_overlay_text_size);
  final TextView textView=new TextView(context);
  textView.setLayoutParams(params);
  textView.setTextColor(textColor);
  textView.setTextSize(TypedValue.COMPLEX_UNIT_PX,textSize);
  textView.setSingleLine(true);
  textView.setEllipsize(TruncateAt.MIDDLE);
  textView.setGravity(Gravity.CENTER);
  textView.setAlpha(0f);
  textView.setLayoutDirection(mList.getLayoutDirection());
  return textView;
}
Program: 923
Project: 923
Buggy source:
public void setTextSize(float size){
  final DisplayMetrics metrics=getContext().getResources().getDisplayMetrics();
  final float pixels=TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP,size,metrics);
  if (mTextPaint.getTextSize() != size) {
    mTextPaint.setTextSize(size);
    mInnerPaddingX=(int)(size * INNER_PADDING_RATIO + 0.5f);
    mHasMeasurements=false;
    forceLayout();
  }
}

Fixed version (ground truth):
/** 
 * Sets the text size in pixels.
 * @param size the text size in pixels
 */
public void setTextSize(float size){
  if (mTextPaint.getTextSize() != size) {
    mTextPaint.setTextSize(size);
    mInnerPaddingX=(int)(size * INNER_PADDING_RATIO + 0.5f);
    mHasMeasurements=false;
    forceLayout();
  }
}
Program: 924
Project: 924
Buggy source:
public SubtitleView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs);
  final Theme theme=context.getTheme();
  final TypedArray a=theme.obtainStyledAttributes(attrs,android.R.styleable.TextView,defStyle,0);
  CharSequence text="String_Node_Str";
  int textSize=15;
  final int n=a.getIndexCount();
  for (int i=0; i < n; i++) {
    int attr=a.getIndex(i);
switch (attr) {
case android.R.styleable.TextView_text:
      text=a.getText(attr);
    break;
case android.R.styleable.TextView_lineSpacingExtra:
  mSpacingAdd=a.getDimensionPixelSize(attr,(int)mSpacingAdd);
break;
case android.R.styleable.TextView_lineSpacingMultiplier:
mSpacingMult=a.getFloat(attr,mSpacingMult);
break;
case android.R.styleable.TextAppearance_textSize:
textSize=a.getDimensionPixelSize(attr,textSize);
break;
}
}
final Resources res=getContext().getResources();
final DisplayMetrics m=res.getDisplayMetrics();
mCornerRadius=res.getDimension(com.android.internal.R.dimen.subtitle_corner_radius);
mOutlineWidth=res.getDimension(com.android.internal.R.dimen.subtitle_outline_width);
mShadowRadius=res.getDimension(com.android.internal.R.dimen.subtitle_shadow_radius);
mShadowOffsetX=res.getDimension(com.android.internal.R.dimen.subtitle_shadow_offset);
mShadowOffsetY=mShadowOffsetX;
mTextPaint=new TextPaint();
mTextPaint.setAntiAlias(true);
mTextPaint.setSubpixelText(true);
mPaint=new Paint();
mPaint.setAntiAlias(true);
setText(text);
setTextSize(textSize);
}

Fixed version (ground truth):
public SubtitleView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs);
  final Theme theme=context.getTheme();
  final TypedArray a=theme.obtainStyledAttributes(attrs,android.R.styleable.TextView,defStyle,0);
  CharSequence text="String_Node_Str";
  int textSize=15;
  final int n=a.getIndexCount();
  for (int i=0; i < n; i++) {
    int attr=a.getIndex(i);
switch (attr) {
case android.R.styleable.TextView_text:
      text=a.getText(attr);
    break;
case android.R.styleable.TextView_lineSpacingExtra:
  mSpacingAdd=a.getDimensionPixelSize(attr,(int)mSpacingAdd);
break;
case android.R.styleable.TextView_lineSpacingMultiplier:
mSpacingMult=a.getFloat(attr,mSpacingMult);
break;
case android.R.styleable.TextAppearance_textSize:
textSize=a.getDimensionPixelSize(attr,textSize);
break;
}
}
final Resources res=getContext().getResources();
final DisplayMetrics m=res.getDisplayMetrics();
mCornerRadius=res.getDimensionPixelSize(com.android.internal.R.dimen.subtitle_corner_radius);
mOutlineWidth=res.getDimensionPixelSize(com.android.internal.R.dimen.subtitle_outline_width);
mShadowRadius=res.getDimensionPixelSize(com.android.internal.R.dimen.subtitle_shadow_radius);
mShadowOffsetX=res.getDimensionPixelSize(com.android.internal.R.dimen.subtitle_shadow_offset);
mShadowOffsetY=mShadowOffsetX;
mTextPaint=new TextPaint();
mTextPaint.setAntiAlias(true);
mTextPaint.setSubpixelText(true);
mPaint=new Paint();
mPaint.setAntiAlias(true);
setText(text);
setTextSize(textSize);
}
Program: 928
Project: 928
Buggy source:
/** 
 * Creates a view into which preview text can be placed.
 */
private TextView createPreviewTextView(Context context,TypedArray ta){
  final LayoutParams params=new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
  final Resources res=context.getResources();
  final int minSize=res.getDimensionPixelSize(R.dimen.fastscroll_overlay_size);
  final ColorStateList textColor=ta.getColorStateList(TEXT_COLOR);
  final float textSize=res.getDimension(R.dimen.fastscroll_overlay_text_size);
  final TextView textView=new TextView(context);
  textView.setLayoutParams(params);
  textView.setTextColor(textColor);
  textView.setTextSize(textSize);
  textView.setSingleLine(true);
  textView.setEllipsize(TruncateAt.MIDDLE);
  textView.setGravity(Gravity.CENTER);
  textView.setAlpha(0f);
  textView.setLayoutDirection(mList.getLayoutDirection());
  return textView;
}

Fixed version (ground truth):
/** 
 * Creates a view into which preview text can be placed.
 */
private TextView createPreviewTextView(Context context,TypedArray ta){
  final LayoutParams params=new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
  final Resources res=context.getResources();
  final int minSize=res.getDimensionPixelSize(R.dimen.fastscroll_overlay_size);
  final ColorStateList textColor=ta.getColorStateList(TEXT_COLOR);
  final float textSize=res.getDimensionPixelSize(R.dimen.fastscroll_overlay_text_size);
  final TextView textView=new TextView(context);
  textView.setLayoutParams(params);
  textView.setTextColor(textColor);
  textView.setTextSize(TypedValue.COMPLEX_UNIT_PX,textSize);
  textView.setSingleLine(true);
  textView.setEllipsize(TruncateAt.MIDDLE);
  textView.setGravity(Gravity.CENTER);
  textView.setAlpha(0f);
  textView.setLayoutDirection(mList.getLayoutDirection());
  return textView;
}
Program: 929
Project: 929
Buggy source:
public void setTextSize(float size){
  final DisplayMetrics metrics=getContext().getResources().getDisplayMetrics();
  final float pixels=TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP,size,metrics);
  if (mTextPaint.getTextSize() != size) {
    mTextPaint.setTextSize(size);
    mInnerPaddingX=(int)(size * INNER_PADDING_RATIO + 0.5f);
    mHasMeasurements=false;
    forceLayout();
  }
}

Fixed version (ground truth):
/** 
 * Sets the text size in pixels.
 * @param size the text size in pixels
 */
public void setTextSize(float size){
  if (mTextPaint.getTextSize() != size) {
    mTextPaint.setTextSize(size);
    mInnerPaddingX=(int)(size * INNER_PADDING_RATIO + 0.5f);
    mHasMeasurements=false;
    forceLayout();
  }
}
Program: 930
Project: 930
Buggy source:
public SubtitleView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs);
  final Theme theme=context.getTheme();
  final TypedArray a=theme.obtainStyledAttributes(attrs,android.R.styleable.TextView,defStyle,0);
  CharSequence text="String_Node_Str";
  int textSize=15;
  final int n=a.getIndexCount();
  for (int i=0; i < n; i++) {
    int attr=a.getIndex(i);
switch (attr) {
case android.R.styleable.TextView_text:
      text=a.getText(attr);
    break;
case android.R.styleable.TextView_lineSpacingExtra:
  mSpacingAdd=a.getDimensionPixelSize(attr,(int)mSpacingAdd);
break;
case android.R.styleable.TextView_lineSpacingMultiplier:
mSpacingMult=a.getFloat(attr,mSpacingMult);
break;
case android.R.styleable.TextAppearance_textSize:
textSize=a.getDimensionPixelSize(attr,textSize);
break;
}
}
final Resources res=getContext().getResources();
final DisplayMetrics m=res.getDisplayMetrics();
mCornerRadius=res.getDimension(com.android.internal.R.dimen.subtitle_corner_radius);
mOutlineWidth=res.getDimension(com.android.internal.R.dimen.subtitle_outline_width);
mShadowRadius=res.getDimension(com.android.internal.R.dimen.subtitle_shadow_radius);
mShadowOffsetX=res.getDimension(com.android.internal.R.dimen.subtitle_shadow_offset);
mShadowOffsetY=mShadowOffsetX;
mTextPaint=new TextPaint();
mTextPaint.setAntiAlias(true);
mTextPaint.setSubpixelText(true);
mPaint=new Paint();
mPaint.setAntiAlias(true);
setText(text);
setTextSize(textSize);
}

Fixed version (ground truth):
public SubtitleView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs);
  final Theme theme=context.getTheme();
  final TypedArray a=theme.obtainStyledAttributes(attrs,android.R.styleable.TextView,defStyle,0);
  CharSequence text="String_Node_Str";
  int textSize=15;
  final int n=a.getIndexCount();
  for (int i=0; i < n; i++) {
    int attr=a.getIndex(i);
switch (attr) {
case android.R.styleable.TextView_text:
      text=a.getText(attr);
    break;
case android.R.styleable.TextView_lineSpacingExtra:
  mSpacingAdd=a.getDimensionPixelSize(attr,(int)mSpacingAdd);
break;
case android.R.styleable.TextView_lineSpacingMultiplier:
mSpacingMult=a.getFloat(attr,mSpacingMult);
break;
case android.R.styleable.TextAppearance_textSize:
textSize=a.getDimensionPixelSize(attr,textSize);
break;
}
}
final Resources res=getContext().getResources();
final DisplayMetrics m=res.getDisplayMetrics();
mCornerRadius=res.getDimensionPixelSize(com.android.internal.R.dimen.subtitle_corner_radius);
mOutlineWidth=res.getDimensionPixelSize(com.android.internal.R.dimen.subtitle_outline_width);
mShadowRadius=res.getDimensionPixelSize(com.android.internal.R.dimen.subtitle_shadow_radius);
mShadowOffsetX=res.getDimensionPixelSize(com.android.internal.R.dimen.subtitle_shadow_offset);
mShadowOffsetY=mShadowOffsetX;
mTextPaint=new TextPaint();
mTextPaint.setAntiAlias(true);
mTextPaint.setSubpixelText(true);
mPaint=new Paint();
mPaint.setAntiAlias(true);
setText(text);
setTextSize(textSize);
}
Program: 937
Project: 937
Buggy source:
/** 
 * Dismiss the keyguard through the security layers.
 */
public void dismiss(){
  if (mShowing && !mHidden) {
    mKeyguardViewManager.dismiss();
  }
}

Fixed version (ground truth):
public void dismiss(){
  mHandler.sendEmptyMessage(DISMISS);
}
Program: 938
Project: 938
Buggy source:
public void keyguardDone(boolean authenticated,boolean wakeup){
  mKeyguardDonePending=false;
synchronized (this) {
    EventLog.writeEvent(70000,2);
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + authenticated + "String_Node_Str");
    Message msg=mHandler.obtainMessage(KEYGUARD_DONE,authenticated ? 1 : 0,wakeup ? 1 : 0);
    mHandler.sendMessage(msg);
  }
}

Fixed version (ground truth):
public void keyguardDone(boolean authenticated,boolean wakeup){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + authenticated + "String_Node_Str");
  EventLog.writeEvent(70000,2);
synchronized (this) {
    mKeyguardDonePending=false;
  }
  Message msg=mHandler.obtainMessage(KEYGUARD_DONE,authenticated ? 1 : 0,wakeup ? 1 : 0);
  mHandler.sendMessage(msg);
}
Program: 939
Project: 939
Buggy source:
@Override public void handleMessage(Message msg){
switch (msg.what) {
case SHOW:
    handleShow((Bundle)msg.obj);
  return;
case HIDE:
handleHide();
return;
case RESET:
handleReset((Bundle)msg.obj);
return;
case VERIFY_UNLOCK:
handleVerifyUnlock();
return;
case NOTIFY_SCREEN_OFF:
handleNotifyScreenOff();
return;
case NOTIFY_SCREEN_ON:
handleNotifyScreenOn((IKeyguardShowCallback)msg.obj);
return;
case KEYGUARD_DONE:
handleKeyguardDone(msg.arg1 != 0,msg.arg2 != 0);
return;
case KEYGUARD_DONE_DRAWING:
handleKeyguardDoneDrawing();
return;
case KEYGUARD_DONE_AUTHENTICATING:
keyguardDone(true,true);
return;
case SET_HIDDEN:
handleSetHidden(msg.arg1 != 0);
break;
case KEYGUARD_TIMEOUT:
synchronized (KeyguardViewMediator.this) {
doKeyguardLocked((Bundle)msg.obj);
}
break;
case SHOW_ASSISTANT:
handleShowAssistant();
break;
case DISPATCH_EVENT:
handleDispatchEvent((MotionEvent)msg.obj);
break;
case LAUNCH_CAMERA:
handleLaunchCamera();
break;
}
}

Fixed version (ground truth):
@Override public void handleMessage(Message msg){
switch (msg.what) {
case SHOW:
    handleShow((Bundle)msg.obj);
  break;
case HIDE:
handleHide();
break;
case RESET:
handleReset((Bundle)msg.obj);
break;
case VERIFY_UNLOCK:
handleVerifyUnlock();
break;
case NOTIFY_SCREEN_OFF:
handleNotifyScreenOff();
break;
case NOTIFY_SCREEN_ON:
handleNotifyScreenOn((IKeyguardShowCallback)msg.obj);
break;
case KEYGUARD_DONE:
handleKeyguardDone(msg.arg1 != 0,msg.arg2 != 0);
break;
case KEYGUARD_DONE_DRAWING:
handleKeyguardDoneDrawing();
break;
case KEYGUARD_DONE_AUTHENTICATING:
keyguardDone(true,true);
break;
case SET_HIDDEN:
handleSetHidden(msg.arg1 != 0);
break;
case KEYGUARD_TIMEOUT:
synchronized (KeyguardViewMediator.this) {
doKeyguardLocked((Bundle)msg.obj);
}
break;
case SHOW_ASSISTANT:
handleShowAssistant();
break;
case DISPATCH_EVENT:
handleDispatchEvent((MotionEvent)msg.obj);
break;
case LAUNCH_CAMERA:
handleLaunchCamera();
break;
case DISMISS:
handleDismiss();
break;
}
}
Program: 941
Project: 941
Buggy source:
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  final boolean wasFormatted=mFormatItems;
  mFormatItems=MeasureSpec.getMode(widthMeasureSpec) == MeasureSpec.EXACTLY;
  if (wasFormatted != mFormatItems) {
    mFormatItemsWidth=0;
  }
  final int widthSize=MeasureSpec.getMode(widthMeasureSpec);
  if (mFormatItems && mMenu != null && widthSize != mFormatItemsWidth) {
    mFormatItemsWidth=widthSize;
    mMenu.onItemsChanged(true);
  }
  if (mFormatItems) {
    onMeasureExactFormat(widthMeasureSpec,heightMeasureSpec);
  }
 else {
    final int childCount=getChildCount();
    for (int i=0; i < childCount; i++) {
      final View child=getChildAt(i);
      final LayoutParams lp=(LayoutParams)child.getLayoutParams();
      lp.leftMargin=lp.rightMargin=0;
    }
    super.onMeasure(widthMeasureSpec,heightMeasureSpec);
  }
}

Fixed version (ground truth):
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  final boolean wasFormatted=mFormatItems;
  mFormatItems=MeasureSpec.getMode(widthMeasureSpec) == MeasureSpec.EXACTLY;
  if (wasFormatted != mFormatItems) {
    mFormatItemsWidth=0;
  }
  final int widthSize=MeasureSpec.getSize(widthMeasureSpec);
  if (mFormatItems && mMenu != null && widthSize != mFormatItemsWidth) {
    mFormatItemsWidth=widthSize;
    mMenu.onItemsChanged(true);
  }
  if (mFormatItems) {
    onMeasureExactFormat(widthMeasureSpec,heightMeasureSpec);
  }
 else {
    final int childCount=getChildCount();
    for (int i=0; i < childCount; i++) {
      final View child=getChildAt(i);
      final LayoutParams lp=(LayoutParams)child.getLayoutParams();
      lp.leftMargin=lp.rightMargin=0;
    }
    super.onMeasure(widthMeasureSpec,heightMeasureSpec);
  }
}
Program: 946
Project: 946
Buggy source:
@Override public boolean bindService(Intent service,ServiceConnection conn,int flags){
  warnIfCallingFromSystemProcess();
  return bindServiceAsUser(service,conn,flags,Process.myUserHandle());
}

Fixed version (ground truth):
@Override public boolean bindService(Intent service,ServiceConnection conn,int flags){
  warnIfCallingFromSystemProcess();
  return bindServiceCommon(service,conn,flags,Process.myUserHandle());
}
Program: 947
Project: 947
Buggy source:
@Override public ComponentName startServiceAsUser(Intent service,UserHandle user){
  try {
    if (service.getComponent() == null && service.getPackage() == null) {
      if (getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.KITKAT) {
        IllegalArgumentException ex=new IllegalArgumentException("String_Node_Str" + service);
        Log.e(TAG,"String_Node_Str",ex);
      }
    }
    service.prepareToLeaveProcess();
    ComponentName cn=ActivityManagerNative.getDefault().startService(mMainThread.getApplicationThread(),service,service.resolveTypeIfNeeded(getContentResolver()),user.getIdentifier());
    if (cn != null) {
      if (cn.getPackageName().equals("String_Node_Str")) {
        throw new SecurityException("String_Node_Str" + service + "String_Node_Str"+ cn.getClassName());
      }
 else       if (cn.getPackageName().equals("String_Node_Str")) {
        throw new SecurityException("String_Node_Str" + service + "String_Node_Str"+ cn.getClassName());
      }
    }
    return cn;
  }
 catch (  RemoteException e) {
    return null;
  }
}

Fixed version (ground truth):
@Override public ComponentName startServiceAsUser(Intent service,UserHandle user){
  return startServiceCommon(service,user);
}
Program: 948
Project: 948
Buggy source:
@Override public boolean stopServiceAsUser(Intent service,UserHandle user){
  try {
    if (service.getComponent() == null && service.getPackage() == null) {
      if (getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.KITKAT) {
        IllegalArgumentException ex=new IllegalArgumentException("String_Node_Str" + service);
        Log.e(TAG,"String_Node_Str",ex);
      }
    }
    service.prepareToLeaveProcess();
    int res=ActivityManagerNative.getDefault().stopService(mMainThread.getApplicationThread(),service,service.resolveTypeIfNeeded(getContentResolver()),user.getIdentifier());
    if (res < 0) {
      throw new SecurityException("String_Node_Str" + service);
    }
    return res != 0;
  }
 catch (  RemoteException e) {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean stopServiceAsUser(Intent service,UserHandle user){
  return stopServiceCommon(service,user);
}
Program: 949
Project: 949
Buggy source:
/** 
 * @hide 
 */
@Override public boolean bindServiceAsUser(Intent service,ServiceConnection conn,int flags,UserHandle user){
  IServiceConnection sd;
  if (conn == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (mPackageInfo != null) {
    sd=mPackageInfo.getServiceDispatcher(conn,getOuterContext(),mMainThread.getHandler(),flags);
  }
 else {
    throw new RuntimeException("String_Node_Str");
  }
  if (service.getComponent() == null && service.getPackage() == null) {
    if (getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.KITKAT) {
      IllegalArgumentException ex=new IllegalArgumentException("String_Node_Str" + service);
      Log.e(TAG,"String_Node_Str",ex);
    }
  }
  try {
    IBinder token=getActivityToken();
    if (token == null && (flags & BIND_AUTO_CREATE) == 0 && mPackageInfo != null && mPackageInfo.getApplicationInfo().targetSdkVersion < android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
      flags|=BIND_WAIVE_PRIORITY;
    }
    service.prepareToLeaveProcess();
    int res=ActivityManagerNative.getDefault().bindService(mMainThread.getApplicationThread(),getActivityToken(),service,service.resolveTypeIfNeeded(getContentResolver()),sd,flags,user.getIdentifier());
    if (res < 0) {
      throw new SecurityException("String_Node_Str" + service);
    }
    return res != 0;
  }
 catch (  RemoteException e) {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * @hide 
 */
@Override public boolean bindServiceAsUser(Intent service,ServiceConnection conn,int flags,UserHandle user){
  return bindServiceCommon(service,conn,flags,user);
}
Program: 950
Project: 950
Buggy source:
@Override public ComponentName startService(Intent service){
  warnIfCallingFromSystemProcess();
  return startServiceAsUser(service,mUser);
}

Fixed version (ground truth):
@Override public ComponentName startService(Intent service){
  warnIfCallingFromSystemProcess();
  return startServiceCommon(service,mUser);
}
Program: 951
Project: 951
Buggy source:
@Override public boolean stopService(Intent service){
  warnIfCallingFromSystemProcess();
  return stopServiceAsUser(service,mUser);
}

Fixed version (ground truth):
@Override public boolean stopService(Intent service){
  warnIfCallingFromSystemProcess();
  return stopServiceCommon(service,mUser);
}
Program: 952
Project: 952
Buggy source:
/** 
 * TODO: optimize this later (getting just the value part of a Bundle with a single pair) once Bundle.forPair() above is implemented with a special single-value Map implementation/serialization. Note: value in single-pair Bundle may be null.
 * @hide
 */
public String getPairValue(){
  unparcel();
  int size=mMap.size();
  if (size > 1) {
    Log.w(LOG_TAG,"String_Node_Str");
  }
  if (size == 0) {
    return null;
  }
  Object o=mMap.valueAt(0);
  try {
    return (String)o;
  }
 catch (  ClassCastException e) {
    typeWarning("String_Node_Str",o,"String_Node_Str",e);
    return null;
  }
}

Fixed version (ground truth):
/** 
 * TODO: optimize this later (getting just the value part of a Bundle with a single pair) once Bundle.forPair() above is implemented with a special single-value Map implementation/serialization. Note: value in single-pair Bundle may be null.
 * @hide
 */
public String getPairValue(){
  unparcel();
  int size=mMap.size();
  if (size > 1) {
    Log.w(TAG,"String_Node_Str");
  }
  if (size == 0) {
    return null;
  }
  Object o=mMap.valueAt(0);
  try {
    return (String)o;
  }
 catch (  ClassCastException e) {
    typeWarning("String_Node_Str",o,"String_Node_Str",e);
    return null;
  }
}
Program: 953
Project: 953
Buggy source:
/** 
 * Writes the Bundle contents to a Parcel, typically in order for it to be passed through an IBinder connection.
 * @param parcel The parcel to copy this bundle to.
 */
public void writeToParcel(Parcel parcel,int flags){
  final boolean oldAllowFds=parcel.pushAllowFds(mAllowFds);
  try {
    if (mParcelledData != null) {
      int length=mParcelledData.dataSize();
      parcel.writeInt(length);
      parcel.writeInt(BUNDLE_MAGIC);
      parcel.appendFrom(mParcelledData,0,length);
    }
 else {
      parcel.writeInt(-1);
      parcel.writeInt(BUNDLE_MAGIC);
      int oldPos=parcel.dataPosition();
      parcel.writeArrayMapInternal(mMap);
      int newPos=parcel.dataPosition();
      parcel.setDataPosition(oldPos - 8);
      int length=newPos - oldPos;
      parcel.writeInt(length);
      parcel.setDataPosition(newPos);
    }
  }
  finally {
    parcel.restoreAllowFds(oldAllowFds);
  }
}

Fixed version (ground truth):
/** 
 * Writes the Bundle contents to a Parcel, typically in order for it to be passed through an IBinder connection.
 * @param parcel The parcel to copy this bundle to.
 */
public void writeToParcel(Parcel parcel,int flags){
  final boolean oldAllowFds=parcel.pushAllowFds(mAllowFds);
  try {
    if (mParcelledData != null) {
      int length=mParcelledData.dataSize();
      parcel.writeInt(length);
      parcel.writeInt(BUNDLE_MAGIC);
      parcel.appendFrom(mParcelledData,0,length);
    }
 else {
      int lengthPos=parcel.dataPosition();
      parcel.writeInt(-1);
      parcel.writeInt(BUNDLE_MAGIC);
      int startPos=parcel.dataPosition();
      parcel.writeArrayMapInternal(mMap);
      int endPos=parcel.dataPosition();
      parcel.setDataPosition(lengthPos);
      int length=endPos - startPos;
      parcel.writeInt(length);
      parcel.setDataPosition(endPos);
    }
  }
  finally {
    parcel.restoreAllowFds(oldAllowFds);
  }
}
Program: 954
Project: 954
Buggy source:
/** 
 * If the underlying data are stored as a Parcel, unparcel them using the currently assigned class loader.
 */
synchronized void unparcel(){
  if (mParcelledData == null) {
    return;
  }
  int N=mParcelledData.readInt();
  if (N < 0) {
    return;
  }
  if (mMap == null) {
    mMap=new ArrayMap<String,Object>(N);
  }
 else {
    mMap.erase();
    mMap.ensureCapacity(N);
  }
  mParcelledData.readArrayMapInternal(mMap,N,mClassLoader);
  mParcelledData.recycle();
  mParcelledData=null;
}

Fixed version (ground truth):
/** 
 * If the underlying data are stored as a Parcel, unparcel them using the currently assigned class loader.
 */
synchronized void unparcel(){
  if (mParcelledData == null) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + Integer.toHexString(System.identityHashCode(this)) + "String_Node_Str");
    return;
  }
  int N=mParcelledData.readInt();
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + Integer.toHexString(System.identityHashCode(this)) + "String_Node_Str"+ N+ "String_Node_Str");
  if (N < 0) {
    return;
  }
  if (mMap == null) {
    mMap=new ArrayMap<String,Object>(N);
  }
 else {
    mMap.erase();
    mMap.ensureCapacity(N);
  }
  mParcelledData.readArrayMapInternal(mMap,N,mClassLoader);
  mParcelledData.recycle();
  mParcelledData=null;
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + Integer.toHexString(System.identityHashCode(this)) + "String_Node_Str"+ mMap);
}
Program: 955
Project: 955
Buggy source:
void readFromParcelInner(Parcel parcel,int length){
  int magic=parcel.readInt();
  if (magic != BUNDLE_MAGIC) {
    throw new IllegalStateException("String_Node_Str" + Integer.toHexString(magic));
  }
  int offset=parcel.dataPosition();
  parcel.setDataPosition(offset + length);
  Parcel p=Parcel.obtain();
  p.setDataPosition(0);
  p.appendFrom(parcel,offset,length);
  p.setDataPosition(0);
  if (mMap != null) {
    if (mFdsKnown) {
      mHasFds|=p.hasFileDescriptors();
    }
    int N=p.readInt();
    p.readArrayMapSafelyInternal(mMap,N,mClassLoader);
    p.recycle();
  }
 else {
    mParcelledData=p;
    mHasFds=p.hasFileDescriptors();
    mFdsKnown=true;
  }
}

Fixed version (ground truth):
void readFromParcelInner(Parcel parcel,int length){
  int magic=parcel.readInt();
  if (magic != BUNDLE_MAGIC) {
    throw new IllegalStateException("String_Node_Str" + Integer.toHexString(magic));
  }
  int offset=parcel.dataPosition();
  parcel.setDataPosition(offset + length);
  Parcel p=Parcel.obtain();
  p.setDataPosition(0);
  p.appendFrom(parcel,offset,length);
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + Integer.toHexString(System.identityHashCode(this)) + "String_Node_Str"+ length+ "String_Node_Str"+ offset);
  p.setDataPosition(0);
  mParcelledData=p;
  mHasFds=p.hasFileDescriptors();
  mFdsKnown=true;
}
Program: 956
Project: 956
Buggy source:
/** 
 * Read and return a new Bundle object from the parcel at the current dataPosition(), using the given class loader to initialize the class loader of the Bundle for later retrieval of Parcelable objects. Returns null if the previously written Bundle object was null.
 */
public final Bundle readBundle(ClassLoader loader){
  int length=readInt();
  if (length < 0) {
    return null;
  }
  final Bundle bundle=new Bundle(this,length);
  if (loader != null) {
    bundle.setClassLoader(loader);
  }
  return bundle;
}

Fixed version (ground truth):
/** 
 * Read and return a new Bundle object from the parcel at the current dataPosition(), using the given class loader to initialize the class loader of the Bundle for later retrieval of Parcelable objects. Returns null if the previously written Bundle object was null.
 */
public final Bundle readBundle(ClassLoader loader){
  int length=readInt();
  if (length < 0) {
    if (Bundle.DEBUG)     Log.d(TAG,"String_Node_Str" + length);
    return null;
  }
  final Bundle bundle=new Bundle(this,length);
  if (loader != null) {
    bundle.setClassLoader(loader);
  }
  return bundle;
}
Program: 957
Project: 957
Buggy source:
/** 
 * @hide Like  {@link #clear}, but doesn't reduce the capacity of the ArrayMap.
 */
public void erase(){
  if (mSize > 0) {
    final int N=mSize << 1;
    final Object[] array=mArray;
    for (int i=0; i < N; i++) {
      array[i]=null;
    }
  }
}

Fixed version (ground truth):
/** 
 * @hide Like  {@link #clear}, but doesn't reduce the capacity of the ArrayMap.
 */
public void erase(){
  if (mSize > 0) {
    final int N=mSize << 1;
    final Object[] array=mArray;
    for (int i=0; i < N; i++) {
      array[i]=null;
    }
    mSize=0;
  }
}
Program: 959
Project: 959
Buggy source:
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  final boolean wasFormatted=mFormatItems;
  mFormatItems=MeasureSpec.getMode(widthMeasureSpec) == MeasureSpec.EXACTLY;
  if (wasFormatted != mFormatItems) {
    mFormatItemsWidth=0;
  }
  final int widthSize=MeasureSpec.getMode(widthMeasureSpec);
  if (mFormatItems && mMenu != null && widthSize != mFormatItemsWidth) {
    mFormatItemsWidth=widthSize;
    mMenu.onItemsChanged(true);
  }
  if (mFormatItems) {
    onMeasureExactFormat(widthMeasureSpec,heightMeasureSpec);
  }
 else {
    final int childCount=getChildCount();
    for (int i=0; i < childCount; i++) {
      final View child=getChildAt(i);
      final LayoutParams lp=(LayoutParams)child.getLayoutParams();
      lp.leftMargin=lp.rightMargin=0;
    }
    super.onMeasure(widthMeasureSpec,heightMeasureSpec);
  }
}

Fixed version (ground truth):
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  final boolean wasFormatted=mFormatItems;
  mFormatItems=MeasureSpec.getMode(widthMeasureSpec) == MeasureSpec.EXACTLY;
  if (wasFormatted != mFormatItems) {
    mFormatItemsWidth=0;
  }
  final int widthSize=MeasureSpec.getSize(widthMeasureSpec);
  if (mFormatItems && mMenu != null && widthSize != mFormatItemsWidth) {
    mFormatItemsWidth=widthSize;
    mMenu.onItemsChanged(true);
  }
  if (mFormatItems) {
    onMeasureExactFormat(widthMeasureSpec,heightMeasureSpec);
  }
 else {
    final int childCount=getChildCount();
    for (int i=0; i < childCount; i++) {
      final View child=getChildAt(i);
      final LayoutParams lp=(LayoutParams)child.getLayoutParams();
      lp.leftMargin=lp.rightMargin=0;
    }
    super.onMeasure(widthMeasureSpec,heightMeasureSpec);
  }
}
Program: 961
Project: 961
Buggy source:
/** 
 * Dismiss the keyguard through the security layers.
 */
public void dismiss(){
  if (mShowing && !mHidden) {
    mKeyguardViewManager.dismiss();
  }
}

Fixed version (ground truth):
public void dismiss(){
  mHandler.sendEmptyMessage(DISMISS);
}
Program: 962
Project: 962
Buggy source:
public void keyguardDone(boolean authenticated,boolean wakeup){
  mKeyguardDonePending=false;
synchronized (this) {
    EventLog.writeEvent(70000,2);
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + authenticated + "String_Node_Str");
    Message msg=mHandler.obtainMessage(KEYGUARD_DONE,authenticated ? 1 : 0,wakeup ? 1 : 0);
    mHandler.sendMessage(msg);
  }
}

Fixed version (ground truth):
public void keyguardDone(boolean authenticated,boolean wakeup){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + authenticated + "String_Node_Str");
  EventLog.writeEvent(70000,2);
synchronized (this) {
    mKeyguardDonePending=false;
  }
  Message msg=mHandler.obtainMessage(KEYGUARD_DONE,authenticated ? 1 : 0,wakeup ? 1 : 0);
  mHandler.sendMessage(msg);
}
Program: 963
Project: 963
Buggy source:
@Override public void handleMessage(Message msg){
switch (msg.what) {
case SHOW:
    handleShow((Bundle)msg.obj);
  return;
case HIDE:
handleHide();
return;
case RESET:
handleReset((Bundle)msg.obj);
return;
case VERIFY_UNLOCK:
handleVerifyUnlock();
return;
case NOTIFY_SCREEN_OFF:
handleNotifyScreenOff();
return;
case NOTIFY_SCREEN_ON:
handleNotifyScreenOn((IKeyguardShowCallback)msg.obj);
return;
case KEYGUARD_DONE:
handleKeyguardDone(msg.arg1 != 0,msg.arg2 != 0);
return;
case KEYGUARD_DONE_DRAWING:
handleKeyguardDoneDrawing();
return;
case KEYGUARD_DONE_AUTHENTICATING:
keyguardDone(true,true);
return;
case SET_HIDDEN:
handleSetHidden(msg.arg1 != 0);
break;
case KEYGUARD_TIMEOUT:
synchronized (KeyguardViewMediator.this) {
doKeyguardLocked((Bundle)msg.obj);
}
break;
case SHOW_ASSISTANT:
handleShowAssistant();
break;
case DISPATCH_EVENT:
handleDispatchEvent((MotionEvent)msg.obj);
break;
case LAUNCH_CAMERA:
handleLaunchCamera();
break;
}
}

Fixed version (ground truth):
@Override public void handleMessage(Message msg){
switch (msg.what) {
case SHOW:
    handleShow((Bundle)msg.obj);
  break;
case HIDE:
handleHide();
break;
case RESET:
handleReset((Bundle)msg.obj);
break;
case VERIFY_UNLOCK:
handleVerifyUnlock();
break;
case NOTIFY_SCREEN_OFF:
handleNotifyScreenOff();
break;
case NOTIFY_SCREEN_ON:
handleNotifyScreenOn((IKeyguardShowCallback)msg.obj);
break;
case KEYGUARD_DONE:
handleKeyguardDone(msg.arg1 != 0,msg.arg2 != 0);
break;
case KEYGUARD_DONE_DRAWING:
handleKeyguardDoneDrawing();
break;
case KEYGUARD_DONE_AUTHENTICATING:
keyguardDone(true,true);
break;
case SET_HIDDEN:
handleSetHidden(msg.arg1 != 0);
break;
case KEYGUARD_TIMEOUT:
synchronized (KeyguardViewMediator.this) {
doKeyguardLocked((Bundle)msg.obj);
}
break;
case SHOW_ASSISTANT:
handleShowAssistant();
break;
case DISPATCH_EVENT:
handleDispatchEvent((MotionEvent)msg.obj);
break;
case LAUNCH_CAMERA:
handleLaunchCamera();
break;
case DISMISS:
handleDismiss();
break;
}
}
Program: 965
Project: 965
Buggy source:
/** 
 * Dismiss the keyguard through the security layers.
 */
public void dismiss(){
  if (mShowing && !mHidden) {
    mKeyguardViewManager.dismiss();
  }
}

Fixed version (ground truth):
public void dismiss(){
  mHandler.sendEmptyMessage(DISMISS);
}
Program: 966
Project: 966
Buggy source:
public void keyguardDone(boolean authenticated,boolean wakeup){
  mKeyguardDonePending=false;
synchronized (this) {
    EventLog.writeEvent(70000,2);
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + authenticated + "String_Node_Str");
    Message msg=mHandler.obtainMessage(KEYGUARD_DONE,authenticated ? 1 : 0,wakeup ? 1 : 0);
    mHandler.sendMessage(msg);
  }
}

Fixed version (ground truth):
public void keyguardDone(boolean authenticated,boolean wakeup){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + authenticated + "String_Node_Str");
  EventLog.writeEvent(70000,2);
synchronized (this) {
    mKeyguardDonePending=false;
  }
  Message msg=mHandler.obtainMessage(KEYGUARD_DONE,authenticated ? 1 : 0,wakeup ? 1 : 0);
  mHandler.sendMessage(msg);
}
Program: 967
Project: 967
Buggy source:
@Override public void handleMessage(Message msg){
switch (msg.what) {
case SHOW:
    handleShow((Bundle)msg.obj);
  return;
case HIDE:
handleHide();
return;
case RESET:
handleReset((Bundle)msg.obj);
return;
case VERIFY_UNLOCK:
handleVerifyUnlock();
return;
case NOTIFY_SCREEN_OFF:
handleNotifyScreenOff();
return;
case NOTIFY_SCREEN_ON:
handleNotifyScreenOn((IKeyguardShowCallback)msg.obj);
return;
case KEYGUARD_DONE:
handleKeyguardDone(msg.arg1 != 0,msg.arg2 != 0);
return;
case KEYGUARD_DONE_DRAWING:
handleKeyguardDoneDrawing();
return;
case KEYGUARD_DONE_AUTHENTICATING:
keyguardDone(true,true);
return;
case SET_HIDDEN:
handleSetHidden(msg.arg1 != 0);
break;
case KEYGUARD_TIMEOUT:
synchronized (KeyguardViewMediator.this) {
doKeyguardLocked((Bundle)msg.obj);
}
break;
case SHOW_ASSISTANT:
handleShowAssistant();
break;
case DISPATCH_EVENT:
handleDispatchEvent((MotionEvent)msg.obj);
break;
case LAUNCH_CAMERA:
handleLaunchCamera();
break;
}
}

Fixed version (ground truth):
@Override public void handleMessage(Message msg){
switch (msg.what) {
case SHOW:
    handleShow((Bundle)msg.obj);
  break;
case HIDE:
handleHide();
break;
case RESET:
handleReset((Bundle)msg.obj);
break;
case VERIFY_UNLOCK:
handleVerifyUnlock();
break;
case NOTIFY_SCREEN_OFF:
handleNotifyScreenOff();
break;
case NOTIFY_SCREEN_ON:
handleNotifyScreenOn((IKeyguardShowCallback)msg.obj);
break;
case KEYGUARD_DONE:
handleKeyguardDone(msg.arg1 != 0,msg.arg2 != 0);
break;
case KEYGUARD_DONE_DRAWING:
handleKeyguardDoneDrawing();
break;
case KEYGUARD_DONE_AUTHENTICATING:
keyguardDone(true,true);
break;
case SET_HIDDEN:
handleSetHidden(msg.arg1 != 0);
break;
case KEYGUARD_TIMEOUT:
synchronized (KeyguardViewMediator.this) {
doKeyguardLocked((Bundle)msg.obj);
}
break;
case SHOW_ASSISTANT:
handleShowAssistant();
break;
case DISPATCH_EVENT:
handleDispatchEvent((MotionEvent)msg.obj);
break;
case LAUNCH_CAMERA:
handleLaunchCamera();
break;
case DISMISS:
handleDismiss();
break;
}
}
Program: 969
Project: 969
Buggy source:
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  final boolean wasFormatted=mFormatItems;
  mFormatItems=MeasureSpec.getMode(widthMeasureSpec) == MeasureSpec.EXACTLY;
  if (wasFormatted != mFormatItems) {
    mFormatItemsWidth=0;
  }
  final int widthSize=MeasureSpec.getMode(widthMeasureSpec);
  if (mFormatItems && mMenu != null && widthSize != mFormatItemsWidth) {
    mFormatItemsWidth=widthSize;
    mMenu.onItemsChanged(true);
  }
  if (mFormatItems) {
    onMeasureExactFormat(widthMeasureSpec,heightMeasureSpec);
  }
 else {
    final int childCount=getChildCount();
    for (int i=0; i < childCount; i++) {
      final View child=getChildAt(i);
      final LayoutParams lp=(LayoutParams)child.getLayoutParams();
      lp.leftMargin=lp.rightMargin=0;
    }
    super.onMeasure(widthMeasureSpec,heightMeasureSpec);
  }
}

Fixed version (ground truth):
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  final boolean wasFormatted=mFormatItems;
  mFormatItems=MeasureSpec.getMode(widthMeasureSpec) == MeasureSpec.EXACTLY;
  if (wasFormatted != mFormatItems) {
    mFormatItemsWidth=0;
  }
  final int widthSize=MeasureSpec.getSize(widthMeasureSpec);
  if (mFormatItems && mMenu != null && widthSize != mFormatItemsWidth) {
    mFormatItemsWidth=widthSize;
    mMenu.onItemsChanged(true);
  }
  if (mFormatItems) {
    onMeasureExactFormat(widthMeasureSpec,heightMeasureSpec);
  }
 else {
    final int childCount=getChildCount();
    for (int i=0; i < childCount; i++) {
      final View child=getChildAt(i);
      final LayoutParams lp=(LayoutParams)child.getLayoutParams();
      lp.leftMargin=lp.rightMargin=0;
    }
    super.onMeasure(widthMeasureSpec,heightMeasureSpec);
  }
}
Program: 972
Project: 972
Buggy source:
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  final boolean wasFormatted=mFormatItems;
  mFormatItems=MeasureSpec.getMode(widthMeasureSpec) == MeasureSpec.EXACTLY;
  if (wasFormatted != mFormatItems) {
    mFormatItemsWidth=0;
  }
  final int widthSize=MeasureSpec.getMode(widthMeasureSpec);
  if (mFormatItems && mMenu != null && widthSize != mFormatItemsWidth) {
    mFormatItemsWidth=widthSize;
    mMenu.onItemsChanged(true);
  }
  if (mFormatItems) {
    onMeasureExactFormat(widthMeasureSpec,heightMeasureSpec);
  }
 else {
    final int childCount=getChildCount();
    for (int i=0; i < childCount; i++) {
      final View child=getChildAt(i);
      final LayoutParams lp=(LayoutParams)child.getLayoutParams();
      lp.leftMargin=lp.rightMargin=0;
    }
    super.onMeasure(widthMeasureSpec,heightMeasureSpec);
  }
}

Fixed version (ground truth):
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  final boolean wasFormatted=mFormatItems;
  mFormatItems=MeasureSpec.getMode(widthMeasureSpec) == MeasureSpec.EXACTLY;
  if (wasFormatted != mFormatItems) {
    mFormatItemsWidth=0;
  }
  final int widthSize=MeasureSpec.getSize(widthMeasureSpec);
  if (mFormatItems && mMenu != null && widthSize != mFormatItemsWidth) {
    mFormatItemsWidth=widthSize;
    mMenu.onItemsChanged(true);
  }
  if (mFormatItems) {
    onMeasureExactFormat(widthMeasureSpec,heightMeasureSpec);
  }
 else {
    final int childCount=getChildCount();
    for (int i=0; i < childCount; i++) {
      final View child=getChildAt(i);
      final LayoutParams lp=(LayoutParams)child.getLayoutParams();
      lp.leftMargin=lp.rightMargin=0;
    }
    super.onMeasure(widthMeasureSpec,heightMeasureSpec);
  }
}
Program: 974
Project: 974
Buggy source:
/** 
 * Dismiss the keyguard through the security layers.
 */
public void dismiss(){
  if (mShowing && !mHidden) {
    mKeyguardViewManager.dismiss();
  }
}

Fixed version (ground truth):
public void dismiss(){
  mHandler.sendEmptyMessage(DISMISS);
}
Program: 975
Project: 975
Buggy source:
public void keyguardDone(boolean authenticated,boolean wakeup){
  mKeyguardDonePending=false;
synchronized (this) {
    EventLog.writeEvent(70000,2);
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + authenticated + "String_Node_Str");
    Message msg=mHandler.obtainMessage(KEYGUARD_DONE,authenticated ? 1 : 0,wakeup ? 1 : 0);
    mHandler.sendMessage(msg);
  }
}

Fixed version (ground truth):
public void keyguardDone(boolean authenticated,boolean wakeup){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + authenticated + "String_Node_Str");
  EventLog.writeEvent(70000,2);
synchronized (this) {
    mKeyguardDonePending=false;
  }
  Message msg=mHandler.obtainMessage(KEYGUARD_DONE,authenticated ? 1 : 0,wakeup ? 1 : 0);
  mHandler.sendMessage(msg);
}