nus-yam/ex-repair huggingface dataset:
Program: 179895
Project: 179895
Buggy source:
/** 
 * Adds the specified child in the specified screen. The position and dimension of the child are defined by x, y, spanX and spanY.
 * @param child The child to add in one of the workspace's screens.
 * @param screen The screen in which to add the child.
 * @param x The X position of the child in the screen's grid.
 * @param y The Y position of the child in the screen's grid.
 * @param spanX The number of cells spanned horizontally by the child.
 * @param spanY The number of cells spanned vertically by the child.
 * @param insert When true, the child is inserted at the beginning of the children list.
 */
void addInScreen(View child,int screen,int x,int y,int spanX,int spanY,boolean insert){
  if (screen < 0 || screen >= getChildCount()) {
    throw new IllegalStateException("String_Node_Str" + getChildCount());
  }
  clearVacantCache();
  final CellLayout group=(CellLayout)getChildAt(screen);
  CellLayout.LayoutParams lp=(CellLayout.LayoutParams)child.getLayoutParams();
  if (lp == null) {
    lp=new CellLayout.LayoutParams(x,y,spanX,spanY);
  }
 else {
    lp.cellX=x;
    lp.cellY=y;
    lp.cellHSpan=spanX;
    lp.cellVSpan=spanY;
  }
  group.addView(child,insert ? 0 : -1,lp);
  if (!(child instanceof Folder)) {
    child.setOnLongClickListener(mLongClickListener);
  }
  if (child instanceof DropTarget) {
    mDragController.addDropTarget((DropTarget)child);
  }
}

Fixed version (ground truth):
/** 
 * Adds the specified child in the specified screen. The position and dimension of the child are defined by x, y, spanX and spanY.
 * @param child The child to add in one of the workspace's screens.
 * @param screen The screen in which to add the child.
 * @param x The X position of the child in the screen's grid.
 * @param y The Y position of the child in the screen's grid.
 * @param spanX The number of cells spanned horizontally by the child.
 * @param spanY The number of cells spanned vertically by the child.
 * @param insert When true, the child is inserted at the beginning of the children list.
 */
void addInScreen(View child,int screen,int x,int y,int spanX,int spanY,boolean insert){
  if (screen < 0 || screen >= getChildCount()) {
    throw new IllegalStateException("String_Node_Str" + getChildCount());
  }
  clearVacantCache();
  final CellLayout group=(CellLayout)getChildAt(screen);
  CellLayout.LayoutParams lp=(CellLayout.LayoutParams)child.getLayoutParams();
  if (lp == null) {
    lp=new CellLayout.LayoutParams(x,y,spanX,spanY);
  }
 else {
    lp.cellX=x;
    lp.cellY=y;
    lp.cellHSpan=spanX;
    lp.cellVSpan=spanY;
  }
  group.addView(child,insert ? 0 : -1,lp);
  if (!(child instanceof Folder)) {
    child.setHapticFeedbackEnabled(false);
    child.setOnLongClickListener(mLongClickListener);
  }
  if (child instanceof DropTarget) {
    mDragController.addDropTarget((DropTarget)child);
  }
}
Program: 179896
Project: 179896
Buggy source:
private void onDropExternal(int x,int y,Object dragInfo,CellLayout cellLayout,boolean insertAtFirst){
  ItemInfo info=(ItemInfo)dragInfo;
  View view;
switch (info.itemType) {
case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION:
case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT:
    if (info.container == NO_ID) {
      info=new ApplicationInfo((ApplicationInfo)info);
    }
  view=mLauncher.createShortcut(R.layout.application,cellLayout,(ApplicationInfo)info);
break;
case LauncherSettings.Favorites.ITEM_TYPE_USER_FOLDER:
view=FolderIcon.fromXml(R.layout.folder_icon,mLauncher,(ViewGroup)getChildAt(mCurrentScreen),((UserFolderInfo)info));
break;
default :
throw new IllegalStateException("String_Node_Str" + info.itemType);
}
cellLayout.addView(view,insertAtFirst ? 0 : -1);
view.setOnLongClickListener(mLongClickListener);
if (view instanceof DropTarget) {
mDragController.addDropTarget((DropTarget)view);
}
mTargetCell=estimateDropCell(x,y,1,1,view,cellLayout,mTargetCell);
cellLayout.onDropChild(view,mTargetCell);
CellLayout.LayoutParams lp=(CellLayout.LayoutParams)view.getLayoutParams();
LauncherModel.addOrMoveItemInDatabase(mLauncher,info,LauncherSettings.Favorites.CONTAINER_DESKTOP,mCurrentScreen,lp.cellX,lp.cellY);
}

