Program: 38249
Project: 38249
Buggy source:
private void updateCameraSettings(){
  String sceneMode=null;
  String flashMode=null;
  String redeyeReduction=null;
  String aeBracketing=null;
  String focusMode=null;
  String colorEffect=null;
  String exposureCompensation=null;
  String touchAfAec=null;
  boolean disableLongShot=false;
  String ubiFocusOn=mActivity.getString(R.string.pref_camera_advanced_feature_value_ubifocus_on);
  String continuousShotOn=mActivity.getString(R.string.setting_on_value);
  String reFocusOn=mActivity.getString(R.string.pref_camera_advanced_feature_value_refocus_on);
  String chromaFlashOn=mActivity.getString(R.string.pref_camera_advanced_feature_value_chromaflash_on);
  String optiZoomOn=mActivity.getString(R.string.pref_camera_advanced_feature_value_optizoom_on);
  String fssrOn=mActivity.getString(R.string.pref_camera_advanced_feature_value_FSSR_on);
  String truPortraitOn=mActivity.getString(R.string.pref_camera_advanced_feature_value_trueportrait_on);
  String multiTouchFocusOn=mActivity.getString(R.string.pref_camera_advanced_feature_value_multi_touch_focus_on);
  String optiZoom=mParameters.get(CameraSettings.KEY_QC_OPTI_ZOOM);
  String chromaFlash=mParameters.get(CameraSettings.KEY_QC_CHROMA_FLASH);
  String ubiFocus=mParameters.get(CameraSettings.KEY_QC_AF_BRACKETING);
  String fssr=mParameters.get(CameraSettings.KEY_QC_FSSR);
  String truePortrait=mParameters.get(CameraSettings.KEY_QC_TP);
  String multiTouchFocus=mParameters.get(CameraSettings.KEY_QC_MULTI_TOUCH_FOCUS);
  String stillMoreOn=mActivity.getString(R.string.pref_camera_advanced_feature_value_stillmore_on);
  String stillMore=mParameters.get(CameraSettings.KEY_QC_STILL_MORE);
  String continuousShot=mParameters.get("String_Node_Str");
  if (mManual3AEnabled > 0) {
    disableLongShot=true;
  }
  if ((continuousShot != null) && continuousShot.equals(continuousShotOn)) {
    String pictureFormat=mActivity.getString(R.string.pref_camera_picture_format_value_jpeg);
    mUI.overrideSettings(CameraSettings.KEY_PICTURE_FORMAT,pictureFormat);
  }
 else {
    mUI.overrideSettings(CameraSettings.KEY_PICTURE_FORMAT,null);
  }
  String reFocus=mParameters.get(CameraSettings.KEY_QC_RE_FOCUS);
  if (mFocusManager.isZslEnabled()) {
    String pictureFormat=mActivity.getString(R.string.pref_camera_picture_format_value_jpeg);
    mUI.overrideSettings(CameraSettings.KEY_PICTURE_FORMAT,pictureFormat);
  }
 else {
    mUI.overrideSettings(CameraSettings.KEY_PICTURE_FORMAT,null);
  }
  if ((multiTouchFocus != null && multiTouchFocus.equals(multiTouchFocusOn)) || (chromaFlash != null && chromaFlash.equals(chromaFlashOn)) || (optiZoom != null && optiZoom.equals(optiZoomOn))|| (fssr != null && fssr.equals(fssrOn))|| (truePortrait != null && truePortrait.equals(truPortraitOn))|| (stillMore != null && stillMore.equals(stillMoreOn))) {
    if (optiZoom != null && optiZoom.equals(optiZoomOn)) {
      sceneMode=null;
    }
 else {
      mSceneMode=sceneMode=Parameters.SCENE_MODE_AUTO;
    }
    flashMode=Parameters.FLASH_MODE_OFF;
    focusMode=Parameters.FOCUS_MODE_INFINITY;
    redeyeReduction=mActivity.getString(R.string.pref_camera_redeyereduction_entry_disable);
    aeBracketing=mActivity.getString(R.string.pref_camera_ae_bracket_hdr_entry_off);
    colorEffect=mActivity.getString(R.string.pref_camera_coloreffect_default);
    exposureCompensation=CameraSettings.EXPOSURE_DEFAULT_VALUE;
    overrideCameraSettings(flashMode,null,focusMode,exposureCompensation,touchAfAec,null,null,null,null,colorEffect,sceneMode,redeyeReduction,aeBracketing);
    disableLongShot=true;
    RotateTextToast.makeText(mActivity,R.string.advanced_capture_disable_continuous_shot,Toast.LENGTH_LONG).show();
  }
  if (!Parameters.SCENE_MODE_AUTO.equals(mSceneMode)) {
    flashMode=mParameters.FLASH_MODE_OFF;
    String whiteBalance=Parameters.WHITE_BALANCE_AUTO;
    focusMode=mFocusManager.getFocusMode();
    colorEffect=mParameters.getColorEffect();
    exposureCompensation=Integer.toString(mParameters.getExposureCompensation());
    touchAfAec=mCurrTouchAfAec;
    overrideCameraSettings(flashMode,whiteBalance,focusMode,exposureCompensation,touchAfAec,mParameters.getAutoExposure(),Integer.toString(mParameters.getSaturation()),Integer.toString(mParameters.getContrast()),Integer.toString(mParameters.getSharpness()),colorEffect,sceneMode,redeyeReduction,aeBracketing);
    if (CameraUtil.SCENE_MODE_HDR.equals(mSceneMode)) {
      disableLongShot=true;
    }
  }
 else   if (mFocusManager.isZslEnabled()) {
    focusMode=mParameters.getFocusMode();
    overrideCameraSettings(flashMode,null,focusMode,exposureCompensation,touchAfAec,null,null,null,null,colorEffect,sceneMode,redeyeReduction,aeBracketing);
  }
 else {
    if (mManual3AEnabled > 0) {
      updateCommonManual3ASettings();
    }
 else {
      overrideCameraSettings(flashMode,null,focusMode,exposureCompensation,touchAfAec,null,null,null,null,colorEffect,sceneMode,redeyeReduction,aeBracketing);
    }
  }
  String aeBracket=mParameters.get(CameraSettings.KEY_QC_AE_BRACKETING);
  if (!aeBracket.equalsIgnoreCase("String_Node_Str")) {
    String fMode=Parameters.FLASH_MODE_OFF;
    mUI.overrideSettings(CameraSettings.KEY_FLASH_MODE,fMode);
    mParameters.setFlashMode(fMode);
  }
  if (disableLongShot) {
    mUI.overrideSettings(CameraSettings.KEY_LONGSHOT,mActivity.getString(R.string.setting_off_value));
  }
 else {
    mUI.overrideSettings(CameraSettings.KEY_LONGSHOT,null);
  }
}

