nus-yam/ex-repair huggingface dataset:
Program: 183255
Project: 183255
Buggy source:
/** 
 * Drop a content provider from a ProcessRecord's bookkeeping
 * @param cpr
 */
public void removeContentProvider(IApplicationThread caller,String name){
synchronized (this) {
    ContentProviderRecord cpr=(ContentProviderRecord)mProvidersByName.get(name);
    if (cpr == null) {
      if (localLOGV)       Log.v(TAG,name + "String_Node_Str");
      return;
    }
    final ProcessRecord r=getRecordForAppLocked(caller);
    if (r == null) {
      throw new SecurityException("String_Node_Str" + caller + "String_Node_Str"+ name);
    }
    ContentProviderRecord localCpr=(ContentProviderRecord)mProvidersByClass.get(cpr.info.name);
    if (localLOGV)     Log.v(TAG,"String_Node_Str" + r.info.processName + "String_Node_Str"+ localCpr.appInfo.processName);
    if (localCpr.appInfo.processName == r.info.processName) {
      if (localLOGV)       Log.v(TAG,"String_Node_Str");
      return;
    }
 else {
      localCpr.clients.remove(r);
      r.conProviders.remove(localCpr);
    }
    updateOomAdjLocked();
  }
}

Fixed version (ground truth):
/** 
 * Drop a content provider from a ProcessRecord's bookkeeping
 * @param cpr
 */
public void removeContentProvider(IApplicationThread caller,String name){
synchronized (this) {
    ContentProviderRecord cpr=(ContentProviderRecord)mProvidersByName.get(name);
    if (cpr == null) {
      if (DEBUG_PROVIDER)       Log.v(TAG,name + "String_Node_Str");
      return;
    }
    final ProcessRecord r=getRecordForAppLocked(caller);
    if (r == null) {
      throw new SecurityException("String_Node_Str" + caller + "String_Node_Str"+ name);
    }
    ContentProviderRecord localCpr=(ContentProviderRecord)mProvidersByClass.get(cpr.info.name);
    if (DEBUG_PROVIDER)     Log.v(TAG,"String_Node_Str" + r.info.processName + "String_Node_Str"+ localCpr.appInfo.processName);
    if (localCpr.app == r) {
      Log.w(TAG,"String_Node_Str" + cpr.info.name + "String_Node_Str"+ r.processName);
      return;
    }
 else {
      localCpr.clients.remove(r);
      r.conProviders.remove(localCpr);
    }
    updateOomAdjLocked();
  }
}
Program: 183258
Project: 183258
Buggy source:
Globals(Looper looper){
  IBinder b=ServiceManager.getService(Context.WALLPAPER_SERVICE);
  mService=IWallpaperManager.Stub.asInterface(b);
  mHandler=new Handler(){
    @Override public void handleMessage(    Message msg){
switch (msg.what) {
case MSG_CLEAR_WALLPAPER:
synchronized (this) {
          mWallpaper=null;
        }
      break;
  }
}
}
;
}

Fixed version (ground truth):
Globals(Looper looper){
  IBinder b=ServiceManager.getService(Context.WALLPAPER_SERVICE);
  mService=IWallpaperManager.Stub.asInterface(b);
  mHandler=new Handler(looper){
    @Override public void handleMessage(    Message msg){
switch (msg.what) {
case MSG_CLEAR_WALLPAPER:
synchronized (this) {
          mWallpaper=null;
        }
      break;
  }
}
}
;
}
Program: 183259
Project: 183259
Buggy source:
private final int reAddWindowLocked(int index,WindowState win){
  final int NCW=win.mChildWindows.size();
  boolean added=false;
  for (int j=0; j < NCW; j++) {
    WindowState cwin=(WindowState)win.mChildWindows.get(j);
    if (!added && cwin.mSubLayer >= 0) {
      mWindows.add(index,win);
      index++;
      added=true;
    }
    mWindows.add(index,cwin);
    index++;
  }
  if (!added) {
    mWindows.add(index,win);
    index++;
  }
  return index;
}

Fixed version (ground truth):
private final int reAddWindowLocked(int index,WindowState win){
  final int NCW=win.mChildWindows.size();
  boolean added=false;
  for (int j=0; j < NCW; j++) {
    WindowState cwin=(WindowState)win.mChildWindows.get(j);
    if (!added && cwin.mSubLayer >= 0) {
      if (DEBUG_WINDOW_MOVEMENT)       Log.v(TAG,"String_Node_Str" + index + "String_Node_Str"+ cwin);
      mWindows.add(index,win);
      index++;
      added=true;
    }
    if (DEBUG_WINDOW_MOVEMENT)     Log.v(TAG,"String_Node_Str" + index + "String_Node_Str"+ cwin);
    mWindows.add(index,cwin);
    index++;
  }
  if (!added) {
    if (DEBUG_WINDOW_MOVEMENT)     Log.v(TAG,"String_Node_Str" + index + "String_Node_Str"+ win);
    mWindows.add(index,win);
    index++;
  }
  return index;
}
Program: 183260
Project: 183260
Buggy source:
Configuration updateOrientationFromAppTokensUnchecked(Configuration currentConfig,IBinder freezeThisOneIfNeeded){
  Configuration config;
synchronized (mWindowMap) {
    config=updateOrientationFromAppTokensLocked(currentConfig,freezeThisOneIfNeeded);
  }
  if (config != null) {
    mLayoutNeeded=true;
    performLayoutAndPlaceSurfacesLocked();
  }
  return config;
}

Fixed version (ground truth):
Configuration updateOrientationFromAppTokensUnchecked(Configuration currentConfig,IBinder freezeThisOneIfNeeded){
  Configuration config;
synchronized (mWindowMap) {
    config=updateOrientationFromAppTokensLocked(currentConfig,freezeThisOneIfNeeded);
    if (config != null) {
      mLayoutNeeded=true;
      performLayoutAndPlaceSurfacesLocked();
    }
  }
  return config;
}
Program: 183262
Project: 183262
Buggy source:
private boolean tmpRemoveAppWindowsLocked(WindowToken token){
  final int NW=token.windows.size();
  for (int i=0; i < NW; i++) {
    WindowState win=token.windows.get(i);
    mWindows.remove(win);
    int j=win.mChildWindows.size();
    while (j > 0) {
      j--;
      mWindows.remove(win.mChildWindows.get(j));
    }
  }
  return NW > 0;
}

