nus-yam/ex-repair huggingface dataset:
Program: 199782
Project: 199782
Buggy source:
/** 
 * Resumes this transition, sending out calls to   {@link TransitionListener#onTransitionPause(Transition)} to all listenersand pausing all running animators started by this transition.
 * @hide
 */
public void resume(){
  if (mPaused) {
    if (!mEnded) {
      ArrayMap<Animator,AnimationInfo> runningAnimators=getRunningAnimators();
      int numOldAnims=runningAnimators.size();
      for (int i=numOldAnims - 1; i >= 0; i--) {
        Animator anim=runningAnimators.keyAt(i);
        anim.resume();
      }
      if (mListeners != null && mListeners.size() > 0) {
        ArrayList<TransitionListener> tmpListeners=(ArrayList<TransitionListener>)mListeners.clone();
        int numListeners=tmpListeners.size();
        for (int i=0; i < numListeners; ++i) {
          tmpListeners.get(i).onTransitionResume(this);
        }
      }
    }
    mPaused=false;
  }
}

Fixed version (ground truth):
/** 
 * Resumes this transition, sending out calls to   {@link TransitionListener#onTransitionPause(Transition)} to all listenersand pausing all running animators started by this transition.
 * @hide
 */
public void resume(View sceneRoot){
  if (mPaused) {
    if (!mEnded) {
      ArrayMap<Animator,AnimationInfo> runningAnimators=getRunningAnimators();
      int numOldAnims=runningAnimators.size();
      WindowId windowId=sceneRoot.getWindowId();
      for (int i=numOldAnims - 1; i >= 0; i--) {
        AnimationInfo info=runningAnimators.valueAt(i);
        if (info.view != null && windowId.equals(info.windowId)) {
          Animator anim=runningAnimators.keyAt(i);
          anim.resume();
        }
      }
      if (mListeners != null && mListeners.size() > 0) {
        ArrayList<TransitionListener> tmpListeners=(ArrayList<TransitionListener>)mListeners.clone();
        int numListeners=tmpListeners.size();
        for (int i=0; i < numListeners; ++i) {
          tmpListeners.get(i).onTransitionResume(this);
        }
      }
    }
    mPaused=false;
  }
}
Program: 199783
Project: 199783
Buggy source:
private static void sceneChangeSetup(ViewGroup sceneRoot,Transition transition){
  ArrayList<Transition> runningTransitions=getRunningTransitions().get(sceneRoot);
  if (runningTransitions != null && runningTransitions.size() > 0) {
    for (    Transition runningTransition : runningTransitions) {
      runningTransition.pause();
    }
  }
  if (transition != null) {
    transition.captureValues(sceneRoot,true);
  }
  Scene previousScene=Scene.getCurrentScene(sceneRoot);
  if (previousScene != null) {
    previousScene.exit();
  }
}

Fixed version (ground truth):
private static void sceneChangeSetup(ViewGroup sceneRoot,Transition transition){
  ArrayList<Transition> runningTransitions=getRunningTransitions().get(sceneRoot);
  if (runningTransitions != null && runningTransitions.size() > 0) {
    for (    Transition runningTransition : runningTransitions) {
      runningTransition.pause(sceneRoot);
    }
  }
  if (transition != null) {
    transition.captureValues(sceneRoot,true);
  }
  Scene previousScene=Scene.getCurrentScene(sceneRoot);
  if (previousScene != null) {
    previousScene.exit();
  }
}
Program: 199784
Project: 199784
Buggy source:
@Override public boolean onPreDraw(){
  removeListeners();
  sPendingTransitions.remove(mSceneRoot);
  final ArrayMap<ViewGroup,ArrayList<Transition>> runningTransitions=getRunningTransitions();
  ArrayList<Transition> currentTransitions=runningTransitions.get(mSceneRoot);
  ArrayList<Transition> previousRunningTransitions=null;
  if (currentTransitions == null) {
    currentTransitions=new ArrayList<Transition>();
    runningTransitions.put(mSceneRoot,currentTransitions);
  }
 else   if (currentTransitions.size() > 0) {
    previousRunningTransitions=new ArrayList<Transition>(currentTransitions);
  }
  currentTransitions.add(mTransition);
  mTransition.addListener(new Transition.TransitionListenerAdapter(){
    @Override public void onTransitionEnd(    Transition transition){
      ArrayList<Transition> currentTransitions=runningTransitions.get(mSceneRoot);
      currentTransitions.remove(transition);
    }
  }
);
  mTransition.captureValues(mSceneRoot,false);
  if (previousRunningTransitions != null) {
    for (    Transition runningTransition : previousRunningTransitions) {
      runningTransition.resume();
    }
  }
  mTransition.playTransition(mSceneRoot);
  return true;
}

Fixed version (ground truth):
@Override public boolean onPreDraw(){
  removeListeners();
  sPendingTransitions.remove(mSceneRoot);
  final ArrayMap<ViewGroup,ArrayList<Transition>> runningTransitions=getRunningTransitions();
  ArrayList<Transition> currentTransitions=runningTransitions.get(mSceneRoot);
  ArrayList<Transition> previousRunningTransitions=null;
  if (currentTransitions == null) {
    currentTransitions=new ArrayList<Transition>();
    runningTransitions.put(mSceneRoot,currentTransitions);
  }
 else   if (currentTransitions.size() > 0) {
    previousRunningTransitions=new ArrayList<Transition>(currentTransitions);
  }
  currentTransitions.add(mTransition);
  mTransition.addListener(new Transition.TransitionListenerAdapter(){
    @Override public void onTransitionEnd(    Transition transition){
      ArrayList<Transition> currentTransitions=runningTransitions.get(mSceneRoot);
      currentTransitions.remove(transition);
    }
  }
);
  mTransition.captureValues(mSceneRoot,false);
  if (previousRunningTransitions != null) {
    for (    Transition runningTransition : previousRunningTransitions) {
      runningTransition.resume(mSceneRoot);
    }
  }
  mTransition.playTransition(mSceneRoot);
  return true;
}
Program: 199785
Project: 199785
Buggy source:
@Override public void onViewDetachedFromWindow(View v){
  removeListeners();
  sPendingTransitions.remove(mSceneRoot);
  ArrayList<Transition> runningTransitions=getRunningTransitions().get(mSceneRoot);
  if (runningTransitions != null && runningTransitions.size() > 0) {
    for (    Transition runningTransition : runningTransitions) {
      runningTransition.resume();
    }
  }
  mTransition.clearValues(true);
}

