Program: 13756
Project: 13756
Buggy source:
@Override protected void onCreate(@Nullable Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  ((WordPress)getApplication()).component().inject(this);
  setContentView(R.layout.media_settings_activity);
  ActionBar actionBar=getSupportActionBar();
  if (actionBar != null) {
    actionBar.setDisplayShowTitleEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setHomeAsUpIndicator(R.drawable.ic_close_white_24dp);
    actionBar.setTitle(R.string.media);
    actionBar.setShowHideAnimationEnabled(true);
    makeStatusAndToolbarTransparent();
  }
  mImageView=(ImageView)findViewById(R.id.image_preview);
  mTitleView=(EditText)findViewById(R.id.edit_title);
  mCaptionView=(EditText)findViewById(R.id.edit_caption);
  mAltTextView=(EditText)findViewById(R.id.edit_alt_text);
  mDescriptionView=(EditText)findViewById(R.id.edit_description);
  mFabView=(FloatingActionButton)findViewById(R.id.fab_button);
  int mediaId;
  if (savedInstanceState != null) {
    mSite=(SiteModel)savedInstanceState.getSerializable(WordPress.SITE);
    mediaId=savedInstanceState.getInt(ARG_MEDIA_LOCAL_ID);
  }
 else {
    mSite=(SiteModel)getIntent().getSerializableExtra(WordPress.SITE);
    mediaId=getIntent().getIntExtra(ARG_MEDIA_LOCAL_ID,0);
  }
  mMedia=mMediaStore.getMediaWithLocalId(mediaId);
  if (mMedia == null) {
    delayedFinishWithError();
    return;
  }
  int displayHeight=DisplayUtils.getDisplayPixelHeight(this);
  int imageHeight=(int)(displayHeight * 0.4);
  mImageView.getLayoutParams().height=imageHeight;
  if (shouldShowFab()) {
    int fabHeight=DisplayUtils.dpToPx(this,56);
    ViewGroup.MarginLayoutParams params=(ViewGroup.MarginLayoutParams)mFabView.getLayoutParams();
    int topMargin=imageHeight - (fabHeight / 2);
    int rightMargin=getResources().getDimensionPixelSize(R.dimen.fab_margin);
    params.setMargins(0,topMargin,rightMargin,0);
  }
  int toolbarHeight=DisplayUtils.getActionBarHeight(this);
  ImageView imgGradient=(ImageView)findViewById(R.id.image_gradient);
  imgGradient.getLayoutParams().height=toolbarHeight * 3;
  ImageView imgPlayVideo=(ImageView)findViewById(R.id.image_play_video);
  imgPlayVideo.setVisibility(mMedia.isVideo() ? View.VISIBLE : View.GONE);
  findViewById(R.id.edit_alt_text_layout).setVisibility(mMedia.isVideo() ? View.GONE : View.VISIBLE);
  View.OnClickListener listener=new View.OnClickListener(){
    @Override public void onClick(    View v){
      showFullScreen();
    }
  }
;
  mFabView.setOnClickListener(listener);
  mImageView.setOnClickListener(listener);
  imgPlayVideo.setOnClickListener(listener);
  showMediaMetaData();
  loadImage();
}

Fixed version (ground truth):
@Override protected void onCreate(@Nullable Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  ((WordPress)getApplication()).component().inject(this);
  setContentView(R.layout.media_settings_activity);
  ActionBar actionBar=getSupportActionBar();
  if (actionBar != null) {
    actionBar.setDisplayShowTitleEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setHomeAsUpIndicator(R.drawable.ic_close_white_24dp);
    actionBar.setTitle(R.string.media);
    makeStatusAndToolbarTransparent();
    actionBar.setShowHideAnimationEnabled(true);
  }
  mImageView=(ImageView)findViewById(R.id.image_preview);
  mTitleView=(EditText)findViewById(R.id.edit_title);
  mCaptionView=(EditText)findViewById(R.id.edit_caption);
  mAltTextView=(EditText)findViewById(R.id.edit_alt_text);
  mDescriptionView=(EditText)findViewById(R.id.edit_description);
  mFabView=(FloatingActionButton)findViewById(R.id.fab_button);
  int mediaId;
  if (savedInstanceState != null) {
    mSite=(SiteModel)savedInstanceState.getSerializable(WordPress.SITE);
    mediaId=savedInstanceState.getInt(ARG_MEDIA_LOCAL_ID);
  }
 else {
    mSite=(SiteModel)getIntent().getSerializableExtra(WordPress.SITE);
    mediaId=getIntent().getIntExtra(ARG_MEDIA_LOCAL_ID,0);
  }
  mMedia=mMediaStore.getMediaWithLocalId(mediaId);
  if (mMedia == null) {
    delayedFinishWithError();
    return;
  }
  int displayHeight=DisplayUtils.getDisplayPixelHeight(this);
  int imageHeight=(int)(displayHeight * 0.4);
  mImageView.getLayoutParams().height=imageHeight;
  if (shouldShowFab()) {
    int fabHeight=DisplayUtils.dpToPx(this,56);
    ViewGroup.MarginLayoutParams params=(ViewGroup.MarginLayoutParams)mFabView.getLayoutParams();
    int topMargin=imageHeight - (fabHeight / 2);
    int rightMargin=getResources().getDimensionPixelSize(R.dimen.fab_margin);
    params.setMargins(0,topMargin,rightMargin,0);
  }
  int toolbarHeight=DisplayUtils.getActionBarHeight(this);
  ImageView imgGradient=(ImageView)findViewById(R.id.image_gradient);
  imgGradient.getLayoutParams().height=toolbarHeight * 3;
  ImageView imgPlayVideo=(ImageView)findViewById(R.id.image_play_video);
  imgPlayVideo.setVisibility(mMedia.isVideo() ? View.VISIBLE : View.GONE);
  findViewById(R.id.edit_alt_text_layout).setVisibility(mMedia.isVideo() ? View.GONE : View.VISIBLE);
  View.OnClickListener listener=new View.OnClickListener(){
    @Override public void onClick(    View v){
      showFullScreen();
    }
  }
;
  mFabView.setOnClickListener(listener);
  mImageView.setOnClickListener(listener);
  imgPlayVideo.setOnClickListener(listener);
  showMediaMetaData();
  loadImage();
}