Fixed version (ground truth):
private boolean tmpRemoveAppWindowsLocked(WindowToken token){
  final int NW=token.windows.size();
  for (int i=0; i < NW; i++) {
    WindowState win=token.windows.get(i);
    if (DEBUG_WINDOW_MOVEMENT)     Log.v(TAG,"String_Node_Str" + win);
    mWindows.remove(win);
    int j=win.mChildWindows.size();
    while (j > 0) {
      j--;
      WindowState cwin=(WindowState)win.mChildWindows.get(j);
      if (DEBUG_WINDOW_MOVEMENT)       Log.v(TAG,"String_Node_Str" + cwin);
      mWindows.remove(cwin);
    }
  }
  return NW > 0;
}
Program: 183264
Project: 183264
Buggy source:
final void rebuildAppWindowListLocked(){
  int NW=mWindows.size();
  int i;
  i=0;
  while (i < NW) {
    if (((WindowState)mWindows.get(i)).mAppToken != null) {
      mWindows.remove(i);
      NW--;
      continue;
    }
    i++;
  }
  int NT=mAppTokens.size();
  i=0;
  for (int j=0; j < NT; j++) {
    AppWindowToken wt=mAppTokens.get(j);
    final int NTW=wt.windows.size();
    for (int k=0; k < NTW; k++) {
      WindowState win=wt.windows.get(k);
      final int NC=win.mChildWindows.size();
      int c;
      for (c=0; c < NC; c++) {
        WindowState cwin=(WindowState)win.mChildWindows.get(c);
        if (cwin.mSubLayer >= 0) {
          break;
        }
        mWindows.add(i,cwin);
        i++;
      }
      mWindows.add(i,win);
      i++;
      for (; c < NC; c++) {
        WindowState cwin=(WindowState)win.mChildWindows.get(c);
        mWindows.add(i,cwin);
        i++;
      }
    }
  }
}

Fixed version (ground truth):
final void rebuildAppWindowListLocked(){
  int NW=mWindows.size();
  int i;
  i=0;
  while (i < NW) {
    if (((WindowState)mWindows.get(i)).mAppToken != null) {
      WindowState win=(WindowState)mWindows.remove(i);
      if (DEBUG_WINDOW_MOVEMENT)       Log.v(TAG,"String_Node_Str" + win);
      NW--;
      continue;
    }
    i++;
  }
  int NT=mExitingAppTokens.size();
  i=0;
  for (int j=0; j < NT; j++) {
    i=reAddAppWindowsLocked(i,mExitingAppTokens.get(j));
  }
  NT=mAppTokens.size();
  for (int j=0; j < NT; j++) {
    i=reAddAppWindowsLocked(i,mAppTokens.get(j));
  }
}
Program: 183265
Project: 183265
Buggy source:
Globals(Looper looper){
  IBinder b=ServiceManager.getService(Context.WALLPAPER_SERVICE);
  mService=IWallpaperManager.Stub.asInterface(b);
  mHandler=new Handler(){
    @Override public void handleMessage(    Message msg){
switch (msg.what) {
case MSG_CLEAR_WALLPAPER:
synchronized (this) {
          mWallpaper=null;
        }
      break;
  }
}
}
;
}

Fixed version (ground truth):
Globals(Looper looper){
  IBinder b=ServiceManager.getService(Context.WALLPAPER_SERVICE);
  mService=IWallpaperManager.Stub.asInterface(b);
  mHandler=new Handler(looper){
    @Override public void handleMessage(    Message msg){
switch (msg.what) {
case MSG_CLEAR_WALLPAPER:
synchronized (this) {
          mWallpaper=null;
        }
      break;
  }
}
}
;
}
Program: 183266
Project: 183266
Buggy source:
private final int reAddWindowLocked(int index,WindowState win){
  final int NCW=win.mChildWindows.size();
  boolean added=false;
  for (int j=0; j < NCW; j++) {
    WindowState cwin=(WindowState)win.mChildWindows.get(j);
    if (!added && cwin.mSubLayer >= 0) {
      mWindows.add(index,win);
      index++;
      added=true;
    }
    mWindows.add(index,cwin);
    index++;
  }
  if (!added) {
    mWindows.add(index,win);
    index++;
  }
  return index;
}

Fixed version (ground truth):
private final int reAddWindowLocked(int index,WindowState win){
  final int NCW=win.mChildWindows.size();
  boolean added=false;
  for (int j=0; j < NCW; j++) {
    WindowState cwin=(WindowState)win.mChildWindows.get(j);
    if (!added && cwin.mSubLayer >= 0) {
      if (DEBUG_WINDOW_MOVEMENT)       Log.v(TAG,"String_Node_Str" + index + "String_Node_Str"+ cwin);
      mWindows.add(index,win);
      index++;
      added=true;
    }
    if (DEBUG_WINDOW_MOVEMENT)     Log.v(TAG,"String_Node_Str" + index + "String_Node_Str"+ cwin);
    mWindows.add(index,cwin);
    index++;
  }
  if (!added) {
    if (DEBUG_WINDOW_MOVEMENT)     Log.v(TAG,"String_Node_Str" + index + "String_Node_Str"+ win);
    mWindows.add(index,win);
    index++;
  }
  return index;
}
Program: 183267
Project: 183267
Buggy source:
Configuration updateOrientationFromAppTokensUnchecked(Configuration currentConfig,IBinder freezeThisOneIfNeeded){
  Configuration config;
synchronized (mWindowMap) {
    config=updateOrientationFromAppTokensLocked(currentConfig,freezeThisOneIfNeeded);
  }
  if (config != null) {
    mLayoutNeeded=true;
    performLayoutAndPlaceSurfacesLocked();
  }
  return config;
}

Fixed version (ground truth):
Configuration updateOrientationFromAppTokensUnchecked(Configuration currentConfig,IBinder freezeThisOneIfNeeded){
  Configuration config;
synchronized (mWindowMap) {
    config=updateOrientationFromAppTokensLocked(currentConfig,freezeThisOneIfNeeded);
    if (config != null) {
      mLayoutNeeded=true;
      performLayoutAndPlaceSurfacesLocked();
    }
  }
  return config;
}
Program: 183269
Project: 183269
Buggy source:
private boolean tmpRemoveAppWindowsLocked(WindowToken token){
  final int NW=token.windows.size();
  for (int i=0; i < NW; i++) {
    WindowState win=token.windows.get(i);
    mWindows.remove(win);
    int j=win.mChildWindows.size();
    while (j > 0) {
      j--;
      mWindows.remove(win.mChildWindows.get(j));
    }
  }
  return NW > 0;
}

Fixed version (ground truth):
private boolean tmpRemoveAppWindowsLocked(WindowToken token){
  final int NW=token.windows.size();
  for (int i=0; i < NW; i++) {
    WindowState win=token.windows.get(i);
    if (DEBUG_WINDOW_MOVEMENT)     Log.v(TAG,"String_Node_Str" + win);
    mWindows.remove(win);
    int j=win.mChildWindows.size();
    while (j > 0) {
      j--;
      WindowState cwin=(WindowState)win.mChildWindows.get(j);
      if (DEBUG_WINDOW_MOVEMENT)       Log.v(TAG,"String_Node_Str" + cwin);
      mWindows.remove(cwin);
    }
  }
  return NW > 0;
}
Program: 183271
Project: 183271
Buggy source:
final void rebuildAppWindowListLocked(){
  int NW=mWindows.size();
  int i;
  i=0;
  while (i < NW) {
    if (((WindowState)mWindows.get(i)).mAppToken != null) {
      mWindows.remove(i);
      NW--;
      continue;
    }
    i++;
  }
  int NT=mAppTokens.size();
  i=0;
  for (int j=0; j < NT; j++) {
    AppWindowToken wt=mAppTokens.get(j);
    final int NTW=wt.windows.size();
    for (int k=0; k < NTW; k++) {
      WindowState win=wt.windows.get(k);
      final int NC=win.mChildWindows.size();
      int c;
      for (c=0; c < NC; c++) {
        WindowState cwin=(WindowState)win.mChildWindows.get(c);
        if (cwin.mSubLayer >= 0) {
          break;
        }
        mWindows.add(i,cwin);
        i++;
      }
      mWindows.add(i,win);
      i++;
      for (; c < NC; c++) {
        WindowState cwin=(WindowState)win.mChildWindows.get(c);
        mWindows.add(i,cwin);
        i++;
      }
    }
  }
}

