nus-yam/ex-repair huggingface dataset:
Program: 45574
Project: 45574
Buggy source:
private void startWallpaper(){
  final Intent pickWallpaper=new Intent(Intent.ACTION_SET_WALLPAPER);
  Intent chooser=Intent.createChooser(pickWallpaper,getText(R.string.chooser_wallpaper));
  WallpaperManager wm=(WallpaperManager)getSystemService(Context.WALLPAPER_SERVICE);
  WallpaperInfo wi=wm.getWallpaperInfo();
  if (wi != null && wi.getSettingsActivity() != null) {
    LabeledIntent li=new LabeledIntent(getPackageName(),R.string.configure_wallpaper,0);
    li.setClassName(wi.getPackageName(),wi.getSettingsActivity());
    chooser.putExtra(Intent.EXTRA_INITIAL_INTENTS,new Intent[]{li});
  }
  startActivityForResult(chooser,REQUEST_PICK_WALLPAPER);
}

Fixed version (ground truth):
private void startWallpaper(){
  closeAllApps(true);
  final Intent pickWallpaper=new Intent(Intent.ACTION_SET_WALLPAPER);
  Intent chooser=Intent.createChooser(pickWallpaper,getText(R.string.chooser_wallpaper));
  WallpaperManager wm=(WallpaperManager)getSystemService(Context.WALLPAPER_SERVICE);
  WallpaperInfo wi=wm.getWallpaperInfo();
  if (wi != null && wi.getSettingsActivity() != null) {
    LabeledIntent li=new LabeledIntent(getPackageName(),R.string.configure_wallpaper,0);
    li.setClassName(wi.getPackageName(),wi.getSettingsActivity());
    chooser.putExtra(Intent.EXTRA_INITIAL_INTENTS,new Intent[]{li});
  }
  startActivityForResult(chooser,REQUEST_PICK_WALLPAPER);
}
Program: 45575
Project: 45575
Buggy source:
private void addItems(){
  showAddDialog(mMenuAddInfo);
}

Fixed version (ground truth):
private void addItems(){
  closeAllApps(true);
  showAddDialog(mMenuAddInfo);
}
Program: 45576
Project: 45576
Buggy source:
private void startWallpaper(){
  final Intent pickWallpaper=new Intent(Intent.ACTION_SET_WALLPAPER);
  Intent chooser=Intent.createChooser(pickWallpaper,getText(R.string.chooser_wallpaper));
  WallpaperManager wm=(WallpaperManager)getSystemService(Context.WALLPAPER_SERVICE);
  WallpaperInfo wi=wm.getWallpaperInfo();
  if (wi != null && wi.getSettingsActivity() != null) {
    LabeledIntent li=new LabeledIntent(getPackageName(),R.string.configure_wallpaper,0);
    li.setClassName(wi.getPackageName(),wi.getSettingsActivity());
    chooser.putExtra(Intent.EXTRA_INITIAL_INTENTS,new Intent[]{li});
  }
  startActivityForResult(chooser,REQUEST_PICK_WALLPAPER);
}

Fixed version (ground truth):
private void startWallpaper(){
  closeAllApps(true);
  final Intent pickWallpaper=new Intent(Intent.ACTION_SET_WALLPAPER);
  Intent chooser=Intent.createChooser(pickWallpaper,getText(R.string.chooser_wallpaper));
  WallpaperManager wm=(WallpaperManager)getSystemService(Context.WALLPAPER_SERVICE);
  WallpaperInfo wi=wm.getWallpaperInfo();
  if (wi != null && wi.getSettingsActivity() != null) {
    LabeledIntent li=new LabeledIntent(getPackageName(),R.string.configure_wallpaper,0);
    li.setClassName(wi.getPackageName(),wi.getSettingsActivity());
    chooser.putExtra(Intent.EXTRA_INITIAL_INTENTS,new Intent[]{li});
  }
  startActivityForResult(chooser,REQUEST_PICK_WALLPAPER);
}
Program: 45577
Project: 45577
Buggy source:
private void addItems(){
  showAddDialog(mMenuAddInfo);
}

Fixed version (ground truth):
private void addItems(){
  closeAllApps(true);
  showAddDialog(mMenuAddInfo);
}
Program: 45578
Project: 45578
Buggy source:
/** 
 * Implementation of the method from LauncherModel.Callbacks.
 */
void bindFolders(HashMap<Long,FolderInfo> folders){
  mFolders.putAll(folders);
}

Fixed version (ground truth):
/** 
 * Implementation of the method from LauncherModel.Callbacks.
 */
public void bindFolders(HashMap<Long,FolderInfo> folders){
  mFolders.clear();
  mFolders.putAll(folders);
}
Program: 45581
Project: 45581
Buggy source:
@Override public void surfaceDestroyed(SurfaceHolder holder){
  super.surfaceDestroyed(holder);
}

Fixed version (ground truth):
@Override public void surfaceDestroyed(SurfaceHolder holder){
  super.surfaceDestroyed(holder);
  mRollo.mHasSurface=false;
}
Program: 45582
Project: 45582
Buggy source:
private void setApps(ArrayList<ApplicationInfo> list){
  final int count=list != null ? list.size() : 0;
  int allocCount=count;
  if (allocCount < 1) {
    allocCount=1;
  }
  mIcons=new Allocation[count];
  mIconIds=new int[allocCount];
  mAllocIconIds=Allocation.createSized(mRS,Element.USER_I32(mRS),allocCount);
  mLabels=new Allocation[count];
  mLabelIds=new int[allocCount];
  mAllocLabelIds=Allocation.createSized(mRS,Element.USER_I32(mRS),allocCount);
  Element ie8888=Element.RGBA_8888(mRS);
  Utilities.BubbleText bubble=new Utilities.BubbleText(getContext());
  for (int i=0; i < count; i++) {
    uploadAppIcon(i,list.get(i));
  }
  mState.iconCount=count;
  saveAppsList();
}

Fixed version (ground truth):
private void setApps(ArrayList<ApplicationInfo> list){
  final int count=list != null ? list.size() : 0;
  int allocCount=count;
  if (allocCount < 1) {
    allocCount=1;
  }
  mIcons=new Allocation[count];
  mIconIds=new int[allocCount];
  mAllocIconIds=Allocation.createSized(mRS,Element.USER_I32(mRS),allocCount);
  mLabels=new Allocation[count];
  mLabelIds=new int[allocCount];
  mAllocLabelIds=Allocation.createSized(mRS,Element.USER_I32(mRS),allocCount);
  Element ie8888=Element.RGBA_8888(mRS);
  Utilities.BubbleText bubble=new Utilities.BubbleText(getContext());
  mState.iconCount=count;
  uploadApps(list);
  saveAppsList();
}
Program: 45583
Project: 45583
Buggy source:
@Override public void surfaceChanged(SurfaceHolder holder,int format,int w,int h){
  Log.d(TAG,"String_Node_Str");
  long startTime=SystemClock.uptimeMillis();
  super.surfaceChanged(holder,format,w,h);
  if (mRS == null) {
    mRS=createRenderScript(true);
    mRollo=new RolloRS();
    mRollo.init(getResources(),w,h);
    if (mAllAppsList != null) {
      mRollo.setApps(mAllAppsList);
      Log.d(TAG,"String_Node_Str");
    }
  }
  Resources res=getContext().getResources();
  int barHeight=(int)res.getDimension(R.dimen.button_bar_height);
  long endTime=SystemClock.uptimeMillis();
  Log.d(TAG,"String_Node_Str" + (endTime - startTime) + "String_Node_Str");
}