Fixed version (ground truth):
private void onDropExternal(int x,int y,Object dragInfo,CellLayout cellLayout,boolean insertAtFirst){
  ItemInfo info=(ItemInfo)dragInfo;
  View view;
switch (info.itemType) {
case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION:
case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT:
    if (info.container == NO_ID) {
      info=new ApplicationInfo((ApplicationInfo)info);
    }
  view=mLauncher.createShortcut(R.layout.application,cellLayout,(ApplicationInfo)info);
break;
case LauncherSettings.Favorites.ITEM_TYPE_USER_FOLDER:
view=FolderIcon.fromXml(R.layout.folder_icon,mLauncher,(ViewGroup)getChildAt(mCurrentScreen),((UserFolderInfo)info));
break;
default :
throw new IllegalStateException("String_Node_Str" + info.itemType);
}
cellLayout.addView(view,insertAtFirst ? 0 : -1);
view.setHapticFeedbackEnabled(false);
view.setOnLongClickListener(mLongClickListener);
if (view instanceof DropTarget) {
mDragController.addDropTarget((DropTarget)view);
}
mTargetCell=estimateDropCell(x,y,1,1,view,cellLayout,mTargetCell);
cellLayout.onDropChild(view,mTargetCell);
CellLayout.LayoutParams lp=(CellLayout.LayoutParams)view.getLayoutParams();
LauncherModel.addOrMoveItemInDatabase(mLauncher,info,LauncherSettings.Favorites.CONTAINER_DESKTOP,mCurrentScreen,lp.cellX,lp.cellY);
}
Program: 179897
Project: 179897
Buggy source:
/** 
 * Used to inflate the Workspace from XML.
 * @param context The application's context.
 * @param attrs The attribtues set containing the Workspace's customization values.
 * @param defStyle Unused.
 */
public Workspace(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  mWallpaperManager=WallpaperManager.getInstance(context);
  TypedArray a=context.obtainStyledAttributes(attrs,R.styleable.Workspace,defStyle,0);
  mDefaultScreen=a.getInt(R.styleable.Workspace_defaultScreen,1);
  a.recycle();
  initWorkspace();
}

Fixed version (ground truth):
/** 
 * Used to inflate the Workspace from XML.
 * @param context The application's context.
 * @param attrs The attribtues set containing the Workspace's customization values.
 * @param defStyle Unused.
 */
public Workspace(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  mWallpaperManager=WallpaperManager.getInstance(context);
  TypedArray a=context.obtainStyledAttributes(attrs,R.styleable.Workspace,defStyle,0);
  mDefaultScreen=a.getInt(R.styleable.Workspace_defaultScreen,1);
  a.recycle();
  setHapticFeedbackEnabled(false);
  initWorkspace();
}
Program: 179898
Project: 179898
Buggy source:
public boolean isOpaque(){
  if (mZoomDirty) {
    return mNextZoom > 0.999f;
  }
 else {
    if (mRollo == null) {
      return false;
    }
 else {
      return mRollo.mMessageProc.mZoom > 0.999f;
    }
  }
}

Fixed version (ground truth):
public boolean isOpaque(){
  if (mZoomDirty) {
    return mNextZoom > 0.999f;
  }
 else {
    if (mMessageProc == null) {
      return false;
    }
 else {
      return mMessageProc.mZoom > 0.999f;
    }
  }
}
Program: 179899
Project: 179899
Buggy source:
public void run(){
  mPosX=((float)mData[0]) / (1 << 16);
  mVelocity=((float)mData[1]) / (1 << 16);
  mZoom=((float)mData[2]) / (1 << 16);
}