Fixed version (ground truth):
final void rebuildAppWindowListLocked(){
  int NW=mWindows.size();
  int i;
  i=0;
  while (i < NW) {
    if (((WindowState)mWindows.get(i)).mAppToken != null) {
      WindowState win=(WindowState)mWindows.remove(i);
      if (DEBUG_WINDOW_MOVEMENT)       Log.v(TAG,"String_Node_Str" + win);
      NW--;
      continue;
    }
    i++;
  }
  int NT=mExitingAppTokens.size();
  i=0;
  for (int j=0; j < NT; j++) {
    i=reAddAppWindowsLocked(i,mExitingAppTokens.get(j));
  }
  NT=mAppTokens.size();
  for (int j=0; j < NT; j++) {
    i=reAddAppWindowsLocked(i,mAppTokens.get(j));
  }
}
Program: 183272
Project: 183272
Buggy source:
Globals(){
  IBinder b=ServiceManager.getService(Context.WALLPAPER_SERVICE);
  mService=IWallpaperManager.Stub.asInterface(b);
}

Fixed version (ground truth):
Globals(Looper looper){
  IBinder b=ServiceManager.getService(Context.WALLPAPER_SERVICE);
  mService=IWallpaperManager.Stub.asInterface(b);
  mHandler=new Handler(){
    @Override public void handleMessage(    Message msg){
switch (msg.what) {
case MSG_CLEAR_WALLPAPER:
synchronized (this) {
          mWallpaper=null;
        }
      break;
  }
}
}
;
}
Program: 183273
Project: 183273
Buggy source:
static void initGlobals(Looper looper){
synchronized (mSync) {
    if (sGlobals == null) {
      sGlobals=new Globals();
    }
  }
}

Fixed version (ground truth):
static void initGlobals(Looper looper){
synchronized (mSync) {
    if (sGlobals == null) {
      sGlobals=new Globals(looper);
    }
  }
}
Program: 183274
Project: 183274
Buggy source:
InputBindResult startInputInnerLocked(){
  if (mCurMethodId == null) {
    return mNoBinding;
  }
  if (!mSystemReady) {
    return new InputBindResult(null,mCurId,mCurSeq);
  }
  InputMethodInfo info=mMethodMap.get(mCurMethodId);
  if (info == null) {
    throw new IllegalArgumentException("String_Node_Str" + mCurMethodId);
  }
  unbindCurrentMethodLocked(false);
  mCurIntent=new Intent(InputMethod.SERVICE_INTERFACE);
  mCurIntent.setComponent(info.getComponent());
  if (mContext.bindService(mCurIntent,this,Context.BIND_AUTO_CREATE)) {
    mLastBindTime=SystemClock.uptimeMillis();
    mHaveConnection=true;
    mCurId=info.getId();
    mCurToken=new Binder();
    try {
      if (DEBUG)       Log.v(TAG,"String_Node_Str" + mCurToken);
      mIWindowManager.addWindowToken(mCurToken,WindowManager.LayoutParams.TYPE_INPUT_METHOD);
    }
 catch (    RemoteException e) {
    }
    return new InputBindResult(null,mCurId,mCurSeq);
  }
 else {
    mCurIntent=null;
    Log.w(TAG,"String_Node_Str" + mCurIntent);
  }
  return null;
}

Fixed version (ground truth):
InputBindResult startInputInnerLocked(){
  if (mCurMethodId == null) {
    return mNoBinding;
  }
  if (!mSystemReady) {
    return new InputBindResult(null,mCurMethodId,mCurSeq);
  }
  InputMethodInfo info=mMethodMap.get(mCurMethodId);
  if (info == null) {
    throw new IllegalArgumentException("String_Node_Str" + mCurMethodId);
  }
  unbindCurrentMethodLocked(false);
  mCurIntent=new Intent(InputMethod.SERVICE_INTERFACE);
  mCurIntent.setComponent(info.getComponent());
  if (mContext.bindService(mCurIntent,this,Context.BIND_AUTO_CREATE)) {
    mLastBindTime=SystemClock.uptimeMillis();
    mHaveConnection=true;
    mCurId=info.getId();
    mCurToken=new Binder();
    try {
      if (DEBUG)       Log.v(TAG,"String_Node_Str" + mCurToken);
      mIWindowManager.addWindowToken(mCurToken,WindowManager.LayoutParams.TYPE_INPUT_METHOD);
    }
 catch (    RemoteException e) {
    }
    return new InputBindResult(null,mCurId,mCurSeq);
  }
 else {
    mCurIntent=null;
    Log.w(TAG,"String_Node_Str" + mCurIntent);
  }
  return null;
}
Program: 183275
Project: 183275
Buggy source:
public void onServiceConnected(ComponentName name,IBinder service){
synchronized (mMethodMap) {
    if (mCurIntent != null && name.equals(mCurIntent.getComponent())) {
      mCurMethod=IInputMethod.Stub.asInterface(service);
      if (mCurClient != null) {
        if (DEBUG)         Log.v(TAG,"String_Node_Str" + mCurToken);
        executeOrSendMessage(mCurMethod,mCaller.obtainMessageOO(MSG_ATTACH_TOKEN,mCurMethod,mCurToken));
        if (mCurClient != null) {
          if (DEBUG)           Log.v(TAG,"String_Node_Str" + mCurClient);
          executeOrSendMessage(mCurMethod,mCaller.obtainMessageOO(MSG_CREATE_SESSION,mCurMethod,new MethodCallback(mCurMethod)));
        }
      }
    }
  }
}

