Program: 13518
Project: 13518
Buggy source:
@Override public void onBindViewHolder(GridViewHolder holder,int position){
  if (!isValidPosition(position)) {
    return;
  }
  MediaModel media=mMediaList.get(position);
  holder.imageView.setTag(null);
  String strState=media.getUploadState();
  MediaUploadState state=MediaUploadState.fromString(strState);
  boolean isLocalFile=MediaUtils.isLocalFile(strState) && !TextUtils.isEmpty(media.getFilePath());
  boolean isSelected=isItemSelected(media.getId());
  boolean canSelect=canSelectPosition(position);
  boolean isImage=media.getMimeType() != null && media.getMimeType().startsWith("String_Node_Str");
  if (!mLoadThumbnails) {
    holder.fileContainer.setVisibility(View.GONE);
    holder.imageView.setImageUrl(null,WPNetworkImageView.ImageType.PHOTO);
  }
 else   if (isImage) {
    holder.fileContainer.setVisibility(View.GONE);
    if (isLocalFile) {
      loadLocalImage(media.getFilePath(),holder.imageView);
    }
 else {
      holder.imageView.setImageUrl(getBestImageUrl(media),WPNetworkImageView.ImageType.PHOTO);
    }
  }
 else   if (media.isVideo()) {
    holder.fileContainer.setVisibility(View.GONE);
    loadVideoThumbnail(media,holder.imageView);
  }
 else {
    holder.imageView.setImageDrawable(null);
    String fileName=media.getFileName();
    String title=media.getTitle();
    String fileExtension=MediaUtils.getExtensionForMimeType(media.getMimeType());
    holder.fileContainer.setVisibility(View.VISIBLE);
    holder.titleView.setText(TextUtils.isEmpty(title) ? fileName : title);
    holder.fileTypeView.setText(fileExtension.toUpperCase());
    int placeholderResId=WPMediaUtils.getPlaceholder(fileName);
    holder.fileTypeImageView.setImageResource(placeholderResId);
  }
  if (mBrowserType.canMultiselect() && canSelect) {
    holder.selectionCountTextView.setVisibility(View.VISIBLE);
    holder.selectionCountTextView.setSelected(isSelected);
    if (isSelected) {
      int count=mSelectedItems.indexOf(media.getId()) + 1;
      holder.selectionCountTextView.setText(Integer.toString(count));
    }
 else {
      holder.selectionCountTextView.setText(null);
    }
  }
 else {
    holder.selectionCountTextView.setVisibility(View.GONE);
  }
  float scale=isSelected ? SCALE_SELECTED : SCALE_NORMAL;
  if (holder.imageView.getScaleX() != scale) {
    holder.imageView.setScaleX(scale);
    holder.imageView.setScaleY(scale);
  }
  if (state != MediaUploadState.UPLOADED) {
    holder.stateContainer.setVisibility(View.VISIBLE);
    boolean showProgress=state == MediaUploadState.UPLOADING || state == MediaUploadState.DELETING;
    holder.progressUpload.setVisibility(showProgress ? View.VISIBLE : View.GONE);
    if (state == MediaUploadState.FAILED || state == MediaUploadState.QUEUED) {
      holder.retryDeleteContainer.setVisibility(View.VISIBLE);
      holder.imgRetry.setVisibility(state == MediaUploadState.FAILED ? View.VISIBLE : View.GONE);
    }
 else {
      holder.retryDeleteContainer.setVisibility(View.GONE);
    }
    holder.stateTextView.setText(getLabelForMediaUploadState(state));
    holder.videoOverlayContainer.setVisibility(View.GONE);
  }
 else {
    holder.stateContainer.setVisibility(View.GONE);
    holder.stateContainer.setOnClickListener(null);
    holder.videoOverlayContainer.setVisibility(media.isVideo() ? View.VISIBLE : View.GONE);
  }
  if (position == getItemCount() - 1 && !mHasRetrievedAll && mCallback != null) {
    mCallback.onAdapterFetchMoreData();
  }
}