Fixed version (ground truth):
@Override public void surfaceChanged(SurfaceHolder holder,int format,int w,int h){
  Log.d(TAG,"String_Node_Str");
  long startTime=SystemClock.uptimeMillis();
  super.surfaceChanged(holder,format,w,h);
  if (mRS == null) {
    mRS=createRenderScript(true);
    mRollo=new RolloRS();
    mRollo.mHasSurface=true;
    mRollo.init(getResources(),w,h);
    if (mAllAppsList != null) {
      mRollo.setApps(mAllAppsList);
      Log.d(TAG,"String_Node_Str");
    }
  }
 else {
    mRollo.mHasSurface=true;
    mRollo.dirtyCheck();
  }
  Resources res=getContext().getResources();
  int barHeight=(int)res.getDimension(R.dimen.button_bar_height);
  long endTime=SystemClock.uptimeMillis();
  Log.d(TAG,"String_Node_Str" + (endTime - startTime) + "String_Node_Str");
}
Program: 45584
Project: 45584
Buggy source:
/** 
 * Handle the allocations for the new app.  Make sure you call saveAppsList when done.
 */
private void addApp(int index,ApplicationInfo item){
  final int count=mState.iconCount - index;
  final int dest=index + 1;
  System.arraycopy(mIcons,index,mIcons,dest,count);
  System.arraycopy(mIconIds,index,mIconIds,dest,count);
  System.arraycopy(mLabels,index,mLabels,dest,count);
  System.arraycopy(mLabelIds,index,mLabelIds,dest,count);
  uploadAppIcon(index,item);
}

Fixed version (ground truth):
/** 
 * Handle the allocations for the new app.  Make sure you call saveAppsList when done.
 */
private void addApp(int index,ApplicationInfo item){
  final int count=mState.iconCount - index;
  final int dest=index + 1;
  System.arraycopy(mIcons,index,mIcons,dest,count);
  System.arraycopy(mIconIds,index,mIconIds,dest,count);
  System.arraycopy(mLabels,index,mLabels,dest,count);
  System.arraycopy(mLabelIds,index,mLabelIds,dest,count);
  if (mHasSurface) {
    uploadAppIcon(index,item);
  }
 else {
    mAppsDirty=true;
  }
}
Program: 45585
Project: 45585
Buggy source:
private void startWallpaper(){
  final Intent pickWallpaper=new Intent(Intent.ACTION_SET_WALLPAPER);
  Intent chooser=Intent.createChooser(pickWallpaper,getText(R.string.chooser_wallpaper));
  WallpaperManager wm=(WallpaperManager)getSystemService(Context.WALLPAPER_SERVICE);
  WallpaperInfo wi=wm.getWallpaperInfo();
  if (wi != null && wi.getSettingsActivity() != null) {
    LabeledIntent li=new LabeledIntent(getPackageName(),R.string.configure_wallpaper,0);
    li.setClassName(wi.getPackageName(),wi.getSettingsActivity());
    chooser.putExtra(Intent.EXTRA_INITIAL_INTENTS,new Intent[]{li});
  }
  startActivityForResult(chooser,REQUEST_PICK_WALLPAPER);
}

Fixed version (ground truth):
private void startWallpaper(){
  closeAllApps(true);
  final Intent pickWallpaper=new Intent(Intent.ACTION_SET_WALLPAPER);
  Intent chooser=Intent.createChooser(pickWallpaper,getText(R.string.chooser_wallpaper));
  WallpaperManager wm=(WallpaperManager)getSystemService(Context.WALLPAPER_SERVICE);
  WallpaperInfo wi=wm.getWallpaperInfo();
  if (wi != null && wi.getSettingsActivity() != null) {
    LabeledIntent li=new LabeledIntent(getPackageName(),R.string.configure_wallpaper,0);
    li.setClassName(wi.getPackageName(),wi.getSettingsActivity());
    chooser.putExtra(Intent.EXTRA_INITIAL_INTENTS,new Intent[]{li});
  }
  startActivityForResult(chooser,REQUEST_PICK_WALLPAPER);
}
Program: 45586
Project: 45586
Buggy source:
private void addItems(){
  showAddDialog(mMenuAddInfo);
}

Fixed version (ground truth):
private void addItems(){
  closeAllApps(true);
  showAddDialog(mMenuAddInfo);
}
Program: 45587
Project: 45587
Buggy source:
@Override public void surfaceDestroyed(SurfaceHolder holder){
  super.surfaceDestroyed(holder);
}

Fixed version (ground truth):
@Override public void surfaceDestroyed(SurfaceHolder holder){
  super.surfaceDestroyed(holder);
  mRollo.mHasSurface=false;
}
Program: 45588
Project: 45588
Buggy source:
private void setApps(ArrayList<ApplicationInfo> list){
  final int count=list != null ? list.size() : 0;
  int allocCount=count;
  if (allocCount < 1) {
    allocCount=1;
  }
  mIcons=new Allocation[count];
  mIconIds=new int[allocCount];
  mAllocIconIds=Allocation.createSized(mRS,Element.USER_I32(mRS),allocCount);
  mLabels=new Allocation[count];
  mLabelIds=new int[allocCount];
  mAllocLabelIds=Allocation.createSized(mRS,Element.USER_I32(mRS),allocCount);
  Element ie8888=Element.RGBA_8888(mRS);
  Utilities.BubbleText bubble=new Utilities.BubbleText(getContext());
  for (int i=0; i < count; i++) {
    uploadAppIcon(i,list.get(i));
  }
  mState.iconCount=count;
  saveAppsList();
}