Fixed version (ground truth):
public void onServiceConnected(ComponentName name,IBinder service){
synchronized (mMethodMap) {
    if (mCurIntent != null && name.equals(mCurIntent.getComponent())) {
      mCurMethod=IInputMethod.Stub.asInterface(service);
      if (mCurToken == null) {
        Log.w(TAG,"String_Node_Str");
        unbindCurrentMethodLocked(false);
        return;
      }
      if (DEBUG)       Log.v(TAG,"String_Node_Str" + mCurToken);
      executeOrSendMessage(mCurMethod,mCaller.obtainMessageOO(MSG_ATTACH_TOKEN,mCurMethod,mCurToken));
      if (mCurClient != null) {
        if (DEBUG)         Log.v(TAG,"String_Node_Str" + mCurClient);
        executeOrSendMessage(mCurMethod,mCaller.obtainMessageOO(MSG_CREATE_SESSION,mCurMethod,new MethodCallback(mCurMethod)));
      }
    }
  }
}
Program: 183276
Project: 183276
Buggy source:
boolean showCurrentInputLocked(int flags,ResultReceiver resultReceiver){
  mShowRequested=true;
  if ((flags & InputMethodManager.SHOW_IMPLICIT) == 0) {
    mShowExplicitlyRequested=true;
  }
  if ((flags & InputMethodManager.SHOW_FORCED) != 0) {
    mShowExplicitlyRequested=true;
    mShowForced=true;
  }
  boolean res=false;
  if (mCurMethod != null) {
    executeOrSendMessage(mCurMethod,mCaller.obtainMessageIOO(MSG_SHOW_SOFT_INPUT,getImeShowFlags(),mCurMethod,resultReceiver));
    mInputShown=true;
    res=true;
  }
 else   if (mHaveConnection && SystemClock.uptimeMillis() < (mLastBindTime + TIME_TO_RECONNECT)) {
    EventLog.writeEvent(LOG_IMF_FORCE_RECONNECT_IME,mCurMethodId,SystemClock.uptimeMillis() - mLastBindTime,1);
    mContext.unbindService(this);
    mContext.bindService(mCurIntent,this,Context.BIND_AUTO_CREATE);
  }
  return res;
}

Fixed version (ground truth):
boolean showCurrentInputLocked(int flags,ResultReceiver resultReceiver){
  mShowRequested=true;
  if ((flags & InputMethodManager.SHOW_IMPLICIT) == 0) {
    mShowExplicitlyRequested=true;
  }
  if ((flags & InputMethodManager.SHOW_FORCED) != 0) {
    mShowExplicitlyRequested=true;
    mShowForced=true;
  }
  if (!mSystemReady) {
    return false;
  }
  boolean res=false;
  if (mCurMethod != null) {
    executeOrSendMessage(mCurMethod,mCaller.obtainMessageIOO(MSG_SHOW_SOFT_INPUT,getImeShowFlags(),mCurMethod,resultReceiver));
    mInputShown=true;
    res=true;
  }
 else   if (mHaveConnection && SystemClock.uptimeMillis() < (mLastBindTime + TIME_TO_RECONNECT)) {
    EventLog.writeEvent(LOG_IMF_FORCE_RECONNECT_IME,mCurMethodId,SystemClock.uptimeMillis() - mLastBindTime,1);
    mContext.unbindService(this);
    mContext.bindService(mCurIntent,this,Context.BIND_AUTO_CREATE);
  }
  return res;
}
Program: 183278
Project: 183278
Buggy source:
public void systemReady(){
synchronized (mMethodMap) {
    if (!mSystemReady) {
      mSystemReady=true;
      startInputInnerLocked();
    }
  }
}

Fixed version (ground truth):
public void systemReady(){
synchronized (mMethodMap) {
    if (!mSystemReady) {
      mSystemReady=true;
      try {
        startInputInnerLocked();
      }
 catch (      RuntimeException e) {
        Log.w(TAG,"String_Node_Str",e);
      }
    }
  }
}
Program: 183279
Project: 183279
Buggy source:
private final int reAddWindowLocked(int index,WindowState win){
  final int NCW=win.mChildWindows.size();
  boolean added=false;
  for (int j=0; j < NCW; j++) {
    WindowState cwin=(WindowState)win.mChildWindows.get(j);
    if (!added && cwin.mSubLayer >= 0) {
      mWindows.add(index,win);
      index++;
      added=true;
    }
    mWindows.add(index,cwin);
    index++;
  }
  if (!added) {
    mWindows.add(index,win);
    index++;
  }
  return index;
}

Fixed version (ground truth):
private final int reAddWindowLocked(int index,WindowState win){
  final int NCW=win.mChildWindows.size();
  boolean added=false;
  for (int j=0; j < NCW; j++) {
    WindowState cwin=(WindowState)win.mChildWindows.get(j);
    if (!added && cwin.mSubLayer >= 0) {
      if (DEBUG_WINDOW_MOVEMENT)       Log.v(TAG,"String_Node_Str" + index + "String_Node_Str"+ cwin);
      mWindows.add(index,win);
      index++;
      added=true;
    }
    if (DEBUG_WINDOW_MOVEMENT)     Log.v(TAG,"String_Node_Str" + index + "String_Node_Str"+ cwin);
    mWindows.add(index,cwin);
    index++;
  }
  if (!added) {
    if (DEBUG_WINDOW_MOVEMENT)     Log.v(TAG,"String_Node_Str" + index + "String_Node_Str"+ win);
    mWindows.add(index,win);
    index++;
  }
  return index;
}
Program: 183280
Project: 183280
Buggy source:
Configuration updateOrientationFromAppTokensUnchecked(Configuration currentConfig,IBinder freezeThisOneIfNeeded){
  Configuration config;
synchronized (mWindowMap) {
    config=updateOrientationFromAppTokensLocked(currentConfig,freezeThisOneIfNeeded);
  }
  if (config != null) {
    mLayoutNeeded=true;
    performLayoutAndPlaceSurfacesLocked();
  }
  return config;
}

Fixed version (ground truth):
Configuration updateOrientationFromAppTokensUnchecked(Configuration currentConfig,IBinder freezeThisOneIfNeeded){
  Configuration config;
synchronized (mWindowMap) {
    config=updateOrientationFromAppTokensLocked(currentConfig,freezeThisOneIfNeeded);
    if (config != null) {
      mLayoutNeeded=true;
      performLayoutAndPlaceSurfacesLocked();
    }
  }
  return config;
}
Program: 183282
Project: 183282
Buggy source:
private boolean tmpRemoveAppWindowsLocked(WindowToken token){
  final int NW=token.windows.size();
  for (int i=0; i < NW; i++) {
    WindowState win=token.windows.get(i);
    mWindows.remove(win);
    int j=win.mChildWindows.size();
    while (j > 0) {
      j--;
      mWindows.remove(win.mChildWindows.get(j));
    }
  }
  return NW > 0;
}

