nus-yam/ex-repair huggingface dataset:
Program: 23797
Project: 23797
Buggy source:
void detach(){
  mDestroyed=true;
  if (mVisible) {
    mVisible=false;
    if (DEBUG)     Log.v(TAG,"String_Node_Str" + this);
    onVisibilityChanged(false);
  }
  if (mDestroyReportNeeded) {
    mDestroyReportNeeded=false;
    SurfaceHolder.Callback callbacks[];
synchronized (mSurfaceHolder.mCallbacks) {
      callbacks=new SurfaceHolder.Callback[mSurfaceHolder.mCallbacks.size()];
      mSurfaceHolder.mCallbacks.toArray(callbacks);
    }
    for (    SurfaceHolder.Callback c : callbacks) {
      c.surfaceDestroyed(mSurfaceHolder);
    }
    if (DEBUG)     Log.v(TAG,"String_Node_Str" + mSurfaceHolder + "String_Node_Str"+ this);
    onSurfaceDestroyed(mSurfaceHolder);
  }
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + this);
  onDestroy();
  if (mCreated) {
    try {
      mSession.remove(mWindow);
    }
 catch (    RemoteException e) {
    }
    mSurfaceHolder.mSurface.clear();
    mCreated=false;
  }
}

Fixed version (ground truth):
void detach(){
  mDestroyed=true;
  if (mVisible) {
    mVisible=false;
    if (DEBUG)     Log.v(TAG,"String_Node_Str" + this);
    onVisibilityChanged(false);
  }
  if (mDestroyReportNeeded) {
    mDestroyReportNeeded=false;
    SurfaceHolder.Callback callbacks[];
synchronized (mSurfaceHolder.mCallbacks) {
      callbacks=new SurfaceHolder.Callback[mSurfaceHolder.mCallbacks.size()];
      mSurfaceHolder.mCallbacks.toArray(callbacks);
    }
    for (    SurfaceHolder.Callback c : callbacks) {
      c.surfaceDestroyed(mSurfaceHolder);
    }
    if (DEBUG)     Log.v(TAG,"String_Node_Str" + mSurfaceHolder + "String_Node_Str"+ this);
    onSurfaceDestroyed(mSurfaceHolder);
  }
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + this);
  onDestroy();
  if (mCreated) {
    try {
      mSession.remove(mWindow);
    }
 catch (    RemoteException e) {
    }
    mSurfaceHolder.mSurface.release();
    mCreated=false;
  }
}
Program: 23799
Project: 23799
Buggy source:
private native void release();

Fixed version (ground truth):
/** 
 * Release the local reference to the server-side surface. @hide 
 */
public native void release();
Program: 23800
Project: 23800
Buggy source:
public void die(boolean immediate){
  checkThread();
  if (Config.LOGV)   Log.v("String_Node_Str","String_Node_Str" + this + "String_Node_Str"+ mSurface);
synchronized (this) {
    if (mAdded && !mFirst) {
      int viewVisibility=mView.getVisibility();
      boolean viewVisibilityChanged=mViewVisibility != viewVisibility;
      if (mWindowAttributesChanged || viewVisibilityChanged) {
        try {
          if ((relayoutWindow(mWindowAttributes,viewVisibility,false) & WindowManagerImpl.RELAYOUT_FIRST_TIME) != 0) {
            sWindowSession.finishDrawing(mWindow);
          }
        }
 catch (        RemoteException e) {
        }
      }
      mSurface.clear();
    }
    if (mAdded) {
      mAdded=false;
      if (immediate) {
        dispatchDetachedFromWindow();
      }
 else       if (mView != null) {
        sendEmptyMessage(DIE);
      }
    }
  }
}

Fixed version (ground truth):
public void die(boolean immediate){
  checkThread();
  if (Config.LOGV)   Log.v("String_Node_Str","String_Node_Str" + this + "String_Node_Str"+ mSurface);
synchronized (this) {
    if (mAdded && !mFirst) {
      int viewVisibility=mView.getVisibility();
      boolean viewVisibilityChanged=mViewVisibility != viewVisibility;
      if (mWindowAttributesChanged || viewVisibilityChanged) {
        try {
          if ((relayoutWindow(mWindowAttributes,viewVisibility,false) & WindowManagerImpl.RELAYOUT_FIRST_TIME) != 0) {
            sWindowSession.finishDrawing(mWindow);
          }
        }
 catch (        RemoteException e) {
        }
      }
      mSurface.release();
    }
    if (mAdded) {
      mAdded=false;
      if (immediate) {
        dispatchDetachedFromWindow();
      }
 else       if (mView != null) {
        sendEmptyMessage(DIE);
      }
    }
  }
}
Program: 23801
Project: 23801
Buggy source:
void dispatchDetachedFromWindow(){
  if (Config.LOGV)   Log.v("String_Node_Str","String_Node_Str" + this + "String_Node_Str"+ mSurface);
  if (mView != null) {
    mView.dispatchDetachedFromWindow();
  }
  mView=null;
  mAttachInfo.mRootView=null;
  mAttachInfo.mSurface=null;
  if (mUseGL) {
    destroyGL();
  }
  mSurface.clear();
  try {
    sWindowSession.remove(mWindow);
  }
 catch (  RemoteException e) {
  }
}