Fixed version (ground truth):
private void setApps(ArrayList<ApplicationInfo> list){
  final int count=list != null ? list.size() : 0;
  int allocCount=count;
  if (allocCount < 1) {
    allocCount=1;
  }
  mIcons=new Allocation[count];
  mIconIds=new int[allocCount];
  mAllocIconIds=Allocation.createSized(mRS,Element.USER_I32(mRS),allocCount);
  mLabels=new Allocation[count];
  mLabelIds=new int[allocCount];
  mAllocLabelIds=Allocation.createSized(mRS,Element.USER_I32(mRS),allocCount);
  Element ie8888=Element.RGBA_8888(mRS);
  Utilities.BubbleText bubble=new Utilities.BubbleText(getContext());
  mState.iconCount=count;
  uploadApps(list);
  saveAppsList();
}
Program: 45589
Project: 45589
Buggy source:
@Override public void surfaceChanged(SurfaceHolder holder,int format,int w,int h){
  Log.d(TAG,"String_Node_Str");
  long startTime=SystemClock.uptimeMillis();
  super.surfaceChanged(holder,format,w,h);
  if (mRS == null) {
    mRS=createRenderScript(true);
    mRollo=new RolloRS();
    mRollo.init(getResources(),w,h);
    if (mAllAppsList != null) {
      mRollo.setApps(mAllAppsList);
      Log.d(TAG,"String_Node_Str");
    }
  }
  Resources res=getContext().getResources();
  int barHeight=(int)res.getDimension(R.dimen.button_bar_height);
  long endTime=SystemClock.uptimeMillis();
  Log.d(TAG,"String_Node_Str" + (endTime - startTime) + "String_Node_Str");
}

Fixed version (ground truth):
@Override public void surfaceChanged(SurfaceHolder holder,int format,int w,int h){
  Log.d(TAG,"String_Node_Str");
  long startTime=SystemClock.uptimeMillis();
  super.surfaceChanged(holder,format,w,h);
  if (mRS == null) {
    mRS=createRenderScript(true);
    mRollo=new RolloRS();
    mRollo.mHasSurface=true;
    mRollo.init(getResources(),w,h);
    if (mAllAppsList != null) {
      mRollo.setApps(mAllAppsList);
      Log.d(TAG,"String_Node_Str");
    }
  }
 else {
    mRollo.mHasSurface=true;
    mRollo.dirtyCheck();
  }
  Resources res=getContext().getResources();
  int barHeight=(int)res.getDimension(R.dimen.button_bar_height);
  long endTime=SystemClock.uptimeMillis();
  Log.d(TAG,"String_Node_Str" + (endTime - startTime) + "String_Node_Str");
}
Program: 45590
Project: 45590
Buggy source:
/** 
 * Handle the allocations for the new app.  Make sure you call saveAppsList when done.
 */
private void addApp(int index,ApplicationInfo item){
  final int count=mState.iconCount - index;
  final int dest=index + 1;
  System.arraycopy(mIcons,index,mIcons,dest,count);
  System.arraycopy(mIconIds,index,mIconIds,dest,count);
  System.arraycopy(mLabels,index,mLabels,dest,count);
  System.arraycopy(mLabelIds,index,mLabelIds,dest,count);
  uploadAppIcon(index,item);
}

Fixed version (ground truth):
/** 
 * Handle the allocations for the new app.  Make sure you call saveAppsList when done.
 */
private void addApp(int index,ApplicationInfo item){
  final int count=mState.iconCount - index;
  final int dest=index + 1;
  System.arraycopy(mIcons,index,mIcons,dest,count);
  System.arraycopy(mIconIds,index,mIconIds,dest,count);
  System.arraycopy(mLabels,index,mLabels,dest,count);
  System.arraycopy(mLabelIds,index,mLabelIds,dest,count);
  if (mHasSurface) {
    uploadAppIcon(index,item);
  }
 else {
    mAppsDirty=true;
  }
}
Program: 45591
Project: 45591
Buggy source:
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int widthSize=resolveSize(mBitmap.getWidth(),widthMeasureSpec);
  int heightSize=resolveSize(mBitmap.getHeight(),heightMeasureSpec);
  setMeasuredDimension(widthSize,heightSize);
}

Fixed version (ground truth):
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  setMeasuredDimension(mBitmap.getWidth(),mBitmap.getHeight());
}
Program: 45592
Project: 45592
Buggy source:
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int widthSize=resolveSize(mBitmap.getWidth(),widthMeasureSpec);
  int heightSize=resolveSize(mBitmap.getHeight(),heightMeasureSpec);
  setMeasuredDimension(widthSize,heightSize);
}

Fixed version (ground truth):
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  setMeasuredDimension(mBitmap.getWidth(),mBitmap.getHeight());
}
Program: 45593
Project: 45593
Buggy source:
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int widthSize=resolveSize(mBitmap.getWidth(),widthMeasureSpec);
  int heightSize=resolveSize(mBitmap.getHeight(),heightMeasureSpec);
  setMeasuredDimension(widthSize,heightSize);
}

Fixed version (ground truth):
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  setMeasuredDimension(mBitmap.getWidth(),mBitmap.getHeight());
}
Program: 45594
Project: 45594
Buggy source:
@Override public void surfaceDestroyed(SurfaceHolder holder){
  super.surfaceDestroyed(holder);
}

Fixed version (ground truth):
@Override public void surfaceDestroyed(SurfaceHolder holder){
  super.surfaceDestroyed(holder);
  mRollo.mHasSurface=false;
}
Program: 45595
Project: 45595
Buggy source:
private void setApps(ArrayList<ApplicationInfo> list){
  final int count=list != null ? list.size() : 0;
  int allocCount=count;
  if (allocCount < 1) {
    allocCount=1;
  }
  mIcons=new Allocation[count];
  mIconIds=new int[allocCount];
  mAllocIconIds=Allocation.createSized(mRS,Element.USER_I32(mRS),allocCount);
  mLabels=new Allocation[count];
  mLabelIds=new int[allocCount];
  mAllocLabelIds=Allocation.createSized(mRS,Element.USER_I32(mRS),allocCount);
  Element ie8888=Element.RGBA_8888(mRS);
  Utilities.BubbleText bubble=new Utilities.BubbleText(getContext());
  for (int i=0; i < count; i++) {
    uploadAppIcon(i,list.get(i));
  }
  mState.iconCount=count;
  saveAppsList();
}

Fixed version (ground truth):
private void setApps(ArrayList<ApplicationInfo> list){
  final int count=list != null ? list.size() : 0;
  int allocCount=count;
  if (allocCount < 1) {
    allocCount=1;
  }
  mIcons=new Allocation[count];
  mIconIds=new int[allocCount];
  mAllocIconIds=Allocation.createSized(mRS,Element.USER_I32(mRS),allocCount);
  mLabels=new Allocation[count];
  mLabelIds=new int[allocCount];
  mAllocLabelIds=Allocation.createSized(mRS,Element.USER_I32(mRS),allocCount);
  Element ie8888=Element.RGBA_8888(mRS);
  Utilities.BubbleText bubble=new Utilities.BubbleText(getContext());
  mState.iconCount=count;
  uploadApps(list);
  saveAppsList();
}
Program: 45596
Project: 45596
Buggy source:
@Override public void surfaceChanged(SurfaceHolder holder,int format,int w,int h){
  Log.d(TAG,"String_Node_Str");
  long startTime=SystemClock.uptimeMillis();
  super.surfaceChanged(holder,format,w,h);
  if (mRS == null) {
    mRS=createRenderScript(true);
    mRollo=new RolloRS();
    mRollo.init(getResources(),w,h);
    if (mAllAppsList != null) {
      mRollo.setApps(mAllAppsList);
      Log.d(TAG,"String_Node_Str");
    }
  }
  Resources res=getContext().getResources();
  int barHeight=(int)res.getDimension(R.dimen.button_bar_height);
  long endTime=SystemClock.uptimeMillis();
  Log.d(TAG,"String_Node_Str" + (endTime - startTime) + "String_Node_Str");
}