Fixed version (ground truth):
private boolean tmpRemoveAppWindowsLocked(WindowToken token){
  final int NW=token.windows.size();
  for (int i=0; i < NW; i++) {
    WindowState win=token.windows.get(i);
    if (DEBUG_WINDOW_MOVEMENT)     Log.v(TAG,"String_Node_Str" + win);
    mWindows.remove(win);
    int j=win.mChildWindows.size();
    while (j > 0) {
      j--;
      WindowState cwin=(WindowState)win.mChildWindows.get(j);
      if (DEBUG_WINDOW_MOVEMENT)       Log.v(TAG,"String_Node_Str" + cwin);
      mWindows.remove(cwin);
    }
  }
  return NW > 0;
}
Program: 183284
Project: 183284
Buggy source:
final void rebuildAppWindowListLocked(){
  int NW=mWindows.size();
  int i;
  i=0;
  while (i < NW) {
    if (((WindowState)mWindows.get(i)).mAppToken != null) {
      mWindows.remove(i);
      NW--;
      continue;
    }
    i++;
  }
  int NT=mAppTokens.size();
  i=0;
  for (int j=0; j < NT; j++) {
    AppWindowToken wt=mAppTokens.get(j);
    final int NTW=wt.windows.size();
    for (int k=0; k < NTW; k++) {
      WindowState win=wt.windows.get(k);
      final int NC=win.mChildWindows.size();
      int c;
      for (c=0; c < NC; c++) {
        WindowState cwin=(WindowState)win.mChildWindows.get(c);
        if (cwin.mSubLayer >= 0) {
          break;
        }
        mWindows.add(i,cwin);
        i++;
      }
      mWindows.add(i,win);
      i++;
      for (; c < NC; c++) {
        WindowState cwin=(WindowState)win.mChildWindows.get(c);
        mWindows.add(i,cwin);
        i++;
      }
    }
  }
}

Fixed version (ground truth):
final void rebuildAppWindowListLocked(){
  int NW=mWindows.size();
  int i;
  i=0;
  while (i < NW) {
    if (((WindowState)mWindows.get(i)).mAppToken != null) {
      WindowState win=(WindowState)mWindows.remove(i);
      if (DEBUG_WINDOW_MOVEMENT)       Log.v(TAG,"String_Node_Str" + win);
      NW--;
      continue;
    }
    i++;
  }
  int NT=mExitingAppTokens.size();
  i=0;
  for (int j=0; j < NT; j++) {
    i=reAddAppWindowsLocked(i,mExitingAppTokens.get(j));
  }
  NT=mAppTokens.size();
  for (int j=0; j < NT; j++) {
    i=reAddAppWindowsLocked(i,mAppTokens.get(j));
  }
}
Program: 183285
Project: 183285
Buggy source:
Globals(Looper looper){
  IBinder b=ServiceManager.getService(Context.WALLPAPER_SERVICE);
  mService=IWallpaperManager.Stub.asInterface(b);
  mHandler=new Handler(){
    @Override public void handleMessage(    Message msg){
switch (msg.what) {
case MSG_CLEAR_WALLPAPER:
synchronized (this) {
          mWallpaper=null;
        }
      break;
  }
}
}
;
}

Fixed version (ground truth):
Globals(Looper looper){
  IBinder b=ServiceManager.getService(Context.WALLPAPER_SERVICE);
  mService=IWallpaperManager.Stub.asInterface(b);
  mHandler=new Handler(looper){
    @Override public void handleMessage(    Message msg){
switch (msg.what) {
case MSG_CLEAR_WALLPAPER:
synchronized (this) {
          mWallpaper=null;
        }
      break;
  }
}
}
;
}
Program: 183286
Project: 183286
Buggy source:
public Connection dial(String dialString) throws CallStateException {
  String newDialString=PhoneNumberUtils.stripSeparators(dialString);
  if (!mCT.foregroundCall.isIdle()) {
    FeatureCode fc=FeatureCode.newFromDialString(newDialString,this);
    if (fc != null) {
      fc.processCode();
      return null;
    }
  }
  return mCT.dial(newDialString);
}

Fixed version (ground truth):
public Connection dial(String dialString) throws CallStateException {
  String newDialString=PhoneNumberUtils.stripSeparators(dialString);
  return mCT.dial(newDialString);
}
Program: 183287
Project: 183287
Buggy source:
/** 
 * Returns the number of unread conversation with a given label. 
 */
public int getNumUnreadConversations(long labelId){
  Integer unreadConversations=getLabelIdValues(labelId).getAsInteger(LabelColumns.NUM_UNREAD_CONVERSATIONS);
  if (unreadConversations == null) {
    return 0;
  }
 else {
    return unreadConversations;
  }
}

Fixed version (ground truth):
/** 
 * Returns the number of unread conversation with a given label. 
 */
public int getNumUnreadConversations(long labelId){
  Integer unreadConversations=getLabelIdValues(labelId).getAsInteger(LabelColumns.NUM_UNREAD_CONVERSATIONS);
  if (unreadConversations == null) {
    return 0;
  }
 else {
    return unreadConversations < 0 ? 0 : unreadConversations;
  }
}
Program: 183288
Project: 183288
Buggy source:
/** 
 * Returns the number of unread conversation with a given label. 
 */
public int getNumUnreadConversations(long labelId){
  Integer unreadConversations=getLabelIdValues(labelId).getAsInteger(LabelColumns.NUM_UNREAD_CONVERSATIONS);
  if (unreadConversations == null) {
    return 0;
  }
 else {
    return unreadConversations < 0 ? 0 : unreadConversations;
  }
}

Fixed version (ground truth):
/** 
 * Returns the number of unread conversation with a given label. 
 */
public int getNumUnreadConversations(long labelId){
  Integer unreadConversations=getLabelIdValues(labelId).getAsInteger(LabelColumns.NUM_UNREAD_CONVERSATIONS);
  int result=0;
  if (unreadConversations != null) {
    result=unreadConversations < 0 ? 0 : unreadConversations;
  }
  return result;
}
Program: 183289
Project: 183289
Buggy source:
/** 
 * Compare the IMSI to the one stored in the login service's database.  If they differ, erase all passwords and authtokens (and store the new IMSI).
 */
@Override public void onReceive(Context context,Intent intent){
  String imsi=((TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE)).getSubscriberId();
  if (TextUtils.isEmpty(imsi))   return;
  String storedImsi=getMetaValue("String_Node_Str");
  if (Log.isLoggable(TAG,Log.VERBOSE)) {
    Log.v(TAG,"String_Node_Str" + imsi + "String_Node_Str"+ storedImsi);
  }
  if (!imsi.equals(storedImsi) && !"String_Node_Str".equals(storedImsi)) {
    if (Log.isLoggable(TAG,Log.VERBOSE)) {
      Log.v(TAG,"String_Node_Str");
    }
    SQLiteDatabase db=mOpenHelper.getWritableDatabase();
    db.beginTransaction();
    try {
      db.execSQL("String_Node_Str" + TABLE_AUTHTOKENS);
      db.execSQL("String_Node_Str" + TABLE_ACCOUNTS + "String_Node_Str"+ ACCOUNTS_PASSWORD+ "String_Node_Str");
      sendAccountsChangedBroadcast();
      db.setTransactionSuccessful();
    }
  finally {
      db.endTransaction();
    }
  }
  setMetaValue("String_Node_Str",imsi);
}

Fixed version (ground truth):
/** 
 * Compare the IMSI to the one stored in the login service's database.  If they differ, erase all passwords and authtokens (and store the new IMSI).
 */
