Program: 38135
Project: 38135
Buggy source:
private void captureStillPicture(final int id){
  Log.d(TAG,"String_Node_Str" + id);
  mIsRefocus=false;
  CameraCaptureSession.CaptureCallback captureCallback=new CameraCaptureSession.CaptureCallback(){
    @Override public void onCaptureCompleted(    CameraCaptureSession session,    CaptureRequest request,    TotalCaptureResult result){
      Log.d(TAG,"String_Node_Str" + id);
    }
    @Override public void onCaptureFailed(    CameraCaptureSession session,    CaptureRequest request,    CaptureFailure result){
      Log.d(TAG,"String_Node_Str" + id);
    }
    @Override public void onCaptureSequenceCompleted(    CameraCaptureSession session,    int sequenceId,    long frameNumber){
      Log.d(TAG,"String_Node_Str" + id);
      unlockFocus(id);
    }
  }
;
  try {
    if (null == mActivity || null == mCameraDevice[id]) {
      warningToast("String_Node_Str");
      return;
    }
    checkAndPlayShutterSound(id);
    final boolean csEnabled=isClearSightOn();
    CaptureRequest.Builder captureBuilder;
    if (csEnabled) {
      captureBuilder=ClearSightImageProcessor.getInstance().createCaptureRequest(mCameraDevice[id]);
    }
 else {
      captureBuilder=mCameraDevice[id].createCaptureRequest(CameraDevice.TEMPLATE_STILL_CAPTURE);
    }
    Location location=mLocationManager.getCurrentLocation();
    if (location != null) {
      Log.d(TAG,"String_Node_Str" + location.toString());
      location.setTime(location.getTime() / 1000);
      captureBuilder.set(CaptureRequest.JPEG_GPS_LOCATION,location);
    }
 else {
      Log.d(TAG,"String_Node_Str" + getRecordLocation());
    }
    captureBuilder.set(CaptureRequest.JPEG_ORIENTATION,CameraUtil.getJpegRotation(id,mOrientation));
    captureBuilder.set(CaptureRequest.CONTROL_MODE,CaptureRequest.CONTROL_MODE_AUTO);
    addPreviewSurface(captureBuilder,null,id);
    captureBuilder.set(CaptureRequest.CONTROL_AF_MODE,mControlAFMode);
    captureBuilder.set(CaptureRequest.CONTROL_AF_TRIGGER,CaptureRequest.CONTROL_AF_TRIGGER_IDLE);
    applySettingsForLockExposure(captureBuilder,id);
    applySettingsForCapture(captureBuilder,id);
    if (csEnabled) {
      ClearSightImageProcessor.getInstance().capture(id == BAYER_ID,mCaptureSession[id],captureBuilder,mCaptureCallbackHandler);
    }
 else     if (id == getMainCameraId() && mPostProcessor.isFilterOn()) {
      mCaptureSession[id].stopRepeating();
      captureBuilder.addTarget(mImageReader[id].getSurface());
      if (mPostProcessor.isManualMode()) {
        mPostProcessor.manualCapture(captureBuilder,mCaptureSession[id],captureCallback,mCaptureCallbackHandler);
      }
 else {
        List<CaptureRequest> captureList=mPostProcessor.setRequiredImages(captureBuilder);
        mCaptureSession[id].captureBurst(captureList,captureCallback,mCaptureCallbackHandler);
      }
    }
 else {
      captureBuilder.addTarget(mImageReader[id].getSurface());
      mCaptureSession[id].stopRepeating();
      if (mLongshotActive) {
        Log.d(TAG,"String_Node_Str" + id);
        List<CaptureRequest> burstList=new ArrayList<>();
        for (int i=0; i < PersistUtil.getLongshotShotLimit(); i++) {
          burstList.add(captureBuilder.build());
        }
        mCaptureSession[id].captureBurst(burstList,new CameraCaptureSession.CaptureCallback(){
          @Override public void onCaptureCompleted(          CameraCaptureSession session,          CaptureRequest request,          TotalCaptureResult result){
            Log.d(TAG,"String_Node_Str" + id);
            if (mLongshotActive) {
              mActivity.runOnUiThread(new Runnable(){
                @Override public void run(){
                  mUI.doShutterAnimation();
                }
              }
);
            }
          }
          @Override public void onCaptureFailed(          CameraCaptureSession session,          CaptureRequest request,          CaptureFailure result){
            Log.d(TAG,"String_Node_Str" + id);
            if (mLongshotActive) {
              mActivity.runOnUiThread(new Runnable(){
                @Override public void run(){
                  mUI.doShutterAnimation();
                }
              }
);
            }
          }
          @Override public void onCaptureSequenceCompleted(          CameraCaptureSession session,          int sequenceId,          long frameNumber){
            Log.d(TAG,"String_Node_Str" + id);
            mLongshotActive=false;
            unlockFocus(id);
          }
        }
,mCaptureCallbackHandler);
      }
 else {
        if (isMpoOn()) {
          mCaptureStartTime=System.currentTimeMillis();
          mMpoSaveHandler.obtainMessage(MpoSaveHandler.MSG_CONFIGURE,Long.valueOf(mCaptureStartTime)).sendToTarget();
        }
        mCaptureSession[id].capture(captureBuilder.build(),captureCallback,mCaptureCallbackHandler);
      }
    }
  }
 catch (  CameraAccessException e) {
    Log.d(TAG,"String_Node_Str");
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void captureStillPicture(final int id){
  Log.d(TAG,"String_Node_Str" + id);
  mIsRefocus=false;
  CameraCaptureSession.CaptureCallback captureCallback=new CameraCaptureSession.CaptureCallback(){
    @Override public void onCaptureCompleted(    CameraCaptureSession session,    CaptureRequest request,    TotalCaptureResult result){
      Log.d(TAG,"String_Node_Str" + id);
    }
    @Override public void onCaptureFailed(    CameraCaptureSession session,    CaptureRequest request,    CaptureFailure result){
      Log.d(TAG,"String_Node_Str" + id);
    }
    @Override public void onCaptureSequenceCompleted(    CameraCaptureSession session,    int sequenceId,    long frameNumber){
      Log.d(TAG,"String_Node_Str" + id);
      unlockFocus(id);
    }
  }
;
  try {
    if (null == mActivity || null == mCameraDevice[id]) {
      warningToast("String_Node_Str");
      return;
    }
    final boolean csEnabled=isClearSightOn();
    CaptureRequest.Builder captureBuilder;
    if (csEnabled) {
      captureBuilder=ClearSightImageProcessor.getInstance().createCaptureRequest(mCameraDevice[id]);
    }
 else {
      captureBuilder=mCameraDevice[id].createCaptureRequest(CameraDevice.TEMPLATE_STILL_CAPTURE);
    }
    Location location=mLocationManager.getCurrentLocation();
    if (location != null) {
      Log.d(TAG,"String_Node_Str" + location.toString());
      location.setTime(location.getTime() / 1000);
      captureBuilder.set(CaptureRequest.JPEG_GPS_LOCATION,location);
    }
 else {
      Log.d(TAG,"String_Node_Str" + getRecordLocation());
    }
    captureBuilder.set(CaptureRequest.JPEG_ORIENTATION,CameraUtil.getJpegRotation(id,mOrientation));
    captureBuilder.set(CaptureRequest.CONTROL_MODE,CaptureRequest.CONTROL_MODE_AUTO);
    addPreviewSurface(captureBuilder,null,id);
    captureBuilder.set(CaptureRequest.CONTROL_AF_MODE,mControlAFMode);
    captureBuilder.set(CaptureRequest.CONTROL_AF_TRIGGER,CaptureRequest.CONTROL_AF_TRIGGER_IDLE);
    applySettingsForLockExposure(captureBuilder,id);
    applySettingsForCapture(captureBuilder,id);
    if (csEnabled) {
      checkAndPlayShutterSound(id);
      ClearSightImageProcessor.getInstance().capture(id == BAYER_ID,mCaptureSession[id],captureBuilder,mCaptureCallbackHandler);
    }
 else     if (id == getMainCameraId() && mPostProcessor.isFilterOn()) {
      checkAndPlayShutterSound(id);
      mCaptureSession[id].stopRepeating();
      captureBuilder.addTarget(mImageReader[id].getSurface());
      if (mPostProcessor.isManualMode()) {
        mPostProcessor.manualCapture(captureBuilder,mCaptureSession[id],captureCallback,mCaptureCallbackHandler);
      }
 else {
        List<CaptureRequest> captureList=mPostProcessor.setRequiredImages(captureBuilder);
        mCaptureSession[id].captureBurst(captureList,captureCallback,mCaptureCallbackHandler);
      }
    }
 else {
      captureBuilder.addTarget(mImageReader[id].getSurface());
      mCaptureSession[id].stopRepeating();
      if (mLongshotActive) {
        Log.d(TAG,"String_Node_Str" + id);
        List<CaptureRequest> burstList=new ArrayList<>();
        for (int i=0; i < PersistUtil.getLongshotShotLimit(); i++) {
          burstList.add(captureBuilder.build());
        }
        mCaptureSession[id].captureBurst(burstList,new CameraCaptureSession.CaptureCallback(){
          @Override public void onCaptureCompleted(          CameraCaptureSession session,          CaptureRequest request,          TotalCaptureResult result){
            Log.d(TAG,"String_Node_Str" + id);
            if (mLongshotActive) {
              checkAndPlayShutterSound(id);
              mActivity.runOnUiThread(new Runnable(){
                @Override public void run(){
                  mUI.doShutterAnimation();
                }
              }
);
            }
          }
          @Override public void onCaptureFailed(          CameraCaptureSession session,          CaptureRequest request,          CaptureFailure result){
            Log.d(TAG,"String_Node_Str" + id);
            if (mLongshotActive) {
              mActivity.runOnUiThread(new Runnable(){
                @Override public void run(){
                  mUI.doShutterAnimation();
                }
              }
);
            }
          }
          @Override public void onCaptureSequenceCompleted(          CameraCaptureSession session,          int sequenceId,          long frameNumber){
            Log.d(TAG,"String_Node_Str" + id);
            mLongshotActive=false;
            unlockFocus(id);
          }
        }
,mCaptureCallbackHandler);
      }
 else {
        checkAndPlayShutterSound(id);
        if (isMpoOn()) {
          mCaptureStartTime=System.currentTimeMillis();
          mMpoSaveHandler.obtainMessage(MpoSaveHandler.MSG_CONFIGURE,Long.valueOf(mCaptureStartTime)).sendToTarget();
        }
        mCaptureSession[id].capture(captureBuilder.build(),captureCallback,mCaptureCallbackHandler);
      }
    }
  }
 catch (  CameraAccessException e) {
    Log.d(TAG,"String_Node_Str");
    e.printStackTrace();
  }
}