Program: 38481
Project: 38481
Buggy source:
public void showComponent(View view){
  if (mUtilityPanel != null && !mUtilityPanel.selected()) {
    Panel current=mPanels.get(mCurrentPanel);
    ViewPropertyAnimator anim1=current.unselect(-1,VERTICAL_MOVE);
    anim1.start();
    if (mUtilityPanel != null) {
      ViewPropertyAnimator anim2=mUtilityPanel.select();
      anim2.start();
    }
  }
  if (view.getId() == R.id.pickCurvesChannel) {
    ImageCurves curves=(ImageCurves)showImageView(R.id.imageCurves);
    showCurvesPopupMenu(curves,(FramedTextButton)view);
    return;
  }
  if (view.getId() == R.id.aspect) {
    showCropPopupMenu((FramedTextButton)view);
    return;
  }
  if (mCurrentImage != null) {
    mCurrentImage.unselect();
  }
  mUtilityPanel.hideAspectButtons();
  mUtilityPanel.hideCurvesButtons();
switch (view.getId()) {
case R.id.tinyplanetButton:
{
      mCurrentImage=showImageView(R.id.imageTinyPlanet).setShowControls(true);
      String ename=mCurrentImage.getContext().getString(R.string.tinyplanet);
      mUtilityPanel.setEffectName(ename);
      ensureFilter(ename);
      break;
    }
case R.id.straightenButton:
{
    mCurrentImage=showImageView(R.id.imageStraighten);
    String ename=mCurrentImage.getContext().getString(R.string.straighten);
    mUtilityPanel.setEffectName(ename);
    break;
  }
case R.id.cropButton:
{
  mCurrentImage=showImageView(R.id.imageCrop);
  String ename=mCurrentImage.getContext().getString(R.string.crop);
  mUtilityPanel.setEffectName(ename);
  mUtilityPanel.setShowParameter(false);
  if (mCurrentImage instanceof ImageCrop && mUtilityPanel.firstTimeCropDisplayed) {
    ((ImageCrop)mCurrentImage).applyOriginal();
    mUtilityPanel.firstTimeCropDisplayed=false;
  }
  mUtilityPanel.showAspectButtons();
  break;
}
case R.id.rotateButton:
{
mCurrentImage=showImageView(R.id.imageRotate);
String ename=mCurrentImage.getContext().getString(R.string.rotate);
mUtilityPanel.setEffectName(ename);
break;
}
case R.id.flipButton:
{
mCurrentImage=showImageView(R.id.imageFlip);
String ename=mCurrentImage.getContext().getString(R.string.mirror);
mUtilityPanel.setEffectName(ename);
mUtilityPanel.setShowParameter(false);
break;
}
case R.id.vignetteButton:
{
mCurrentImage=showImageView(R.id.imageShow).setShowControls(true);
String ename=mCurrentImage.getContext().getString(R.string.vignette);
mUtilityPanel.setEffectName(ename);
ensureFilter(ename);
break;
}
case R.id.curvesButtonRGB:
{
ImageCurves curves=(ImageCurves)showImageView(R.id.imageCurves);
String ename=curves.getContext().getString(R.string.curvesRGB);
mUtilityPanel.setEffectName(ename);
mUtilityPanel.setShowParameter(false);
mUtilityPanel.showCurvesButtons();
mCurrentImage=curves;
ensureFilter(ename);
break;
}
case R.id.sharpenButton:
{
mCurrentImage=showImageView(R.id.imageZoom).setShowControls(true);
String ename=mCurrentImage.getContext().getString(R.string.sharpness);
mUtilityPanel.setEffectName(ename);
ensureFilter(ename);
break;
}
case R.id.contrastButton:
{
mCurrentImage=showImageView(R.id.imageShow).setShowControls(true);
String ename=mCurrentImage.getContext().getString(R.string.contrast);
mUtilityPanel.setEffectName(ename);
ensureFilter(ename);
break;
}
case R.id.saturationButton:
{
mCurrentImage=showImageView(R.id.imageShow).setShowControls(true);
String ename=mCurrentImage.getContext().getString(R.string.saturation);
mUtilityPanel.setEffectName(ename);
ensureFilter(ename);
break;
}
case R.id.bwfilterButton:
{
mCurrentImage=showImageView(R.id.imageShow).setShowControls(true);
String ename=mCurrentImage.getContext().getString(R.string.bwfilter);
mUtilityPanel.setEffectName(ename);
ensureFilter(ename);
break;
}
case R.id.wbalanceButton:
{
mCurrentImage=showImageView(R.id.imageShow).setShowControls(false);
String ename=mCurrentImage.getContext().getString(R.string.wbalance);
mUtilityPanel.setEffectName(ename);
mUtilityPanel.setShowParameter(false);
ensureFilter(ename);
break;
}
case R.id.hueButton:
{
mCurrentImage=showImageView(R.id.imageShow).setShowControls(true);
String ename=mCurrentImage.getContext().getString(R.string.hue);
mUtilityPanel.setEffectName(ename);
ensureFilter(ename);
break;
}
case R.id.exposureButton:
{
mCurrentImage=showImageView(R.id.imageShow).setShowControls(true);
String ename=mCurrentImage.getContext().getString(R.string.exposure);
mUtilityPanel.setEffectName(ename);
ensureFilter(ename);
break;
}
case R.id.vibranceButton:
{
mCurrentImage=showImageView(R.id.imageShow).setShowControls(true);
String ename=mCurrentImage.getContext().getString(R.string.vibrance);
mUtilityPanel.setEffectName(ename);
ensureFilter(ename);
break;
}
case R.id.shadowRecoveryButton:
{
mCurrentImage=showImageView(R.id.imageShow).setShowControls(true);
String ename=mCurrentImage.getContext().getString(R.string.shadow_recovery);
mUtilityPanel.setEffectName(ename);
ensureFilter(ename);
break;
}
case R.id.redEyeButton:
{
mCurrentImage=showImageView(R.id.imageShow).setShowControls(true);
String ename=mCurrentImage.getContext().getString(R.string.redeye);
mUtilityPanel.setEffectName(ename);
ensureFilter(ename);
break;
}
case R.id.aspect:
{
mUtilityPanel.showAspectButtons();
break;
}
case R.id.applyEffect:
{
if (mMasterImage.getCurrentFilter() instanceof ImageFilterTinyPlanet) {
mActivity.saveImage();
}
 else {
showPanel(mCurrentPanel);
}
break;
}
}
mCurrentImage.select();
}