Fixed version (ground truth):
@Override public void surfaceChanged(SurfaceHolder holder,int format,int w,int h){
  Log.d(TAG,"String_Node_Str");
  long startTime=SystemClock.uptimeMillis();
  super.surfaceChanged(holder,format,w,h);
  if (mRS == null) {
    mRS=createRenderScript(true);
    mRollo=new RolloRS();
    mRollo.mHasSurface=true;
    mRollo.init(getResources(),w,h);
    if (mAllAppsList != null) {
      mRollo.setApps(mAllAppsList);
      Log.d(TAG,"String_Node_Str");
    }
  }
 else {
    mRollo.mHasSurface=true;
    mRollo.dirtyCheck();
  }
  Resources res=getContext().getResources();
  int barHeight=(int)res.getDimension(R.dimen.button_bar_height);
  long endTime=SystemClock.uptimeMillis();
  Log.d(TAG,"String_Node_Str" + (endTime - startTime) + "String_Node_Str");
}
Program: 45597
Project: 45597
Buggy source:
/** 
 * Handle the allocations for the new app.  Make sure you call saveAppsList when done.
 */
private void addApp(int index,ApplicationInfo item){
  final int count=mState.iconCount - index;
  final int dest=index + 1;
  System.arraycopy(mIcons,index,mIcons,dest,count);
  System.arraycopy(mIconIds,index,mIconIds,dest,count);
  System.arraycopy(mLabels,index,mLabels,dest,count);
  System.arraycopy(mLabelIds,index,mLabelIds,dest,count);
  uploadAppIcon(index,item);
}

Fixed version (ground truth):
/** 
 * Handle the allocations for the new app.  Make sure you call saveAppsList when done.
 */
private void addApp(int index,ApplicationInfo item){
  final int count=mState.iconCount - index;
  final int dest=index + 1;
  System.arraycopy(mIcons,index,mIcons,dest,count);
  System.arraycopy(mIconIds,index,mIconIds,dest,count);
  System.arraycopy(mLabels,index,mLabels,dest,count);
  System.arraycopy(mLabelIds,index,mLabelIds,dest,count);
  if (mHasSurface) {
    uploadAppIcon(index,item);
  }
 else {
    mAppsDirty=true;
  }
}
Program: 45598
Project: 45598
Buggy source:
@Override public void surfaceDestroyed(SurfaceHolder holder){
  super.surfaceDestroyed(holder);
}

Fixed version (ground truth):
@Override public void surfaceDestroyed(SurfaceHolder holder){
  super.surfaceDestroyed(holder);
  mRollo.mHasSurface=false;
}
Program: 45599
Project: 45599
Buggy source:
private void setApps(ArrayList<ApplicationInfo> list){
  final int count=list != null ? list.size() : 0;
  int allocCount=count;
  if (allocCount < 1) {
    allocCount=1;
  }
  mIcons=new Allocation[count];
  mIconIds=new int[allocCount];
  mAllocIconIds=Allocation.createSized(mRS,Element.USER_I32(mRS),allocCount);
  mLabels=new Allocation[count];
  mLabelIds=new int[allocCount];
  mAllocLabelIds=Allocation.createSized(mRS,Element.USER_I32(mRS),allocCount);
  Element ie8888=Element.RGBA_8888(mRS);
  Utilities.BubbleText bubble=new Utilities.BubbleText(getContext());
  for (int i=0; i < count; i++) {
    uploadAppIcon(i,list.get(i));
  }
  mState.iconCount=count;
  saveAppsList();
}

Fixed version (ground truth):
private void setApps(ArrayList<ApplicationInfo> list){
  final int count=list != null ? list.size() : 0;
  int allocCount=count;
  if (allocCount < 1) {
    allocCount=1;
  }
  mIcons=new Allocation[count];
  mIconIds=new int[allocCount];
  mAllocIconIds=Allocation.createSized(mRS,Element.USER_I32(mRS),allocCount);
  mLabels=new Allocation[count];
  mLabelIds=new int[allocCount];
  mAllocLabelIds=Allocation.createSized(mRS,Element.USER_I32(mRS),allocCount);
  Element ie8888=Element.RGBA_8888(mRS);
  Utilities.BubbleText bubble=new Utilities.BubbleText(getContext());
  mState.iconCount=count;
  uploadApps(list);
  saveAppsList();
}
Program: 45600
Project: 45600
Buggy source:
@Override public void surfaceChanged(SurfaceHolder holder,int format,int w,int h){
  Log.d(TAG,"String_Node_Str");
  long startTime=SystemClock.uptimeMillis();
  super.surfaceChanged(holder,format,w,h);
  if (mRS == null) {
    mRS=createRenderScript(true);
    mRollo=new RolloRS();
    mRollo.init(getResources(),w,h);
    if (mAllAppsList != null) {
      mRollo.setApps(mAllAppsList);
      Log.d(TAG,"String_Node_Str");
    }
  }
  Resources res=getContext().getResources();
  int barHeight=(int)res.getDimension(R.dimen.button_bar_height);
  long endTime=SystemClock.uptimeMillis();
  Log.d(TAG,"String_Node_Str" + (endTime - startTime) + "String_Node_Str");
}

Fixed version (ground truth):
@Override public void surfaceChanged(SurfaceHolder holder,int format,int w,int h){
  Log.d(TAG,"String_Node_Str");
  long startTime=SystemClock.uptimeMillis();
  super.surfaceChanged(holder,format,w,h);
  if (mRS == null) {
    mRS=createRenderScript(true);
    mRollo=new RolloRS();
    mRollo.mHasSurface=true;
    mRollo.init(getResources(),w,h);
    if (mAllAppsList != null) {
      mRollo.setApps(mAllAppsList);
      Log.d(TAG,"String_Node_Str");
    }
  }
 else {
    mRollo.mHasSurface=true;
    mRollo.dirtyCheck();
  }
  Resources res=getContext().getResources();
  int barHeight=(int)res.getDimension(R.dimen.button_bar_height);
  long endTime=SystemClock.uptimeMillis();
  Log.d(TAG,"String_Node_Str" + (endTime - startTime) + "String_Node_Str");
}
Program: 45601
Project: 45601
Buggy source:
/** 
 * Handle the allocations for the new app.  Make sure you call saveAppsList when done.
 */
