Program: 199171
Project: 199171
Buggy source:
/** 
 * Create an internal state listener, to be invoked on the mDeviceHandler <p>It has a few behaviors: <ul> <li>Convert device state changes into session state changes. <li>Keep track of async tasks that the session began (idle, abort). </ul> </p>
 */
CameraDevice.StateListener getDeviceStateListener(){
  final CameraCaptureSession session=this;
  return new CameraDevice.StateListener(){
    private boolean mBusy=false;
    private boolean mActive=false;
    @Override public void onOpened(    CameraDevice camera){
      throw new AssertionError("String_Node_Str");
    }
    @Override public void onDisconnected(    CameraDevice camera){
      close();
    }
    @Override public void onError(    CameraDevice camera,    int error){
      Log.wtf(TAG,"String_Node_Str" + error);
    }
    @Override public void onActive(    CameraDevice camera){
      mIdleDrainer.taskStarted();
      mActive=true;
      mStateListener.onActive(session);
    }
    @Override public void onIdle(    CameraDevice camera){
      boolean isAborting;
synchronized (session) {
        isAborting=mAborting;
      }
      if (mBusy && isAborting) {
        mAbortDrainer.taskFinished();
synchronized (session) {
          mAborting=false;
        }
      }
      if (mActive) {
        mIdleDrainer.taskFinished();
      }
      mBusy=false;
      mActive=false;
      mStateListener.onReady(session);
    }
    @Override public void onBusy(    CameraDevice camera){
      mBusy=true;
      Log.w(TAG,"String_Node_Str");
      mStateListener.onActive(session);
    }
    @Override public void onUnconfigured(    CameraDevice camera){
      mUnconfigureDrainer.taskFinished();
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Create an internal state listener, to be invoked on the mDeviceHandler <p>It has a few behaviors: <ul> <li>Convert device state changes into session state changes. <li>Keep track of async tasks that the session began (idle, abort). </ul> </p>
 */
CameraDevice.StateListener getDeviceStateListener(){
  final CameraCaptureSession session=this;
  return new CameraDevice.StateListener(){
    private boolean mBusy=false;
    private boolean mActive=false;
    @Override public void onOpened(    CameraDevice camera){
      throw new AssertionError("String_Node_Str");
    }
    @Override public void onDisconnected(    CameraDevice camera){
      close();
    }
    @Override public void onError(    CameraDevice camera,    int error){
      Log.wtf(TAG,"String_Node_Str" + error);
    }
    @Override public void onActive(    CameraDevice camera){
      mIdleDrainer.taskStarted();
      mActive=true;
      mStateListener.onActive(session);
    }
    @Override public void onIdle(    CameraDevice camera){
      boolean isAborting;
synchronized (session) {
        isAborting=mAborting;
      }
      if (mBusy && isAborting) {
        mAbortDrainer.taskFinished();
synchronized (session) {
          mAborting=false;
        }
      }
      if (mActive) {
        mIdleDrainer.taskFinished();
      }
      mBusy=false;
      mActive=false;
      mStateListener.onReady(session);
    }
    @Override public void onBusy(    CameraDevice camera){
      mBusy=true;
      Log.w(TAG,"String_Node_Str");
      mStateListener.onActive(session);
    }
    @Override public void onUnconfigured(    CameraDevice camera){
synchronized (session) {
        if (mClosed) {
          mUnconfigureDrainer.taskFinished();
        }
      }
    }
  }
;
}