Fixed version (ground truth):
public void showComponent(View view){
  if (mUtilityPanel != null && !mUtilityPanel.selected()) {
    Panel current=mPanels.get(mCurrentPanel);
    ViewPropertyAnimator anim1=current.unselect(-1,VERTICAL_MOVE);
    anim1.start();
    if (mUtilityPanel != null) {
      ViewPropertyAnimator anim2=mUtilityPanel.select();
      anim2.start();
    }
  }
  if (view.getId() == R.id.pickCurvesChannel) {
    ImageCurves curves=(ImageCurves)showImageView(R.id.imageCurves);
    showCurvesPopupMenu(curves,(FramedTextButton)view);
    return;
  }
  if (view.getId() == R.id.aspect) {
    showCropPopupMenu((FramedTextButton)view);
    return;
  }
  if (mCurrentImage != null) {
    mCurrentImage.unselect();
  }
  mUtilityPanel.hideAspectButtons();
  mUtilityPanel.hideCurvesButtons();
switch (view.getId()) {
case R.id.tinyplanetButton:
{
      mCurrentImage=showImageView(R.id.imageTinyPlanet).setShowControls(true);
      String ename=mCurrentImage.getContext().getString(R.string.tinyplanet);
      mUtilityPanel.setEffectName(ename);
      ensureFilter(ename);
      break;
    }
case R.id.straightenButton:
{
    mCurrentImage=showImageView(R.id.imageStraighten);
    String ename=mCurrentImage.getContext().getString(R.string.straighten);
    mUtilityPanel.setEffectName(ename);
    break;
  }
case R.id.cropButton:
{
  mCurrentImage=showImageView(R.id.imageCrop);
  String ename=mCurrentImage.getContext().getString(R.string.crop);
  mUtilityPanel.setEffectName(ename);
  mUtilityPanel.setShowParameter(false);
  if (mCurrentImage instanceof ImageCrop && mUtilityPanel.firstTimeCropDisplayed) {
    ((ImageCrop)mCurrentImage).applyOriginal();
    mUtilityPanel.firstTimeCropDisplayed=false;
  }
  mUtilityPanel.showAspectButtons();
  break;
}
case R.id.rotateButton:
{
mCurrentImage=showImageView(R.id.imageRotate);
String ename=mCurrentImage.getContext().getString(R.string.rotate);
mUtilityPanel.setEffectName(ename);
break;
}
case R.id.flipButton:
{
mCurrentImage=showImageView(R.id.imageFlip);
String ename=mCurrentImage.getContext().getString(R.string.mirror);
mUtilityPanel.setEffectName(ename);
mUtilityPanel.setShowParameter(false);
break;
}
case R.id.vignetteButton:
{
mCurrentImage=showImageView(R.id.imageShow).setShowControls(true);
String ename=mCurrentImage.getContext().getString(R.string.vignette);
mUtilityPanel.setEffectName(ename);
ensureFilter(ename);
break;
}
case R.id.curvesButtonRGB:
{
ImageCurves curves=(ImageCurves)showImageView(R.id.imageCurves);
String ename=curves.getContext().getString(R.string.curvesRGB);
mUtilityPanel.setEffectName(ename);
mUtilityPanel.setShowParameter(false);
mUtilityPanel.showCurvesButtons();
mCurrentImage=curves;
ensureFilter(ename);
break;
}
case R.id.sharpenButton:
{
mCurrentImage=showImageView(R.id.imageZoom).setShowControls(true);
String ename=mCurrentImage.getContext().getString(R.string.sharpness);
mUtilityPanel.setEffectName(ename);
ensureFilter(ename);
break;
}
case R.id.contrastButton:
{
mCurrentImage=showImageView(R.id.imageShow).setShowControls(true);
String ename=mCurrentImage.getContext().getString(R.string.contrast);
mUtilityPanel.setEffectName(ename);
ensureFilter(ename);
break;
}
case R.id.saturationButton:
{
mCurrentImage=showImageView(R.id.imageShow).setShowControls(true);
String ename=mCurrentImage.getContext().getString(R.string.saturation);
mUtilityPanel.setEffectName(ename);
ensureFilter(ename);
break;
}
case R.id.bwfilterButton:
{
mCurrentImage=showImageView(R.id.imageShow).setShowControls(true);
String ename=mCurrentImage.getContext().getString(R.string.bwfilter);
mUtilityPanel.setEffectName(ename);
ensureFilter(ename);
break;
}
case R.id.wbalanceButton:
{
mCurrentImage=showImageView(R.id.imageShow).setShowControls(false);
String ename=mCurrentImage.getContext().getString(R.string.wbalance);
mUtilityPanel.setEffectName(ename);
mUtilityPanel.setShowParameter(false);
ensureFilter(ename);
break;
}
case R.id.hueButton:
{
mCurrentImage=showImageView(R.id.imageShow).setShowControls(true);
String ename=mCurrentImage.getContext().getString(R.string.hue);
mUtilityPanel.setEffectName(ename);
ensureFilter(ename);
break;
}
case R.id.exposureButton:
{
mCurrentImage=showImageView(R.id.imageShow).setShowControls(true);
String ename=mCurrentImage.getContext().getString(R.string.exposure);
mUtilityPanel.setEffectName(ename);
ensureFilter(ename);
break;
}
case R.id.vibranceButton:
{
mCurrentImage=showImageView(R.id.imageShow).setShowControls(true);
String ename=mCurrentImage.getContext().getString(R.string.vibrance);
mUtilityPanel.setEffectName(ename);
ensureFilter(ename);
break;
}
case R.id.shadowRecoveryButton:
{
mCurrentImage=showImageView(R.id.imageShow).setShowControls(true);
String ename=mCurrentImage.getContext().getString(R.string.shadow_recovery);
mUtilityPanel.setEffectName(ename);
ensureFilter(ename);
break;
}
case R.id.redEyeButton:
{
mCurrentImage=showImageView(R.id.imageShow).setShowControls(true);
String ename=mCurrentImage.getContext().getString(R.string.redeye);
mUtilityPanel.setEffectName(ename);
ensureFilter(ename);
break;
}
case R.id.aspect:
{
mUtilityPanel.showAspectButtons();
break;
}
case R.id.applyEffect:
{
if (mMasterImage.getCurrentFilter() instanceof ImageFilterTinyPlanet) {
mActivity.saveImage();
}
 else {
if (mCurrentImage instanceof ImageCrop) {
((ImageCrop)mCurrentImage).saveAndSetPreset();
}
showPanel(mCurrentPanel);
}
break;
}
}
mCurrentImage.select();
}