private void addApp(int index,ApplicationInfo item){
  final int count=mState.iconCount - index;
  final int dest=index + 1;
  System.arraycopy(mIcons,index,mIcons,dest,count);
  System.arraycopy(mIconIds,index,mIconIds,dest,count);
  System.arraycopy(mLabels,index,mLabels,dest,count);
  System.arraycopy(mLabelIds,index,mLabelIds,dest,count);
  uploadAppIcon(index,item);
}

Fixed version (ground truth):
/** 
 * Handle the allocations for the new app.  Make sure you call saveAppsList when done.
 */
private void addApp(int index,ApplicationInfo item){
  final int count=mState.iconCount - index;
  final int dest=index + 1;
  System.arraycopy(mIcons,index,mIcons,dest,count);
  System.arraycopy(mIconIds,index,mIconIds,dest,count);
  System.arraycopy(mLabels,index,mLabels,dest,count);
  System.arraycopy(mLabelIds,index,mLabelIds,dest,count);
  if (mHasSurface) {
    uploadAppIcon(index,item);
  }
 else {
    mAppsDirty=true;
  }
}
Program: 45602
Project: 45602
Buggy source:
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int widthSize=resolveSize(mBitmap.getWidth(),widthMeasureSpec);
  int heightSize=resolveSize(mBitmap.getHeight(),heightMeasureSpec);
  setMeasuredDimension(widthSize,heightSize);
}

Fixed version (ground truth):
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  setMeasuredDimension(mBitmap.getWidth(),mBitmap.getHeight());
}
Program: 45603
Project: 45603
Buggy source:
/** 
 * Update the title and icon.  Don't keep a reference to the context!
 */
private static void updateTitleAndIcon(ResolveInfo info,ApplicationInfo application,Context context,Utilities.BubbleText bubble){
  final PackageManager packageManager=context.getPackageManager();
  application.title=info.loadLabel(packageManager);
  if (application.title == null) {
    application.title=info.activityInfo.name;
  }
  application.iconBitmap=Utilities.createAllAppsBitmap(info.activityInfo.loadIcon(packageManager),context);
  application.filtered=true;
  application.titleBitmap=bubble.createTextBitmap(application.title.toString());
}

Fixed version (ground truth):
/** 
 * Update the title and icon.  Don't keep a reference to the context!
 */
private static void updateTitleAndIcon(ResolveInfo info,ApplicationInfo application,Context context,Utilities.BubbleText bubble){
  final PackageManager packageManager=context.getPackageManager();
  application.title=info.loadLabel(packageManager);
  if (application.title == null) {
    application.title=info.activityInfo.name;
  }
  application.iconBitmap=Utilities.createAllAppsBitmap(info.activityInfo.loadIcon(packageManager),context);
  application.titleBitmap=bubble.createTextBitmap(application.title.toString());
}
Program: 45604
Project: 45604
Buggy source:
public ApplicationsAdapter(Context context,ArrayList<ApplicationInfo> apps){
  super(context,0,apps);
  mInflater=LayoutInflater.from(context);
}

Fixed version (ground truth):
public ApplicationsAdapter(Context context,ArrayList<ApplicationInfo> apps){
  super(context,0,apps);
  mPackageManager=context.getPackageManager();
  mInflater=LayoutInflater.from(context);
}
Program: 45605
Project: 45605
Buggy source:
@Override public View getView(int position,View convertView,ViewGroup parent){
  final ApplicationInfo info=getItem(position);
  if (convertView == null) {
    convertView=mInflater.inflate(R.layout.application_boxed,parent,false);
  }
  if (!info.filtered) {
    info.icon=Utilities.createIconThumbnail(info.icon,getContext());
    info.filtered=true;
  }
  final TextView textView=(TextView)convertView;
  textView.setCompoundDrawablesWithIntrinsicBounds(null,info.icon,null,null);
  textView.setText(info.title);
  return convertView;
}

Fixed version (ground truth):
@Override public View getView(int position,View convertView,ViewGroup parent){
  final ApplicationInfo info=getItem(position);
  if (convertView == null) {
    convertView=mInflater.inflate(R.layout.application_boxed,parent,false);
  }
  if (info.icon == null) {
    info.icon=AppInfoCache.getIconDrawable(mPackageManager,info);
  }
  if (!info.filtered) {
    info.icon=Utilities.createIconThumbnail(info.icon,getContext());
    info.filtered=true;
  }
  final TextView textView=(TextView)convertView;
  textView.setCompoundDrawablesWithIntrinsicBounds(null,info.icon,null,null);
  textView.setText(info.title);
  return convertView;
}
Program: 45606
Project: 45606
Buggy source:
/** 
 * Update the title and icon.  Don't keep a reference to the context!
 */
private static void updateTitleAndIcon(ResolveInfo info,ApplicationInfo application,Context context,Utilities.BubbleText bubble){
  final PackageManager packageManager=context.getPackageManager();
  application.title=info.loadLabel(packageManager);
  if (application.title == null) {
    application.title=info.activityInfo.name;
  }
  application.iconBitmap=Utilities.createAllAppsBitmap(info.activityInfo.loadIcon(packageManager),context);
  application.filtered=true;
  application.titleBitmap=bubble.createTextBitmap(application.title.toString());
}

Fixed version (ground truth):
/** 
 * Update the title and icon.  Don't keep a reference to the context!
 */
private static void updateTitleAndIcon(ResolveInfo info,ApplicationInfo application,Context context,Utilities.BubbleText bubble){
  final PackageManager packageManager=context.getPackageManager();
  application.title=info.loadLabel(packageManager);
  if (application.title == null) {
    application.title=info.activityInfo.name;
  }
  application.iconBitmap=Utilities.createAllAppsBitmap(info.activityInfo.loadIcon(packageManager),context);
  application.titleBitmap=bubble.createTextBitmap(application.title.toString());
}
Program: 45607
Project: 45607
Buggy source:
public ApplicationsAdapter(Context context,ArrayList<ApplicationInfo> apps){
  super(context,0,apps);
  mInflater=LayoutInflater.from(context);
}

Fixed version (ground truth):
public ApplicationsAdapter(Context context,ArrayList<ApplicationInfo> apps){
  super(context,0,apps);
  mPackageManager=context.getPackageManager();
  mInflater=LayoutInflater.from(context);
}
Program: 45608
Project: 45608
Buggy source:
@Override public View getView(int position,View convertView,ViewGroup parent){
  final ApplicationInfo info=getItem(position);
  if (convertView == null) {
    convertView=mInflater.inflate(R.layout.application_boxed,parent,false);
  }
  if (!info.filtered) {
    info.icon=Utilities.createIconThumbnail(info.icon,getContext());
    info.filtered=true;
  }
  final TextView textView=(TextView)convertView;
  textView.setCompoundDrawablesWithIntrinsicBounds(null,info.icon,null,null);
  textView.setText(info.title);
  return convertView;
}