Fixed version (ground truth):
@Override public void onBindViewHolder(GridViewHolder holder,int position){
  if (!isValidPosition(position)) {
    return;
  }
  MediaModel media=mMediaList.get(position);
  holder.imageView.setTag(null);
  String strState=media.getUploadState();
  MediaUploadState state=MediaUploadState.fromString(strState);
  boolean isLocalFile=MediaUtils.isLocalFile(strState) && !TextUtils.isEmpty(media.getFilePath());
  boolean isSelected=isItemSelected(media.getId());
  boolean canSelect=canSelectPosition(position);
  boolean isImage=media.getMimeType() != null && media.getMimeType().startsWith("String_Node_Str");
  if (!mLoadThumbnails) {
    holder.fileContainer.setVisibility(View.GONE);
    holder.imageView.setImageUrl(null,WPNetworkImageView.ImageType.PHOTO);
  }
 else   if (isImage) {
    holder.fileContainer.setVisibility(View.GONE);
    if (isLocalFile) {
      loadLocalImage(media.getFilePath(),holder.imageView);
    }
 else {
      holder.imageView.setImageUrl(getBestImageUrl(media),WPNetworkImageView.ImageType.PHOTO);
    }
  }
 else   if (media.isVideo()) {
    holder.fileContainer.setVisibility(View.GONE);
    loadVideoThumbnail(media,holder.imageView);
  }
 else {
    holder.imageView.setImageDrawable(null);
    String fileName=media.getFileName();
    String title=media.getTitle();
    String fileExtension=MediaUtils.getExtensionForMimeType(media.getMimeType());
    holder.fileContainer.setVisibility(View.VISIBLE);
    holder.titleView.setText(TextUtils.isEmpty(title) ? fileName : title);
    holder.fileTypeView.setText(fileExtension.toUpperCase());
    int placeholderResId=WPMediaUtils.getPlaceholder(fileName);
    holder.fileTypeImageView.setImageResource(placeholderResId);
  }
  if (mBrowserType.canMultiselect() && canSelect) {
    holder.selectionCountContainer.setVisibility(View.VISIBLE);
    holder.selectionCountTextView.setVisibility(View.VISIBLE);
    holder.selectionCountTextView.setSelected(isSelected);
    if (isSelected) {
      int count=mSelectedItems.indexOf(media.getId()) + 1;
      holder.selectionCountTextView.setText(Integer.toString(count));
    }
 else {
      holder.selectionCountTextView.setText(null);
    }
  }
 else {
    holder.selectionCountContainer.setVisibility(View.GONE);
    holder.selectionCountTextView.setVisibility(View.GONE);
  }
  float scale=isSelected ? SCALE_SELECTED : SCALE_NORMAL;
  if (holder.imageView.getScaleX() != scale) {
    holder.imageView.setScaleX(scale);
    holder.imageView.setScaleY(scale);
  }
  if (state != MediaUploadState.UPLOADED) {
    holder.stateContainer.setVisibility(View.VISIBLE);
    boolean showProgress=state == MediaUploadState.UPLOADING || state == MediaUploadState.DELETING;
    holder.progressUpload.setVisibility(showProgress ? View.VISIBLE : View.GONE);
    if (state == MediaUploadState.FAILED || state == MediaUploadState.QUEUED) {
      holder.retryDeleteContainer.setVisibility(View.VISIBLE);
      holder.imgRetry.setVisibility(state == MediaUploadState.FAILED ? View.VISIBLE : View.GONE);
    }
 else {
      holder.retryDeleteContainer.setVisibility(View.GONE);
    }
    holder.stateTextView.setText(getLabelForMediaUploadState(state));
    holder.videoOverlayContainer.setVisibility(View.GONE);
  }
 else {
    holder.stateContainer.setVisibility(View.GONE);
    holder.stateContainer.setOnClickListener(null);
    holder.videoOverlayContainer.setVisibility(media.isVideo() ? View.VISIBLE : View.GONE);
  }
  if (position == getItemCount() - 1 && !mHasRetrievedAll && mCallback != null) {
    mCallback.onAdapterFetchMoreData();
  }
}