Fixed version (ground truth):
private void updateCameraSettings(){
  String sceneMode=null;
  String flashMode=null;
  String redeyeReduction=null;
  String aeBracketing=null;
  String focusMode=null;
  String colorEffect=null;
  String exposureCompensation=null;
  String touchAfAec=null;
  boolean disableLongShot=false;
  String ubiFocusOn=mActivity.getString(R.string.pref_camera_advanced_feature_value_ubifocus_on);
  String continuousShotOn=mActivity.getString(R.string.setting_on_value);
  String reFocusOn=mActivity.getString(R.string.pref_camera_advanced_feature_value_refocus_on);
  String chromaFlashOn=mActivity.getString(R.string.pref_camera_advanced_feature_value_chromaflash_on);
  String optiZoomOn=mActivity.getString(R.string.pref_camera_advanced_feature_value_optizoom_on);
  String fssrOn=mActivity.getString(R.string.pref_camera_advanced_feature_value_FSSR_on);
  String truPortraitOn=mActivity.getString(R.string.pref_camera_advanced_feature_value_trueportrait_on);
  String multiTouchFocusOn=mActivity.getString(R.string.pref_camera_advanced_feature_value_multi_touch_focus_on);
  String optiZoom=mParameters.get(CameraSettings.KEY_QC_OPTI_ZOOM);
  String chromaFlash=mParameters.get(CameraSettings.KEY_QC_CHROMA_FLASH);
  String ubiFocus=mParameters.get(CameraSettings.KEY_QC_AF_BRACKETING);
  String fssr=mParameters.get(CameraSettings.KEY_QC_FSSR);
  String truePortrait=mParameters.get(CameraSettings.KEY_QC_TP);
  String multiTouchFocus=mParameters.get(CameraSettings.KEY_QC_MULTI_TOUCH_FOCUS);
  String stillMoreOn=mActivity.getString(R.string.pref_camera_advanced_feature_value_stillmore_on);
  String stillMore=mParameters.get(CameraSettings.KEY_QC_STILL_MORE);
  String continuousShot=mParameters.get("String_Node_Str");
  if (mManual3AEnabled > 0) {
    disableLongShot=true;
  }
  if ((continuousShot != null) && continuousShot.equals(continuousShotOn)) {
    String pictureFormat=mActivity.getString(R.string.pref_camera_picture_format_value_jpeg);
    mUI.overrideSettings(CameraSettings.KEY_PICTURE_FORMAT,pictureFormat);
  }
 else {
    mUI.overrideSettings(CameraSettings.KEY_PICTURE_FORMAT,null);
  }
  String reFocus=mParameters.get(CameraSettings.KEY_QC_RE_FOCUS);
  if (mFocusManager.isZslEnabled()) {
    String pictureFormat=mActivity.getString(R.string.pref_camera_picture_format_value_jpeg);
    mUI.overrideSettings(CameraSettings.KEY_PICTURE_FORMAT,pictureFormat);
  }
 else {
    mUI.overrideSettings(CameraSettings.KEY_PICTURE_FORMAT,null);
  }
  if ((multiTouchFocus != null && multiTouchFocus.equals(multiTouchFocusOn)) || (chromaFlash != null && chromaFlash.equals(chromaFlashOn)) || (optiZoom != null && optiZoom.equals(optiZoomOn))|| (fssr != null && fssr.equals(fssrOn))|| (truePortrait != null && truePortrait.equals(truPortraitOn))|| (stillMore != null && stillMore.equals(stillMoreOn))) {
    if (optiZoom != null && optiZoom.equals(optiZoomOn)) {
      sceneMode=null;
    }
 else {
      mSceneMode=sceneMode=Parameters.SCENE_MODE_AUTO;
    }
    flashMode=Parameters.FLASH_MODE_OFF;
    focusMode=Parameters.FOCUS_MODE_INFINITY;
    redeyeReduction=mActivity.getString(R.string.pref_camera_redeyereduction_entry_disable);
    aeBracketing=mActivity.getString(R.string.pref_camera_ae_bracket_hdr_entry_off);
    colorEffect=mActivity.getString(R.string.pref_camera_coloreffect_default);
    exposureCompensation=CameraSettings.EXPOSURE_DEFAULT_VALUE;
    overrideCameraSettings(flashMode,null,focusMode,exposureCompensation,touchAfAec,null,null,null,null,colorEffect,sceneMode,redeyeReduction,aeBracketing);
    disableLongShot=true;
  }
  if (!Parameters.SCENE_MODE_AUTO.equals(mSceneMode)) {
    flashMode=mParameters.FLASH_MODE_OFF;
    String whiteBalance=Parameters.WHITE_BALANCE_AUTO;
    focusMode=mFocusManager.getFocusMode();
    colorEffect=mParameters.getColorEffect();
    exposureCompensation=Integer.toString(mParameters.getExposureCompensation());
    touchAfAec=mCurrTouchAfAec;
    overrideCameraSettings(flashMode,whiteBalance,focusMode,exposureCompensation,touchAfAec,mParameters.getAutoExposure(),Integer.toString(mParameters.getSaturation()),Integer.toString(mParameters.getContrast()),Integer.toString(mParameters.getSharpness()),colorEffect,sceneMode,redeyeReduction,aeBracketing);
    if (CameraUtil.SCENE_MODE_HDR.equals(mSceneMode)) {
      disableLongShot=true;
    }
  }
 else   if (mFocusManager.isZslEnabled()) {
    focusMode=mParameters.getFocusMode();
    overrideCameraSettings(flashMode,null,focusMode,exposureCompensation,touchAfAec,null,null,null,null,colorEffect,sceneMode,redeyeReduction,aeBracketing);
  }
 else {
    if (mManual3AEnabled > 0) {
      updateCommonManual3ASettings();
    }
 else {
      overrideCameraSettings(flashMode,null,focusMode,exposureCompensation,touchAfAec,null,null,null,null,colorEffect,sceneMode,redeyeReduction,aeBracketing);
    }
  }
  String aeBracket=mParameters.get(CameraSettings.KEY_QC_AE_BRACKETING);
  if (!aeBracket.equalsIgnoreCase("String_Node_Str")) {
    String fMode=Parameters.FLASH_MODE_OFF;
    mUI.overrideSettings(CameraSettings.KEY_FLASH_MODE,fMode);
    mParameters.setFlashMode(fMode);
  }
  if (disableLongShot) {
    mUI.overrideSettings(CameraSettings.KEY_LONGSHOT,mActivity.getString(R.string.setting_off_value));
  }
 else {
    mUI.overrideSettings(CameraSettings.KEY_LONGSHOT,null);
  }
}