Fixed version (ground truth):
@Override public void onViewDetachedFromWindow(View v){
  removeListeners();
  sPendingTransitions.remove(mSceneRoot);
  ArrayList<Transition> runningTransitions=getRunningTransitions().get(mSceneRoot);
  if (runningTransitions != null && runningTransitions.size() > 0) {
    for (    Transition runningTransition : runningTransitions) {
      runningTransition.resume(mSceneRoot);
    }
  }
  mTransition.clearValues(true);
}
Program: 199786
Project: 199786
Buggy source:
/** 
 * @hide 
 */
@Override public void resume(){
  super.resume();
  int numTransitions=mTransitions.size();
  for (int i=0; i < numTransitions; ++i) {
    mTransitions.get(i).resume();
  }
}

Fixed version (ground truth):
/** 
 * @hide 
 */
@Override public void resume(View sceneRoot){
  super.resume(sceneRoot);
  int numTransitions=mTransitions.size();
  for (int i=0; i < numTransitions; ++i) {
    mTransitions.get(i).resume(sceneRoot);
  }
}
Program: 199787
Project: 199787
Buggy source:
/** 
 * @hide 
 */
@Override public void pause(){
  super.pause();
  int numTransitions=mTransitions.size();
  for (int i=0; i < numTransitions; ++i) {
    mTransitions.get(i).pause();
  }
}

Fixed version (ground truth):
/** 
 * @hide 
 */
@Override public void pause(View sceneRoot){
  super.pause(sceneRoot);
  int numTransitions=mTransitions.size();
  for (int i=0; i < numTransitions; ++i) {
    mTransitions.get(i).pause(sceneRoot);
  }
}
Program: 199791
Project: 199791
Buggy source:
@Override public View getItemView(final MenuItemImpl item,View convertView,ViewGroup parent){
  View actionView=item.getActionView();
  if (actionView == null || item.hasCollapsibleActionView()) {
    actionView=super.getItemView(item,convertView,parent);
  }
  actionView.setVisibility(item.isActionViewExpanded() ? View.GONE : View.VISIBLE);
  if (item.hasSubMenu()) {
    actionView.setOnTouchListener(new ForwardingListener(actionView){
      @Override public ListPopupWindow getPopup(){
        return mActionButtonPopup != null ? mActionButtonPopup.getPopup() : null;
      }
      @Override protected boolean onForwardingStarted(){
        return onSubMenuSelected((SubMenuBuilder)item.getSubMenu());
      }
      @Override protected boolean onForwardingStopped(){
        return dismissPopupMenus();
      }
    }
);
  }
 else {
    actionView.setOnTouchListener(null);
  }
  final ActionMenuView menuParent=(ActionMenuView)parent;
  final ViewGroup.LayoutParams lp=actionView.getLayoutParams();
  if (!menuParent.checkLayoutParams(lp)) {
    actionView.setLayoutParams(menuParent.generateLayoutParams(lp));
  }
  return actionView;
}

Fixed version (ground truth):
@Override public View getItemView(final MenuItemImpl item,View convertView,ViewGroup parent){
  View actionView=item.getActionView();
  if (actionView == null || item.hasCollapsibleActionView()) {
    actionView=super.getItemView(item,convertView,parent);
  }
  actionView.setVisibility(item.isActionViewExpanded() ? View.GONE : View.VISIBLE);
  final ActionMenuView menuParent=(ActionMenuView)parent;
  final ViewGroup.LayoutParams lp=actionView.getLayoutParams();
  if (!menuParent.checkLayoutParams(lp)) {
    actionView.setLayoutParams(menuParent.generateLayoutParams(lp));
  }
  return actionView;
}
Program: 199792
Project: 199792
Buggy source:
@Override public void bindItemView(MenuItemImpl item,MenuView.ItemView itemView){
  itemView.initialize(item,0);
  final ActionMenuView menuView=(ActionMenuView)mMenuView;
  ActionMenuItemView actionItemView=(ActionMenuItemView)itemView;
  actionItemView.setItemInvoker(menuView);
}

Fixed version (ground truth):
@Override public void bindItemView(final MenuItemImpl item,MenuView.ItemView itemView){
  itemView.initialize(item,0);
  final ActionMenuView menuView=(ActionMenuView)mMenuView;
  final ActionMenuItemView actionItemView=(ActionMenuItemView)itemView;
  actionItemView.setItemInvoker(menuView);
  if (item.hasSubMenu()) {
    actionItemView.setOnTouchListener(new ForwardingListener(actionItemView){
      @Override public ListPopupWindow getPopup(){
        return mActionButtonPopup != null ? mActionButtonPopup.getPopup() : null;
      }
      @Override protected boolean onForwardingStarted(){
        return onSubMenuSelected((SubMenuBuilder)item.getSubMenu());
      }
      @Override protected boolean onForwardingStopped(){
        return dismissPopupMenus();
      }
    }
);
  }
 else {
    actionItemView.setOnTouchListener(null);
  }
}
Program: 199796
Project: 199796
Buggy source:
AnimationInfo(View view,String name,TransitionValues values){
  this.view=view;
  this.name=name;
  this.values=values;
}

Fixed version (ground truth):
AnimationInfo(View view,String name,WindowId windowId,TransitionValues values){
  this.view=view;
  this.name=name;
  this.values=values;
  this.windowId=windowId;
}
Program: 199797
Project: 199797
Buggy source:
/** 
 * Pauses this transition, sending out calls to   {@link TransitionListener#onTransitionPause(Transition)} to all listenersand pausing all running animators started by this transition.
 * @hide
 */
public void pause(){
  if (!mEnded) {
    ArrayMap<Animator,AnimationInfo> runningAnimators=getRunningAnimators();
    int numOldAnims=runningAnimators.size();
    for (int i=numOldAnims - 1; i >= 0; i--) {
      Animator anim=runningAnimators.keyAt(i);
      anim.pause();
    }
    if (mListeners != null && mListeners.size() > 0) {
      ArrayList<TransitionListener> tmpListeners=(ArrayList<TransitionListener>)mListeners.clone();
      int numListeners=tmpListeners.size();
      for (int i=0; i < numListeners; ++i) {
        tmpListeners.get(i).onTransitionPause(this);
      }
    }
    mPaused=true;
  }
}

Fixed version (ground truth):
/** 
 * Pauses this transition, sending out calls to   {@link TransitionListener#onTransitionPause(Transition)} to all listenersand pausing all running animators started by this transition.
 * @hide
 */