@Override public void onReceive(Context context,Intent intent){
  String imsi=((TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE)).getSubscriberId();
  if (TextUtils.isEmpty(imsi))   return;
  String storedImsi=getMetaValue("String_Node_Str");
  if (Log.isLoggable(TAG,Log.VERBOSE)) {
    Log.v(TAG,"String_Node_Str" + imsi + "String_Node_Str"+ storedImsi);
  }
  if (!imsi.equals(storedImsi) && !TextUtils.isEmpty(storedImsi)) {
    if (Log.isLoggable(TAG,Log.VERBOSE)) {
      Log.v(TAG,"String_Node_Str");
    }
    SQLiteDatabase db=mOpenHelper.getWritableDatabase();
    db.beginTransaction();
    try {
      db.execSQL("String_Node_Str" + TABLE_AUTHTOKENS);
      db.execSQL("String_Node_Str" + TABLE_ACCOUNTS + "String_Node_Str"+ ACCOUNTS_PASSWORD+ "String_Node_Str");
      sendAccountsChangedBroadcast();
      db.setTransactionSuccessful();
    }
  finally {
      db.endTransaction();
    }
  }
  setMetaValue("String_Node_Str",imsi);
}
Program: 183291
Project: 183291
Buggy source:
/** 
 * <p>Set the range of the progress bar to 0...<tt>max</tt>.</p>
 * @param max the upper range of this progress bar
 * @see #getMax()
 * @see #setProgress(int) 
 * @see #setSecondaryProgress(int) 
 */
@android.view.RemotableViewMethod public synchronized void setMax(int max){
  if (max < 0) {
    max=0;
  }
  if (max != mMax) {
    mMax=max;
    postInvalidate();
    if (mProgress > max) {
      mProgress=max;
    }
  }
}

Fixed version (ground truth):
/** 
 * <p>Set the range of the progress bar to 0...<tt>max</tt>.</p>
 * @param max the upper range of this progress bar
 * @see #getMax()
 * @see #setProgress(int) 
 * @see #setSecondaryProgress(int) 
 */
@android.view.RemotableViewMethod public synchronized void setMax(int max){
  if (max < 0) {
    max=0;
  }
  if (max != mMax) {
    mMax=max;
    postInvalidate();
    if (mProgress > max) {
      mProgress=max;
      refreshProgress(R.id.progress,mProgress,false);
    }
  }
}
Program: 183292
Project: 183292
Buggy source:
public abstract Handler getHandler();

Fixed version (ground truth):
public Handler getHandler(){
  return this;
}
Program: 183293
Project: 183293
Buggy source:
/** 
 * Constructs a PhoneBase in normal (non-unit test) mode.
 * @param context Context object from hosting application
 * @param notifier An instance of DefaultPhoneNotifier,unless unit testing.
 * @param unitTestMode when true, prevents notificationsof state change events
 */
protected PhoneBase(PhoneNotifier notifier,Context context,boolean unitTestMode){
  this.mNotifier=notifier;
  this.mContext=context;
  mLooper=Looper.myLooper();
  setPropertiesByCarrier();
  setUnitTestMode(unitTestMode);
  SharedPreferences sp=PreferenceManager.getDefaultSharedPreferences(context);
  mDnsCheckDisabled=sp.getBoolean(DNS_SERVER_CHECK_DISABLED_KEY,false);
}

Fixed version (ground truth):
/** 
 * Constructs a PhoneBase in normal (non-unit test) mode.
 * @param context Context object from hosting application
 * @param notifier An instance of DefaultPhoneNotifier,unless unit testing.
 * @param unitTestMode when true, prevents notificationsof state change events
 */
protected PhoneBase(PhoneNotifier notifier,Context context,CommandsInterface ci,boolean unitTestMode){
  this.mNotifier=notifier;
  this.mContext=context;
  mLooper=Looper.myLooper();
  mCM=ci;
  setPropertiesByCarrier();
  setUnitTestMode(unitTestMode);
  SharedPreferences sp=PreferenceManager.getDefaultSharedPreferences(context);
  mDnsCheckDisabled=sp.getBoolean(DNS_SERVER_CHECK_DISABLED_KEY,false);
  mCM.setOnCallRing(this,EVENT_CALL_RING,null);
  mDoesRilSendMultipleCallRing=SystemProperties.getBoolean(TelephonyProperties.PROPERTY_RIL_SENDS_MULTIPLE_CALL_RING,true);
  Log.d(LOG_TAG,"String_Node_Str" + mDoesRilSendMultipleCallRing);
  mCallRingDelay=SystemProperties.getInt(TelephonyProperties.PROPERTY_CALL_RING_DELAY,3000);
  Log.d(LOG_TAG,"String_Node_Str" + mCallRingDelay);
}
Program: 183294
Project: 183294
Buggy source:
public void executeMessage(Message message){
switch (message.what) {
case DO_ON_ACCESSIBILITY_EVENT:
    AccessibilityEvent event=(AccessibilityEvent)message.obj;
  mTarget.onAccessibilityEvent(event);
event.recycle();
return;
case DO_ON_INTERRUPT:
mTarget.onInterrupt();
return;
case DO_SET_SET_CONNECTION:
mConnection=((IAccessibilityServiceConnection)message.obj);
mTarget.onServiceConnected();
return;
default :
Log.w(LOG_TAG,"String_Node_Str" + message.what);
}
}

Fixed version (ground truth):
public void executeMessage(Message message){
switch (message.what) {
case DO_ON_ACCESSIBILITY_EVENT:
    AccessibilityEvent event=(AccessibilityEvent)message.obj;
  if (event != null) {
    mTarget.onAccessibilityEvent(event);
    event.recycle();
  }
return;
case DO_ON_INTERRUPT:
mTarget.onInterrupt();
return;
case DO_SET_SET_CONNECTION:
mConnection=((IAccessibilityServiceConnection)message.obj);
mTarget.onServiceConnected();
return;
default :
Log.w(LOG_TAG,"String_Node_Str" + message.what);
}
}
Program: 183297
Project: 183297
Buggy source:
void commitFinishDrawingLocked(long currentTime){
  if (!mCommitDrawPending) {
    return;
  }
  mCommitDrawPending=false;
  mReadyToShow=true;
  final boolean starting=mAttrs.type == TYPE_APPLICATION_STARTING;
  final AppWindowToken atoken=mAppToken;
  if (atoken == null || atoken.allDrawn || starting) {
    performShowLocked();
  }
}