Fixed version (ground truth):
public void run(){
  mPosX=((float)mData[0]) / (1 << 16);
  mVelocity=((float)mData[1]) / (1 << 16);
  mZoom=((float)mData[2]) / (1 << 16);
  mZoomDirty=false;
}
Program: 179900
Project: 179900
Buggy source:
private void gainFocus(){
  if (!mArrowNavigation && mRollo.mState.iconCount > 0) {
    mArrowNavigation=true;
    mRollo.selectIcon(Math.round(mRollo.mMessageProc.mPosX) * Defines.COLUMNS_PER_PAGE,SELECTED_FOCUSED);
    mRollo.mState.save();
  }
}

Fixed version (ground truth):
private void gainFocus(){
  if (!mArrowNavigation && mRollo.mState.iconCount > 0) {
    mArrowNavigation=true;
    mRollo.selectIcon(Math.round(mMessageProc.mPosX) * Defines.COLUMNS_PER_PAGE,SELECTED_FOCUSED);
    mRollo.mState.save();
  }
}
Program: 179901
Project: 179901
Buggy source:
private void initRs(){
  ScriptC.Builder sb=new ScriptC.Builder(mRS);
  sb.setScript(mRes,R.raw.rollo3);
  sb.setRoot(true);
  sb.addDefines(mDefines);
  sb.setType(mParams.mType,"String_Node_Str",Defines.ALLOC_PARAMS);
  sb.setType(mState.mType,"String_Node_Str",Defines.ALLOC_STATE);
  mInvokeMove=sb.addInvokable("String_Node_Str");
  mInvokeFling=sb.addInvokable("String_Node_Str");
  mInvokeMoveTo=sb.addInvokable("String_Node_Str");
  mInvokeResetWAR=sb.addInvokable("String_Node_Str");
  mInvokeSetZoom=sb.addInvokable("String_Node_Str");
  mScript=sb.create();
  mScript.setClearColor(0.0f,0.0f,0.0f,0.0f);
  mScript.bindAllocation(mParams.mAlloc,Defines.ALLOC_PARAMS);
  mScript.bindAllocation(mState.mAlloc,Defines.ALLOC_STATE);
  mScript.bindAllocation(mAllocIconIds,Defines.ALLOC_ICON_IDS);
  mScript.bindAllocation(mAllocLabelIds,Defines.ALLOC_LABEL_IDS);
  mMessageProc=new AAMessage();
  mRS.mMessageCallback=mMessageProc;
  mRS.contextBindRootScript(mScript);
}

Fixed version (ground truth):
private void initRs(){
  ScriptC.Builder sb=new ScriptC.Builder(mRS);
  sb.setScript(mRes,R.raw.rollo3);
  sb.setRoot(true);
  sb.addDefines(mDefines);
  sb.setType(mParams.mType,"String_Node_Str",Defines.ALLOC_PARAMS);
  sb.setType(mState.mType,"String_Node_Str",Defines.ALLOC_STATE);
  mInvokeMove=sb.addInvokable("String_Node_Str");
  mInvokeFling=sb.addInvokable("String_Node_Str");
  mInvokeMoveTo=sb.addInvokable("String_Node_Str");
  mInvokeResetWAR=sb.addInvokable("String_Node_Str");
  mInvokeSetZoom=sb.addInvokable("String_Node_Str");
  mScript=sb.create();
  mScript.setClearColor(0.0f,0.0f,0.0f,0.0f);
  mScript.bindAllocation(mParams.mAlloc,Defines.ALLOC_PARAMS);
  mScript.bindAllocation(mState.mAlloc,Defines.ALLOC_STATE);
  mScript.bindAllocation(mAllocIconIds,Defines.ALLOC_ICON_IDS);
  mScript.bindAllocation(mAllocLabelIds,Defines.ALLOC_LABEL_IDS);
  mRS.contextBindRootScript(mScript);
}
Program: 179903
Project: 179903
Buggy source:
public boolean isVisible(){
  if (mZoomDirty) {
    return mNextZoom > 0.001f;
  }
 else {
    if (mRollo == null) {
      return false;
    }
 else {
      return mRollo.mMessageProc.mZoom > 0.001f;
    }
  }
}

