nus-yam/ex-repair huggingface dataset:
Program: 316
Project: 316
Buggy source:
public void clearCurrentOwner(Object owner,boolean silently){
  if (mOwner == owner) {
    mProc.decActiveServices(mName);
    if (mStartedState != STATE_NOTHING || mBoundState != STATE_NOTHING || mExecState != STATE_NOTHING) {
      long now=SystemClock.uptimeMillis();
      if (mStartedState != STATE_NOTHING) {
        if (!silently) {
          Slog.wtfStack(TAG,"String_Node_Str" + owner + "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
        }
        setStarted(false,0,now);
      }
      if (mBoundState != STATE_NOTHING) {
        if (!silently) {
          Slog.wtfStack(TAG,"String_Node_Str" + owner + "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
        }
        setBound(false,0,now);
      }
      if (mExecState != STATE_NOTHING) {
        if (!silently) {
          Slog.wtfStack(TAG,"String_Node_Str" + owner + "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
        }
        setExecuting(false,0,now);
      }
    }
    mOwner=null;
  }
}

Fixed version (ground truth):
public void clearCurrentOwner(Object owner,boolean silently){
  if (mOwner == owner) {
    mProc.decActiveServices(mName);
    if (mStarted || mBoundState != STATE_NOTHING || mExecState != STATE_NOTHING) {
      long now=SystemClock.uptimeMillis();
      if (mStarted) {
        if (!silently) {
          Slog.wtfStack(TAG,"String_Node_Str" + owner + "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
        }
        setStarted(false,0,now);
      }
      if (mBoundState != STATE_NOTHING) {
        if (!silently) {
          Slog.wtfStack(TAG,"String_Node_Str" + owner + "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
        }
        setBound(false,0,now);
      }
      if (mExecState != STATE_NOTHING) {
        if (!silently) {
          Slog.wtfStack(TAG,"String_Node_Str" + owner + "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
        }
        setExecuting(false,0,now);
      }
    }
    mOwner=null;
  }
}
Program: 317
Project: 317
Buggy source:
void incStartedServices(int memFactor,long now){
  if (mCommonProcess != this) {
    mCommonProcess.incStartedServices(memFactor,now);
  }
  mNumStartedServices++;
  if (mNumStartedServices == 1 && mCurState == STATE_NOTHING) {
    setState(STATE_NOTHING,memFactor,now,null);
  }
}

Fixed version (ground truth):
void incStartedServices(int memFactor,long now,String serviceName){
  if (false) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Slog.d(TAG,"String_Node_Str" + this + "String_Node_Str"+ serviceName+ "String_Node_Str"+ (mNumStartedServices + 1),here);
  }
  if (mCommonProcess != this) {
    mCommonProcess.incStartedServices(memFactor,now,serviceName);
  }
  mNumStartedServices++;
  if (mNumStartedServices == 1 && mCurState == STATE_NOTHING) {
    setState(STATE_SERVICE_RESTARTING + (memFactor * STATE_COUNT),now);
  }
}
Program: 318
Project: 318
Buggy source:
public void applyNewOwner(Object newOwner){
  if (mOwner != newOwner) {
    if (mOwner == null) {
      mOwner=newOwner;
      mProc.incActiveServices(mName);
    }
 else {
      mOwner=newOwner;
      if (mStartedState != STATE_NOTHING || mBoundState != STATE_NOTHING || mExecState != STATE_NOTHING) {
        long now=SystemClock.uptimeMillis();
        if (mStartedState != STATE_NOTHING) {
          if (DEBUG)           Slog.d(TAG,"String_Node_Str" + newOwner + "String_Node_Str"+ mOwner+ "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
          setStarted(false,0,now);
        }
        if (mBoundState != STATE_NOTHING) {
          if (DEBUG)           Slog.d(TAG,"String_Node_Str" + newOwner + "String_Node_Str"+ mOwner+ "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
          setBound(false,0,now);
        }
        if (mExecState != STATE_NOTHING) {
          if (DEBUG)           Slog.d(TAG,"String_Node_Str" + newOwner + "String_Node_Str"+ mOwner+ "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
          setExecuting(false,0,now);
        }
      }
    }
  }
}

Fixed version (ground truth):
public void applyNewOwner(Object newOwner){
  if (mOwner != newOwner) {
    if (mOwner == null) {
      mOwner=newOwner;
      mProc.incActiveServices(mName);
    }
 else {
      mOwner=newOwner;
      if (mStarted || mBoundState != STATE_NOTHING || mExecState != STATE_NOTHING) {
        long now=SystemClock.uptimeMillis();
        if (mStarted) {
          if (DEBUG)           Slog.d(TAG,"String_Node_Str" + newOwner + "String_Node_Str"+ mOwner+ "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
          setStarted(false,0,now);
        }
        if (mBoundState != STATE_NOTHING) {
          if (DEBUG)           Slog.d(TAG,"String_Node_Str" + newOwner + "String_Node_Str"+ mOwner+ "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
          setBound(false,0,now);
        }
        if (mExecState != STATE_NOTHING) {
          if (DEBUG)           Slog.d(TAG,"String_Node_Str" + newOwner + "String_Node_Str"+ mOwner+ "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
          setExecuting(false,0,now);
        }
      }
    }
  }
}
Program: 320
Project: 320
Buggy source:
public void setStarted(boolean started,int memFactor,long now){
  if (mOwner == null) {
    Slog.wtf(TAG,"String_Node_Str" + this + "String_Node_Str");
  }
  final boolean wasStarted=mStartedState != STATE_NOTHING;
  final int state=started ? memFactor : STATE_NOTHING;
  if (mStartedState != state) {
    if (mStartedState != STATE_NOTHING) {
      addDuration(SERVICE_STARTED + (mStartedState * SERVICE_COUNT),now - mStartedStartTime);
    }
 else     if (started) {
      mStartedCount++;
    }
    mStartedState=state;
    mStartedStartTime=now;
    mProc=mProc.pullFixedProc(mPackage);
    if (wasStarted != started) {
      if (started) {
        mProc.incStartedServices(memFactor,now);
      }
 else {
        mProc.decStartedServices(memFactor,now);
      }
    }
    updateRunning(memFactor,now);
  }
}

Fixed version (ground truth):
public void setStarted(boolean started,int memFactor,long now){
  if (mOwner == null) {
    Slog.wtf(TAG,"String_Node_Str" + this + "String_Node_Str");
  }
  mStarted=started;
  updateStartedState(memFactor,now);
}
Program: 322
Project: 322
Buggy source:
void decStartedServices(int memFactor,long now){
  if (mCommonProcess != this) {
    mCommonProcess.decStartedServices(memFactor,now);
  }
  mNumStartedServices--;
  if (mNumStartedServices == 0 && mCurState == STATE_SERVICE_RESTARTING) {
    setState(STATE_NOTHING,memFactor,now,null);
  }
 else   if (mNumStartedServices < 0) {
    Slog.wtfStack(TAG,"String_Node_Str" + mPackage + "String_Node_Str"+ mUid+ "String_Node_Str"+ mName);
    mNumStartedServices=0;
  }
}

Fixed version (ground truth):
void decStartedServices(int memFactor,long now,String serviceName){
  if (false) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Slog.d(TAG,"String_Node_Str" + this + "String_Node_Str"+ serviceName+ "String_Node_Str"+ (mNumStartedServices - 1),here);
  }
  if (mCommonProcess != this) {
    mCommonProcess.decStartedServices(memFactor,now,serviceName);
  }
  mNumStartedServices--;
  if (mNumStartedServices == 0 && (mCurState % STATE_COUNT) == STATE_SERVICE_RESTARTING) {
    setState(STATE_NOTHING,now);
  }
 else   if (mNumStartedServices < 0) {
    Slog.wtfStack(TAG,"String_Node_Str" + mPackage + "String_Node_Str"+ mUid+ "String_Node_Str"+ mName);
    mNumStartedServices=0;
  }
}
Program: 323
Project: 323
Buggy source:
private final boolean unscheduleServiceRestartLocked(ServiceRecord r,int callingUid){
  if (r.restartDelay == 0) {
    return false;
  }
  boolean removed=mRestartingServices.remove(r);
  if (removed || callingUid != r.appInfo.uid) {
    r.resetRestartCounter();
  }
  mAm.mHandler.removeCallbacks(r.restarter);
  return true;
}

Fixed version (ground truth):
private final boolean unscheduleServiceRestartLocked(ServiceRecord r,int callingUid){
  if (r.restartDelay == 0) {
    return false;
  }
  boolean removed=mRestartingServices.remove(r);
  if (removed || callingUid != r.appInfo.uid) {
    r.resetRestartCounter();
  }
  if (removed) {
    r.clearRestarting(mAm.mProcessStats.getMemFactorLocked(),SystemClock.uptimeMillis());
  }
  mAm.mHandler.removeCallbacks(r.restarter);
  return true;
}
Program: 331
Project: 331
Buggy source:
/** 
 * @hide
 */
public static void dumpPackageStateStatic(FileDescriptor fd,String packageName){
  FileOutputStream fout=new FileOutputStream(fd);
  PrintWriter pw=new FastPrintWriter(fout);
  dumpService(pw,fd,Context.ACTIVITY_SERVICE,new String[]{"String_Node_Str",packageName});
  pw.println();
  dumpService(pw,fd,ProcessStats.SERVICE_NAME,new String[]{packageName});
  pw.println();
  dumpService(pw,fd,"String_Node_Str",new String[]{"String_Node_Str",packageName});
  pw.println();
  dumpService(pw,fd,"String_Node_Str",new String[]{packageName});
  pw.println();
  dumpService(pw,fd,BatteryStats.SERVICE_NAME,new String[]{packageName});
  pw.flush();
}

Fixed version (ground truth):
/** 
 * @hide
 */
public static void dumpPackageStateStatic(FileDescriptor fd,String packageName){
  FileOutputStream fout=new FileOutputStream(fd);
  PrintWriter pw=new FastPrintWriter(fout);
  dumpService(pw,fd,Context.ACTIVITY_SERVICE,new String[]{"String_Node_Str","String_Node_Str",packageName});
  pw.println();
  dumpService(pw,fd,"String_Node_Str",new String[]{"String_Node_Str",packageName});
  pw.println();
  dumpService(pw,fd,ProcessStats.SERVICE_NAME,new String[]{"String_Node_Str",packageName});
  pw.println();
  dumpService(pw,fd,"String_Node_Str",new String[]{"String_Node_Str",packageName});
  pw.println();
  dumpService(pw,fd,"String_Node_Str",new String[]{packageName});
  pw.println();
  dumpService(pw,fd,BatteryStats.SERVICE_NAME,new String[]{packageName});
  pw.flush();
}
Program: 332
Project: 332
Buggy source:
private static void dumpService(PrintWriter pw,FileDescriptor fd,String name,String[] args){
  pw.print("String_Node_Str");
  pw.print(name);
  pw.println("String_Node_Str");
  IBinder service=ServiceManager.checkService(name);
  if (service == null) {
    pw.println("String_Node_Str");
    return;
  }
  TransferPipe tp=null;
  try {
    pw.flush();
    tp=new TransferPipe();
    tp.setBufferPrefix("String_Node_Str");
    service.dump(tp.getWriteFd().getFileDescriptor(),args);
    tp.go(fd);
  }
 catch (  Throwable e) {
    if (tp != null) {
      tp.kill();
    }
    pw.println("String_Node_Str");
    e.printStackTrace(pw);
  }
}

Fixed version (ground truth):
private static void dumpService(PrintWriter pw,FileDescriptor fd,String name,String[] args){
  pw.print("String_Node_Str");
  pw.print(name);
  pw.println("String_Node_Str");
  IBinder service=ServiceManager.checkService(name);
  if (service == null) {
    pw.println("String_Node_Str");
    return;
  }
  TransferPipe tp=null;
  try {
    pw.flush();
    tp=new TransferPipe();
    tp.setBufferPrefix("String_Node_Str");
    service.dumpAsync(tp.getWriteFd().getFileDescriptor(),args);
    tp.go(fd);
  }
 catch (  Throwable e) {
    if (tp != null) {
      tp.kill();
    }
    pw.println("String_Node_Str");
    e.printStackTrace(pw);
  }
}
Program: 333
Project: 333
Buggy source:
public void clearCurrentOwner(Object owner,boolean silently){
  if (mOwner == owner) {
    mProc.decActiveServices(mName);
    if (mStartedState != STATE_NOTHING || mBoundState != STATE_NOTHING || mExecState != STATE_NOTHING) {
      long now=SystemClock.uptimeMillis();
      if (mStartedState != STATE_NOTHING) {
        if (!silently) {
          Slog.wtfStack(TAG,"String_Node_Str" + owner + "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
        }
        setStarted(false,0,now);
      }
      if (mBoundState != STATE_NOTHING) {
        if (!silently) {
          Slog.wtfStack(TAG,"String_Node_Str" + owner + "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
        }
        setBound(false,0,now);
      }
      if (mExecState != STATE_NOTHING) {
        if (!silently) {
          Slog.wtfStack(TAG,"String_Node_Str" + owner + "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
        }
        setExecuting(false,0,now);
      }
    }
    mOwner=null;
  }
}

Fixed version (ground truth):
public void clearCurrentOwner(Object owner,boolean silently){
  if (mOwner == owner) {
    mProc.decActiveServices(mName);
    if (mStarted || mBoundState != STATE_NOTHING || mExecState != STATE_NOTHING) {
      long now=SystemClock.uptimeMillis();
      if (mStarted) {
        if (!silently) {
          Slog.wtfStack(TAG,"String_Node_Str" + owner + "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
        }
        setStarted(false,0,now);
      }
      if (mBoundState != STATE_NOTHING) {
        if (!silently) {
          Slog.wtfStack(TAG,"String_Node_Str" + owner + "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
        }
        setBound(false,0,now);
      }
      if (mExecState != STATE_NOTHING) {
        if (!silently) {
          Slog.wtfStack(TAG,"String_Node_Str" + owner + "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
        }
        setExecuting(false,0,now);
      }
    }
    mOwner=null;
  }
}
Program: 334
Project: 334
Buggy source:
void incStartedServices(int memFactor,long now){
  if (mCommonProcess != this) {
    mCommonProcess.incStartedServices(memFactor,now);
  }
  mNumStartedServices++;
  if (mNumStartedServices == 1 && mCurState == STATE_NOTHING) {
    setState(STATE_NOTHING,memFactor,now,null);
  }
}

Fixed version (ground truth):
void incStartedServices(int memFactor,long now,String serviceName){
  if (false) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Slog.d(TAG,"String_Node_Str" + this + "String_Node_Str"+ serviceName+ "String_Node_Str"+ (mNumStartedServices + 1),here);
  }
  if (mCommonProcess != this) {
    mCommonProcess.incStartedServices(memFactor,now,serviceName);
  }
  mNumStartedServices++;
  if (mNumStartedServices == 1 && mCurState == STATE_NOTHING) {
    setState(STATE_SERVICE_RESTARTING + (memFactor * STATE_COUNT),now);
  }
}
Program: 335
Project: 335
Buggy source:
public void applyNewOwner(Object newOwner){
  if (mOwner != newOwner) {
    if (mOwner == null) {
      mOwner=newOwner;
      mProc.incActiveServices(mName);
    }
 else {
      mOwner=newOwner;
      if (mStartedState != STATE_NOTHING || mBoundState != STATE_NOTHING || mExecState != STATE_NOTHING) {
        long now=SystemClock.uptimeMillis();
        if (mStartedState != STATE_NOTHING) {
          if (DEBUG)           Slog.d(TAG,"String_Node_Str" + newOwner + "String_Node_Str"+ mOwner+ "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
          setStarted(false,0,now);
        }
        if (mBoundState != STATE_NOTHING) {
          if (DEBUG)           Slog.d(TAG,"String_Node_Str" + newOwner + "String_Node_Str"+ mOwner+ "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
          setBound(false,0,now);
        }
        if (mExecState != STATE_NOTHING) {
          if (DEBUG)           Slog.d(TAG,"String_Node_Str" + newOwner + "String_Node_Str"+ mOwner+ "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
          setExecuting(false,0,now);
        }
      }
    }
  }
}

Fixed version (ground truth):
public void applyNewOwner(Object newOwner){
  if (mOwner != newOwner) {
    if (mOwner == null) {
      mOwner=newOwner;
      mProc.incActiveServices(mName);
    }
 else {
      mOwner=newOwner;
      if (mStarted || mBoundState != STATE_NOTHING || mExecState != STATE_NOTHING) {
        long now=SystemClock.uptimeMillis();
        if (mStarted) {
          if (DEBUG)           Slog.d(TAG,"String_Node_Str" + newOwner + "String_Node_Str"+ mOwner+ "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
          setStarted(false,0,now);
        }
        if (mBoundState != STATE_NOTHING) {
          if (DEBUG)           Slog.d(TAG,"String_Node_Str" + newOwner + "String_Node_Str"+ mOwner+ "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
          setBound(false,0,now);
        }
        if (mExecState != STATE_NOTHING) {
          if (DEBUG)           Slog.d(TAG,"String_Node_Str" + newOwner + "String_Node_Str"+ mOwner+ "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
          setExecuting(false,0,now);
        }
      }
    }
  }
}
Program: 337
Project: 337
Buggy source:
public void setStarted(boolean started,int memFactor,long now){
  if (mOwner == null) {
    Slog.wtf(TAG,"String_Node_Str" + this + "String_Node_Str");
  }
  final boolean wasStarted=mStartedState != STATE_NOTHING;
  final int state=started ? memFactor : STATE_NOTHING;
  if (mStartedState != state) {
    if (mStartedState != STATE_NOTHING) {
      addDuration(SERVICE_STARTED + (mStartedState * SERVICE_COUNT),now - mStartedStartTime);
    }
 else     if (started) {
      mStartedCount++;
    }
    mStartedState=state;
    mStartedStartTime=now;
    mProc=mProc.pullFixedProc(mPackage);
    if (wasStarted != started) {
      if (started) {
        mProc.incStartedServices(memFactor,now);
      }
 else {
        mProc.decStartedServices(memFactor,now);
      }
    }
    updateRunning(memFactor,now);
  }
}

Fixed version (ground truth):
public void setStarted(boolean started,int memFactor,long now){
  if (mOwner == null) {
    Slog.wtf(TAG,"String_Node_Str" + this + "String_Node_Str");
  }
  mStarted=started;
  updateStartedState(memFactor,now);
}
Program: 339
Project: 339
Buggy source:
void decStartedServices(int memFactor,long now){
  if (mCommonProcess != this) {
    mCommonProcess.decStartedServices(memFactor,now);
  }
  mNumStartedServices--;
  if (mNumStartedServices == 0 && mCurState == STATE_SERVICE_RESTARTING) {
    setState(STATE_NOTHING,memFactor,now,null);
  }
 else   if (mNumStartedServices < 0) {
    Slog.wtfStack(TAG,"String_Node_Str" + mPackage + "String_Node_Str"+ mUid+ "String_Node_Str"+ mName);
    mNumStartedServices=0;
  }
}

Fixed version (ground truth):
void decStartedServices(int memFactor,long now,String serviceName){
  if (false) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Slog.d(TAG,"String_Node_Str" + this + "String_Node_Str"+ serviceName+ "String_Node_Str"+ (mNumStartedServices - 1),here);
  }
  if (mCommonProcess != this) {
    mCommonProcess.decStartedServices(memFactor,now,serviceName);
  }
  mNumStartedServices--;
  if (mNumStartedServices == 0 && (mCurState % STATE_COUNT) == STATE_SERVICE_RESTARTING) {
    setState(STATE_NOTHING,now);
  }
 else   if (mNumStartedServices < 0) {
    Slog.wtfStack(TAG,"String_Node_Str" + mPackage + "String_Node_Str"+ mUid+ "String_Node_Str"+ mName);
    mNumStartedServices=0;
  }
}
Program: 340
Project: 340
Buggy source:
private final boolean unscheduleServiceRestartLocked(ServiceRecord r,int callingUid){
  if (r.restartDelay == 0) {
    return false;
  }
  boolean removed=mRestartingServices.remove(r);
  if (removed || callingUid != r.appInfo.uid) {
    r.resetRestartCounter();
  }
  mAm.mHandler.removeCallbacks(r.restarter);
  return true;
}

Fixed version (ground truth):
private final boolean unscheduleServiceRestartLocked(ServiceRecord r,int callingUid){
  if (r.restartDelay == 0) {
    return false;
  }
  boolean removed=mRestartingServices.remove(r);
  if (removed || callingUid != r.appInfo.uid) {
    r.resetRestartCounter();
  }
  if (removed) {
    r.clearRestarting(mAm.mProcessStats.getMemFactorLocked(),SystemClock.uptimeMillis());
  }
  mAm.mHandler.removeCallbacks(r.restarter);
  return true;
}
Program: 348
Project: 348
Buggy source:
/** 
 * @hide
 */
public static void dumpPackageStateStatic(FileDescriptor fd,String packageName){
  FileOutputStream fout=new FileOutputStream(fd);
  PrintWriter pw=new FastPrintWriter(fout);
  dumpService(pw,fd,Context.ACTIVITY_SERVICE,new String[]{"String_Node_Str",packageName});
  pw.println();
  dumpService(pw,fd,ProcessStats.SERVICE_NAME,new String[]{packageName});
  pw.println();
  dumpService(pw,fd,"String_Node_Str",new String[]{"String_Node_Str",packageName});
  pw.println();
  dumpService(pw,fd,"String_Node_Str",new String[]{packageName});
  pw.println();
  dumpService(pw,fd,BatteryStats.SERVICE_NAME,new String[]{packageName});
  pw.flush();
}

Fixed version (ground truth):
/** 
 * @hide
 */
public static void dumpPackageStateStatic(FileDescriptor fd,String packageName){
  FileOutputStream fout=new FileOutputStream(fd);
  PrintWriter pw=new FastPrintWriter(fout);
  dumpService(pw,fd,Context.ACTIVITY_SERVICE,new String[]{"String_Node_Str","String_Node_Str",packageName});
  pw.println();
  dumpService(pw,fd,"String_Node_Str",new String[]{"String_Node_Str",packageName});
  pw.println();
  dumpService(pw,fd,ProcessStats.SERVICE_NAME,new String[]{"String_Node_Str",packageName});
  pw.println();
  dumpService(pw,fd,"String_Node_Str",new String[]{"String_Node_Str",packageName});
  pw.println();
  dumpService(pw,fd,"String_Node_Str",new String[]{packageName});
  pw.println();
  dumpService(pw,fd,BatteryStats.SERVICE_NAME,new String[]{packageName});
  pw.flush();
}
Program: 349
Project: 349
Buggy source:
private static void dumpService(PrintWriter pw,FileDescriptor fd,String name,String[] args){
  pw.print("String_Node_Str");
  pw.print(name);
  pw.println("String_Node_Str");
  IBinder service=ServiceManager.checkService(name);
  if (service == null) {
    pw.println("String_Node_Str");
    return;
  }
  TransferPipe tp=null;
  try {
    pw.flush();
    tp=new TransferPipe();
    tp.setBufferPrefix("String_Node_Str");
    service.dump(tp.getWriteFd().getFileDescriptor(),args);
    tp.go(fd);
  }
 catch (  Throwable e) {
    if (tp != null) {
      tp.kill();
    }
    pw.println("String_Node_Str");
    e.printStackTrace(pw);
  }
}

Fixed version (ground truth):
private static void dumpService(PrintWriter pw,FileDescriptor fd,String name,String[] args){
  pw.print("String_Node_Str");
  pw.print(name);
  pw.println("String_Node_Str");
  IBinder service=ServiceManager.checkService(name);
  if (service == null) {
    pw.println("String_Node_Str");
    return;
  }
  TransferPipe tp=null;
  try {
    pw.flush();
    tp=new TransferPipe();
    tp.setBufferPrefix("String_Node_Str");
    service.dumpAsync(tp.getWriteFd().getFileDescriptor(),args);
    tp.go(fd);
  }
 catch (  Throwable e) {
    if (tp != null) {
      tp.kill();
    }
    pw.println("String_Node_Str");
    e.printStackTrace(pw);
  }
}
Program: 350
Project: 350
Buggy source:
public void clearCurrentOwner(Object owner,boolean silently){
  if (mOwner == owner) {
    mProc.decActiveServices(mName);
    if (mStartedState != STATE_NOTHING || mBoundState != STATE_NOTHING || mExecState != STATE_NOTHING) {
      long now=SystemClock.uptimeMillis();
      if (mStartedState != STATE_NOTHING) {
        if (!silently) {
          Slog.wtfStack(TAG,"String_Node_Str" + owner + "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
        }
        setStarted(false,0,now);
      }
      if (mBoundState != STATE_NOTHING) {
        if (!silently) {
          Slog.wtfStack(TAG,"String_Node_Str" + owner + "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
        }
        setBound(false,0,now);
      }
      if (mExecState != STATE_NOTHING) {
        if (!silently) {
          Slog.wtfStack(TAG,"String_Node_Str" + owner + "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
        }
        setExecuting(false,0,now);
      }
    }
    mOwner=null;
  }
}

Fixed version (ground truth):
public void clearCurrentOwner(Object owner,boolean silently){
  if (mOwner == owner) {
    mProc.decActiveServices(mName);
    if (mStarted || mBoundState != STATE_NOTHING || mExecState != STATE_NOTHING) {
      long now=SystemClock.uptimeMillis();
      if (mStarted) {
        if (!silently) {
          Slog.wtfStack(TAG,"String_Node_Str" + owner + "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
        }
        setStarted(false,0,now);
      }
      if (mBoundState != STATE_NOTHING) {
        if (!silently) {
          Slog.wtfStack(TAG,"String_Node_Str" + owner + "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
        }
        setBound(false,0,now);
      }
      if (mExecState != STATE_NOTHING) {
        if (!silently) {
          Slog.wtfStack(TAG,"String_Node_Str" + owner + "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
        }
        setExecuting(false,0,now);
      }
    }
    mOwner=null;
  }
}
Program: 351
Project: 351
Buggy source:
void incStartedServices(int memFactor,long now){
  if (mCommonProcess != this) {
    mCommonProcess.incStartedServices(memFactor,now);
  }
  mNumStartedServices++;
  if (mNumStartedServices == 1 && mCurState == STATE_NOTHING) {
    setState(STATE_NOTHING,memFactor,now,null);
  }
}

Fixed version (ground truth):
void incStartedServices(int memFactor,long now,String serviceName){
  if (false) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Slog.d(TAG,"String_Node_Str" + this + "String_Node_Str"+ serviceName+ "String_Node_Str"+ (mNumStartedServices + 1),here);
  }
  if (mCommonProcess != this) {
    mCommonProcess.incStartedServices(memFactor,now,serviceName);
  }
  mNumStartedServices++;
  if (mNumStartedServices == 1 && mCurState == STATE_NOTHING) {
    setState(STATE_SERVICE_RESTARTING + (memFactor * STATE_COUNT),now);
  }
}
Program: 352
Project: 352
Buggy source:
public void applyNewOwner(Object newOwner){
  if (mOwner != newOwner) {
    if (mOwner == null) {
      mOwner=newOwner;
      mProc.incActiveServices(mName);
    }
 else {
      mOwner=newOwner;
      if (mStartedState != STATE_NOTHING || mBoundState != STATE_NOTHING || mExecState != STATE_NOTHING) {
        long now=SystemClock.uptimeMillis();
        if (mStartedState != STATE_NOTHING) {
          if (DEBUG)           Slog.d(TAG,"String_Node_Str" + newOwner + "String_Node_Str"+ mOwner+ "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
          setStarted(false,0,now);
        }
        if (mBoundState != STATE_NOTHING) {
          if (DEBUG)           Slog.d(TAG,"String_Node_Str" + newOwner + "String_Node_Str"+ mOwner+ "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
          setBound(false,0,now);
        }
        if (mExecState != STATE_NOTHING) {
          if (DEBUG)           Slog.d(TAG,"String_Node_Str" + newOwner + "String_Node_Str"+ mOwner+ "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
          setExecuting(false,0,now);
        }
      }
    }
  }
}

Fixed version (ground truth):
public void applyNewOwner(Object newOwner){
  if (mOwner != newOwner) {
    if (mOwner == null) {
      mOwner=newOwner;
      mProc.incActiveServices(mName);
    }
 else {
      mOwner=newOwner;
      if (mStarted || mBoundState != STATE_NOTHING || mExecState != STATE_NOTHING) {
        long now=SystemClock.uptimeMillis();
        if (mStarted) {
          if (DEBUG)           Slog.d(TAG,"String_Node_Str" + newOwner + "String_Node_Str"+ mOwner+ "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
          setStarted(false,0,now);
        }
        if (mBoundState != STATE_NOTHING) {
          if (DEBUG)           Slog.d(TAG,"String_Node_Str" + newOwner + "String_Node_Str"+ mOwner+ "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
          setBound(false,0,now);
        }
        if (mExecState != STATE_NOTHING) {
          if (DEBUG)           Slog.d(TAG,"String_Node_Str" + newOwner + "String_Node_Str"+ mOwner+ "String_Node_Str"+ mPackage+ "String_Node_Str"+ mName+ "String_Node_Str"+ mProc);
          setExecuting(false,0,now);
        }
      }
    }
  }
}
Program: 354
Project: 354
Buggy source:
public void setStarted(boolean started,int memFactor,long now){
  if (mOwner == null) {
    Slog.wtf(TAG,"String_Node_Str" + this + "String_Node_Str");
  }
  final boolean wasStarted=mStartedState != STATE_NOTHING;
  final int state=started ? memFactor : STATE_NOTHING;
  if (mStartedState != state) {
    if (mStartedState != STATE_NOTHING) {
      addDuration(SERVICE_STARTED + (mStartedState * SERVICE_COUNT),now - mStartedStartTime);
    }
 else     if (started) {
      mStartedCount++;
    }
    mStartedState=state;
    mStartedStartTime=now;
    mProc=mProc.pullFixedProc(mPackage);
    if (wasStarted != started) {
      if (started) {
        mProc.incStartedServices(memFactor,now);
      }
 else {
        mProc.decStartedServices(memFactor,now);
      }
    }
    updateRunning(memFactor,now);
  }
}

Fixed version (ground truth):
public void setStarted(boolean started,int memFactor,long now){
  if (mOwner == null) {
    Slog.wtf(TAG,"String_Node_Str" + this + "String_Node_Str");
  }
  mStarted=started;
  updateStartedState(memFactor,now);
}
Program: 356
Project: 356
Buggy source:
void decStartedServices(int memFactor,long now){
  if (mCommonProcess != this) {
    mCommonProcess.decStartedServices(memFactor,now);
  }
  mNumStartedServices--;
  if (mNumStartedServices == 0 && mCurState == STATE_SERVICE_RESTARTING) {
    setState(STATE_NOTHING,memFactor,now,null);
  }
 else   if (mNumStartedServices < 0) {
    Slog.wtfStack(TAG,"String_Node_Str" + mPackage + "String_Node_Str"+ mUid+ "String_Node_Str"+ mName);
    mNumStartedServices=0;
  }
}

Fixed version (ground truth):
void decStartedServices(int memFactor,long now,String serviceName){
  if (false) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Slog.d(TAG,"String_Node_Str" + this + "String_Node_Str"+ serviceName+ "String_Node_Str"+ (mNumStartedServices - 1),here);
  }
  if (mCommonProcess != this) {
    mCommonProcess.decStartedServices(memFactor,now,serviceName);
  }
  mNumStartedServices--;
  if (mNumStartedServices == 0 && (mCurState % STATE_COUNT) == STATE_SERVICE_RESTARTING) {
    setState(STATE_NOTHING,now);
  }
 else   if (mNumStartedServices < 0) {
    Slog.wtfStack(TAG,"String_Node_Str" + mPackage + "String_Node_Str"+ mUid+ "String_Node_Str"+ mName);
    mNumStartedServices=0;
  }
}
Program: 357
Project: 357
Buggy source:
private final boolean unscheduleServiceRestartLocked(ServiceRecord r,int callingUid){
  if (r.restartDelay == 0) {
    return false;
  }
  boolean removed=mRestartingServices.remove(r);
  if (removed || callingUid != r.appInfo.uid) {
    r.resetRestartCounter();
  }
  mAm.mHandler.removeCallbacks(r.restarter);
  return true;
}

Fixed version (ground truth):
private final boolean unscheduleServiceRestartLocked(ServiceRecord r,int callingUid){
  if (r.restartDelay == 0) {
    return false;
  }
  boolean removed=mRestartingServices.remove(r);
  if (removed || callingUid != r.appInfo.uid) {
    r.resetRestartCounter();
  }
  if (removed) {
    r.clearRestarting(mAm.mProcessStats.getMemFactorLocked(),SystemClock.uptimeMillis());
  }
  mAm.mHandler.removeCallbacks(r.restarter);
  return true;
}
Program: 365
Project: 365
Buggy source:
@Override public boolean getPadding(Rect padding){
  final Rect r=mDrawableContainerState.getConstantPadding();
  boolean result=true;
  if (r != null) {
    padding.set(r);
  }
 else {
    if (mCurrDrawable != null) {
      result=mCurrDrawable.getPadding(padding);
    }
 else {
      result=super.getPadding(padding);
    }
  }
  if (needsMirroring()) {
    final int left=padding.left;
    final int right=padding.right;
    padding.left=right;
    padding.right=left;
  }
  return result;
}

Fixed version (ground truth):
@Override public boolean getPadding(Rect padding){
  final Rect r=mDrawableContainerState.getConstantPadding();
  boolean result;
  if (r != null) {
    padding.set(r);
    result=(r.left | r.top | r.bottom| r.right) != 0;
  }
 else {
    if (mCurrDrawable != null) {
      result=mCurrDrawable.getPadding(padding);
    }
 else {
      result=super.getPadding(padding);
    }
  }
  if (needsMirroring()) {
    final int left=padding.left;
    final int right=padding.right;
    padding.left=right;
    padding.right=left;
  }
  return result;
}
Program: 366
Project: 366
Buggy source:
@Override public boolean getPadding(Rect padding){
  if (needsMirroring()) {
    padding.set(mPadding.right,mPadding.top,mPadding.left,mPadding.bottom);
  }
 else {
    padding.set(mPadding);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean getPadding(Rect padding){
  if (needsMirroring()) {
    padding.set(mPadding.right,mPadding.top,mPadding.left,mPadding.bottom);
  }
 else {
    padding.set(mPadding);
  }
  return (padding.left | padding.top | padding.right| padding.bottom) != 0;
}
Program: 368
Project: 368
Buggy source:
private void getInitialTransportState(){
  DisplayClientState dcs=KeyguardUpdateMonitor.getInstance(mContext).getCachedDisplayClientState();
  mTransportState=(dcs.clearing ? TRANSPORT_GONE : (isMusicPlaying(dcs.playbackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE));
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + mTransportState + "String_Node_Str"+ dcs.playbackState);
}

Fixed version (ground truth):
private void getInitialTransportState(){
  DisplayClientState dcs=KeyguardUpdateMonitor.getInstance(mContext).getCachedDisplayClientState();
  mTransportState=(dcs.clearing ? TRANSPORT_GONE : (isMusicPlaying(dcs.playbackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE));
  if (DEBUGXPORT)   Log.v(TAG,"String_Node_Str" + mTransportState + "String_Node_Str"+ dcs.playbackState);
}
Program: 369
Project: 369
Buggy source:
@Override public void run(){
  showAppropriateWidgetPage();
}

Fixed version (ground truth):
@Override public void run(){
  mAppWidgetContainer.setCurrentPage(pageToShow);
}
Program: 370
Project: 370
Buggy source:
@Override public void onRestoreInstanceState(Parcelable state){
  if (!(state instanceof SavedState)) {
    super.onRestoreInstanceState(state);
    return;
  }
  SavedState ss=(SavedState)state;
  super.onRestoreInstanceState(ss.getSuperState());
  mTransportState=(ss.transportState);
  mAppWidgetToShow=ss.appWidgetToShow;
  setInsets(ss.insets);
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + mTransportState);
  post(mSwitchPageRunnable);
}

Fixed version (ground truth):
@Override public void onRestoreInstanceState(Parcelable state){
  if (!(state instanceof SavedState)) {
    super.onRestoreInstanceState(state);
    return;
  }
  SavedState ss=(SavedState)state;
  super.onRestoreInstanceState(ss.getSuperState());
  mTransportState=(ss.transportState);
  mAppWidgetToShow=ss.appWidgetToShow;
  setInsets(ss.insets);
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + mTransportState);
  mSwitchPageRunnable.run();
}
Program: 371
Project: 371
Buggy source:
private void showAppropriateWidgetPage(){
  int state=mTransportState;
  ensureTransportPresentOrRemoved(state);
  int pageToShow=getAppropriateWidgetPage(state);
  mAppWidgetContainer.setCurrentPage(pageToShow);
}

Fixed version (ground truth):
private void showAppropriateWidgetPage(){
  final int state=mTransportState;
  final boolean transportAdded=ensureTransportPresentOrRemoved(state);
  final int pageToShow=getAppropriateWidgetPage(state);
  if (!transportAdded) {
    mAppWidgetContainer.setCurrentPage(pageToShow);
  }
 else   if (state == TRANSPORT_VISIBLE) {
    post(new Runnable(){
      @Override public void run(){
        mAppWidgetContainer.setCurrentPage(pageToShow);
      }
    }
);
  }
}
Program: 373
Project: 373
Buggy source:
private void getInitialTransportState(){
  DisplayClientState dcs=KeyguardUpdateMonitor.getInstance(mContext).getCachedDisplayClientState();
  mTransportState=(dcs.clearing ? TRANSPORT_GONE : (isMusicPlaying(dcs.playbackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE));
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + mTransportState + "String_Node_Str"+ dcs.playbackState);
}

Fixed version (ground truth):
private void getInitialTransportState(){
  DisplayClientState dcs=KeyguardUpdateMonitor.getInstance(mContext).getCachedDisplayClientState();
  mTransportState=(dcs.clearing ? TRANSPORT_GONE : (isMusicPlaying(dcs.playbackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE));
  if (DEBUGXPORT)   Log.v(TAG,"String_Node_Str" + mTransportState + "String_Node_Str"+ dcs.playbackState);
}
Program: 374
Project: 374
Buggy source:
@Override public void run(){
  showAppropriateWidgetPage();
}

Fixed version (ground truth):
@Override public void run(){
  mAppWidgetContainer.setCurrentPage(pageToShow);
}
Program: 375
Project: 375
Buggy source:
@Override public void onRestoreInstanceState(Parcelable state){
  if (!(state instanceof SavedState)) {
    super.onRestoreInstanceState(state);
    return;
  }
  SavedState ss=(SavedState)state;
  super.onRestoreInstanceState(ss.getSuperState());
  mTransportState=(ss.transportState);
  mAppWidgetToShow=ss.appWidgetToShow;
  setInsets(ss.insets);
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + mTransportState);
  post(mSwitchPageRunnable);
}

Fixed version (ground truth):
@Override public void onRestoreInstanceState(Parcelable state){
  if (!(state instanceof SavedState)) {
    super.onRestoreInstanceState(state);
    return;
  }
  SavedState ss=(SavedState)state;
  super.onRestoreInstanceState(ss.getSuperState());
  mTransportState=(ss.transportState);
  mAppWidgetToShow=ss.appWidgetToShow;
  setInsets(ss.insets);
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + mTransportState);
  mSwitchPageRunnable.run();
}
Program: 376
Project: 376
Buggy source:
private void showAppropriateWidgetPage(){
  int state=mTransportState;
  ensureTransportPresentOrRemoved(state);
  int pageToShow=getAppropriateWidgetPage(state);
  mAppWidgetContainer.setCurrentPage(pageToShow);
}

Fixed version (ground truth):
private void showAppropriateWidgetPage(){
  final int state=mTransportState;
  final boolean transportAdded=ensureTransportPresentOrRemoved(state);
  final int pageToShow=getAppropriateWidgetPage(state);
  if (!transportAdded) {
    mAppWidgetContainer.setCurrentPage(pageToShow);
  }
 else   if (state == TRANSPORT_VISIBLE) {
    post(new Runnable(){
      @Override public void run(){
        mAppWidgetContainer.setCurrentPage(pageToShow);
      }
    }
);
  }
}
Program: 378
Project: 378
Buggy source:
private void getInitialTransportState(){
  DisplayClientState dcs=KeyguardUpdateMonitor.getInstance(mContext).getCachedDisplayClientState();
  mTransportState=(dcs.clearing ? TRANSPORT_GONE : (isMusicPlaying(dcs.playbackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE));
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + mTransportState + "String_Node_Str"+ dcs.playbackState);
}

Fixed version (ground truth):
private void getInitialTransportState(){
  DisplayClientState dcs=KeyguardUpdateMonitor.getInstance(mContext).getCachedDisplayClientState();
  mTransportState=(dcs.clearing ? TRANSPORT_GONE : (isMusicPlaying(dcs.playbackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE));
  if (DEBUGXPORT)   Log.v(TAG,"String_Node_Str" + mTransportState + "String_Node_Str"+ dcs.playbackState);
}
Program: 379
Project: 379
Buggy source:
@Override public void run(){
  showAppropriateWidgetPage();
}

Fixed version (ground truth):
@Override public void run(){
  mAppWidgetContainer.setCurrentPage(pageToShow);
}
Program: 380
Project: 380
Buggy source:
@Override public void onRestoreInstanceState(Parcelable state){
  if (!(state instanceof SavedState)) {
    super.onRestoreInstanceState(state);
    return;
  }
  SavedState ss=(SavedState)state;
  super.onRestoreInstanceState(ss.getSuperState());
  mTransportState=(ss.transportState);
  mAppWidgetToShow=ss.appWidgetToShow;
  setInsets(ss.insets);
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + mTransportState);
  post(mSwitchPageRunnable);
}

Fixed version (ground truth):
@Override public void onRestoreInstanceState(Parcelable state){
  if (!(state instanceof SavedState)) {
    super.onRestoreInstanceState(state);
    return;
  }
  SavedState ss=(SavedState)state;
  super.onRestoreInstanceState(ss.getSuperState());
  mTransportState=(ss.transportState);
  mAppWidgetToShow=ss.appWidgetToShow;
  setInsets(ss.insets);
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + mTransportState);
  mSwitchPageRunnable.run();
}
Program: 381
Project: 381
Buggy source:
private void showAppropriateWidgetPage(){
  int state=mTransportState;
  ensureTransportPresentOrRemoved(state);
  int pageToShow=getAppropriateWidgetPage(state);
  mAppWidgetContainer.setCurrentPage(pageToShow);
}

Fixed version (ground truth):
private void showAppropriateWidgetPage(){
  final int state=mTransportState;
  final boolean transportAdded=ensureTransportPresentOrRemoved(state);
  final int pageToShow=getAppropriateWidgetPage(state);
  if (!transportAdded) {
    mAppWidgetContainer.setCurrentPage(pageToShow);
  }
 else   if (state == TRANSPORT_VISIBLE) {
    post(new Runnable(){
      @Override public void run(){
        mAppWidgetContainer.setCurrentPage(pageToShow);
      }
    }
);
  }
}
Program: 383
Project: 383
Buggy source:
private void getInitialTransportState(){
  DisplayClientState dcs=KeyguardUpdateMonitor.getInstance(mContext).getCachedDisplayClientState();
  mTransportState=(dcs.clearing ? TRANSPORT_GONE : (isMusicPlaying(dcs.playbackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE));
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + mTransportState + "String_Node_Str"+ dcs.playbackState);
}

Fixed version (ground truth):
private void getInitialTransportState(){
  DisplayClientState dcs=KeyguardUpdateMonitor.getInstance(mContext).getCachedDisplayClientState();
  mTransportState=(dcs.clearing ? TRANSPORT_GONE : (isMusicPlaying(dcs.playbackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE));
  if (DEBUGXPORT)   Log.v(TAG,"String_Node_Str" + mTransportState + "String_Node_Str"+ dcs.playbackState);
}
Program: 384
Project: 384
Buggy source:
@Override public void run(){
  showAppropriateWidgetPage();
}

Fixed version (ground truth):
@Override public void run(){
  mAppWidgetContainer.setCurrentPage(pageToShow);
}
Program: 385
Project: 385
Buggy source:
@Override public void onRestoreInstanceState(Parcelable state){
  if (!(state instanceof SavedState)) {
    super.onRestoreInstanceState(state);
    return;
  }
  SavedState ss=(SavedState)state;
  super.onRestoreInstanceState(ss.getSuperState());
  mTransportState=(ss.transportState);
  mAppWidgetToShow=ss.appWidgetToShow;
  setInsets(ss.insets);
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + mTransportState);
  post(mSwitchPageRunnable);
}

Fixed version (ground truth):
@Override public void onRestoreInstanceState(Parcelable state){
  if (!(state instanceof SavedState)) {
    super.onRestoreInstanceState(state);
    return;
  }
  SavedState ss=(SavedState)state;
  super.onRestoreInstanceState(ss.getSuperState());
  mTransportState=(ss.transportState);
  mAppWidgetToShow=ss.appWidgetToShow;
  setInsets(ss.insets);
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + mTransportState);
  mSwitchPageRunnable.run();
}
Program: 386
Project: 386
Buggy source:
private void showAppropriateWidgetPage(){
  int state=mTransportState;
  ensureTransportPresentOrRemoved(state);
  int pageToShow=getAppropriateWidgetPage(state);
  mAppWidgetContainer.setCurrentPage(pageToShow);
}

Fixed version (ground truth):
private void showAppropriateWidgetPage(){
  final int state=mTransportState;
  final boolean transportAdded=ensureTransportPresentOrRemoved(state);
  final int pageToShow=getAppropriateWidgetPage(state);
  if (!transportAdded) {
    mAppWidgetContainer.setCurrentPage(pageToShow);
  }
 else   if (state == TRANSPORT_VISIBLE) {
    post(new Runnable(){
      @Override public void run(){
        mAppWidgetContainer.setCurrentPage(pageToShow);
      }
    }
);
  }
}
Program: 388
Project: 388
Buggy source:
private void getInitialTransportState(){
  DisplayClientState dcs=KeyguardUpdateMonitor.getInstance(mContext).getCachedDisplayClientState();
  mTransportState=(dcs.clearing ? TRANSPORT_GONE : (isMusicPlaying(dcs.playbackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE));
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + mTransportState + "String_Node_Str"+ dcs.playbackState);
}

Fixed version (ground truth):
private void getInitialTransportState(){
  DisplayClientState dcs=KeyguardUpdateMonitor.getInstance(mContext).getCachedDisplayClientState();
  mTransportState=(dcs.clearing ? TRANSPORT_GONE : (isMusicPlaying(dcs.playbackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE));
  if (DEBUGXPORT)   Log.v(TAG,"String_Node_Str" + mTransportState + "String_Node_Str"+ dcs.playbackState);
}
Program: 389
Project: 389
Buggy source:
@Override public void run(){
  showAppropriateWidgetPage();
}

Fixed version (ground truth):
@Override public void run(){
  mAppWidgetContainer.setCurrentPage(pageToShow);
}
Program: 390
Project: 390
Buggy source:
@Override public void onRestoreInstanceState(Parcelable state){
  if (!(state instanceof SavedState)) {
    super.onRestoreInstanceState(state);
    return;
  }
  SavedState ss=(SavedState)state;
  super.onRestoreInstanceState(ss.getSuperState());
  mTransportState=(ss.transportState);
  mAppWidgetToShow=ss.appWidgetToShow;
  setInsets(ss.insets);
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + mTransportState);
  post(mSwitchPageRunnable);
}

Fixed version (ground truth):
@Override public void onRestoreInstanceState(Parcelable state){
  if (!(state instanceof SavedState)) {
    super.onRestoreInstanceState(state);
    return;
  }
  SavedState ss=(SavedState)state;
  super.onRestoreInstanceState(ss.getSuperState());
  mTransportState=(ss.transportState);
  mAppWidgetToShow=ss.appWidgetToShow;
  setInsets(ss.insets);
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + mTransportState);
  mSwitchPageRunnable.run();
}
Program: 391
Project: 391
Buggy source:
private void showAppropriateWidgetPage(){
  int state=mTransportState;
  ensureTransportPresentOrRemoved(state);
  int pageToShow=getAppropriateWidgetPage(state);
  mAppWidgetContainer.setCurrentPage(pageToShow);
}

Fixed version (ground truth):
private void showAppropriateWidgetPage(){
  final int state=mTransportState;
  final boolean transportAdded=ensureTransportPresentOrRemoved(state);
  final int pageToShow=getAppropriateWidgetPage(state);
  if (!transportAdded) {
    mAppWidgetContainer.setCurrentPage(pageToShow);
  }
 else   if (state == TRANSPORT_VISIBLE) {
    post(new Runnable(){
      @Override public void run(){
        mAppWidgetContainer.setCurrentPage(pageToShow);
      }
    }
);
  }
}
Program: 393
Project: 393
Buggy source:
private void getInitialTransportState(){
  DisplayClientState dcs=KeyguardUpdateMonitor.getInstance(mContext).getCachedDisplayClientState();
  mTransportState=(dcs.clearing ? TRANSPORT_GONE : (isMusicPlaying(dcs.playbackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE));
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + mTransportState + "String_Node_Str"+ dcs.playbackState);
}

Fixed version (ground truth):
private void getInitialTransportState(){
  DisplayClientState dcs=KeyguardUpdateMonitor.getInstance(mContext).getCachedDisplayClientState();
  mTransportState=(dcs.clearing ? TRANSPORT_GONE : (isMusicPlaying(dcs.playbackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE));
  if (DEBUGXPORT)   Log.v(TAG,"String_Node_Str" + mTransportState + "String_Node_Str"+ dcs.playbackState);
}
Program: 394
Project: 394
Buggy source:
@Override public void run(){
  showAppropriateWidgetPage();
}

Fixed version (ground truth):
@Override public void run(){
  mAppWidgetContainer.setCurrentPage(pageToShow);
}