Fixed version (ground truth):
boolean commitFinishDrawingLocked(long currentTime){
  if (!mCommitDrawPending) {
    return false;
  }
  mCommitDrawPending=false;
  mReadyToShow=true;
  final boolean starting=mAttrs.type == TYPE_APPLICATION_STARTING;
  final AppWindowToken atoken=mAppToken;
  if (atoken == null || atoken.allDrawn || starting) {
    performShowLocked();
  }
  return true;
}
Program: 183298
Project: 183298
Buggy source:
public void installLocationProvider(String name,ILocationProvider provider){
  if (mContext.checkCallingOrSelfPermission(INSTALL_LOCATION_PROVIDER) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str");
  }
synchronized (mLock) {
    LocationProviderProxy oldProvider=mProvidersByName.get(name);
    if (oldProvider != null) {
      if (oldProvider.isDead()) {
        Log.d(TAG,"String_Node_Str");
        removeProvider(oldProvider);
      }
 else {
        throw new IllegalArgumentException("String_Node_Str" + name + "String_Node_Str");
      }
    }
    LocationProviderProxy proxy=new LocationProviderProxy(name,provider);
    addProvider(proxy);
    updateProvidersLocked();
    proxy.updateNetworkState(mNetworkState);
  }
}

Fixed version (ground truth):
public void installLocationProvider(String name,ILocationProvider provider){
  if (mContext.checkCallingOrSelfPermission(INSTALL_LOCATION_PROVIDER) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str");
  }
synchronized (mLock) {
    LocationProviderProxy oldProvider=mProvidersByName.get(name);
    if (oldProvider != null) {
      if (oldProvider.isDead()) {
        Log.d(TAG,"String_Node_Str");
        removeProvider(oldProvider);
      }
 else {
        throw new IllegalArgumentException("String_Node_Str" + name + "String_Node_Str");
      }
    }
    LocationProviderProxy proxy=new LocationProviderProxy(name,provider);
    addProvider(proxy);
    updateProvidersLocked();
    if (LocationManager.NETWORK_PROVIDER.equals(name)) {
      mNetworkLocationProvider=proxy;
    }
    proxy.updateNetworkState(mNetworkState);
  }
}
Program: 183299
Project: 183299
Buggy source:
public void addTestProvider(String name,boolean requiresNetwork,boolean requiresSatellite,boolean requiresCell,boolean hasMonetaryCost,boolean supportsAltitude,boolean supportsSpeed,boolean supportsBearing,int powerRequirement,int accuracy){
  checkMockPermissionsSafe();
synchronized (mLock) {
    MockProvider provider=new MockProvider(name,this,requiresNetwork,requiresSatellite,requiresCell,hasMonetaryCost,supportsAltitude,supportsSpeed,supportsBearing,powerRequirement,accuracy);
    if (mProvidersByName.get(name) != null) {
      throw new IllegalArgumentException("String_Node_Str" + name + "String_Node_Str");
    }
    long identity=Binder.clearCallingIdentity();
    addProvider(new LocationProviderProxy(name,provider));
    mMockProviders.put(name,provider);
    updateProvidersLocked();
    Binder.restoreCallingIdentity(identity);
  }
}

Fixed version (ground truth):
public void addTestProvider(String name,boolean requiresNetwork,boolean requiresSatellite,boolean requiresCell,boolean hasMonetaryCost,boolean supportsAltitude,boolean supportsSpeed,boolean supportsBearing,int powerRequirement,int accuracy){
  checkMockPermissionsSafe();
synchronized (mLock) {
    MockProvider provider=new MockProvider(name,this,requiresNetwork,requiresSatellite,requiresCell,hasMonetaryCost,supportsAltitude,supportsSpeed,supportsBearing,powerRequirement,accuracy);
    if (LocationManager.GPS_PROVIDER.equals(name) || LocationManager.NETWORK_PROVIDER.equals(name)) {
      LocationProviderProxy proxy=mProvidersByName.get(name);
      if (proxy != null) {
        proxy.enableLocationTracking(false);
        removeProvider(proxy);
      }
    }
    if (mProvidersByName.get(name) != null) {
      throw new IllegalArgumentException("String_Node_Str" + name + "String_Node_Str");
    }
    addProvider(new LocationProviderProxy(name,provider));
    mMockProviders.put(name,provider);
    mLastKnownLocation.put(name,null);
    updateProvidersLocked();
  }
}
Program: 183300
Project: 183300
Buggy source:
public void removeTestProvider(String provider){
  checkMockPermissionsSafe();
synchronized (mLock) {
    MockProvider mockProvider=mMockProviders.get(provider);
    if (mockProvider == null) {
      throw new IllegalArgumentException("String_Node_Str" + provider + "String_Node_Str");
    }
    removeProvider(mProvidersByName.get(provider));
    mMockProviders.remove(mockProvider);
    updateProvidersLocked();
  }
}

Fixed version (ground truth):
public void removeTestProvider(String provider){
  checkMockPermissionsSafe();
synchronized (mLock) {
    MockProvider mockProvider=mMockProviders.get(provider);
    if (mockProvider == null) {
      throw new IllegalArgumentException("String_Node_Str" + provider + "String_Node_Str");
    }
    removeProvider(mProvidersByName.get(provider));
    mMockProviders.remove(mockProvider);
    if (LocationManager.GPS_PROVIDER.equals(provider) && mGpsLocationProvider != null) {
      addProvider(mGpsLocationProvider);
    }
 else     if (LocationManager.NETWORK_PROVIDER.equals(provider) && mNetworkLocationProvider != null) {
      addProvider(mNetworkLocationProvider);
    }
    mLastKnownLocation.put(provider,null);
    updateProvidersLocked();
  }
}
Program: 183301
Project: 183301
Buggy source:
private void _loadProvidersLocked(){
  if (GpsLocationProvider.isSupported()) {
    GpsLocationProvider provider=new GpsLocationProvider(mContext,this);
    mGpsStatusProvider=provider.getGpsStatusProvider();
    LocationProviderProxy proxy=new LocationProviderProxy(LocationManager.GPS_PROVIDER,provider);
    addProvider(proxy);
  }
  updateProvidersLocked();
}

Fixed version (ground truth):
private void _loadProvidersLocked(){
  if (GpsLocationProvider.isSupported()) {
    GpsLocationProvider provider=new GpsLocationProvider(mContext,this);
    mGpsStatusProvider=provider.getGpsStatusProvider();
    LocationProviderProxy proxy=new LocationProviderProxy(LocationManager.GPS_PROVIDER,provider);
    addProvider(proxy);
    mGpsLocationProvider=proxy;
  }
  updateProvidersLocked();
}
Program: 183302
Project: 183302
Buggy source:
public void installLocationProvider(String name,ILocationProvider provider){
  if (mContext.checkCallingOrSelfPermission(INSTALL_LOCATION_PROVIDER) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str");
  }
synchronized (mLock) {
    LocationProviderProxy oldProvider=mProvidersByName.get(name);
    if (oldProvider != null) {
      if (oldProvider.isDead()) {
        Log.d(TAG,"String_Node_Str");
        removeProvider(oldProvider);
      }
 else {
        throw new IllegalArgumentException("String_Node_Str" + name + "String_Node_Str");
      }
    }
    LocationProviderProxy proxy=new LocationProviderProxy(name,provider);
    addProvider(proxy);
    updateProvidersLocked();
    proxy.updateNetworkState(mNetworkState);
  }
}