public void pause(View sceneRoot){
  if (!mEnded) {
    ArrayMap<Animator,AnimationInfo> runningAnimators=getRunningAnimators();
    int numOldAnims=runningAnimators.size();
    WindowId windowId=sceneRoot.getWindowId();
    for (int i=numOldAnims - 1; i >= 0; i--) {
      AnimationInfo info=runningAnimators.valueAt(i);
      if (info.view != null && windowId.equals(info.windowId)) {
        Animator anim=runningAnimators.keyAt(i);
        anim.pause();
      }
    }
    if (mListeners != null && mListeners.size() > 0) {
      ArrayList<TransitionListener> tmpListeners=(ArrayList<TransitionListener>)mListeners.clone();
      int numListeners=tmpListeners.size();
      for (int i=0; i < numListeners; ++i) {
        tmpListeners.get(i).onTransitionPause(this);
      }
    }
    mPaused=true;
  }
}
Program: 199798
Project: 199798
Buggy source:
/** 
 * Resumes this transition, sending out calls to   {@link TransitionListener#onTransitionPause(Transition)} to all listenersand pausing all running animators started by this transition.
 * @hide
 */
public void resume(){
  if (mPaused) {
    if (!mEnded) {
      ArrayMap<Animator,AnimationInfo> runningAnimators=getRunningAnimators();
      int numOldAnims=runningAnimators.size();
      for (int i=numOldAnims - 1; i >= 0; i--) {
        Animator anim=runningAnimators.keyAt(i);
        anim.resume();
      }
      if (mListeners != null && mListeners.size() > 0) {
        ArrayList<TransitionListener> tmpListeners=(ArrayList<TransitionListener>)mListeners.clone();
        int numListeners=tmpListeners.size();
        for (int i=0; i < numListeners; ++i) {
          tmpListeners.get(i).onTransitionResume(this);
        }
      }
    }
    mPaused=false;
  }
}

Fixed version (ground truth):
/** 
 * Resumes this transition, sending out calls to   {@link TransitionListener#onTransitionPause(Transition)} to all listenersand pausing all running animators started by this transition.
 * @hide
 */
public void resume(View sceneRoot){
  if (mPaused) {
    if (!mEnded) {
      ArrayMap<Animator,AnimationInfo> runningAnimators=getRunningAnimators();
      int numOldAnims=runningAnimators.size();
      WindowId windowId=sceneRoot.getWindowId();
      for (int i=numOldAnims - 1; i >= 0; i--) {
        AnimationInfo info=runningAnimators.valueAt(i);
        if (info.view != null && windowId.equals(info.windowId)) {
          Animator anim=runningAnimators.keyAt(i);
          anim.resume();
        }
      }
      if (mListeners != null && mListeners.size() > 0) {
        ArrayList<TransitionListener> tmpListeners=(ArrayList<TransitionListener>)mListeners.clone();
        int numListeners=tmpListeners.size();
        for (int i=0; i < numListeners; ++i) {
          tmpListeners.get(i).onTransitionResume(this);
        }
      }
    }
    mPaused=false;
  }
}
Program: 199799
Project: 199799
Buggy source:
private static void sceneChangeSetup(ViewGroup sceneRoot,Transition transition){
  ArrayList<Transition> runningTransitions=getRunningTransitions().get(sceneRoot);
  if (runningTransitions != null && runningTransitions.size() > 0) {
    for (    Transition runningTransition : runningTransitions) {
      runningTransition.pause();
    }
  }
  if (transition != null) {
    transition.captureValues(sceneRoot,true);
  }
  Scene previousScene=Scene.getCurrentScene(sceneRoot);
  if (previousScene != null) {
    previousScene.exit();
  }
}

Fixed version (ground truth):
private static void sceneChangeSetup(ViewGroup sceneRoot,Transition transition){
  ArrayList<Transition> runningTransitions=getRunningTransitions().get(sceneRoot);
  if (runningTransitions != null && runningTransitions.size() > 0) {
    for (    Transition runningTransition : runningTransitions) {
      runningTransition.pause(sceneRoot);
    }
  }
  if (transition != null) {
    transition.captureValues(sceneRoot,true);
  }
  Scene previousScene=Scene.getCurrentScene(sceneRoot);
  if (previousScene != null) {
    previousScene.exit();
  }
}
Program: 199800
Project: 199800
Buggy source:
@Override public boolean onPreDraw(){
  removeListeners();
  sPendingTransitions.remove(mSceneRoot);
  final ArrayMap<ViewGroup,ArrayList<Transition>> runningTransitions=getRunningTransitions();
  ArrayList<Transition> currentTransitions=runningTransitions.get(mSceneRoot);
  ArrayList<Transition> previousRunningTransitions=null;
  if (currentTransitions == null) {
    currentTransitions=new ArrayList<Transition>();
    runningTransitions.put(mSceneRoot,currentTransitions);
  }
 else   if (currentTransitions.size() > 0) {
    previousRunningTransitions=new ArrayList<Transition>(currentTransitions);
  }
  currentTransitions.add(mTransition);
  mTransition.addListener(new Transition.TransitionListenerAdapter(){
    @Override public void onTransitionEnd(    Transition transition){
      ArrayList<Transition> currentTransitions=runningTransitions.get(mSceneRoot);
      currentTransitions.remove(transition);
    }
  }
);
  mTransition.captureValues(mSceneRoot,false);
  if (previousRunningTransitions != null) {
    for (    Transition runningTransition : previousRunningTransitions) {
      runningTransition.resume();
    }
  }
  mTransition.playTransition(mSceneRoot);
  return true;
}

Fixed version (ground truth):
@Override public boolean onPreDraw(){
  removeListeners();
  sPendingTransitions.remove(mSceneRoot);
  final ArrayMap<ViewGroup,ArrayList<Transition>> runningTransitions=getRunningTransitions();
  ArrayList<Transition> currentTransitions=runningTransitions.get(mSceneRoot);
  ArrayList<Transition> previousRunningTransitions=null;
  if (currentTransitions == null) {
    currentTransitions=new ArrayList<Transition>();
    runningTransitions.put(mSceneRoot,currentTransitions);
  }
 else   if (currentTransitions.size() > 0) {
    previousRunningTransitions=new ArrayList<Transition>(currentTransitions);
  }
  currentTransitions.add(mTransition);
  mTransition.addListener(new Transition.TransitionListenerAdapter(){
    @Override public void onTransitionEnd(    Transition transition){
      ArrayList<Transition> currentTransitions=runningTransitions.get(mSceneRoot);
      currentTransitions.remove(transition);
    }
  }
);
  mTransition.captureValues(mSceneRoot,false);
  if (previousRunningTransitions != null) {
    for (    Transition runningTransition : previousRunningTransitions) {
      runningTransition.resume(mSceneRoot);
    }
  }
  mTransition.playTransition(mSceneRoot);
  return true;
}
Program: 199801
Project: 199801
Buggy source:
@Override public void onViewDetachedFromWindow(View v){
  removeListeners();
  sPendingTransitions.remove(mSceneRoot);
  ArrayList<Transition> runningTransitions=getRunningTransitions().get(mSceneRoot);
  if (runningTransitions != null && runningTransitions.size() > 0) {
    for (    Transition runningTransition : runningTransitions) {
      runningTransition.resume();
    }
  }
  mTransition.clearValues(true);
}

