nus-yam/ex-repair huggingface dataset:
Program: 83789
Project: 83789
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: 83790
Project: 83790
Buggy source:
private void addItems(){
  showAddDialog(mMenuAddInfo);
}

Fixed version (ground truth):
private void addItems(){
  closeAllApps(true);
  showAddDialog(mMenuAddInfo);
}
Program: 83791
Project: 83791
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: 83792
Project: 83792
Buggy source:
private void addItems(){
  showAddDialog(mMenuAddInfo);
}

Fixed version (ground truth):
private void addItems(){
  closeAllApps(true);
  showAddDialog(mMenuAddInfo);
}
Program: 83793
Project: 83793
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: 83794
Project: 83794
Buggy source:
private void addItems(){
  showAddDialog(mMenuAddInfo);
}

Fixed version (ground truth):
private void addItems(){
  closeAllApps(true);
  showAddDialog(mMenuAddInfo);
}
Program: 83795
Project: 83795
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: 83798
Project: 83798
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: 83799
Project: 83799
Buggy source:
private void addItems(){
  showAddDialog(mMenuAddInfo);
}

Fixed version (ground truth):
private void addItems(){
  closeAllApps(true);
  showAddDialog(mMenuAddInfo);
}
Program: 83800
Project: 83800
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: 83801
Project: 83801
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: 83802
Project: 83802
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: 83803
Project: 83803
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: 83804
Project: 83804
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: 83805
Project: 83805
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: 83806
Project: 83806
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: 83807
Project: 83807
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: 83808
Project: 83808
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: 83809
Project: 83809
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: 83810
Project: 83810
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: 83811
Project: 83811
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: 83812
Project: 83812
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: 83813
Project: 83813
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: 83814
Project: 83814
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: 83815
Project: 83815
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: 83816
Project: 83816
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: 83817
Project: 83817
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: 83818
Project: 83818
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: 83819
Project: 83819
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: 83820
Project: 83820
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: 83821
Project: 83821
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: 83822
Project: 83822
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: 83823
Project: 83823
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: 83824
Project: 83824
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: 83825
Project: 83825
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: 83826
Project: 83826
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: 83827
Project: 83827
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: 83828
Project: 83828
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: 83829
Project: 83829
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: 83830
Project: 83830
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: 83831
Project: 83831
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: 83833
Project: 83833
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: 83835
Project: 83835
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: 83837
Project: 83837
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: 83839
Project: 83839
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: 83840
Project: 83840
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: 83843
Project: 83843
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: 83844
Project: 83844
Buggy source:
public void onClick(View v){
  if (mLocks != 0 || !isVisible()) {
    return;
  }
  int index=mRollo.mState.selectedIconIndex;
  if (mRollo.checkClickOK() && index >= 0 && index < mAllAppsList.size()) {
    ApplicationInfo app=mAllAppsList.get(index);
    mLauncher.startActivitySafely(app.intent);
  }
}

Fixed version (ground truth):
public void onClick(View v){
  if (mLocks != 0 || !isVisible()) {
    return;
  }
  if (mRollo.checkClickOK() && mCurrentIconIndex == mDownIconIndex && mCurrentIconIndex >= 0 && mCurrentIconIndex < mAllAppsList.size()) {
    ApplicationInfo app=mAllAppsList.get(mCurrentIconIndex);
    mLauncher.startActivitySafely(app.intent);
  }
}
Program: 83846
Project: 83846
Buggy source:
void selectIcon(int index){
  int iconCount=mAllAppsList.size();
  if (index < 0 || index >= iconCount) {
    mState.selectedIconIndex=-1;
    return;
  }
 else {
    mState.selectedIconIndex=index;
    Bitmap selectionBitmap=mSelectionBitmap;
    Utilities.drawSelectedAllAppsBitmap(mSelectionCanvas,selectionBitmap.getWidth(),selectionBitmap.getHeight(),mAllAppsList.get(index).iconBitmap);
    mSelectedIcon=Allocation.createFromBitmap(mRS,selectionBitmap,Element.RGBA_8888(mRS),false);
    mSelectedIcon.uploadToTexture(0);
    mState.selectedIconTexture=mSelectedIcon.getID();
  }
}

Fixed version (ground truth):
void selectIcon(int index){
  if (index < 0) {
    mState.selectedIconIndex=-1;
  }
 else {
    mState.selectedIconIndex=index;
    Bitmap selectionBitmap=mSelectionBitmap;
    Utilities.drawSelectedAllAppsBitmap(mSelectionCanvas,selectionBitmap.getWidth(),selectionBitmap.getHeight(),mAllAppsList.get(index).iconBitmap);
    mSelectedIcon=Allocation.createFromBitmap(mRS,selectionBitmap,Element.RGBA_8888(mRS),false);
    mSelectedIcon.uploadToTexture(0);
    mState.selectedIconTexture=mSelectedIcon.getID();
  }
}