Fixed version (ground truth):
public void installLocationProvider(String name,ILocationProvider provider){
  if (mContext.checkCallingOrSelfPermission(INSTALL_LOCATION_PROVIDER) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str");
  }
synchronized (mLock) {
    LocationProviderProxy oldProvider=mProvidersByName.get(name);
    if (oldProvider != null) {
      if (oldProvider.isDead()) {
        Log.d(TAG,"String_Node_Str");
        removeProvider(oldProvider);
      }
 else {
        throw new IllegalArgumentException("String_Node_Str" + name + "String_Node_Str");
      }
    }
    LocationProviderProxy proxy=new LocationProviderProxy(name,provider);
    addProvider(proxy);
    updateProvidersLocked();
    if (LocationManager.NETWORK_PROVIDER.equals(name)) {
      mNetworkLocationProvider=proxy;
    }
    proxy.updateNetworkState(mNetworkState);
  }
}
Program: 183303
Project: 183303
Buggy source:
public void addTestProvider(String name,boolean requiresNetwork,boolean requiresSatellite,boolean requiresCell,boolean hasMonetaryCost,boolean supportsAltitude,boolean supportsSpeed,boolean supportsBearing,int powerRequirement,int accuracy){
  checkMockPermissionsSafe();
synchronized (mLock) {
    MockProvider provider=new MockProvider(name,this,requiresNetwork,requiresSatellite,requiresCell,hasMonetaryCost,supportsAltitude,supportsSpeed,supportsBearing,powerRequirement,accuracy);
    if (mProvidersByName.get(name) != null) {
      throw new IllegalArgumentException("String_Node_Str" + name + "String_Node_Str");
    }
    long identity=Binder.clearCallingIdentity();
    addProvider(new LocationProviderProxy(name,provider));
    mMockProviders.put(name,provider);
    updateProvidersLocked();
    Binder.restoreCallingIdentity(identity);
  }
}

Fixed version (ground truth):
public void addTestProvider(String name,boolean requiresNetwork,boolean requiresSatellite,boolean requiresCell,boolean hasMonetaryCost,boolean supportsAltitude,boolean supportsSpeed,boolean supportsBearing,int powerRequirement,int accuracy){
  checkMockPermissionsSafe();
synchronized (mLock) {
    MockProvider provider=new MockProvider(name,this,requiresNetwork,requiresSatellite,requiresCell,hasMonetaryCost,supportsAltitude,supportsSpeed,supportsBearing,powerRequirement,accuracy);
    if (LocationManager.GPS_PROVIDER.equals(name) || LocationManager.NETWORK_PROVIDER.equals(name)) {
      LocationProviderProxy proxy=mProvidersByName.get(name);
      if (proxy != null) {
        proxy.enableLocationTracking(false);
        removeProvider(proxy);
      }
    }
    if (mProvidersByName.get(name) != null) {
      throw new IllegalArgumentException("String_Node_Str" + name + "String_Node_Str");
    }
    addProvider(new LocationProviderProxy(name,provider));
    mMockProviders.put(name,provider);
    mLastKnownLocation.put(name,null);
    updateProvidersLocked();
  }
}
Program: 183304
Project: 183304
Buggy source:
public void removeTestProvider(String provider){
  checkMockPermissionsSafe();
synchronized (mLock) {
    MockProvider mockProvider=mMockProviders.get(provider);
    if (mockProvider == null) {
      throw new IllegalArgumentException("String_Node_Str" + provider + "String_Node_Str");
    }
    removeProvider(mProvidersByName.get(provider));
    mMockProviders.remove(mockProvider);
    updateProvidersLocked();
  }
}

Fixed version (ground truth):
public void removeTestProvider(String provider){
  checkMockPermissionsSafe();
synchronized (mLock) {
    MockProvider mockProvider=mMockProviders.get(provider);
    if (mockProvider == null) {
      throw new IllegalArgumentException("String_Node_Str" + provider + "String_Node_Str");
    }
    removeProvider(mProvidersByName.get(provider));
    mMockProviders.remove(mockProvider);
    if (LocationManager.GPS_PROVIDER.equals(provider) && mGpsLocationProvider != null) {
      addProvider(mGpsLocationProvider);
    }
 else     if (LocationManager.NETWORK_PROVIDER.equals(provider) && mNetworkLocationProvider != null) {
      addProvider(mNetworkLocationProvider);
    }
    mLastKnownLocation.put(provider,null);
    updateProvidersLocked();
  }
}
Program: 183305
Project: 183305
Buggy source:
private void _loadProvidersLocked(){
  if (GpsLocationProvider.isSupported()) {
    GpsLocationProvider provider=new GpsLocationProvider(mContext,this);
    mGpsStatusProvider=provider.getGpsStatusProvider();
    LocationProviderProxy proxy=new LocationProviderProxy(LocationManager.GPS_PROVIDER,provider);
    addProvider(proxy);
  }
  updateProvidersLocked();
}

Fixed version (ground truth):
private void _loadProvidersLocked(){
  if (GpsLocationProvider.isSupported()) {
    GpsLocationProvider provider=new GpsLocationProvider(mContext,this);
    mGpsStatusProvider=provider.getGpsStatusProvider();
    LocationProviderProxy proxy=new LocationProviderProxy(LocationManager.GPS_PROVIDER,provider);
    addProvider(proxy);
    mGpsLocationProvider=proxy;
  }
  updateProvidersLocked();
}
Program: 183306
Project: 183306
Buggy source:
public void installLocationProvider(String name,ILocationProvider provider){
  if (mContext.checkCallingOrSelfPermission(INSTALL_LOCATION_PROVIDER) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str");
  }
synchronized (mLock) {
    LocationProviderProxy oldProvider=mProvidersByName.get(name);
    if (oldProvider != null) {
      if (oldProvider.isDead()) {
        Log.d(TAG,"String_Node_Str");
        removeProvider(oldProvider);
      }
 else {
        throw new IllegalArgumentException("String_Node_Str" + name + "String_Node_Str");
      }
    }
    LocationProviderProxy proxy=new LocationProviderProxy(name,provider);
    addProvider(proxy);
    updateProvidersLocked();
    proxy.updateNetworkState(mNetworkState);
  }
}

Fixed version (ground truth):
public void installLocationProvider(String name,ILocationProvider provider){
  if (mContext.checkCallingOrSelfPermission(INSTALL_LOCATION_PROVIDER) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str");
  }
synchronized (mLock) {
    LocationProviderProxy oldProvider=mProvidersByName.get(name);
    if (oldProvider != null) {
      if (oldProvider.isDead()) {
        Log.d(TAG,"String_Node_Str");
        removeProvider(oldProvider);
      }
 else {
        throw new IllegalArgumentException("String_Node_Str" + name + "String_Node_Str");
      }
    }
    LocationProviderProxy proxy=new LocationProviderProxy(name,provider);
    addProvider(proxy);
    updateProvidersLocked();
    if (LocationManager.NETWORK_PROVIDER.equals(name)) {
      mNetworkLocationProvider=proxy;
    }
    proxy.updateNetworkState(mNetworkState);
  }
}