nus-yam/ex-repair huggingface dataset:
Program: 181282
Project: 181282
Buggy source:
public void updatePosition(){
  final int selectionStart=getSelectionStart();
  final int selectionEnd=getSelectionEnd();
  if ((selectionStart < 0) || (selectionEnd < 0)) {
    Log.w(LOG_TAG,"String_Node_Str");
    hide();
    return;
  }
  boolean oneLineSelection=mLayout.getLineForOffset(selectionStart) == mLayout.getLineForOffset(selectionEnd);
  mStartHandle.positionAtCursor(selectionStart,oneLineSelection);
  mEndHandle.positionAtCursor(selectionEnd,true);
  hideDelayed(DELAY_BEFORE_FADE_OUT);
}

Fixed version (ground truth):
public void updatePosition(){
  final int selectionStart=getSelectionStart();
  final int selectionEnd=getSelectionEnd();
  if ((selectionStart < 0) || (selectionEnd < 0)) {
    Log.w(LOG_TAG,"String_Node_Str");
    hide();
    return;
  }
  mStartHandle.positionAtCursor(selectionStart,true);
  mEndHandle.positionAtCursor(selectionEnd,true);
  hideDelayed(DELAY_BEFORE_FADE_OUT);
}
Program: 181283
Project: 181283
Buggy source:
SelectionModifierCursorController(){
  Resources res=mContext.getResources();
  mStartHandle=new HandleView(this,res.getDrawable(mTextSelectHandleLeftRes));
  mEndHandle=new HandleView(this,res.getDrawable(mTextSelectHandleRightRes));
}

Fixed version (ground truth):
SelectionModifierCursorController(){
  mStartHandle=new HandleView(this,HandleView.LEFT);
  mEndHandle=new HandleView(this,HandleView.RIGHT);
}
Program: 181284
Project: 181284
Buggy source:
private boolean isPositionVisible(){
  if (mIsDragging) {
    return true;
  }
  final int extendedPaddingTop=getExtendedPaddingTop();
  final int extendedPaddingBottom=getExtendedPaddingBottom();
  final int compoundPaddingLeft=getCompoundPaddingLeft();
  final int compoundPaddingRight=getCompoundPaddingRight();
  final TextView hostView=TextView.this;
  final int left=0;
  final int right=hostView.getWidth();
  final int top=0;
  final int bottom=hostView.getHeight();
  if (mTempRect == null) {
    mTempRect=new Rect();
  }
  final Rect clip=mTempRect;
  clip.left=left + compoundPaddingLeft;
  clip.top=top + extendedPaddingTop;
  clip.right=right - compoundPaddingRight;
  clip.bottom=bottom - extendedPaddingBottom;
  final ViewParent parent=hostView.getParent();
  if (parent == null || !parent.getChildVisibleRect(hostView,clip,null)) {
    return false;
  }
  final int[] coords=mTempCoords;
  hostView.getLocationInWindow(coords);
  final int posX=coords[0] + mPositionX + (int)mHotspotX;
  final int posY=coords[1] + mPositionY;
  return posX >= clip.left && posX <= clip.right && posY >= clip.top && posY + mHotspotY <= clip.bottom;
}

Fixed version (ground truth):
private boolean isPositionVisible(){
  if (mIsDragging) {
    return true;
  }
  final int extendedPaddingTop=getExtendedPaddingTop();
  final int extendedPaddingBottom=getExtendedPaddingBottom();
  final int compoundPaddingLeft=getCompoundPaddingLeft();
  final int compoundPaddingRight=getCompoundPaddingRight();
  final TextView hostView=TextView.this;
  final int left=0;
  final int right=hostView.getWidth();
  final int top=0;
  final int bottom=hostView.getHeight();
  if (mTempRect == null) {
    mTempRect=new Rect();
  }
  final Rect clip=mTempRect;
  clip.left=left + compoundPaddingLeft;
  clip.top=top + extendedPaddingTop;
  clip.right=right - compoundPaddingRight;
  clip.bottom=bottom - extendedPaddingBottom;
  final ViewParent parent=hostView.getParent();
  if (parent == null || !parent.getChildVisibleRect(hostView,clip,null)) {
    return false;
  }
  final int[] coords=mTempCoords;
  hostView.getLocationInWindow(coords);
  final int posX=coords[0] + mPositionX + (int)mHotspotX;
  final int posY=coords[1] + mPositionY + (int)mHotspotY;
  return posX >= clip.left && posX <= clip.right && posY >= clip.top && posY <= clip.bottom;
}
Program: 181285
Project: 181285
Buggy source:
void onInputQueueCreated(InputQueue queue);

Fixed version (ground truth):
/** 
 * Called when the given InputQueue is now associated with the thread making this call, so it can start receiving events from it.
 */
void onInputQueueCreated(InputQueue queue);
Program: 181286
Project: 181286
Buggy source:
void onInputQueueDestroyed(InputQueue queue);

Fixed version (ground truth):
/** 
 * Called when the given InputQueue is no longer associated with the thread and thus not dispatching events.
 */
void onInputQueueDestroyed(InputQueue queue);
Program: 181287
Project: 181287
Buggy source:
/** 
 * <p>Generate the layout parameters for the popup window.</p>
 * @param token the window token used to bind the popup's window
 * @return the layout parameters to pass to the window manager
 */
private WindowManager.LayoutParams createPopupLayout(IBinder token){
  WindowManager.LayoutParams p=new WindowManager.LayoutParams();
  p.gravity=Gravity.LEFT | Gravity.TOP;
  p.width=mLastWidth=mWidth;
  p.height=mLastHeight=mHeight;
  if (mBackground != null) {
    p.format=mBackground.getOpacity();
  }
 else {
    p.format=PixelFormat.TRANSLUCENT;
  }
  p.flags=computeFlags(p.flags);
  p.type=WindowManager.LayoutParams.TYPE_APPLICATION_PANEL;
  p.token=token;
  p.softInputMode=mSoftInputMode;
  p.setTitle("String_Node_Str" + Integer.toHexString(hashCode()));
  return p;
}

Fixed version (ground truth):
/** 
 * <p>Generate the layout parameters for the popup window.</p>
 * @param token the window token used to bind the popup's window
 * @return the layout parameters to pass to the window manager
 */
private WindowManager.LayoutParams createPopupLayout(IBinder token){
  WindowManager.LayoutParams p=new WindowManager.LayoutParams();
  p.gravity=Gravity.LEFT | Gravity.TOP;
  p.width=mLastWidth=mWidth;
  p.height=mLastHeight=mHeight;
  if (mBackground != null) {
    p.format=mBackground.getOpacity();
  }
 else {
    p.format=PixelFormat.TRANSLUCENT;
  }
  p.flags=computeFlags(p.flags);
  p.type=mWindowLayoutType;
  p.token=token;
  p.softInputMode=mSoftInputMode;
  p.setTitle("String_Node_Str" + Integer.toHexString(hashCode()));
  return p;
}
Program: 181288
Project: 181288
Buggy source:
public HandleView(CursorController controller,int pos){
  super(TextView.this.mContext);
  mController=controller;
  mContainer=new PopupWindow(TextView.this.mContext,null,com.android.internal.R.attr.textSelectHandleWindowStyle);
  mContainer.setSplitTouchEnabled(true);
  mContainer.setClippingEnabled(false);
  setOrientation(pos);
}