Fixed version (ground truth):
public boolean isVisible(){
  if (mZoomDirty) {
    return mNextZoom > 0.001f;
  }
 else {
    if (mMessageProc == null) {
      return false;
    }
 else {
      return mMessageProc.mZoom > 0.001f;
    }
  }
}
Program: 179905
Project: 179905
Buggy source:
void dirtyCheck(){
  if (mHasSurface) {
    if (mAppsDirty) {
      uploadApps(mAllAppsList);
      saveAppsList();
      mAppsDirty=false;
    }
    if (mZoomDirty) {
      setZoom(mNextZoom,mNextAnimate);
      mZoomDirty=false;
    }
  }
}

Fixed version (ground truth):
void dirtyCheck(){
  if (mHasSurface) {
    if (mAppsDirty) {
      uploadApps(mAllAppsList);
      saveAppsList();
      mAppsDirty=false;
    }
    if (mZoomDirty) {
      setZoom(mNextZoom,mNextAnimate);
    }
  }
}
Program: 179906
Project: 179906
Buggy source:
@Override public void surfaceChanged(SurfaceHolder holder,int format,int w,int h){
  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);
    }
    if (mShouldGainFocus) {
      gainFocus();
      mShouldGainFocus=false;
    }
    mRollo.dirtyCheck();
  }
 else {
    mRollo.mHasSurface=true;
    mRollo.dirtyCheck();
  }
  Resources res=getContext().getResources();
  int barHeight=(int)res.getDimension(R.dimen.button_bar_height);
}