Fixed version (ground truth):
@Override public View getView(int position,View convertView,ViewGroup parent){
  final ApplicationInfo info=getItem(position);
  if (convertView == null) {
    convertView=mInflater.inflate(R.layout.application_boxed,parent,false);
  }
  if (info.icon == null) {
    info.icon=AppInfoCache.getIconDrawable(mPackageManager,info);
  }
  if (!info.filtered) {
    info.icon=Utilities.createIconThumbnail(info.icon,getContext());
    info.filtered=true;
  }
  final TextView textView=(TextView)convertView;
  textView.setCompoundDrawablesWithIntrinsicBounds(null,info.icon,null,null);
  textView.setText(info.title);
  return convertView;
}
Program: 45609
Project: 45609
Buggy source:
/** 
 * Update the title and icon.  Don't keep a reference to the context!
 */
private static void updateTitleAndIcon(ResolveInfo info,ApplicationInfo application,Context context,Utilities.BubbleText bubble){
  final PackageManager packageManager=context.getPackageManager();
  application.title=info.loadLabel(packageManager);
  if (application.title == null) {
    application.title=info.activityInfo.name;
  }
  application.iconBitmap=Utilities.createAllAppsBitmap(info.activityInfo.loadIcon(packageManager),context);
  application.filtered=true;
  application.titleBitmap=bubble.createTextBitmap(application.title.toString());
}

Fixed version (ground truth):
/** 
 * Update the title and icon.  Don't keep a reference to the context!
 */
private static void updateTitleAndIcon(ResolveInfo info,ApplicationInfo application,Context context,Utilities.BubbleText bubble){
  final PackageManager packageManager=context.getPackageManager();
  application.title=info.loadLabel(packageManager);
  if (application.title == null) {
    application.title=info.activityInfo.name;
  }
  application.iconBitmap=Utilities.createAllAppsBitmap(info.activityInfo.loadIcon(packageManager),context);
  application.titleBitmap=bubble.createTextBitmap(application.title.toString());
}
Program: 45610
Project: 45610
Buggy source:
public ApplicationsAdapter(Context context,ArrayList<ApplicationInfo> apps){
  super(context,0,apps);
  mInflater=LayoutInflater.from(context);
}

Fixed version (ground truth):
public ApplicationsAdapter(Context context,ArrayList<ApplicationInfo> apps){
  super(context,0,apps);
  mPackageManager=context.getPackageManager();
  mInflater=LayoutInflater.from(context);
}
Program: 45611
Project: 45611
Buggy source:
@Override public View getView(int position,View convertView,ViewGroup parent){
  final ApplicationInfo info=getItem(position);
  if (convertView == null) {
    convertView=mInflater.inflate(R.layout.application_boxed,parent,false);
  }
  if (!info.filtered) {
    info.icon=Utilities.createIconThumbnail(info.icon,getContext());
    info.filtered=true;
  }
  final TextView textView=(TextView)convertView;
  textView.setCompoundDrawablesWithIntrinsicBounds(null,info.icon,null,null);
  textView.setText(info.title);
  return convertView;
}

Fixed version (ground truth):
@Override public View getView(int position,View convertView,ViewGroup parent){
  final ApplicationInfo info=getItem(position);
  if (convertView == null) {
    convertView=mInflater.inflate(R.layout.application_boxed,parent,false);
  }
  if (info.icon == null) {
    info.icon=AppInfoCache.getIconDrawable(mPackageManager,info);
  }
  if (!info.filtered) {
    info.icon=Utilities.createIconThumbnail(info.icon,getContext());
    info.filtered=true;
  }
  final TextView textView=(TextView)convertView;
  textView.setCompoundDrawablesWithIntrinsicBounds(null,info.icon,null,null);
  textView.setText(info.title);
  return convertView;
}
Program: 45612
Project: 45612
Buggy source:
/** 
 * Update the title and icon.  Don't keep a reference to the context!
 */
private static void updateTitleAndIcon(ResolveInfo info,ApplicationInfo application,Context context,Utilities.BubbleText bubble){
  final PackageManager packageManager=context.getPackageManager();
  application.title=info.loadLabel(packageManager);
  if (application.title == null) {
    application.title=info.activityInfo.name;
  }
  application.iconBitmap=Utilities.createAllAppsBitmap(info.activityInfo.loadIcon(packageManager),context);
  application.filtered=true;
  application.titleBitmap=bubble.createTextBitmap(application.title.toString());
}

Fixed version (ground truth):
/** 
 * Update the title and icon.  Don't keep a reference to the context!
 */
private static void updateTitleAndIcon(ResolveInfo info,ApplicationInfo application,Context context,Utilities.BubbleText bubble){
  final PackageManager packageManager=context.getPackageManager();
  application.title=info.loadLabel(packageManager);
  if (application.title == null) {
    application.title=info.activityInfo.name;
  }
  application.iconBitmap=Utilities.createAllAppsBitmap(info.activityInfo.loadIcon(packageManager),context);
  application.titleBitmap=bubble.createTextBitmap(application.title.toString());
}
Program: 45613
Project: 45613
Buggy source:
public ApplicationsAdapter(Context context,ArrayList<ApplicationInfo> apps){
  super(context,0,apps);
  mInflater=LayoutInflater.from(context);
}

Fixed version (ground truth):
public ApplicationsAdapter(Context context,ArrayList<ApplicationInfo> apps){
  super(context,0,apps);
  mPackageManager=context.getPackageManager();
  mInflater=LayoutInflater.from(context);
}
Program: 45614
Project: 45614
Buggy source:
@Override public View getView(int position,View convertView,ViewGroup parent){
  final ApplicationInfo info=getItem(position);
  if (convertView == null) {
    convertView=mInflater.inflate(R.layout.application_boxed,parent,false);
  }
  if (!info.filtered) {
    info.icon=Utilities.createIconThumbnail(info.icon,getContext());
    info.filtered=true;
  }
  final TextView textView=(TextView)convertView;
  textView.setCompoundDrawablesWithIntrinsicBounds(null,info.icon,null,null);
  textView.setText(info.title);
  return convertView;
}

Fixed version (ground truth):
@Override public View getView(int position,View convertView,ViewGroup parent){
  final ApplicationInfo info=getItem(position);
  if (convertView == null) {
    convertView=mInflater.inflate(R.layout.application_boxed,parent,false);
  }
  if (info.icon == null) {
    info.icon=AppInfoCache.getIconDrawable(mPackageManager,info);
  }
  if (!info.filtered) {
    info.icon=Utilities.createIconThumbnail(info.icon,getContext());
    info.filtered=true;
  }
  final TextView textView=(TextView)convertView;
  textView.setCompoundDrawablesWithIntrinsicBounds(null,info.icon,null,null);
  textView.setText(info.title);
  return convertView;
}
Program: 45616
Project: 45616
Buggy source:
@Override protected void onFocusChanged(boolean gainFocus,int direction,Rect previouslyFocusedRect){
  super.onFocusChanged(gainFocus,direction,previouslyFocusedRect);
  if (gainFocus) {
    if (!mArrowNavigation && mRollo.mState.iconCount > 0) {
      mArrowNavigation=true;
      mRollo.selectIcon(Math.round(mRollo.mMessageProc.mPosX) * Defines.COLUMNS_PER_PAGE);
      mRollo.mState.save();
    }
  }
 else {
    if (mArrowNavigation) {
      mRollo.clearSelectedIcon();
      mRollo.mState.save();
      mArrowNavigation=false;
    }
  }
}