Fixed version (ground truth):
@Override public void onViewDetachedFromWindow(View v){
  removeListeners();
  sPendingTransitions.remove(mSceneRoot);
  ArrayList<Transition> runningTransitions=getRunningTransitions().get(mSceneRoot);
  if (runningTransitions != null && runningTransitions.size() > 0) {
    for (    Transition runningTransition : runningTransitions) {
      runningTransition.resume(mSceneRoot);
    }
  }
  mTransition.clearValues(true);
}
Program: 199802
Project: 199802
Buggy source:
/** 
 * @hide 
 */
@Override public void resume(){
  super.resume();
  int numTransitions=mTransitions.size();
  for (int i=0; i < numTransitions; ++i) {
    mTransitions.get(i).resume();
  }
}

Fixed version (ground truth):
/** 
 * @hide 
 */
@Override public void resume(View sceneRoot){
  super.resume(sceneRoot);
  int numTransitions=mTransitions.size();
  for (int i=0; i < numTransitions; ++i) {
    mTransitions.get(i).resume(sceneRoot);
  }
}
Program: 199803
Project: 199803
Buggy source:
/** 
 * @hide 
 */
@Override public void pause(){
  super.pause();
  int numTransitions=mTransitions.size();
  for (int i=0; i < numTransitions; ++i) {
    mTransitions.get(i).pause();
  }
}

Fixed version (ground truth):
/** 
 * @hide 
 */
@Override public void pause(View sceneRoot){
  super.pause(sceneRoot);
  int numTransitions=mTransitions.size();
  for (int i=0; i < numTransitions; ++i) {
    mTransitions.get(i).pause(sceneRoot);
  }
}
Program: 199804
Project: 199804
Buggy source:
void finishInstrumentationLocked(ProcessRecord app,int resultCode,Bundle results){
  if (app.instrumentationWatcher != null) {
    try {
      app.instrumentationWatcher.instrumentationFinished(app.instrumentationClass,resultCode,results);
    }
 catch (    RemoteException e) {
    }
  }
  if (app.instrumentationUiAutomationConnection != null) {
    try {
      app.instrumentationUiAutomationConnection.shutdown();
    }
 catch (    RemoteException re) {
    }
    mUserIsMonkey=false;
  }
  app.instrumentationWatcher=null;
  app.instrumentationUiAutomationConnection=null;
  app.instrumentationClass=null;
  app.instrumentationInfo=null;
  app.instrumentationProfileFile=null;
  app.instrumentationArguments=null;
  forceStopPackageLocked(app.info.packageName,-1,false,false,true,true,app.userId,"String_Node_Str");
}

Fixed version (ground truth):
void finishInstrumentationLocked(ProcessRecord app,int resultCode,Bundle results){
  if (app.instrumentationWatcher != null) {
    try {
      app.instrumentationWatcher.instrumentationFinished(app.instrumentationClass,resultCode,results);
    }
 catch (    RemoteException e) {
    }
  }
  if (app.instrumentationUiAutomationConnection != null) {
    try {
      app.instrumentationUiAutomationConnection.shutdown();
    }
 catch (    RemoteException re) {
    }
    mUserIsMonkey=false;
  }
  app.instrumentationWatcher=null;
  app.instrumentationUiAutomationConnection=null;
  app.instrumentationClass=null;
  app.instrumentationInfo=null;
  app.instrumentationProfileFile=null;
  app.instrumentationArguments=null;
  forceStopPackageLocked(app.info.packageName,-1,false,false,true,true,false,app.userId,"String_Node_Str");
}
Program: 199806
Project: 199806
Buggy source:
private void forceStopUserLocked(int userId,String reason){
  forceStopPackageLocked(null,-1,false,false,true,false,userId,reason);
  Intent intent=new Intent(Intent.ACTION_USER_STOPPED);
  intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY | Intent.FLAG_RECEIVER_FOREGROUND);
  intent.putExtra(Intent.EXTRA_USER_HANDLE,userId);
  broadcastIntentLocked(null,null,intent,null,null,0,null,null,null,AppOpsManager.OP_NONE,false,false,MY_PID,Process.SYSTEM_UID,UserHandle.USER_ALL);
}