Fixed version (ground truth):
public HandleView(CursorController controller,int pos){
  super(TextView.this.mContext);
  mController=controller;
  mContainer=new PopupWindow(TextView.this.mContext,null,com.android.internal.R.attr.textSelectHandleWindowStyle);
  mContainer.setSplitTouchEnabled(true);
  mContainer.setClippingEnabled(false);
  mContainer.setWindowLayoutType(WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL);
  setOrientation(pos);
}
Program: 181289
Project: 181289
Buggy source:
/** 
 * @deprecated This functionality will be removed in the future; please donot use. Control whether this activity is required to be persistent.  By default activities are not persistent; setting this to true will prevent the system from stopping this activity or its process when running low on resources. <p><em>You should avoid using this method</em>, it has severe negative consequences on how well the system can manage its resources.  A better approach is to implement an application service that you control with {@link Context#startService} and {@link Context#stopService}.
 * @param isPersistent Control whether the current activity must bepersistent, true if so, false for the normal behavior.
 */
@Deprecated public void setPersistent(boolean isPersistent){
  if (mParent == null) {
    try {
      ActivityManagerNative.getDefault().setPersistent(mToken,isPersistent);
    }
 catch (    RemoteException e) {
    }
  }
 else {
    throw new RuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * @deprecated As of {@link android.os.Build.VERSION_CODES#GINGERBREAD}this is a no-op.
 */
@Deprecated public void setPersistent(boolean isPersistent){
}
Program: 181298
Project: 181298
Buggy source:
ProcessRecord(BatteryStatsImpl.Uid.Proc _batteryStats,IApplicationThread _thread,ApplicationInfo _info,String _processName){
  batteryStats=_batteryStats;
  info=_info;
  processName=_processName;
  pkgList.add(_info.packageName);
  thread=_thread;
  maxAdj=ActivityManagerService.EMPTY_APP_ADJ;
  hiddenAdj=ActivityManagerService.HIDDEN_APP_MIN_ADJ;
  curRawAdj=setRawAdj=-100;
  curAdj=setAdj=-100;
  persistent=false;
  removed=false;
  persistentActivities=0;
}

Fixed version (ground truth):
ProcessRecord(BatteryStatsImpl.Uid.Proc _batteryStats,IApplicationThread _thread,ApplicationInfo _info,String _processName){
  batteryStats=_batteryStats;
  info=_info;
  processName=_processName;
  pkgList.add(_info.packageName);
  thread=_thread;
  maxAdj=ActivityManagerService.EMPTY_APP_ADJ;
  hiddenAdj=ActivityManagerService.HIDDEN_APP_MIN_ADJ;
  curRawAdj=setRawAdj=-100;
  curAdj=setAdj=-100;
  persistent=false;
  removed=false;
}
Program: 181299
Project: 181299
Buggy source:
/** 
 * @deprecated This functionality will be removed in the future; please donot use. Control whether this activity is required to be persistent.  By default activities are not persistent; setting this to true will prevent the system from stopping this activity or its process when running low on resources. <p><em>You should avoid using this method</em>, it has severe negative consequences on how well the system can manage its resources.  A better approach is to implement an application service that you control with {@link Context#startService} and {@link Context#stopService}.
 * @param isPersistent Control whether the current activity must bepersistent, true if so, false for the normal behavior.
 */
@Deprecated public void setPersistent(boolean isPersistent){
  if (mParent == null) {
    try {
      ActivityManagerNative.getDefault().setPersistent(mToken,isPersistent);
    }
 catch (    RemoteException e) {
    }
  }
 else {
    throw new RuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * @deprecated As of {@link android.os.Build.VERSION_CODES#GINGERBREAD}this is a no-op.
 */
@Deprecated public void setPersistent(boolean isPersistent){
}
Program: 181308
Project: 181308
Buggy source:
ProcessRecord(BatteryStatsImpl.Uid.Proc _batteryStats,IApplicationThread _thread,ApplicationInfo _info,String _processName){
  batteryStats=_batteryStats;
  info=_info;
  processName=_processName;
  pkgList.add(_info.packageName);
  thread=_thread;
  maxAdj=ActivityManagerService.EMPTY_APP_ADJ;
  hiddenAdj=ActivityManagerService.HIDDEN_APP_MIN_ADJ;
  curRawAdj=setRawAdj=-100;
  curAdj=setAdj=-100;
  persistent=false;
  removed=false;
  persistentActivities=0;
}

Fixed version (ground truth):
ProcessRecord(BatteryStatsImpl.Uid.Proc _batteryStats,IApplicationThread _thread,ApplicationInfo _info,String _processName){
  batteryStats=_batteryStats;
  info=_info;
  processName=_processName;
  pkgList.add(_info.packageName);
  thread=_thread;
  maxAdj=ActivityManagerService.EMPTY_APP_ADJ;
  hiddenAdj=ActivityManagerService.HIDDEN_APP_MIN_ADJ;
  curRawAdj=setRawAdj=-100;
  curAdj=setAdj=-100;
  persistent=false;
  removed=false;
}
Program: 181309
Project: 181309
Buggy source:
public void dump(Printer pw,String prefix){
  super.dumpFront(pw,prefix);
  if (className != null) {
    pw.println(prefix + "String_Node_Str" + className);
  }
  if (permission != null) {
    pw.println(prefix + "String_Node_Str" + permission);
  }
  pw.println(prefix + "String_Node_Str" + processName);
  pw.println(prefix + "String_Node_Str" + taskAffinity);
  pw.println(prefix + "String_Node_Str" + uid+ "String_Node_Str"+ Integer.toHexString(flags)+ "String_Node_Str"+ Integer.toHexString(theme));
  pw.println(prefix + "String_Node_Str" + sourceDir);
  if (!sourceDir.equals(publicSourceDir)) {
    pw.println(prefix + "String_Node_Str" + publicSourceDir);
  }
  if (resourceDirs != null) {
    pw.println(prefix + "String_Node_Str" + resourceDirs);
  }
  pw.println(prefix + "String_Node_Str" + dataDir);
  if (sharedLibraryFiles != null) {
    pw.println(prefix + "String_Node_Str" + sharedLibraryFiles);
  }
  pw.println(prefix + "String_Node_Str" + enabled+ "String_Node_Str"+ targetSdkVersion);
  if (manageSpaceActivityName != null) {
    pw.println(prefix + "String_Node_Str" + manageSpaceActivityName);
  }
  if (descriptionRes != 0) {
    pw.println(prefix + "String_Node_Str" + Integer.toHexString(descriptionRes));
  }
  super.dumpBack(pw,prefix);
}

Fixed version (ground truth):
public void dump(Printer pw,String prefix){
  super.dumpFront(pw,prefix);
  if (className != null) {
    pw.println(prefix + "String_Node_Str" + className);
  }
  if (permission != null) {
    pw.println(prefix + "String_Node_Str" + permission);
  }
  pw.println(prefix + "String_Node_Str" + processName);
  pw.println(prefix + "String_Node_Str" + taskAffinity);
  pw.println(prefix + "String_Node_Str" + uid+ "String_Node_Str"+ Integer.toHexString(flags)+ "String_Node_Str"+ Integer.toHexString(theme));
  pw.println(prefix + "String_Node_Str" + sourceDir);
  if (sourceDir == null) {
    if (publicSourceDir != null) {
      pw.println(prefix + "String_Node_Str" + publicSourceDir);
    }
  }
 else   if (!sourceDir.equals(publicSourceDir)) {
    pw.println(prefix + "String_Node_Str" + publicSourceDir);
  }
  if (resourceDirs != null) {
    pw.println(prefix + "String_Node_Str" + resourceDirs);
  }
  pw.println(prefix + "String_Node_Str" + dataDir);
  if (sharedLibraryFiles != null) {
    pw.println(prefix + "String_Node_Str" + sharedLibraryFiles);
  }
  pw.println(prefix + "String_Node_Str" + enabled+ "String_Node_Str"+ targetSdkVersion);
  if (manageSpaceActivityName != null) {
    pw.println(prefix + "String_Node_Str" + manageSpaceActivityName);
  }
  if (descriptionRes != 0) {
    pw.println(prefix + "String_Node_Str" + Integer.toHexString(descriptionRes));
  }
  super.dumpBack(pw,prefix);
}
Program: 181310
Project: 181310
Buggy source:
public void dump(Printer pw,String prefix){
  super.dumpFront(pw,prefix);
  if (className != null) {
    pw.println(prefix + "String_Node_Str" + className);
  }
  if (permission != null) {
    pw.println(prefix + "String_Node_Str" + permission);
  }
  pw.println(prefix + "String_Node_Str" + processName);
  pw.println(prefix + "String_Node_Str" + taskAffinity);
  pw.println(prefix + "String_Node_Str" + uid+ "String_Node_Str"+ Integer.toHexString(flags)+ "String_Node_Str"+ Integer.toHexString(theme));
  pw.println(prefix + "String_Node_Str" + sourceDir);
  if (!sourceDir.equals(publicSourceDir)) {
    pw.println(prefix + "String_Node_Str" + publicSourceDir);
  }
  if (resourceDirs != null) {
    pw.println(prefix + "String_Node_Str" + resourceDirs);
  }
  pw.println(prefix + "String_Node_Str" + dataDir);
  if (sharedLibraryFiles != null) {
    pw.println(prefix + "String_Node_Str" + sharedLibraryFiles);
  }
  pw.println(prefix + "String_Node_Str" + enabled+ "String_Node_Str"+ targetSdkVersion);
  if (manageSpaceActivityName != null) {
    pw.println(prefix + "String_Node_Str" + manageSpaceActivityName);
  }
  if (descriptionRes != 0) {
    pw.println(prefix + "String_Node_Str" + Integer.toHexString(descriptionRes));
  }
  super.dumpBack(pw,prefix);
}

Fixed version (ground truth):
public void dump(Printer pw,String prefix){
  super.dumpFront(pw,prefix);
  if (className != null) {
    pw.println(prefix + "String_Node_Str" + className);
  }
  if (permission != null) {
    pw.println(prefix + "String_Node_Str" + permission);
  }
  pw.println(prefix + "String_Node_Str" + processName);
  pw.println(prefix + "String_Node_Str" + taskAffinity);
  pw.println(prefix + "String_Node_Str" + uid+ "String_Node_Str"+ Integer.toHexString(flags)+ "String_Node_Str"+ Integer.toHexString(theme));
  pw.println(prefix + "String_Node_Str" + sourceDir);
  if (sourceDir == null) {
    if (publicSourceDir != null) {
      pw.println(prefix + "String_Node_Str" + publicSourceDir);
    }
  }
 else   if (!sourceDir.equals(publicSourceDir)) {
    pw.println(prefix + "String_Node_Str" + publicSourceDir);
  }
  if (resourceDirs != null) {
    pw.println(prefix + "String_Node_Str" + resourceDirs);
  }
  pw.println(prefix + "String_Node_Str" + dataDir);
  if (sharedLibraryFiles != null) {
    pw.println(prefix + "String_Node_Str" + sharedLibraryFiles);
  }
  pw.println(prefix + "String_Node_Str" + enabled+ "String_Node_Str"+ targetSdkVersion);
  if (manageSpaceActivityName != null) {
    pw.println(prefix + "String_Node_Str" + manageSpaceActivityName);
  }
  if (descriptionRes != 0) {
    pw.println(prefix + "String_Node_Str" + Integer.toHexString(descriptionRes));
  }
  super.dumpBack(pw,prefix);
}
Program: 181311
Project: 181311
Buggy source:
public HandleView(CursorController controller,Drawable handle){
  super(TextView.this.mContext);
  mController=controller;
  mDrawable=handle;
  mContainer=new PopupWindow(TextView.this.mContext,null,com.android.internal.R.attr.textSelectHandleWindowStyle);
  mContainer.setSplitTouchEnabled(true);
  mContainer.setClippingEnabled(false);
  mHotspotX=mDrawable.getIntrinsicWidth() * 0.5f;
  mHotspotY=-mDrawable.getIntrinsicHeight() * 0.2f;
}

Fixed version (ground truth):
public HandleView(CursorController controller,Drawable handle){
  super(TextView.this.mContext);
  mController=controller;
  mDrawable=handle;
  mContainer=new PopupWindow(TextView.this.mContext,null,com.android.internal.R.attr.textSelectHandleWindowStyle);
  mContainer.setSplitTouchEnabled(true);
  mContainer.setClippingEnabled(false);
  final int handleWidth=mDrawable.getIntrinsicWidth();
  final int handleHeight=mDrawable.getIntrinsicHeight();
  mHotspotX=handleWidth * 0.5f;
  mHotspotY=-handleHeight * 0.2f;
}
Program: 181312
Project: 181312
Buggy source:
private void moveTo(int x,int y){
  mPositionX=x - TextView.this.mScrollX;
  mPositionY=y - TextView.this.mScrollY;
  if (isPositionInBounds()) {
    if (mContainer.isShowing()) {
      final int[] coords=mTempCoords;
      TextView.this.getLocationInWindow(coords);
      coords[0]+=mPositionX;
      coords[1]+=mPositionY;
      mContainer.update(coords[0],coords[1],mRight - mLeft,mBottom - mTop);
    }
 else {
      show();
    }
  }
 else {
    hide();
  }
}

Fixed version (ground truth):
private void moveTo(int x,int y){
  mPositionX=x - TextView.this.mScrollX;
  mPositionY=y - TextView.this.mScrollY;
  if (isPositionVisible()) {
    int[] coords=null;
    if (mContainer.isShowing()) {
      coords=mTempCoords;
      TextView.this.getLocationInWindow(coords);
      mContainer.update(coords[0] + mPositionX,coords[1] + mPositionY,mRight - mLeft,mBottom - mTop);
    }
 else {
      show();
    }
    if (mIsDragging) {
      if (coords == null) {
        coords=mTempCoords;
        TextView.this.getLocationInWindow(coords);
      }
      if (coords[0] != mLastParentX || coords[1] != mLastParentY) {
        mOffsetX+=coords[0] - mLastParentX;
        mOffsetY+=coords[1] - mLastParentY;
        mLastParentX=coords[0];
        mLastParentY=coords[1];
      }
    }
  }
 else {
    hide();
  }
}
Program: 181313
Project: 181313
Buggy source:
private int getScrollRange(){
  int scrollRange=0;
  if (getChildCount() > 0) {
    View child=getChildAt(0);
    scrollRange=Math.max(0,child.getWidth() - getWidth() - mPaddingLeft- mPaddingRight);
  }
  return scrollRange;
}

Fixed version (ground truth):
private int getScrollRange(){
  int scrollRange=0;
  if (getChildCount() > 0) {
    View child=getChildAt(0);
    scrollRange=Math.max(0,child.getWidth() - (getWidth() - mPaddingLeft - mPaddingRight));
  }
  return scrollRange;
}
Program: 181315
Project: 181315
Buggy source:
private int getScrollRange(){
  int scrollRange=0;
  if (getChildCount() > 0) {
    View child=getChildAt(0);
    scrollRange=Math.max(0,child.getHeight() - getHeight() - mPaddingBottom- mPaddingTop);
  }
  return scrollRange;
}

Fixed version (ground truth):
private int getScrollRange(){
  int scrollRange=0;
  if (getChildCount() > 0) {
    View child=getChildAt(0);
    scrollRange=Math.max(0,child.getHeight() - (getHeight() - mPaddingBottom - mPaddingTop));
  }
  return scrollRange;
}
Program: 181317
Project: 181317
Buggy source:
private int getScrollRange(){
  int scrollRange=0;
  if (getChildCount() > 0) {
    View child=getChildAt(0);
    scrollRange=Math.max(0,child.getWidth() - getWidth() - mPaddingLeft- mPaddingRight);
  }
  return scrollRange;
}

Fixed version (ground truth):
private int getScrollRange(){
  int scrollRange=0;
  if (getChildCount() > 0) {
    View child=getChildAt(0);
    scrollRange=Math.max(0,child.getWidth() - (getWidth() - mPaddingLeft - mPaddingRight));
  }
  return scrollRange;
}
Program: 181319
Project: 181319
Buggy source:
private int getScrollRange(){
  int scrollRange=0;
  if (getChildCount() > 0) {
    View child=getChildAt(0);
    scrollRange=Math.max(0,child.getHeight() - getHeight() - mPaddingBottom- mPaddingTop);
  }
  return scrollRange;
}

Fixed version (ground truth):
private int getScrollRange(){
  int scrollRange=0;
  if (getChildCount() > 0) {
    View child=getChildAt(0);
    scrollRange=Math.max(0,child.getHeight() - (getHeight() - mPaddingBottom - mPaddingTop));
  }
  return scrollRange;
}
Program: 181322
Project: 181322
Buggy source:
@Override public boolean onKeyShortcut(int keyCode,KeyEvent event){
switch (keyCode) {
case KeyEvent.KEYCODE_A:
    if (canSelectAll()) {
      return onTextContextMenuItem(ID_SELECT_ALL);
    }
  break;
case KeyEvent.KEYCODE_X:
if (canCut()) {
  return onTextContextMenuItem(ID_CUT);
}
break;
case KeyEvent.KEYCODE_C:
if (canCopy()) {
return onTextContextMenuItem(ID_COPY);
}
break;
case KeyEvent.KEYCODE_V:
if (canPaste()) {
return onTextContextMenuItem(ID_PASTE);
}
break;
}
return super.onKeyShortcut(keyCode,event);
}

Fixed version (ground truth):
@Override public boolean onKeyShortcut(int keyCode,KeyEvent event){
switch (keyCode) {
case KeyEvent.KEYCODE_A:
    if (canSelectText()) {
      return onTextContextMenuItem(ID_SELECT_ALL);
    }
  break;
case KeyEvent.KEYCODE_X:
if (canCut()) {
  return onTextContextMenuItem(ID_CUT);
}
break;
case KeyEvent.KEYCODE_C:
if (canCopy()) {
return onTextContextMenuItem(ID_COPY);
}
break;
case KeyEvent.KEYCODE_V:
if (canPaste()) {
return onTextContextMenuItem(ID_PASTE);
}
break;
}
return super.onKeyShortcut(keyCode,event);
}
Program: 181323
Project: 181323
Buggy source:
private void prepareCursorControllers(){
  if (mCursorVisible && mLayout != null) {
    if (mInsertionPointCursorController == null) {
      mInsertionPointCursorController=new InsertionPointCursorController();
    }
  }
 else {
    mInsertionPointCursorController=null;
  }
  if (canSelectText() && mLayout != null) {
    if (mSelectionModifierCursorController == null) {
      mSelectionModifierCursorController=new SelectionModifierCursorController();
    }
  }
 else {
    stopTextSelectionMode();
    mSelectionModifierCursorController=null;
  }
}

Fixed version (ground truth):
private void prepareCursorControllers(){
  if (mCursorVisible && mLayout != null) {
    if (mInsertionPointCursorController == null) {
      mInsertionPointCursorController=new InsertionPointCursorController();
    }
  }
 else {
    mInsertionPointCursorController=null;
  }
  if (textCanBeSelected() && mLayout != null) {
    if (mSelectionModifierCursorController == null) {
      mSelectionModifierCursorController=new SelectionModifierCursorController();
    }
  }
 else {
    stopTextSelectionMode();
    mSelectionModifierCursorController=null;
  }
}
Program: 181324
Project: 181324
Buggy source:
private boolean canSelectText(){
  return (mText instanceof Spannable && mMovement != null && mMovement.canSelectArbitrarily());
}

Fixed version (ground truth):
private boolean canSelectText(){
  return textCanBeSelected() && mText.length() != 0;
}
Program: 181327
Project: 181327
Buggy source:
/** 
 * Set the range of numbers allowed for the number picker. The current value will be automatically set to the start. Also provide a mapping for values used to display to the user.
 * @param start the start of the range (inclusive)
 * @param end the end of the range (inclusive)
 * @param displayedValues the values displayed to the user.
 */
public void setRange(int start,int end,String[] displayedValues){
  mDisplayedValues=displayedValues;
  mStart=start;
  mEnd=end;
  mCurrent=start;
  updateView();
}

Fixed version (ground truth):
/** 
 * Set the range of numbers allowed for the number picker. The current value will be automatically set to the start. Also provide a mapping for values used to display to the user.
 * @param start the start of the range (inclusive)
 * @param end the end of the range (inclusive)
 * @param displayedValues the values displayed to the user.
 */
public void setRange(int start,int end,String[] displayedValues){
  mDisplayedValues=displayedValues;
  mStart=start;
  mEnd=end;
  mCurrent=start;
  updateView();
  if (displayedValues != null) {
    mText.setRawInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
  }
}
Program: 181328
Project: 181328
Buggy source:
@Override protected void onAttachedToWindow(){
  super.onAttachedToWindow();
  mTemporaryDetach=false;
  if (mShowErrorAfterAttach) {
    showError();
    mShowErrorAfterAttach=false;
  }
}

Fixed version (ground truth):
@Override protected void onAttachedToWindow(){
  super.onAttachedToWindow();
  mTemporaryDetach=false;
  if (mShowErrorAfterAttach) {
    showError();
    mShowErrorAfterAttach=false;
  }
  final ViewTreeObserver observer=getViewTreeObserver();
  if (observer != null) {
    if (mInsertionPointCursorController != null) {
      observer.addOnTouchModeChangeListener(mInsertionPointCursorController);
    }
    if (mSelectionModifierCursorController != null) {
      observer.addOnTouchModeChangeListener(mSelectionModifierCursorController);
    }
  }
}
Program: 181329
Project: 181329
Buggy source:
@Override protected void onVisibilityChanged(View changedView,int visibility){
  super.onVisibilityChanged(changedView,visibility);
  if (visibility != VISIBLE) {
    hideControllers();
  }
}

Fixed version (ground truth):
@Override protected void onVisibilityChanged(View changedView,int visibility){
  super.onVisibilityChanged(changedView,visibility);
  if (visibility != VISIBLE) {
    hideInsertionPointCursorController();
    if (mSelectionModifierCursorController != null) {
      mSelectionModifierCursorController.hide();
    }
  }
}
Program: 181330
Project: 181330
Buggy source:
private void onTapUpEvent(int prevStart,int prevEnd){
  final int start=getSelectionStart();
  final int end=getSelectionEnd();
  if (start == end) {
    if (start >= prevStart && start < prevEnd) {
      Selection.setSelection((Spannable)mText,prevStart,prevEnd);
      showContextMenu();
      return;
    }
 else {
      stopTextSelectionMode();
      if (mInsertionPointCursorController != null) {
        mInsertionPointCursorController.show();
      }
    }
  }
}

Fixed version (ground truth):
private void onTapUpEvent(int prevStart,int prevEnd){
  final int start=getSelectionStart();
  final int end=getSelectionEnd();
  if (start == end) {
    if (start >= prevStart && start < prevEnd) {
      Selection.setSelection((Spannable)mText,prevStart,prevEnd);
      if (mSelectionModifierCursorController != null && !mSelectionModifierCursorController.isShowing()) {
        mSelectionModifierCursorController.show();
      }
 else {
        showContextMenu();
      }
      return;
    }
 else {
      stopTextSelectionMode();
      if (mInsertionPointCursorController != null) {
        mInsertionPointCursorController.show();
      }
    }
  }
 else   if (hasSelection() && mSelectionModifierCursorController != null) {
    mSelectionModifierCursorController.show();
  }
}
Program: 181331
Project: 181331
Buggy source:
public void show(){
  mIsShowing=true;
  updatePosition();
  mStartHandle.show();
  mEndHandle.show();
  hideInsertionPointCursorController();
}

Fixed version (ground truth):
public void show(){
  mIsShowing=true;
  updatePosition();
  mStartHandle.show();
  mEndHandle.show();
  hideInsertionPointCursorController();
  hideDelayed(DELAY_BEFORE_FADE_OUT);
}
Program: 181332
Project: 181332
Buggy source:
private void hideDelayed(int msec){
  TextView.this.removeCallbacks(mHider);
  TextView.this.postDelayed(mHider,msec);
}

Fixed version (ground truth):
private void hideDelayed(int delay){
  removeCallbacks(mHider);
  postDelayed(mHider,delay);
}
Program: 181333
Project: 181333
Buggy source:
public void updatePosition(){
  final int selectionStart=getSelectionStart();
  final int selectionEnd=getSelectionEnd();
  if ((selectionStart < 0) || (selectionEnd < 0)) {
    Log.w(LOG_TAG,"String_Node_Str");
    hide();
    return;
  }
  boolean oneLineSelection=mLayout.getLineForOffset(selectionStart) == mLayout.getLineForOffset(selectionEnd);
  mStartHandle.positionAtCursor(selectionStart,oneLineSelection);
  mEndHandle.positionAtCursor(selectionEnd,true);
}

Fixed version (ground truth):
public void updatePosition(){
  final int selectionStart=getSelectionStart();
  final int selectionEnd=getSelectionEnd();
  if ((selectionStart < 0) || (selectionEnd < 0)) {
    Log.w(LOG_TAG,"String_Node_Str");
    hide();
    return;
  }
  boolean oneLineSelection=mLayout.getLineForOffset(selectionStart) == mLayout.getLineForOffset(selectionEnd);
  mStartHandle.positionAtCursor(selectionStart,oneLineSelection);
  mEndHandle.positionAtCursor(selectionEnd,true);
  hideDelayed(DELAY_BEFORE_FADE_OUT);
}
Program: 181334
Project: 181334
Buggy source:
public void hide(){
  mStartHandle.hide();
  mEndHandle.hide();
  mIsShowing=false;
}

Fixed version (ground truth):
public void hide(){
  mStartHandle.hide();
  mEndHandle.hide();
  mIsShowing=false;
  removeCallbacks(mHider);
}
Program: 181335
Project: 181335
Buggy source:
@Override public void onWindowFocusChanged(boolean hasWindowFocus){
  super.onWindowFocusChanged(hasWindowFocus);
  if (hasWindowFocus) {
    if (mBlink != null) {
      mBlink.uncancel();
      if (isFocused()) {
        mShowCursor=SystemClock.uptimeMillis();
        makeBlink();
      }
    }
  }
 else {
    if (mBlink != null) {
      mBlink.cancel();
    }
    onEndBatchEdit();
    if (mInputContentType != null) {
      mInputContentType.enterDown=false;
    }
    hideControllers();
  }
  startStopMarquee(hasWindowFocus);
}

Fixed version (ground truth):
@Override public void onWindowFocusChanged(boolean hasWindowFocus){
  super.onWindowFocusChanged(hasWindowFocus);
  if (hasWindowFocus) {
    if (mBlink != null) {
      mBlink.uncancel();
      if (isFocused()) {
        mShowCursor=SystemClock.uptimeMillis();
        makeBlink();
      }
    }
  }
 else {
    if (mBlink != null) {
      mBlink.cancel();
    }
    onEndBatchEdit();
    if (mInputContentType != null) {
      mInputContentType.enterDown=false;
    }
    hideInsertionPointCursorController();
    if (mSelectionModifierCursorController != null) {
      mSelectionModifierCursorController.hide();
    }
  }
  startStopMarquee(hasWindowFocus);
}
Program: 181336
Project: 181336
Buggy source:
@Override protected void onDetachedFromWindow(){
  super.onDetachedFromWindow();
  if (mPreDrawState != PREDRAW_NOT_REGISTERED) {
    final ViewTreeObserver observer=getViewTreeObserver();
    if (observer != null) {
      observer.removeOnPreDrawListener(this);
      mPreDrawState=PREDRAW_NOT_REGISTERED;
    }
  }
  if (mError != null) {
    hideError();
  }
  hideControllers();
}

Fixed version (ground truth):
@Override protected void onDetachedFromWindow(){
  super.onDetachedFromWindow();
  final ViewTreeObserver observer=getViewTreeObserver();
  if (observer != null) {
    if (mPreDrawState != PREDRAW_NOT_REGISTERED) {
      observer.removeOnPreDrawListener(this);
      mPreDrawState=PREDRAW_NOT_REGISTERED;
    }
    if (mInsertionPointCursorController != null) {
      observer.removeOnTouchModeChangeListener(mInsertionPointCursorController);
    }
    if (mSelectionModifierCursorController != null) {
      observer.removeOnTouchModeChangeListener(mSelectionModifierCursorController);
    }
  }
  if (mError != null) {
    hideError();
  }
  hideControllers();
}
Program: 181337
Project: 181337
Buggy source:
public HandleView(CursorController controller,Drawable handle){
  super(TextView.this.mContext);
  mController=controller;
  mDrawable=handle;
  mContainer=new PopupWindow(TextView.this.mContext,null,com.android.internal.R.attr.textSelectHandleWindowStyle);
  mContainer.setSplitTouchEnabled(true);
  mContainer.setClippingEnabled(false);
  mContainer.setLayoutInScreenEnabled(true);
}

Fixed version (ground truth):
public HandleView(CursorController controller,Drawable handle){
  super(TextView.this.mContext);
  mController=controller;
  mDrawable=handle;
  mContainer=new PopupWindow(TextView.this.mContext,null,com.android.internal.R.attr.textSelectHandleWindowStyle);
  mContainer.setSplitTouchEnabled(true);
  mContainer.setClippingEnabled(false);
  mHotspotX=mDrawable.getIntrinsicWidth() * 0.5f;
  mHotspotY=-mDrawable.getIntrinsicHeight() * 0.2f;
}
Program: 181338
Project: 181338
Buggy source:
private void moveTo(int x,int y){
  mPositionX=x - TextView.this.mScrollX;
  mPositionY=y - TextView.this.mScrollY;
  if (isPositionInBounds()) {
    if (mContainer.isShowing()) {
      final int[] coords=mTempCoords;
      TextView.this.getLocationOnScreen(coords);
      coords[0]+=mPositionX;
      coords[1]+=mPositionY;
      mContainer.update(coords[0],coords[1],mRight - mLeft,mBottom - mTop);
    }
 else {
      show();
    }
  }
 else {
    hide();
  }
}

Fixed version (ground truth):
private void moveTo(int x,int y){
  mPositionX=x - TextView.this.mScrollX;
  mPositionY=y - TextView.this.mScrollY;
  if (isPositionInBounds()) {
    if (mContainer.isShowing()) {
      final int[] coords=mTempCoords;
      TextView.this.getLocationInWindow(coords);
      coords[0]+=mPositionX;
      coords[1]+=mPositionY;
      mContainer.update(coords[0],coords[1],mRight - mLeft,mBottom - mTop);
    }
 else {
      show();
    }
  }
 else {
    hide();
  }
}
Program: 181340
Project: 181340
Buggy source:
@Override public boolean onKeyShortcut(int keyCode,KeyEvent event){
switch (keyCode) {
case KeyEvent.KEYCODE_A:
    if (canSelectAll()) {
      return onTextContextMenuItem(ID_SELECT_ALL);
    }
  break;
case KeyEvent.KEYCODE_X:
if (canCut()) {
  return onTextContextMenuItem(ID_CUT);
}
break;
case KeyEvent.KEYCODE_C:
if (canCopy()) {
return onTextContextMenuItem(ID_COPY);
}
break;
case KeyEvent.KEYCODE_V:
if (canPaste()) {
return onTextContextMenuItem(ID_PASTE);
}
break;
}
return super.onKeyShortcut(keyCode,event);
}

Fixed version (ground truth):
@Override public boolean onKeyShortcut(int keyCode,KeyEvent event){
switch (keyCode) {
case KeyEvent.KEYCODE_A:
    if (canSelectText()) {
      return onTextContextMenuItem(ID_SELECT_ALL);
    }
  break;
case KeyEvent.KEYCODE_X:
if (canCut()) {
  return onTextContextMenuItem(ID_CUT);
}
break;
case KeyEvent.KEYCODE_C:
if (canCopy()) {
return onTextContextMenuItem(ID_COPY);
}
break;
case KeyEvent.KEYCODE_V:
if (canPaste()) {
return onTextContextMenuItem(ID_PASTE);
}
break;
}
return super.onKeyShortcut(keyCode,event);
}
Program: 181341
Project: 181341
Buggy source:
private void prepareCursorControllers(){
  if (mCursorVisible && mLayout != null) {
    if (mInsertionPointCursorController == null) {
      mInsertionPointCursorController=new InsertionPointCursorController();
    }
  }
 else {
    mInsertionPointCursorController=null;
  }
  if (canSelectText() && mLayout != null) {
    if (mSelectionModifierCursorController == null) {
      mSelectionModifierCursorController=new SelectionModifierCursorController();
    }
  }
 else {
    stopTextSelectionMode();
    mSelectionModifierCursorController=null;
  }
}

Fixed version (ground truth):
private void prepareCursorControllers(){
  if (mCursorVisible && mLayout != null) {
    if (mInsertionPointCursorController == null) {
      mInsertionPointCursorController=new InsertionPointCursorController();
    }
  }
 else {
    mInsertionPointCursorController=null;
  }
  if (textCanBeSelected() && mLayout != null) {
    if (mSelectionModifierCursorController == null) {
      mSelectionModifierCursorController=new SelectionModifierCursorController();
    }
  }
 else {
    stopTextSelectionMode();
    mSelectionModifierCursorController=null;
  }
}
Program: 181342
Project: 181342
Buggy source:
private boolean canSelectText(){
  return (mText instanceof Spannable && mMovement != null && mMovement.canSelectArbitrarily());
}

Fixed version (ground truth):
private boolean canSelectText(){
  return textCanBeSelected() && mText.length() != 0;
}
Program: 181344
Project: 181344
Buggy source:
/** 
 * {@inheritDoc} 
 */
public void animatingWindowLw(WindowState win,WindowManager.LayoutParams attrs){
  if (mTopFullscreenOpaqueWindowState == null && win.isVisibleOrBehindKeyguardLw()) {
    if ((attrs.flags & FLAG_FORCE_NOT_FULLSCREEN) != 0) {
      mForceStatusBar=true;
    }
    if (attrs.type >= FIRST_APPLICATION_WINDOW && attrs.type <= LAST_APPLICATION_WINDOW && win.fillsScreenLw(mW,mH,false,false)) {
      if (DEBUG_LAYOUT)       Log.v(TAG,"String_Node_Str" + win);
      mTopFullscreenOpaqueWindowState=win;
      if ((attrs.flags & FLAG_SHOW_WHEN_LOCKED) != 0) {
        if (localLOGV)         Log.v(TAG,"String_Node_Str" + win);
        mHideLockScreen=true;
      }
      if ((attrs.flags & FLAG_DISMISS_KEYGUARD) != 0) {
        if (localLOGV)         Log.v(TAG,"String_Node_Str" + win);
        mDismissKeyguard=true;
      }
      if ((attrs.flags & FLAG_ALLOW_LOCK_WHILE_SCREEN_ON) != 0) {
        mAllowLockscreenWhenOn=true;
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public void animatingWindowLw(WindowState win,WindowManager.LayoutParams attrs){
  if (mTopFullscreenOpaqueWindowState == null && win.isVisibleOrBehindKeyguardLw()) {
    if ((attrs.flags & FLAG_FORCE_NOT_FULLSCREEN) != 0) {
      mForceStatusBar=true;
    }
    if (attrs.type >= FIRST_APPLICATION_WINDOW && attrs.type <= LAST_APPLICATION_WINDOW && attrs.x == 0 && attrs.y == 0 && attrs.width == WindowManager.LayoutParams.MATCH_PARENT && attrs.height == WindowManager.LayoutParams.MATCH_PARENT) {
      if (DEBUG_LAYOUT)       Log.v(TAG,"String_Node_Str" + win);
      mTopFullscreenOpaqueWindowState=win;
      if ((attrs.flags & FLAG_SHOW_WHEN_LOCKED) != 0) {
        if (localLOGV)         Log.v(TAG,"String_Node_Str" + win);
        mHideLockScreen=true;
      }
      if ((attrs.flags & FLAG_DISMISS_KEYGUARD) != 0) {
        if (localLOGV)         Log.v(TAG,"String_Node_Str" + win);
        mDismissKeyguard=true;
      }
      if ((attrs.flags & FLAG_ALLOW_LOCK_WHILE_SCREEN_ON) != 0) {
        mAllowLockscreenWhenOn=true;
      }
    }
  }
}
Program: 181345
Project: 181345
Buggy source:
private void printRestoreSets(RestoreSet[] sets){
  for (  RestoreSet s : sets) {
    System.out.println("String_Node_Str" + Long.toHexString(s.token) + "String_Node_Str"+ s.name);
  }
}

Fixed version (ground truth):
private void printRestoreSets(RestoreSet[] sets){
  if (sets == null || sets.length == 0) {
    System.out.println("String_Node_Str");
    return;
  }
  for (  RestoreSet s : sets) {
    System.out.println("String_Node_Str" + Long.toHexString(s.token) + "String_Node_Str"+ s.name);
  }
}
Program: 181346
Project: 181346
Buggy source:
/** 
 * {@inheritDoc} 
 */
public void animatingWindowLw(WindowState win,WindowManager.LayoutParams attrs){
  if (mTopFullscreenOpaqueWindowState == null && win.isVisibleOrBehindKeyguardLw()) {
    if ((attrs.flags & FLAG_FORCE_NOT_FULLSCREEN) != 0) {
      mForceStatusBar=true;
    }
    if (attrs.type >= FIRST_APPLICATION_WINDOW && attrs.type <= LAST_APPLICATION_WINDOW && win.fillsScreenLw(mW,mH,false,false)) {
      if (DEBUG_LAYOUT)       Log.v(TAG,"String_Node_Str" + win);
      mTopFullscreenOpaqueWindowState=win;
      if ((attrs.flags & FLAG_SHOW_WHEN_LOCKED) != 0) {
        if (localLOGV)         Log.v(TAG,"String_Node_Str" + win);
        mHideLockScreen=true;
      }
      if ((attrs.flags & FLAG_DISMISS_KEYGUARD) != 0) {
        if (localLOGV)         Log.v(TAG,"String_Node_Str" + win);
        mDismissKeyguard=true;
      }
      if ((attrs.flags & FLAG_ALLOW_LOCK_WHILE_SCREEN_ON) != 0) {
        mAllowLockscreenWhenOn=true;
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public void animatingWindowLw(WindowState win,WindowManager.LayoutParams attrs){
  if (mTopFullscreenOpaqueWindowState == null && win.isVisibleOrBehindKeyguardLw()) {
    if ((attrs.flags & FLAG_FORCE_NOT_FULLSCREEN) != 0) {
      mForceStatusBar=true;
    }
    if (attrs.type >= FIRST_APPLICATION_WINDOW && attrs.type <= LAST_APPLICATION_WINDOW && attrs.x == 0 && attrs.y == 0 && attrs.width == WindowManager.LayoutParams.MATCH_PARENT && attrs.height == WindowManager.LayoutParams.MATCH_PARENT) {
      if (DEBUG_LAYOUT)       Log.v(TAG,"String_Node_Str" + win);
      mTopFullscreenOpaqueWindowState=win;
      if ((attrs.flags & FLAG_SHOW_WHEN_LOCKED) != 0) {
        if (localLOGV)         Log.v(TAG,"String_Node_Str" + win);
        mHideLockScreen=true;
      }
      if ((attrs.flags & FLAG_DISMISS_KEYGUARD) != 0) {
        if (localLOGV)         Log.v(TAG,"String_Node_Str" + win);
        mDismissKeyguard=true;
      }
      if ((attrs.flags & FLAG_ALLOW_LOCK_WHILE_SCREEN_ON) != 0) {
        mAllowLockscreenWhenOn=true;
      }
    }
  }
}
Program: 181347
Project: 181347
Buggy source:
private void printRestoreSets(RestoreSet[] sets){
  for (  RestoreSet s : sets) {
    System.out.println("String_Node_Str" + Long.toHexString(s.token) + "String_Node_Str"+ s.name);
  }
}

Fixed version (ground truth):
private void printRestoreSets(RestoreSet[] sets){
  if (sets == null || sets.length == 0) {
    System.out.println("String_Node_Str");
    return;
  }
  for (  RestoreSet s : sets) {
    System.out.println("String_Node_Str" + Long.toHexString(s.token) + "String_Node_Str"+ s.name);
  }
}
Program: 181348
Project: 181348
Buggy source:
@Override public void onChanged(SipAudioCall call){
synchronized (SipPhone.class) {
    Call.State newState=getCallStateFrom(call);
    if (mState == newState)     return;
    if (newState == Call.State.INCOMING) {
      setState(mOwner.getState());
    }
 else {
      if (mOwner == ringingCall) {
        if (ringingCall.getState() == Call.State.WAITING) {
          try {
            switchHoldingAndActive();
          }
 catch (          CallStateException e) {
            onCallEnded(DisconnectCause.LOCAL);
            return;
          }
        }
        foregroundCall.switchWith(ringingCall);
      }
      if (newState == Call.State.ACTIVE)       call.startAudio();
      setState(newState);
    }
    mOwner.onConnectionStateChanged(SipConnection.this);
    Log.v(LOG_TAG,"String_Node_Str" + mPeer.getUriString() + "String_Node_Str"+ mState+ "String_Node_Str"+ getPhone());
  }
}

Fixed version (ground truth):
@Override public void onChanged(SipAudioCall call){
synchronized (SipPhone.class) {
    Call.State newState=getCallStateFrom(call);
    if (mState == newState)     return;
    if (newState == Call.State.INCOMING) {
      setState(mOwner.getState());
    }
 else {
      if (mOwner == ringingCall) {
        if (ringingCall.getState() == Call.State.WAITING) {
          try {
            switchHoldingAndActive();
          }
 catch (          CallStateException e) {
            onCallEnded(DisconnectCause.LOCAL);
            return;
          }
        }
        foregroundCall.switchWith(ringingCall);
      }
      setState(newState);
    }
    mOwner.onConnectionStateChanged(SipConnection.this);
    Log.v(LOG_TAG,"String_Node_Str" + mPeer.getUriString() + "String_Node_Str"+ mState+ "String_Node_Str"+ getPhone());
  }
}
Program: 181351
Project: 181351
Buggy source:
void skipCurrentReceiverLocked(ProcessRecord app){
  boolean reschedule=false;
  BroadcastRecord r=app.curReceiver;
  if (r != null) {
    logBroadcastReceiverDiscard(r);
    finishReceiverLocked(r.receiver,r.resultCode,r.resultData,r.resultExtras,r.resultAbort,true);
    reschedule=true;
  }
  r=mPendingBroadcast;
  if (r != null && r.curApp == app) {
    if (DEBUG_BROADCAST)     Slog.v(TAG,"String_Node_Str" + r);
    logBroadcastReceiverDiscard(r);
    finishReceiverLocked(r.receiver,r.resultCode,r.resultData,r.resultExtras,r.resultAbort,true);
    reschedule=true;
  }
  if (reschedule) {
    scheduleBroadcastsLocked();
  }
}

Fixed version (ground truth):
void skipCurrentReceiverLocked(ProcessRecord app){
  boolean reschedule=false;
  BroadcastRecord r=app.curReceiver;
  if (r != null) {
    logBroadcastReceiverDiscardLocked(r);
    finishReceiverLocked(r.receiver,r.resultCode,r.resultData,r.resultExtras,r.resultAbort,true);
    reschedule=true;
  }
  r=mPendingBroadcast;
  if (r != null && r.curApp == app) {
    if (DEBUG_BROADCAST)     Slog.v(TAG,"String_Node_Str" + r);
    logBroadcastReceiverDiscardLocked(r);
    finishReceiverLocked(r.receiver,r.resultCode,r.resultData,r.resultExtras,r.resultAbort,true);
    reschedule=true;
  }
  if (reschedule) {
    scheduleBroadcastsLocked();
  }
}
Program: 181352
Project: 181352
Buggy source:
static void performReceive(ProcessRecord app,IIntentReceiver receiver,Intent intent,int resultCode,String data,Bundle extras,boolean ordered,boolean sticky) throws RemoteException {
  if (app != null && app.thread != null) {
    app.thread.scheduleRegisteredReceiver(receiver,intent,resultCode,data,extras,ordered,sticky);
  }
 else {
    receiver.performReceive(intent,resultCode,data,extras,ordered,sticky);
  }
}

Fixed version (ground truth):
public void performReceive(Intent intent,int resultCode,String data,Bundle extras,boolean ordered,boolean sticky){
  mHandler.post(new Runnable(){
    public void run(){
synchronized (ActivityManagerService.this) {
        mDidUpdate=true;
      }
      systemReady(goingCallback);
    }
  }
);
}
Program: 181355
Project: 181355
Buggy source:
@SmallTest public void testRecurrenceSet2() throws Exception {
  String recurrence="String_Node_Str" + "String_Node_Str";
  verifyPopulateContentValues(recurrence,"String_Node_Str",null,null,null,1250812800000L,null,"String_Node_Str",1);
}

Fixed version (ground truth):
@SmallTest public void testRecurrenceSet2() throws Exception {
  String recurrence="String_Node_Str" + "String_Node_Str";
  verifyPopulateContentValues(recurrence,"String_Node_Str",null,null,null,1250812800000L,"String_Node_Str","String_Node_Str",1);
}
Program: 181356
Project: 181356
Buggy source:
@SmallTest public void testRecurrenceSet1() throws Exception {
  String recurrence="String_Node_Str" + "String_Node_Str";
  verifyPopulateContentValues(recurrence,"String_Node_Str",null,null,null,1250812800000L,null,"String_Node_Str",1);
}

Fixed version (ground truth):
@SmallTest public void testRecurrenceSet1() throws Exception {
  String recurrence="String_Node_Str" + "String_Node_Str";
  verifyPopulateContentValues(recurrence,"String_Node_Str",null,null,null,1250812800000L,"String_Node_Str","String_Node_Str",1);
}
Program: 181358
Project: 181358
Buggy source:
@SmallTest public void testRecurrenceSet2() throws Exception {
  String recurrence="String_Node_Str" + "String_Node_Str";
  verifyPopulateContentValues(recurrence,"String_Node_Str",null,null,null,1250812800000L,null,"String_Node_Str",1);
}

Fixed version (ground truth):
@SmallTest public void testRecurrenceSet2() throws Exception {
  String recurrence="String_Node_Str" + "String_Node_Str";
  verifyPopulateContentValues(recurrence,"String_Node_Str",null,null,null,1250812800000L,"String_Node_Str","String_Node_Str",1);
}
Program: 181359
Project: 181359
Buggy source:
@SmallTest public void testRecurrenceSet1() throws Exception {
  String recurrence="String_Node_Str" + "String_Node_Str";
  verifyPopulateContentValues(recurrence,"String_Node_Str",null,null,null,1250812800000L,null,"String_Node_Str",1);
}

Fixed version (ground truth):
@SmallTest public void testRecurrenceSet1() throws Exception {
  String recurrence="String_Node_Str" + "String_Node_Str";
  verifyPopulateContentValues(recurrence,"String_Node_Str",null,null,null,1250812800000L,"String_Node_Str","String_Node_Str",1);
}