Fixed version (ground truth):
void dispatchDetachedFromWindow(){
  if (Config.LOGV)   Log.v("String_Node_Str","String_Node_Str" + this + "String_Node_Str"+ mSurface);
  if (mView != null) {
    mView.dispatchDetachedFromWindow();
  }
  mView=null;
  mAttachInfo.mRootView=null;
  mAttachInfo.mSurface=null;
  if (mUseGL) {
    destroyGL();
  }
  mSurface.release();
  try {
    sWindowSession.remove(mWindow);
  }
 catch (  RemoteException e) {
  }
}
Program: 23802
Project: 23802
Buggy source:
public void onTerminate(){
  if (mWriter != null) {
    try {
      mWriter.flush();
      if (mOutputStream != null && mOutputStream instanceof FileOutputStream) {
        ((FileOutputStream)mOutputStream).getFD().sync();
      }
    }
 catch (    IOException e) {
      Log.d(LOG_TAG,"String_Node_Str" + e.getMessage());
    }
 finally {
      try {
        mWriter.close();
      }
 catch (      IOException e) {
      }
    }
  }
}

Fixed version (ground truth):
public void onTerminate(){
  mOnTerminateIsCalled=true;
  if (mWriter != null) {
    try {
      mWriter.flush();
      if (mOutputStream != null && mOutputStream instanceof FileOutputStream) {
        ((FileOutputStream)mOutputStream).getFD().sync();
      }
    }
 catch (    IOException e) {
      Log.d(LOG_TAG,"String_Node_Str" + e.getMessage());
    }
 finally {
      try {
        mWriter.close();
      }
 catch (      IOException e) {
      }
    }
  }
}
Program: 23804
Project: 23804
Buggy source:
private void appendVCardEmailLine(StringBuilder builder,int type,String label,String data){
  builder.append(VCARD_PROPERTY_EMAIL);
  builder.append(VCARD_ATTR_SEPARATOR);
switch (type) {
case Email.TYPE_CUSTOM:
    if (label.equals(android.provider.Contacts.ContactMethodsColumns.MOBILE_EMAIL_TYPE_NAME)) {
      builder.append(Constants.ATTR_TYPE_CELL);
    }
 else     if (mUsesAndroidProperty && VCardUtils.containsOnlyAlphaDigitHyphen(label)) {
      builder.append("String_Node_Str");
      builder.append(label);
    }
 else {
      builder.append(Constants.ATTR_TYPE_INTERNET);
    }
  break;
case Email.TYPE_HOME:
builder.append(Constants.ATTR_TYPE_HOME);
break;
case Email.TYPE_WORK:
builder.append(Constants.ATTR_TYPE_WORK);
break;
case Email.TYPE_OTHER:
builder.append(Constants.ATTR_TYPE_INTERNET);
break;
default :
Log.e(LOG_TAG,"String_Node_Str" + type);
builder.append(Constants.ATTR_TYPE_INTERNET);
break;
}
builder.append(VCARD_DATA_SEPARATOR);
builder.append(data);
builder.append(VCARD_COL_SEPARATOR);
}

Fixed version (ground truth):
private void appendVCardEmailLine(StringBuilder builder,int type,String label,String data){
  builder.append(VCARD_PROPERTY_EMAIL);
  builder.append(VCARD_ATTR_SEPARATOR);
switch (type) {
case Email.TYPE_CUSTOM:
    if (label.equals(android.provider.Contacts.ContactMethodsColumns.MOBILE_EMAIL_TYPE_NAME)) {
      builder.append(Constants.ATTR_TYPE_CELL);
    }
 else     if (mUsesAndroidProperty && VCardUtils.containsOnlyAlphaDigitHyphen(label)) {
      builder.append("String_Node_Str");
      builder.append(label);
    }
 else {
      builder.append(Constants.ATTR_TYPE_INTERNET);
    }
  break;
case Email.TYPE_HOME:
builder.append(Constants.ATTR_TYPE_HOME);
break;
case Email.TYPE_WORK:
builder.append(Constants.ATTR_TYPE_WORK);
break;
case Email.TYPE_OTHER:
builder.append(Constants.ATTR_TYPE_INTERNET);
break;
case Email.TYPE_MOBILE:
builder.append(Constants.ATTR_TYPE_CELL);
break;
default :
Log.e(LOG_TAG,"String_Node_Str" + type);
builder.append(Constants.ATTR_TYPE_INTERNET);
break;
}
builder.append(VCARD_DATA_SEPARATOR);
builder.append(data);
builder.append(VCARD_COL_SEPARATOR);
}
Program: 23805
Project: 23805
Buggy source:
@Override protected void handleAgent(String propertyValue) throws VCardException {
  throw new VCardException("String_Node_Str");
}

Fixed version (ground truth):
@Override protected void handleAgent(String propertyValue){
  if (!mEmittedAgentWarning) {
    Log.w(LOG_TAG,"String_Node_Str");
    mEmittedAgentWarning=true;
  }
}
Program: 23806
Project: 23806
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: 23809
Project: 23809
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: 23810
Project: 23810
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: 23811
Project: 23811
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: 23812
Project: 23812
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: 23814
Project: 23814
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: 23816
Project: 23816
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: 23817
Project: 23817
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: 23818
Project: 23818
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: 23819
Project: 23819
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: 23820
Project: 23820
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: 23821
Project: 23821
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: 23823
Project: 23823
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: 23825
Project: 23825
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: 23826
Project: 23826
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: 23827
Project: 23827
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: 23829
Project: 23829
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: 23831
Project: 23831
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: 23832
Project: 23832
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: 23833
Project: 23833
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: 23834
Project: 23834
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: 23835
Project: 23835
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: 23837
Project: 23837
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: 23838
Project: 23838
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: 23839
Project: 23839
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: 23840
Project: 23840
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: 23842
Project: 23842
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: 23843
Project: 23843
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: 23844
Project: 23844
Buggy source:
public abstract Handler getHandler();

Fixed version (ground truth):
public Handler getHandler(){
  return this;
}
Program: 23845
Project: 23845
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: 23848
Project: 23848
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: 23849
Project: 23849
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: 23850
Project: 23850
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: 23851
Project: 23851
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: 23852
Project: 23852
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();
}