Fixed version (ground truth):
private void forceStopUserLocked(int userId,String reason){
  forceStopPackageLocked(null,-1,false,false,true,false,false,userId,reason);
  Intent intent=new Intent(Intent.ACTION_USER_STOPPED);
  intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY | Intent.FLAG_RECEIVER_FOREGROUND);
  intent.putExtra(Intent.EXTRA_USER_HANDLE,userId);
  broadcastIntentLocked(null,null,intent,null,null,0,null,null,null,AppOpsManager.OP_NONE,false,false,MY_PID,Process.SYSTEM_UID,UserHandle.USER_ALL);
}
Program: 199809
Project: 199809
Buggy source:
public void setDebugApp(String packageName,boolean waitForDebugger,boolean persistent){
  enforceCallingPermission(android.Manifest.permission.SET_DEBUG_APP,"String_Node_Str");
  long ident=Binder.clearCallingIdentity();
  try {
    if (persistent) {
      final ContentResolver resolver=mContext.getContentResolver();
      Settings.Global.putString(resolver,Settings.Global.DEBUG_APP,packageName);
      Settings.Global.putInt(resolver,Settings.Global.WAIT_FOR_DEBUGGER,waitForDebugger ? 1 : 0);
    }
synchronized (this) {
      if (!persistent) {
        mOrigDebugApp=mDebugApp;
        mOrigWaitForDebugger=mWaitForDebugger;
      }
      mDebugApp=packageName;
      mWaitForDebugger=waitForDebugger;
      mDebugTransient=!persistent;
      if (packageName != null) {
        forceStopPackageLocked(packageName,-1,false,false,true,true,UserHandle.USER_ALL,"String_Node_Str");
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}

Fixed version (ground truth):
public void setDebugApp(String packageName,boolean waitForDebugger,boolean persistent){
  enforceCallingPermission(android.Manifest.permission.SET_DEBUG_APP,"String_Node_Str");
  long ident=Binder.clearCallingIdentity();
  try {
    if (persistent) {
      final ContentResolver resolver=mContext.getContentResolver();
      Settings.Global.putString(resolver,Settings.Global.DEBUG_APP,packageName);
      Settings.Global.putInt(resolver,Settings.Global.WAIT_FOR_DEBUGGER,waitForDebugger ? 1 : 0);
    }
synchronized (this) {
      if (!persistent) {
        mOrigDebugApp=mDebugApp;
        mOrigWaitForDebugger=mWaitForDebugger;
      }
      mDebugApp=packageName;
      mWaitForDebugger=waitForDebugger;
      mDebugTransient=!persistent;
      if (packageName != null) {
        forceStopPackageLocked(packageName,-1,false,false,true,true,false,UserHandle.USER_ALL,"String_Node_Str");
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}
Program: 199811
Project: 199811
Buggy source:
void finishInstrumentationLocked(ProcessRecord app,int resultCode,Bundle results){
  if (app.instrumentationWatcher != null) {
    try {
      app.instrumentationWatcher.instrumentationFinished(app.instrumentationClass,resultCode,results);
    }
 catch (    RemoteException e) {
    }
  }
  if (app.instrumentationUiAutomationConnection != null) {
    try {
      app.instrumentationUiAutomationConnection.shutdown();
    }
 catch (    RemoteException re) {
    }
    mUserIsMonkey=false;
  }
  app.instrumentationWatcher=null;
  app.instrumentationUiAutomationConnection=null;
  app.instrumentationClass=null;
  app.instrumentationInfo=null;
  app.instrumentationProfileFile=null;
  app.instrumentationArguments=null;
  forceStopPackageLocked(app.info.packageName,-1,false,false,true,true,app.userId,"String_Node_Str");
}

Fixed version (ground truth):
void finishInstrumentationLocked(ProcessRecord app,int resultCode,Bundle results){
  if (app.instrumentationWatcher != null) {
    try {
      app.instrumentationWatcher.instrumentationFinished(app.instrumentationClass,resultCode,results);
    }
 catch (    RemoteException e) {
    }
  }
  if (app.instrumentationUiAutomationConnection != null) {
    try {
      app.instrumentationUiAutomationConnection.shutdown();
    }
 catch (    RemoteException re) {
    }
    mUserIsMonkey=false;
  }
  app.instrumentationWatcher=null;
  app.instrumentationUiAutomationConnection=null;
  app.instrumentationClass=null;
  app.instrumentationInfo=null;
  app.instrumentationProfileFile=null;
  app.instrumentationArguments=null;
  forceStopPackageLocked(app.info.packageName,-1,false,false,true,true,false,app.userId,"String_Node_Str");
}
Program: 199813
Project: 199813
Buggy source:
private void forceStopUserLocked(int userId,String reason){
  forceStopPackageLocked(null,-1,false,false,true,false,userId,reason);
  Intent intent=new Intent(Intent.ACTION_USER_STOPPED);
  intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY | Intent.FLAG_RECEIVER_FOREGROUND);
  intent.putExtra(Intent.EXTRA_USER_HANDLE,userId);
  broadcastIntentLocked(null,null,intent,null,null,0,null,null,null,AppOpsManager.OP_NONE,false,false,MY_PID,Process.SYSTEM_UID,UserHandle.USER_ALL);
}

Fixed version (ground truth):
private void forceStopUserLocked(int userId,String reason){
  forceStopPackageLocked(null,-1,false,false,true,false,false,userId,reason);
  Intent intent=new Intent(Intent.ACTION_USER_STOPPED);
  intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY | Intent.FLAG_RECEIVER_FOREGROUND);
  intent.putExtra(Intent.EXTRA_USER_HANDLE,userId);
  broadcastIntentLocked(null,null,intent,null,null,0,null,null,null,AppOpsManager.OP_NONE,false,false,MY_PID,Process.SYSTEM_UID,UserHandle.USER_ALL);
}
Program: 199816
Project: 199816
Buggy source:
public void setDebugApp(String packageName,boolean waitForDebugger,boolean persistent){
  enforceCallingPermission(android.Manifest.permission.SET_DEBUG_APP,"String_Node_Str");
  long ident=Binder.clearCallingIdentity();
  try {
    if (persistent) {
      final ContentResolver resolver=mContext.getContentResolver();
      Settings.Global.putString(resolver,Settings.Global.DEBUG_APP,packageName);
      Settings.Global.putInt(resolver,Settings.Global.WAIT_FOR_DEBUGGER,waitForDebugger ? 1 : 0);
    }
synchronized (this) {
      if (!persistent) {
        mOrigDebugApp=mDebugApp;
        mOrigWaitForDebugger=mWaitForDebugger;
      }
      mDebugApp=packageName;
      mWaitForDebugger=waitForDebugger;
      mDebugTransient=!persistent;
      if (packageName != null) {
        forceStopPackageLocked(packageName,-1,false,false,true,true,UserHandle.USER_ALL,"String_Node_Str");
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}

Fixed version (ground truth):
public void setDebugApp(String packageName,boolean waitForDebugger,boolean persistent){
  enforceCallingPermission(android.Manifest.permission.SET_DEBUG_APP,"String_Node_Str");
  long ident=Binder.clearCallingIdentity();
  try {
    if (persistent) {
      final ContentResolver resolver=mContext.getContentResolver();
      Settings.Global.putString(resolver,Settings.Global.DEBUG_APP,packageName);
      Settings.Global.putInt(resolver,Settings.Global.WAIT_FOR_DEBUGGER,waitForDebugger ? 1 : 0);
    }
synchronized (this) {
      if (!persistent) {
        mOrigDebugApp=mDebugApp;
        mOrigWaitForDebugger=mWaitForDebugger;
      }
      mDebugApp=packageName;
      mWaitForDebugger=waitForDebugger;
      mDebugTransient=!persistent;
      if (packageName != null) {
        forceStopPackageLocked(packageName,-1,false,false,true,true,false,UserHandle.USER_ALL,"String_Node_Str");
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}
Program: 199819
Project: 199819
Buggy source:
void finishInstrumentationLocked(ProcessRecord app,int resultCode,Bundle results){
  if (app.instrumentationWatcher != null) {
    try {
      app.instrumentationWatcher.instrumentationFinished(app.instrumentationClass,resultCode,results);
    }
 catch (    RemoteException e) {
    }
  }
  if (app.instrumentationUiAutomationConnection != null) {
    try {
      app.instrumentationUiAutomationConnection.shutdown();
    }
 catch (    RemoteException re) {
    }
    mUserIsMonkey=false;
  }
  app.instrumentationWatcher=null;
  app.instrumentationUiAutomationConnection=null;
  app.instrumentationClass=null;
  app.instrumentationInfo=null;
  app.instrumentationProfileFile=null;
  app.instrumentationArguments=null;
  forceStopPackageLocked(app.info.packageName,-1,false,false,true,true,app.userId,"String_Node_Str");
}

Fixed version (ground truth):
void finishInstrumentationLocked(ProcessRecord app,int resultCode,Bundle results){
  if (app.instrumentationWatcher != null) {
    try {
      app.instrumentationWatcher.instrumentationFinished(app.instrumentationClass,resultCode,results);
    }
 catch (    RemoteException e) {
    }
  }
  if (app.instrumentationUiAutomationConnection != null) {
    try {
      app.instrumentationUiAutomationConnection.shutdown();
    }
 catch (    RemoteException re) {
    }
    mUserIsMonkey=false;
  }
  app.instrumentationWatcher=null;
  app.instrumentationUiAutomationConnection=null;
  app.instrumentationClass=null;
  app.instrumentationInfo=null;
  app.instrumentationProfileFile=null;
  app.instrumentationArguments=null;
  forceStopPackageLocked(app.info.packageName,-1,false,false,true,true,false,app.userId,"String_Node_Str");
}
Program: 199821
Project: 199821
Buggy source:
private void forceStopUserLocked(int userId,String reason){
  forceStopPackageLocked(null,-1,false,false,true,false,userId,reason);
  Intent intent=new Intent(Intent.ACTION_USER_STOPPED);
  intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY | Intent.FLAG_RECEIVER_FOREGROUND);
  intent.putExtra(Intent.EXTRA_USER_HANDLE,userId);
  broadcastIntentLocked(null,null,intent,null,null,0,null,null,null,AppOpsManager.OP_NONE,false,false,MY_PID,Process.SYSTEM_UID,UserHandle.USER_ALL);
}

Fixed version (ground truth):
private void forceStopUserLocked(int userId,String reason){
  forceStopPackageLocked(null,-1,false,false,true,false,false,userId,reason);
  Intent intent=new Intent(Intent.ACTION_USER_STOPPED);
  intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY | Intent.FLAG_RECEIVER_FOREGROUND);
  intent.putExtra(Intent.EXTRA_USER_HANDLE,userId);
  broadcastIntentLocked(null,null,intent,null,null,0,null,null,null,AppOpsManager.OP_NONE,false,false,MY_PID,Process.SYSTEM_UID,UserHandle.USER_ALL);
}
Program: 199824
Project: 199824
Buggy source:
public void setDebugApp(String packageName,boolean waitForDebugger,boolean persistent){
  enforceCallingPermission(android.Manifest.permission.SET_DEBUG_APP,"String_Node_Str");
  long ident=Binder.clearCallingIdentity();
  try {
    if (persistent) {
      final ContentResolver resolver=mContext.getContentResolver();
      Settings.Global.putString(resolver,Settings.Global.DEBUG_APP,packageName);
      Settings.Global.putInt(resolver,Settings.Global.WAIT_FOR_DEBUGGER,waitForDebugger ? 1 : 0);
    }
synchronized (this) {
      if (!persistent) {
        mOrigDebugApp=mDebugApp;
        mOrigWaitForDebugger=mWaitForDebugger;
      }
      mDebugApp=packageName;
      mWaitForDebugger=waitForDebugger;
      mDebugTransient=!persistent;
      if (packageName != null) {
        forceStopPackageLocked(packageName,-1,false,false,true,true,UserHandle.USER_ALL,"String_Node_Str");
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}

Fixed version (ground truth):
public void setDebugApp(String packageName,boolean waitForDebugger,boolean persistent){
  enforceCallingPermission(android.Manifest.permission.SET_DEBUG_APP,"String_Node_Str");
  long ident=Binder.clearCallingIdentity();
  try {
    if (persistent) {
      final ContentResolver resolver=mContext.getContentResolver();
      Settings.Global.putString(resolver,Settings.Global.DEBUG_APP,packageName);
      Settings.Global.putInt(resolver,Settings.Global.WAIT_FOR_DEBUGGER,waitForDebugger ? 1 : 0);
    }
synchronized (this) {
      if (!persistent) {
        mOrigDebugApp=mDebugApp;
        mOrigWaitForDebugger=mWaitForDebugger;
      }
      mDebugApp=packageName;
      mWaitForDebugger=waitForDebugger;
      mDebugTransient=!persistent;
      if (packageName != null) {
        forceStopPackageLocked(packageName,-1,false,false,true,true,false,UserHandle.USER_ALL,"String_Node_Str");
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}
Program: 199826
Project: 199826
Buggy source:
@Override public void onServiceConnected(ComponentName name,IBinder service){
synchronized (mLock) {
    if (mWallpaper.connection == this) {
      mWallpaper.lastDiedTime=SystemClock.uptimeMillis();
      mService=IWallpaperService.Stub.asInterface(service);
      attachServiceLocked(this,mWallpaper);
      saveSettingsLocked(mWallpaper);
    }
  }
}

Fixed version (ground truth):
@Override public void onServiceConnected(ComponentName name,IBinder service){
synchronized (mLock) {
    if (mWallpaper.connection == this) {
      mService=IWallpaperService.Stub.asInterface(service);
      attachServiceLocked(this,mWallpaper);
      saveSettingsLocked(mWallpaper);
    }
  }
}
Program: 199828
Project: 199828
Buggy source:
@Override public void onServiceDisconnected(ComponentName name){
synchronized (mLock) {
    mService=null;
    mEngine=null;
    if (mWallpaper.connection == this) {
      Slog.w(TAG,"String_Node_Str" + mWallpaper.wallpaperComponent);
      if (!mWallpaper.wallpaperUpdating && (mWallpaper.lastDiedTime + MIN_WALLPAPER_CRASH_TIME) > SystemClock.uptimeMillis() && mWallpaper.userId == mCurrentUserId) {
        Slog.w(TAG,"String_Node_Str");
        clearWallpaperLocked(true,mWallpaper.userId,null);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onServiceDisconnected(ComponentName name){
synchronized (mLock) {
    mService=null;
    mEngine=null;
    if (mWallpaper.connection == this) {
      Slog.w(TAG,"String_Node_Str" + mWallpaper.wallpaperComponent);
      if (!mWallpaper.wallpaperUpdating && mWallpaper.userId == mCurrentUserId) {
        if (mWallpaper.lastDiedTime != 0 && mWallpaper.lastDiedTime + MIN_WALLPAPER_CRASH_TIME > SystemClock.uptimeMillis()) {
          Slog.w(TAG,"String_Node_Str");
          clearWallpaperLocked(true,mWallpaper.userId,null);
        }
 else {
          mWallpaper.lastDiedTime=SystemClock.uptimeMillis();
        }
      }
    }
  }
}
Program: 199829
Project: 199829
Buggy source:
void finishInstrumentationLocked(ProcessRecord app,int resultCode,Bundle results){
  if (app.instrumentationWatcher != null) {
    try {
      app.instrumentationWatcher.instrumentationFinished(app.instrumentationClass,resultCode,results);
    }
 catch (    RemoteException e) {
    }
  }
  if (app.instrumentationUiAutomationConnection != null) {
    try {
      app.instrumentationUiAutomationConnection.shutdown();
    }
 catch (    RemoteException re) {
    }
    mUserIsMonkey=false;
  }
  app.instrumentationWatcher=null;
  app.instrumentationUiAutomationConnection=null;
  app.instrumentationClass=null;
  app.instrumentationInfo=null;
  app.instrumentationProfileFile=null;
  app.instrumentationArguments=null;
  forceStopPackageLocked(app.info.packageName,-1,false,false,true,true,app.userId,"String_Node_Str");
}

Fixed version (ground truth):
void finishInstrumentationLocked(ProcessRecord app,int resultCode,Bundle results){
  if (app.instrumentationWatcher != null) {
    try {
      app.instrumentationWatcher.instrumentationFinished(app.instrumentationClass,resultCode,results);
    }
 catch (    RemoteException e) {
    }
  }
  if (app.instrumentationUiAutomationConnection != null) {
    try {
      app.instrumentationUiAutomationConnection.shutdown();
    }
 catch (    RemoteException re) {
    }
    mUserIsMonkey=false;
  }
  app.instrumentationWatcher=null;
  app.instrumentationUiAutomationConnection=null;
  app.instrumentationClass=null;
  app.instrumentationInfo=null;
  app.instrumentationProfileFile=null;
  app.instrumentationArguments=null;
  forceStopPackageLocked(app.info.packageName,-1,false,false,true,true,false,app.userId,"String_Node_Str");
}
Program: 199831
Project: 199831
Buggy source:
private void forceStopUserLocked(int userId,String reason){
  forceStopPackageLocked(null,-1,false,false,true,false,userId,reason);
  Intent intent=new Intent(Intent.ACTION_USER_STOPPED);
  intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY | Intent.FLAG_RECEIVER_FOREGROUND);
  intent.putExtra(Intent.EXTRA_USER_HANDLE,userId);
  broadcastIntentLocked(null,null,intent,null,null,0,null,null,null,AppOpsManager.OP_NONE,false,false,MY_PID,Process.SYSTEM_UID,UserHandle.USER_ALL);
}

Fixed version (ground truth):
private void forceStopUserLocked(int userId,String reason){
  forceStopPackageLocked(null,-1,false,false,true,false,false,userId,reason);
  Intent intent=new Intent(Intent.ACTION_USER_STOPPED);
  intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY | Intent.FLAG_RECEIVER_FOREGROUND);
  intent.putExtra(Intent.EXTRA_USER_HANDLE,userId);
  broadcastIntentLocked(null,null,intent,null,null,0,null,null,null,AppOpsManager.OP_NONE,false,false,MY_PID,Process.SYSTEM_UID,UserHandle.USER_ALL);
}
Program: 199834
Project: 199834
Buggy source:
public void setDebugApp(String packageName,boolean waitForDebugger,boolean persistent){
  enforceCallingPermission(android.Manifest.permission.SET_DEBUG_APP,"String_Node_Str");
  long ident=Binder.clearCallingIdentity();
  try {
    if (persistent) {
      final ContentResolver resolver=mContext.getContentResolver();
      Settings.Global.putString(resolver,Settings.Global.DEBUG_APP,packageName);
      Settings.Global.putInt(resolver,Settings.Global.WAIT_FOR_DEBUGGER,waitForDebugger ? 1 : 0);
    }
synchronized (this) {
      if (!persistent) {
        mOrigDebugApp=mDebugApp;
        mOrigWaitForDebugger=mWaitForDebugger;
      }
      mDebugApp=packageName;
      mWaitForDebugger=waitForDebugger;
      mDebugTransient=!persistent;
      if (packageName != null) {
        forceStopPackageLocked(packageName,-1,false,false,true,true,UserHandle.USER_ALL,"String_Node_Str");
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}

Fixed version (ground truth):
public void setDebugApp(String packageName,boolean waitForDebugger,boolean persistent){
  enforceCallingPermission(android.Manifest.permission.SET_DEBUG_APP,"String_Node_Str");
  long ident=Binder.clearCallingIdentity();
  try {
    if (persistent) {
      final ContentResolver resolver=mContext.getContentResolver();
      Settings.Global.putString(resolver,Settings.Global.DEBUG_APP,packageName);
      Settings.Global.putInt(resolver,Settings.Global.WAIT_FOR_DEBUGGER,waitForDebugger ? 1 : 0);
    }
synchronized (this) {
      if (!persistent) {
        mOrigDebugApp=mDebugApp;
        mOrigWaitForDebugger=mWaitForDebugger;
      }
      mDebugApp=packageName;
      mWaitForDebugger=waitForDebugger;
      mDebugTransient=!persistent;
      if (packageName != null) {
        forceStopPackageLocked(packageName,-1,false,false,true,true,false,UserHandle.USER_ALL,"String_Node_Str");
      }
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}
Program: 199836
Project: 199836
Buggy source:
@Override public void onRtlPropertiesChanged(int layoutDirection){
  super.onRtlPropertiesChanged(layoutDirection);
  mTextDir=getTextDirectionHeuristic();
}

Fixed version (ground truth):
@Override public void onRtlPropertiesChanged(int layoutDirection){
  super.onRtlPropertiesChanged(layoutDirection);
  mTextDir=getTextDirectionHeuristic();
  if (mLayout != null) {
    checkForRelayout();
  }
}
Program: 199837
Project: 199837
Buggy source:
@Override public void onRtlPropertiesChanged(int layoutDirection){
  super.onRtlPropertiesChanged(layoutDirection);
  mTextDir=getTextDirectionHeuristic();
}

Fixed version (ground truth):
@Override public void onRtlPropertiesChanged(int layoutDirection){
  super.onRtlPropertiesChanged(layoutDirection);
  mTextDir=getTextDirectionHeuristic();
  if (mLayout != null) {
    checkForRelayout();
  }
}
Program: 199838
Project: 199838
Buggy source:
@Override public void onRtlPropertiesChanged(int layoutDirection){
  super.onRtlPropertiesChanged(layoutDirection);
  mTextDir=getTextDirectionHeuristic();
}

Fixed version (ground truth):
@Override public void onRtlPropertiesChanged(int layoutDirection){
  super.onRtlPropertiesChanged(layoutDirection);
  mTextDir=getTextDirectionHeuristic();
  if (mLayout != null) {
    checkForRelayout();
  }
}
Program: 199841
Project: 199841
Buggy source:
@Override public void onRtlPropertiesChanged(int layoutDirection){
  super.onRtlPropertiesChanged(layoutDirection);
  mTextDir=getTextDirectionHeuristic();
}

Fixed version (ground truth):
@Override public void onRtlPropertiesChanged(int layoutDirection){
  super.onRtlPropertiesChanged(layoutDirection);
  mTextDir=getTextDirectionHeuristic();
  if (mLayout != null) {
    checkForRelayout();
  }
}
Program: 199845
Project: 199845
Buggy source:
@Override public void onRtlPropertiesChanged(int layoutDirection){
  super.onRtlPropertiesChanged(layoutDirection);
  mTextDir=getTextDirectionHeuristic();
}

Fixed version (ground truth):
@Override public void onRtlPropertiesChanged(int layoutDirection){
  super.onRtlPropertiesChanged(layoutDirection);
  mTextDir=getTextDirectionHeuristic();
  if (mLayout != null) {
    checkForRelayout();
  }
}
Program: 199848
Project: 199848
Buggy source:
@Override public void onRtlPropertiesChanged(int layoutDirection){
  super.onRtlPropertiesChanged(layoutDirection);
  mTextDir=getTextDirectionHeuristic();
}

Fixed version (ground truth):
@Override public void onRtlPropertiesChanged(int layoutDirection){
  super.onRtlPropertiesChanged(layoutDirection);
  mTextDir=getTextDirectionHeuristic();
  if (mLayout != null) {
    checkForRelayout();
  }
}
Program: 199851
Project: 199851
Buggy source:
/** 
 * Return estimated power (in mAs) of sending or receiving a packet with the mobile radio.
 */
private double getMobilePowerPerPacket(){
  final long MOBILE_BPS=200000;
  final double MOBILE_POWER=mPowerProfile.getAveragePower(PowerProfile.POWER_RADIO_ACTIVE) / 3600;
  final long mobileRx=mStats.getNetworkActivityPackets(NETWORK_MOBILE_RX_DATA,mStatsType);
  final long mobileTx=mStats.getNetworkActivityPackets(NETWORK_MOBILE_TX_DATA,mStatsType);
  final long mobileData=mobileRx + mobileTx;
  final long radioDataUptimeMs=mStats.getMobileRadioActiveTime(mBatteryRealtime,mStatsType) / 1000;
  final double mobilePps=radioDataUptimeMs != 0 ? mobileData / (double)radioDataUptimeMs : (((double)MOBILE_BPS) / 8 / 2048);
  return (MOBILE_POWER / mobilePps) / (60 * 60);
}

Fixed version (ground truth):
/** 
 * Return estimated power (in mAs) of sending or receiving a packet with the mobile radio.
 */
private double getMobilePowerPerPacket(){
  final long MOBILE_BPS=200000;
  final double MOBILE_POWER=mPowerProfile.getAveragePower(PowerProfile.POWER_RADIO_ACTIVE) / 3600;
  final long mobileRx=mStats.getNetworkActivityPackets(NETWORK_MOBILE_RX_DATA,mStatsType);
  final long mobileTx=mStats.getNetworkActivityPackets(NETWORK_MOBILE_TX_DATA,mStatsType);
  final long mobileData=mobileRx + mobileTx;
  final long radioDataUptimeMs=mStats.getMobileRadioActiveTime(mBatteryRealtime,mStatsType) / 1000;
  final double mobilePps=(mobileData != 0 && radioDataUptimeMs != 0) ? (mobileData / (double)radioDataUptimeMs) : (((double)MOBILE_BPS) / 8 / 2048);
  return (MOBILE_POWER / mobilePps) / (60 * 60);
}
Program: 199853
Project: 199853
Buggy source:
/** 
 * Return estimated power (in mAs) of sending or receiving a packet with the mobile radio.
 */
private double getMobilePowerPerPacket(){
  final long MOBILE_BPS=200000;
  final double MOBILE_POWER=mPowerProfile.getAveragePower(PowerProfile.POWER_RADIO_ACTIVE) / 3600;
  final long mobileRx=mStats.getNetworkActivityPackets(NETWORK_MOBILE_RX_DATA,mStatsType);
  final long mobileTx=mStats.getNetworkActivityPackets(NETWORK_MOBILE_TX_DATA,mStatsType);
  final long mobileData=mobileRx + mobileTx;
  final long radioDataUptimeMs=mStats.getMobileRadioActiveTime(mBatteryRealtime,mStatsType) / 1000;
  final double mobilePps=radioDataUptimeMs != 0 ? mobileData / (double)radioDataUptimeMs : (((double)MOBILE_BPS) / 8 / 2048);
  return (MOBILE_POWER / mobilePps) / (60 * 60);
}

Fixed version (ground truth):
/** 
 * Return estimated power (in mAs) of sending or receiving a packet with the mobile radio.
 */
private double getMobilePowerPerPacket(){
  final long MOBILE_BPS=200000;
  final double MOBILE_POWER=mPowerProfile.getAveragePower(PowerProfile.POWER_RADIO_ACTIVE) / 3600;
  final long mobileRx=mStats.getNetworkActivityPackets(NETWORK_MOBILE_RX_DATA,mStatsType);
  final long mobileTx=mStats.getNetworkActivityPackets(NETWORK_MOBILE_TX_DATA,mStatsType);
  final long mobileData=mobileRx + mobileTx;
  final long radioDataUptimeMs=mStats.getMobileRadioActiveTime(mBatteryRealtime,mStatsType) / 1000;
  final double mobilePps=(mobileData != 0 && radioDataUptimeMs != 0) ? (mobileData / (double)radioDataUptimeMs) : (((double)MOBILE_BPS) / 8 / 2048);
  return (MOBILE_POWER / mobilePps) / (60 * 60);
}