Fixed version (ground truth):
@Override public void surfaceChanged(SurfaceHolder holder,int format,int w,int h){
  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);
    }
    if (mShouldGainFocus) {
      gainFocus();
      mShouldGainFocus=false;
    }
    mRollo.dirtyCheck();
  }
 else {
    mRollo.mHasSurface=true;
    mRollo.dirtyCheck();
  }
  mRS.mMessageCallback=mMessageProc=new AAMessage();
  Resources res=getContext().getResources();
  int barHeight=(int)res.getDimension(R.dimen.button_bar_height);
}
Program: 179907
Project: 179907
Buggy source:
@Override public void onWindowFocusChanged(boolean hasWindowFocus){
  super.onWindowFocusChanged(hasWindowFocus);
  if (mArrowNavigation) {
    if (!hasWindowFocus) {
      mLastSelectedIcon=mRollo.mState.selectedIconIndex;
      mRollo.setHomeSelected(SELECTED_NONE);
      mRollo.clearSelectedIcon();
      mRollo.mState.save();
    }
 else     if (hasWindowFocus) {
      if (mRollo.mState.iconCount > 0) {
        if (mLastSelection == SELECTION_ICONS) {
          int selection=mLastSelectedIcon;
          final int firstIcon=Math.round(mRollo.mMessageProc.mPosX) * Defines.COLUMNS_PER_PAGE;
          if (selection < 0 || selection < firstIcon || selection >= mRollo.mState.iconCount || selection >= firstIcon + (Defines.COLUMNS_PER_PAGE * Defines.ROWS_PER_PAGE)) {
            selection=firstIcon;
          }
          mRollo.selectIcon(selection,SELECTED_FOCUSED);
          mRollo.mState.save();
        }
 else         if (mLastSelection == SELECTION_HOME) {
          mRollo.setHomeSelected(SELECTED_FOCUSED);
          mRollo.mState.save();
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onWindowFocusChanged(boolean hasWindowFocus){
  super.onWindowFocusChanged(hasWindowFocus);
  if (mArrowNavigation) {
    if (!hasWindowFocus) {
      mLastSelectedIcon=mRollo.mState.selectedIconIndex;
      mRollo.setHomeSelected(SELECTED_NONE);
      mRollo.clearSelectedIcon();
      mRollo.mState.save();
    }
 else     if (hasWindowFocus) {
      if (mRollo.mState.iconCount > 0) {
        if (mLastSelection == SELECTION_ICONS) {
          int selection=mLastSelectedIcon;
          final int firstIcon=Math.round(mMessageProc.mPosX) * Defines.COLUMNS_PER_PAGE;
          if (selection < 0 || selection < firstIcon || selection >= mRollo.mState.iconCount || selection >= firstIcon + (Defines.COLUMNS_PER_PAGE * Defines.ROWS_PER_PAGE)) {
            selection=firstIcon;
          }
          mRollo.selectIcon(selection,SELECTED_FOCUSED);
          mRollo.mState.save();
        }
 else         if (mLastSelection == SELECTION_HOME) {
          mRollo.setHomeSelected(SELECTED_FOCUSED);
          mRollo.mState.save();
        }
      }
    }
  }
}
Program: 179908
Project: 179908
Buggy source:
public boolean isOpaque(){
  if (mZoomDirty) {
    return mNextZoom > 0.999f;
  }
 else {
    if (mRollo == null) {
      return false;
    }
 else {
      return mRollo.mMessageProc.mZoom > 0.999f;
    }
  }
}

Fixed version (ground truth):
public boolean isOpaque(){
  if (mZoomDirty) {
    return mNextZoom > 0.999f;
  }
 else {
    if (mMessageProc == null) {
      return false;
    }
 else {
      return mMessageProc.mZoom > 0.999f;
    }
  }
}
Program: 179909
Project: 179909
Buggy source:
public void run(){
  mPosX=((float)mData[0]) / (1 << 16);
  mVelocity=((float)mData[1]) / (1 << 16);
  mZoom=((float)mData[2]) / (1 << 16);
}

Fixed version (ground truth):
public void run(){
  mPosX=((float)mData[0]) / (1 << 16);
  mVelocity=((float)mData[1]) / (1 << 16);
  mZoom=((float)mData[2]) / (1 << 16);
  mZoomDirty=false;
}
Program: 179910
Project: 179910
Buggy source:
private void gainFocus(){
  if (!mArrowNavigation && mRollo.mState.iconCount > 0) {
    mArrowNavigation=true;
    mRollo.selectIcon(Math.round(mRollo.mMessageProc.mPosX) * Defines.COLUMNS_PER_PAGE,SELECTED_FOCUSED);
    mRollo.mState.save();
  }
}

Fixed version (ground truth):
private void gainFocus(){
  if (!mArrowNavigation && mRollo.mState.iconCount > 0) {
    mArrowNavigation=true;
    mRollo.selectIcon(Math.round(mMessageProc.mPosX) * Defines.COLUMNS_PER_PAGE,SELECTED_FOCUSED);
    mRollo.mState.save();
  }
}
Program: 179911
Project: 179911
Buggy source:
private void initRs(){
  ScriptC.Builder sb=new ScriptC.Builder(mRS);
  sb.setScript(mRes,R.raw.rollo3);
  sb.setRoot(true);
  sb.addDefines(mDefines);
  sb.setType(mParams.mType,"String_Node_Str",Defines.ALLOC_PARAMS);
  sb.setType(mState.mType,"String_Node_Str",Defines.ALLOC_STATE);
  mInvokeMove=sb.addInvokable("String_Node_Str");
  mInvokeFling=sb.addInvokable("String_Node_Str");
  mInvokeMoveTo=sb.addInvokable("String_Node_Str");
  mInvokeResetWAR=sb.addInvokable("String_Node_Str");
  mInvokeSetZoom=sb.addInvokable("String_Node_Str");
  mScript=sb.create();
  mScript.setClearColor(0.0f,0.0f,0.0f,0.0f);
  mScript.bindAllocation(mParams.mAlloc,Defines.ALLOC_PARAMS);
  mScript.bindAllocation(mState.mAlloc,Defines.ALLOC_STATE);
  mScript.bindAllocation(mAllocIconIds,Defines.ALLOC_ICON_IDS);
  mScript.bindAllocation(mAllocLabelIds,Defines.ALLOC_LABEL_IDS);
  mMessageProc=new AAMessage();
  mRS.mMessageCallback=mMessageProc;
  mRS.contextBindRootScript(mScript);
}

Fixed version (ground truth):
private void initRs(){
  ScriptC.Builder sb=new ScriptC.Builder(mRS);
  sb.setScript(mRes,R.raw.rollo3);
  sb.setRoot(true);
  sb.addDefines(mDefines);
  sb.setType(mParams.mType,"String_Node_Str",Defines.ALLOC_PARAMS);
  sb.setType(mState.mType,"String_Node_Str",Defines.ALLOC_STATE);
  mInvokeMove=sb.addInvokable("String_Node_Str");
  mInvokeFling=sb.addInvokable("String_Node_Str");
  mInvokeMoveTo=sb.addInvokable("String_Node_Str");
  mInvokeResetWAR=sb.addInvokable("String_Node_Str");
  mInvokeSetZoom=sb.addInvokable("String_Node_Str");
  mScript=sb.create();
  mScript.setClearColor(0.0f,0.0f,0.0f,0.0f);
  mScript.bindAllocation(mParams.mAlloc,Defines.ALLOC_PARAMS);
  mScript.bindAllocation(mState.mAlloc,Defines.ALLOC_STATE);
  mScript.bindAllocation(mAllocIconIds,Defines.ALLOC_ICON_IDS);
  mScript.bindAllocation(mAllocLabelIds,Defines.ALLOC_LABEL_IDS);
  mRS.contextBindRootScript(mScript);
}
Program: 179913
Project: 179913
Buggy source:
public boolean isVisible(){
  if (mZoomDirty) {
    return mNextZoom > 0.001f;
  }
 else {
    if (mRollo == null) {
      return false;
    }
 else {
      return mRollo.mMessageProc.mZoom > 0.001f;
    }
  }
}

Fixed version (ground truth):
public boolean isVisible(){
  if (mZoomDirty) {
    return mNextZoom > 0.001f;
  }
 else {
    if (mMessageProc == null) {
      return false;
    }
 else {
      return mMessageProc.mZoom > 0.001f;
    }
  }
}
Program: 179915
Project: 179915
Buggy source:
void dirtyCheck(){
  if (mHasSurface) {
    if (mAppsDirty) {
      uploadApps(mAllAppsList);
      saveAppsList();
      mAppsDirty=false;
    }
    if (mZoomDirty) {
      setZoom(mNextZoom,mNextAnimate);
      mZoomDirty=false;
    }
  }
}

Fixed version (ground truth):
void dirtyCheck(){
  if (mHasSurface) {
    if (mAppsDirty) {
      uploadApps(mAllAppsList);
      saveAppsList();
      mAppsDirty=false;
    }
    if (mZoomDirty) {
      setZoom(mNextZoom,mNextAnimate);
    }
  }
}
Program: 179916
Project: 179916
Buggy source:
@Override public void surfaceChanged(SurfaceHolder holder,int format,int w,int h){
  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);
    }
    if (mShouldGainFocus) {
      gainFocus();
      mShouldGainFocus=false;
    }
    mRollo.dirtyCheck();
  }
 else {
    mRollo.mHasSurface=true;
    mRollo.dirtyCheck();
  }
  Resources res=getContext().getResources();
  int barHeight=(int)res.getDimension(R.dimen.button_bar_height);
}

Fixed version (ground truth):
@Override public void surfaceChanged(SurfaceHolder holder,int format,int w,int h){
  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);
    }
    if (mShouldGainFocus) {
      gainFocus();
      mShouldGainFocus=false;
    }
    mRollo.dirtyCheck();
  }
 else {
    mRollo.mHasSurface=true;
    mRollo.dirtyCheck();
  }
  mRS.mMessageCallback=mMessageProc=new AAMessage();
  Resources res=getContext().getResources();
  int barHeight=(int)res.getDimension(R.dimen.button_bar_height);
}
Program: 179917
Project: 179917
Buggy source:
@Override public void onWindowFocusChanged(boolean hasWindowFocus){
  super.onWindowFocusChanged(hasWindowFocus);
  if (mArrowNavigation) {
    if (!hasWindowFocus) {
      mLastSelectedIcon=mRollo.mState.selectedIconIndex;
      mRollo.setHomeSelected(SELECTED_NONE);
      mRollo.clearSelectedIcon();
      mRollo.mState.save();
    }
 else     if (hasWindowFocus) {
      if (mRollo.mState.iconCount > 0) {
        if (mLastSelection == SELECTION_ICONS) {
          int selection=mLastSelectedIcon;
          final int firstIcon=Math.round(mRollo.mMessageProc.mPosX) * Defines.COLUMNS_PER_PAGE;
          if (selection < 0 || selection < firstIcon || selection >= mRollo.mState.iconCount || selection >= firstIcon + (Defines.COLUMNS_PER_PAGE * Defines.ROWS_PER_PAGE)) {
            selection=firstIcon;
          }
          mRollo.selectIcon(selection,SELECTED_FOCUSED);
          mRollo.mState.save();
        }
 else         if (mLastSelection == SELECTION_HOME) {
          mRollo.setHomeSelected(SELECTED_FOCUSED);
          mRollo.mState.save();
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onWindowFocusChanged(boolean hasWindowFocus){
  super.onWindowFocusChanged(hasWindowFocus);
  if (mArrowNavigation) {
    if (!hasWindowFocus) {
      mLastSelectedIcon=mRollo.mState.selectedIconIndex;
      mRollo.setHomeSelected(SELECTED_NONE);
      mRollo.clearSelectedIcon();
      mRollo.mState.save();
    }
 else     if (hasWindowFocus) {
      if (mRollo.mState.iconCount > 0) {
        if (mLastSelection == SELECTION_ICONS) {
          int selection=mLastSelectedIcon;
          final int firstIcon=Math.round(mMessageProc.mPosX) * Defines.COLUMNS_PER_PAGE;
          if (selection < 0 || selection < firstIcon || selection >= mRollo.mState.iconCount || selection >= firstIcon + (Defines.COLUMNS_PER_PAGE * Defines.ROWS_PER_PAGE)) {
            selection=firstIcon;
          }
          mRollo.selectIcon(selection,SELECTED_FOCUSED);
          mRollo.mState.save();
        }
 else         if (mLastSelection == SELECTION_HOME) {
          mRollo.setHomeSelected(SELECTED_FOCUSED);
          mRollo.mState.save();
        }
      }
    }
  }
}
Program: 179918
Project: 179918
Buggy source:
@Override public void surfaceDestroyed(SurfaceHolder holder){
  super.surfaceDestroyed(holder);
  mRollo.mHasSurface=false;
}

Fixed version (ground truth):
@Override public void surfaceDestroyed(SurfaceHolder holder){
  super.surfaceDestroyed(holder);
  mRollo.mHasSurface=false;
  mRS.mMessageCallback=null;
}
Program: 179919
Project: 179919
Buggy source:
@Override public void surfaceDestroyed(SurfaceHolder holder){
  super.surfaceDestroyed(holder);
  mRollo.mHasSurface=false;
}

Fixed version (ground truth):
@Override public void surfaceDestroyed(SurfaceHolder holder){
  super.surfaceDestroyed(holder);
  mRollo.mHasSurface=false;
  mRS.mMessageCallback=null;
}
Program: 179920
Project: 179920
Buggy source:
@Override public void surfaceDestroyed(SurfaceHolder holder){
  super.surfaceDestroyed(holder);
  mRollo.mHasSurface=false;
}

Fixed version (ground truth):
@Override public void surfaceDestroyed(SurfaceHolder holder){
  super.surfaceDestroyed(holder);
  mRollo.mHasSurface=false;
  mRS.mMessageCallback=null;
}
Program: 179921
Project: 179921
Buggy source:
@Override public void surfaceDestroyed(SurfaceHolder holder){
  super.surfaceDestroyed(holder);
  mRollo.mHasSurface=false;
}

Fixed version (ground truth):
@Override public void surfaceDestroyed(SurfaceHolder holder){
  super.surfaceDestroyed(holder);
  mRollo.mHasSurface=false;
  mRS.mMessageCallback=null;
}
Program: 179922
Project: 179922
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: 179923
Project: 179923
Buggy source:
private void addItems(){
  showAddDialog(mMenuAddInfo);
}

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

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

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

Fixed version (ground truth):
private void addItems(){
  closeAllApps(true);
  showAddDialog(mMenuAddInfo);
}
Program: 179930
Project: 179930
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: 179931
Project: 179931
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: 179932
Project: 179932
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: 179933
Project: 179933
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: 179934
Project: 179934
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: 179935
Project: 179935
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: 179936
Project: 179936
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: 179937
Project: 179937
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: 179938
Project: 179938
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: 179939
Project: 179939
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: 179940
Project: 179940
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: 179941
Project: 179941
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: 179942
Project: 179942
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: 179945
Project: 179945
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: 179946
Project: 179946
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: 179947
Project: 179947
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: 179948
Project: 179948
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: 179949
Project: 179949
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: 179950
Project: 179950
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();
}