Program: 184391
Project: 184391
Buggy source:
private void initializeFirstTime(){
  if (mFirstTimeInitialized)   return;
  mOrientationListener=new OrientationEventListener(Camera.this){
    @Override public void onOrientationChanged(    int orientation){
      if (orientation != ORIENTATION_UNKNOWN) {
        orientation+=90;
      }
      orientation=ImageManager.roundOrientation(orientation);
      if (orientation != mLastOrientation) {
        mLastOrientation=orientation;
        if (!mIsImageCaptureIntent) {
          setOrientationIndicator(mLastOrientation);
        }
      }
    }
  }
;
  mOrientationListener.enable();
  mLocationManager=(LocationManager)getSystemService(Context.LOCATION_SERVICE);
  readPreference();
  if (mRecordLocation)   startReceivingLocationUpdates();
  keepMediaProviderInstance();
  checkStorage();
  mContentResolver=getContentResolver();
  if (!mIsImageCaptureIntent) {
    findViewById(R.id.camera_switch).setOnClickListener(this);
    mLastPictureButton=(ImageView)findViewById(R.id.review_thumbnail);
    mLastPictureButton.setOnClickListener(this);
    mThumbController=new ThumbnailController(getResources(),mLastPictureButton,mContentResolver);
    mThumbController.loadData(ImageManager.getLastImageThumbPath());
    updateThumbnailButton();
  }
  mShutterButton=(ShutterButton)findViewById(R.id.shutter_button);
  mShutterButton.setOnShutterButtonListener(this);
  mShutterButton.setVisibility(View.VISIBLE);
  mFocusRectangle=(FocusRectangle)findViewById(R.id.focus_rectangle);
  updateFocusIndicator();
  mGpsIndicator=(IconIndicator)findViewById(R.id.gps_icon);
  ImageManager.ensureOSXCompatibleFolder();
  installIntentFilter();
  initializeFocusTone();
  initializeZoom();
  mFirstTimeInitialized=true;
}

Fixed version (ground truth):
private void initializeFirstTime(){
  if (mFirstTimeInitialized)   return;
  mOrientationListener=new OrientationEventListener(Camera.this){
    @Override public void onOrientationChanged(    int orientation){
      if (orientation != ORIENTATION_UNKNOWN) {
        orientation+=90;
      }
      orientation=ImageManager.roundOrientation(orientation);
      if (orientation != mLastOrientation) {
        mLastOrientation=orientation;
        if (!mIsImageCaptureIntent) {
          setOrientationIndicator(mLastOrientation);
        }
      }
    }
  }
;
  mOrientationListener.enable();
  mLocationManager=(LocationManager)getSystemService(Context.LOCATION_SERVICE);
  mRecordLocation=RecordLocationPreference.get(mPreferences,getContentResolver());
  if (mRecordLocation)   startReceivingLocationUpdates();
  keepMediaProviderInstance();
  checkStorage();
  mContentResolver=getContentResolver();
  if (!mIsImageCaptureIntent) {
    findViewById(R.id.camera_switch).setOnClickListener(this);
    mLastPictureButton=(ImageView)findViewById(R.id.review_thumbnail);
    mLastPictureButton.setOnClickListener(this);
    mThumbController=new ThumbnailController(getResources(),mLastPictureButton,mContentResolver);
    mThumbController.loadData(ImageManager.getLastImageThumbPath());
    updateThumbnailButton();
  }
  mShutterButton=(ShutterButton)findViewById(R.id.shutter_button);
  mShutterButton.setOnShutterButtonListener(this);
  mShutterButton.setVisibility(View.VISIBLE);
  mFocusRectangle=(FocusRectangle)findViewById(R.id.focus_rectangle);
  updateFocusIndicator();
  mGpsIndicator=(IconIndicator)findViewById(R.id.gps_icon);
  ImageManager.ensureOSXCompatibleFolder();
  installIntentFilter();
  initializeFocusTone();
  initializeZoom();
  mFirstTimeInitialized=true;
}