Fixed version (ground truth):
@Override protected void onFocusChanged(boolean gainFocus,int direction,Rect previouslyFocusedRect){
  super.onFocusChanged(gainFocus,direction,previouslyFocusedRect);
  if (!isVisible()) {
    return;
  }
  if (gainFocus) {
    if (!mArrowNavigation && mRollo.mState.iconCount > 0) {
      mArrowNavigation=true;
      mRollo.selectIcon(Math.round(mRollo.mMessageProc.mPosX) * Defines.COLUMNS_PER_PAGE);
      mRollo.mState.save();
    }
  }
 else {
    if (mArrowNavigation) {
      mRollo.clearSelectedIcon();
      mRollo.mState.save();
      mArrowNavigation=false;
    }
  }
}
Program: 45618
Project: 45618
Buggy source:
@Override protected void onFocusChanged(boolean gainFocus,int direction,Rect previouslyFocusedRect){
  super.onFocusChanged(gainFocus,direction,previouslyFocusedRect);
  if (gainFocus) {
    if (!mArrowNavigation && mRollo.mState.iconCount > 0) {
      mArrowNavigation=true;
      mRollo.selectIcon(Math.round(mRollo.mMessageProc.mPosX) * Defines.COLUMNS_PER_PAGE);
      mRollo.mState.save();
    }
  }
 else {
    if (mArrowNavigation) {
      mRollo.clearSelectedIcon();
      mRollo.mState.save();
      mArrowNavigation=false;
    }
  }
}

Fixed version (ground truth):
@Override protected void onFocusChanged(boolean gainFocus,int direction,Rect previouslyFocusedRect){
  super.onFocusChanged(gainFocus,direction,previouslyFocusedRect);
  if (!isVisible()) {
    return;
  }
  if (gainFocus) {
    if (!mArrowNavigation && mRollo.mState.iconCount > 0) {
      mArrowNavigation=true;
      mRollo.selectIcon(Math.round(mRollo.mMessageProc.mPosX) * Defines.COLUMNS_PER_PAGE);
      mRollo.mState.save();
    }
  }
 else {
    if (mArrowNavigation) {
      mRollo.clearSelectedIcon();
      mRollo.mState.save();
      mArrowNavigation=false;
    }
  }
}
Program: 45620
Project: 45620
Buggy source:
@Override protected void onFocusChanged(boolean gainFocus,int direction,Rect previouslyFocusedRect){
  super.onFocusChanged(gainFocus,direction,previouslyFocusedRect);
  if (gainFocus) {
    if (!mArrowNavigation && mRollo.mState.iconCount > 0) {
      mArrowNavigation=true;
      mRollo.selectIcon(Math.round(mRollo.mMessageProc.mPosX) * Defines.COLUMNS_PER_PAGE);
      mRollo.mState.save();
    }
  }
 else {
    if (mArrowNavigation) {
      mRollo.clearSelectedIcon();
      mRollo.mState.save();
      mArrowNavigation=false;
    }
  }
}

Fixed version (ground truth):
@Override protected void onFocusChanged(boolean gainFocus,int direction,Rect previouslyFocusedRect){
  super.onFocusChanged(gainFocus,direction,previouslyFocusedRect);
  if (!isVisible()) {
    return;
  }
  if (gainFocus) {
    if (!mArrowNavigation && mRollo.mState.iconCount > 0) {
      mArrowNavigation=true;
      mRollo.selectIcon(Math.round(mRollo.mMessageProc.mPosX) * Defines.COLUMNS_PER_PAGE);
      mRollo.mState.save();
    }
  }
 else {
    if (mArrowNavigation) {
      mRollo.clearSelectedIcon();
      mRollo.mState.save();
      mArrowNavigation=false;
    }
  }
}
Program: 45622
Project: 45622
Buggy source:
@Override protected void onFocusChanged(boolean gainFocus,int direction,Rect previouslyFocusedRect){
  super.onFocusChanged(gainFocus,direction,previouslyFocusedRect);
  if (gainFocus) {
    if (!mArrowNavigation && mRollo.mState.iconCount > 0) {
      mArrowNavigation=true;
      mRollo.selectIcon(Math.round(mRollo.mMessageProc.mPosX) * Defines.COLUMNS_PER_PAGE);
      mRollo.mState.save();
    }
  }
 else {
    if (mArrowNavigation) {
      mRollo.clearSelectedIcon();
      mRollo.mState.save();
      mArrowNavigation=false;
    }
  }
}

