Program: 38261
Project: 38261
Buggy source:
public void startCapture(){
  mCancelComputation=false;
  mTimeTaken=System.currentTimeMillis();
  mActivity.setSwipingEnabled(false);
  mCaptureState=CAPTURE_STATE_MOSAIC;
  mUI.onStartCapture();
  Parameters parameters=mCameraDevice.getParameters();
  parameters.setAutoExposureLock(true);
  parameters.setAutoWhiteBalanceLock(true);
  configureCamera(parameters);
  mMosaicFrameProcessor.setProgressListener(new MosaicFrameProcessor.ProgressListener(){
    @Override public void onProgress(    boolean isFinished,    float panningRateX,    float panningRateY,    float progressX,    float progressY){
      float accumulatedHorizontalAngle=progressX * mHorizontalViewAngle;
      float accumulatedVerticalAngle=progressY * mVerticalViewAngle;
      boolean isRotated=!(mDeviceOrientationAtCapture == mDeviceOrientation);
      if (isFinished || (Math.abs(accumulatedHorizontalAngle) >= DEFAULT_SWEEP_ANGLE) || (Math.abs(accumulatedVerticalAngle) >= DEFAULT_SWEEP_ANGLE)|| isRotated) {
        stopCapture(false);
      }
 else {
        float panningRateXInDegree=panningRateX * mHorizontalViewAngle;
        float panningRateYInDegree=panningRateY * mVerticalViewAngle;
        mUI.updateCaptureProgress(panningRateXInDegree,panningRateYInDegree,accumulatedHorizontalAngle,accumulatedVerticalAngle,PANNING_SPEED_THRESHOLD);
      }
    }
  }
);
  mUI.resetCaptureProgress();
  mUI.setMaxCaptureProgress(DEFAULT_SWEEP_ANGLE);
  mUI.showCaptureProgress();
  mDeviceOrientationAtCapture=mDeviceOrientation;
  keepScreenOn();
  mOrientationLocked=true;
  int degrees=CameraUtil.getDisplayRotation(mActivity);
  int cameraId=CameraHolder.instance().getBackCameraId();
  int orientation=CameraUtil.getDisplayOrientation(degrees,cameraId);
  mUI.setProgressOrientation(orientation);
}

Fixed version (ground truth):
public void startCapture(){
  mCancelComputation=false;
  mTimeTaken=System.currentTimeMillis();
  mActivity.setSwipingEnabled(false);
  mCaptureState=CAPTURE_STATE_MOSAIC;
  mUI.onStartCapture();
  Parameters parameters=mCameraDevice.getParameters();
  parameters.setAutoExposureLock(true);
  parameters.setAutoWhiteBalanceLock(true);
  configureCamera(parameters);
  mMosaicFrameProcessor.setProgressListener(new MosaicFrameProcessor.ProgressListener(){
    @Override public void onProgress(    boolean isFinished,    float panningRateX,    float panningRateY,    float progressX,    float progressY){
      float accumulatedHorizontalAngle=progressX * mHorizontalViewAngle;
      float accumulatedVerticalAngle=progressY * mVerticalViewAngle;
      boolean isRotated=!(mDeviceOrientationAtCapture == mDeviceOrientation);
      if (isFinished || (Math.abs(accumulatedHorizontalAngle) >= DEFAULT_SWEEP_ANGLE) || (Math.abs(accumulatedVerticalAngle) >= DEFAULT_SWEEP_ANGLE)|| isRotated) {
        stopCapture(false);
      }
 else {
        float panningRateXInDegree=panningRateX * mHorizontalViewAngle;
        float panningRateYInDegree=panningRateY * mVerticalViewAngle;
        if (mDeviceOrientation == 180 || mDeviceOrientation == 90) {
          accumulatedHorizontalAngle=-accumulatedHorizontalAngle;
          accumulatedVerticalAngle=-accumulatedVerticalAngle;
        }
        mUI.updateCaptureProgress(panningRateXInDegree,panningRateYInDegree,accumulatedHorizontalAngle,accumulatedVerticalAngle,PANNING_SPEED_THRESHOLD);
      }
    }
  }
);
  mUI.resetCaptureProgress();
  mUI.setMaxCaptureProgress(DEFAULT_SWEEP_ANGLE);
  mUI.showCaptureProgress();
  mDeviceOrientationAtCapture=mDeviceOrientation;
  keepScreenOn();
  mOrientationLocked=true;
  int degrees=CameraUtil.getDisplayRotation(mActivity);
  int cameraId=CameraHolder.instance().getBackCameraId();
  int orientation=CameraUtil.getDisplayOrientation(degrees,cameraId);
  mUI.setProgressOrientation(orientation);
}