Fixed version (ground truth):
@Override protected void onFocusChanged(boolean gainFocus,int direction,Rect previouslyFocusedRect){
  super.onFocusChanged(gainFocus,direction,previouslyFocusedRect);
  if (!isVisible()) {
    return;
  }
  if (gainFocus) {
    if (!mArrowNavigation && mRollo.mState.iconCount > 0) {
      mArrowNavigation=true;
      mRollo.selectIcon(Math.round(mRollo.mMessageProc.mPosX) * Defines.COLUMNS_PER_PAGE);
      mRollo.mState.save();
    }
  }
 else {
    if (mArrowNavigation) {
      mRollo.clearSelectedIcon();
      mRollo.mState.save();
      mArrowNavigation=false;
    }
  }
}
Program: 45623
Project: 45623
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mModel=((LauncherApplication)getApplication()).setLauncher(this);
  mInflater=getLayoutInflater();
  mAppWidgetManager=AppWidgetManager.getInstance(this);
  mAppWidgetHost=new LauncherAppWidgetHost(this,APPWIDGET_HOST_ID);
  mAppWidgetHost.startListening();
  if (PROFILE_STARTUP) {
    android.os.Debug.startMethodTracing("String_Node_Str");
  }
  checkForLocaleChange();
  setWallpaperDimension();
  setContentView(R.layout.launcher);
  setupViews();
  lockAllApps();
  mSavedState=savedInstanceState;
  restoreState(mSavedState);
  if (PROFILE_STARTUP) {
    android.os.Debug.stopMethodTracing();
  }
  if (!mRestoring) {
    mModel.startLoader(this,true);
  }
  mDefaultKeySsb=new SpannableStringBuilder();
  Selection.setSelection(mDefaultKeySsb,0);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mModel=((LauncherApplication)getApplication()).setLauncher(this);
  mInflater=getLayoutInflater();
  mAppWidgetManager=AppWidgetManager.getInstance(this);
  mAppWidgetHost=new LauncherAppWidgetHost(this,APPWIDGET_HOST_ID);
  mAppWidgetHost.startListening();
  if (PROFILE_STARTUP) {
    android.os.Debug.startMethodTracing("String_Node_Str");
  }
  checkForLocaleChange();
  setWallpaperDimension();
  setContentView(R.layout.launcher);
  setupViews();
  lockAllApps();
  mSavedState=savedInstanceState;
  restoreState(mSavedState);
  if (PROFILE_STARTUP) {
    android.os.Debug.stopMethodTracing();
  }
  mModel.setAllAppsDirty();
  mModel.setWorkspaceDirty();
  if (!mRestoring) {
    mModel.startLoader(this,true);
  }
  mDefaultKeySsb=new SpannableStringBuilder();
  Selection.setSelection(mDefaultKeySsb,0);
}
Program: 45624
Project: 45624
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mModel=((LauncherApplication)getApplication()).setLauncher(this);
  mInflater=getLayoutInflater();
  mAppWidgetManager=AppWidgetManager.getInstance(this);
  mAppWidgetHost=new LauncherAppWidgetHost(this,APPWIDGET_HOST_ID);
  mAppWidgetHost.startListening();
  if (PROFILE_STARTUP) {
    android.os.Debug.startMethodTracing("String_Node_Str");
  }
  checkForLocaleChange();
  setWallpaperDimension();
  setContentView(R.layout.launcher);
  setupViews();
  lockAllApps();
  mSavedState=savedInstanceState;
  restoreState(mSavedState);
  if (PROFILE_STARTUP) {
    android.os.Debug.stopMethodTracing();
  }
  if (!mRestoring) {
    mModel.startLoader(this,true);
  }
  mDefaultKeySsb=new SpannableStringBuilder();
  Selection.setSelection(mDefaultKeySsb,0);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mModel=((LauncherApplication)getApplication()).setLauncher(this);
  mInflater=getLayoutInflater();
  mAppWidgetManager=AppWidgetManager.getInstance(this);
  mAppWidgetHost=new LauncherAppWidgetHost(this,APPWIDGET_HOST_ID);
  mAppWidgetHost.startListening();
  if (PROFILE_STARTUP) {
    android.os.Debug.startMethodTracing("String_Node_Str");
  }
  checkForLocaleChange();
  setWallpaperDimension();
  setContentView(R.layout.launcher);
  setupViews();
  lockAllApps();
  mSavedState=savedInstanceState;
  restoreState(mSavedState);
  if (PROFILE_STARTUP) {
    android.os.Debug.stopMethodTracing();
  }
  mModel.setAllAppsDirty();
  mModel.setWorkspaceDirty();
  if (!mRestoring) {
    mModel.startLoader(this,true);
  }
  mDefaultKeySsb=new SpannableStringBuilder();
  Selection.setSelection(mDefaultKeySsb,0);
}
Program: 45625
Project: 45625
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mModel=((LauncherApplication)getApplication()).setLauncher(this);
  mInflater=getLayoutInflater();
  mAppWidgetManager=AppWidgetManager.getInstance(this);
  mAppWidgetHost=new LauncherAppWidgetHost(this,APPWIDGET_HOST_ID);
  mAppWidgetHost.startListening();
  if (PROFILE_STARTUP) {
    android.os.Debug.startMethodTracing("String_Node_Str");
  }
  checkForLocaleChange();
  setWallpaperDimension();
  setContentView(R.layout.launcher);
  setupViews();
  lockAllApps();
  mSavedState=savedInstanceState;
  restoreState(mSavedState);
  if (PROFILE_STARTUP) {
    android.os.Debug.stopMethodTracing();
  }
  if (!mRestoring) {
    mModel.startLoader(this,true);
  }
  mDefaultKeySsb=new SpannableStringBuilder();
  Selection.setSelection(mDefaultKeySsb,0);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mModel=((LauncherApplication)getApplication()).setLauncher(this);
  mInflater=getLayoutInflater();
  mAppWidgetManager=AppWidgetManager.getInstance(this);
  mAppWidgetHost=new LauncherAppWidgetHost(this,APPWIDGET_HOST_ID);
  mAppWidgetHost.startListening();
  if (PROFILE_STARTUP) {
    android.os.Debug.startMethodTracing("String_Node_Str");
  }
  checkForLocaleChange();
  setWallpaperDimension();
  setContentView(R.layout.launcher);
  setupViews();
  lockAllApps();
  mSavedState=savedInstanceState;
  restoreState(mSavedState);
  if (PROFILE_STARTUP) {
    android.os.Debug.stopMethodTracing();
  }
  mModel.setAllAppsDirty();
  mModel.setWorkspaceDirty();
  if (!mRestoring) {
    mModel.startLoader(this,true);
  }
  mDefaultKeySsb=new SpannableStringBuilder();
  Selection.setSelection(mDefaultKeySsb,0);
}
Program: 45629
Project: 45629
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mModel=((LauncherApplication)getApplication()).setLauncher(this);
  mInflater=getLayoutInflater();
  mAppWidgetManager=AppWidgetManager.getInstance(this);
  mAppWidgetHost=new LauncherAppWidgetHost(this,APPWIDGET_HOST_ID);
  mAppWidgetHost.startListening();
  if (PROFILE_STARTUP) {
    android.os.Debug.startMethodTracing("String_Node_Str");
  }
  checkForLocaleChange();
  setWallpaperDimension();
  setContentView(R.layout.launcher);
  setupViews();
  lockAllApps();
  mSavedState=savedInstanceState;
  restoreState(mSavedState);
  if (PROFILE_STARTUP) {
    android.os.Debug.stopMethodTracing();
  }
  if (!mRestoring) {
    mModel.startLoader(this,true);
  }
  mDefaultKeySsb=new SpannableStringBuilder();
  Selection.setSelection(mDefaultKeySsb,0);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mModel=((LauncherApplication)getApplication()).setLauncher(this);
  mInflater=getLayoutInflater();
  mAppWidgetManager=AppWidgetManager.getInstance(this);
  mAppWidgetHost=new LauncherAppWidgetHost(this,APPWIDGET_HOST_ID);
  mAppWidgetHost.startListening();
  if (PROFILE_STARTUP) {
    android.os.Debug.startMethodTracing("String_Node_Str");
  }
  checkForLocaleChange();
  setWallpaperDimension();
  setContentView(R.layout.launcher);
  setupViews();
  lockAllApps();
  mSavedState=savedInstanceState;
  restoreState(mSavedState);
  if (PROFILE_STARTUP) {
    android.os.Debug.stopMethodTracing();
  }
  mModel.setAllAppsDirty();
  mModel.setWorkspaceDirty();
  if (!mRestoring) {
    mModel.startLoader(this,true);
  }
  mDefaultKeySsb=new SpannableStringBuilder();
  Selection.setSelection(mDefaultKeySsb,0);
}