Program: 14635
Project: 14635
Buggy source:
/** 
 * Loads the image for the view if it isn't already loaded.
 * @param isInLayoutPass True if this was invoked from a layout pass, false otherwise.
 */
private void loadImageIfNecessary(final boolean isInLayoutPass){
  if (mImageType == ImageType.NONE) {
    return;
  }
  int width=getWidth();
  int height=getHeight();
  boolean isFullyWrapContent=getLayoutParams() != null && getLayoutParams().height == LayoutParams.WRAP_CONTENT && getLayoutParams().width == LayoutParams.WRAP_CONTENT;
  if (width == 0 && height == 0 && !isFullyWrapContent) {
    return;
  }
  if (TextUtils.isEmpty(mUrl)) {
    if (mImageContainer != null) {
      mImageContainer.cancelRequest();
      mImageContainer=null;
    }
    showErrorImage();
    return;
  }
  if (mImageContainer != null && mImageContainer.getRequestUrl() != null) {
    if (mImageContainer.getRequestUrl().equals(mUrl)) {
      return;
    }
 else {
      mImageContainer.cancelRequest();
      showDefaultImage();
    }
  }
  Point pt=DisplayUtils.getDisplayPixelSize(this.getContext());
  int maxSize=Math.max(pt.x,pt.y);
  ImageLoader.ImageContainer newContainer=WordPress.imageLoader.get(mUrl,new ImageLoader.ImageListener(){
    @Override public void onErrorResponse(    VolleyError error){
      if (mImageType == ImageType.MSHOT && mRetryCnt < MAX_RETRIES && VolleyUtils.statusCodeFromVolleyError(error) == 307) {
        mRetryCnt++;
        retry(isInLayoutPass);
      }
 else {
        showErrorImage();
        if (mImageListener != null) {
          mImageListener.onImageLoaded(false);
        }
      }
    }
    @Override public void onResponse(    final ImageLoader.ImageContainer response,    boolean isImmediate){
      if (isImmediate && isInLayoutPass) {
        post(new Runnable(){
          @Override public void run(){
            handleResponse(response,true,false);
          }
        }
);
      }
 else {
        handleResponse(response,isImmediate,true);
      }
    }
  }
,maxSize,maxSize);
  mImageContainer=newContainer;
}

Fixed version (ground truth):
/** 
 * Loads the image for the view if it isn't already loaded.
 * @param isInLayoutPass True if this was invoked from a layout pass, false otherwise.
 */
private void loadImageIfNecessary(final boolean isInLayoutPass){
  if (mImageType == ImageType.NONE) {
    return;
  }
  int width=getWidth();
  int height=getHeight();
  boolean isFullyWrapContent=getLayoutParams() != null && getLayoutParams().height == LayoutParams.WRAP_CONTENT && getLayoutParams().width == LayoutParams.WRAP_CONTENT;
  if (width == 0 && height == 0 && !isFullyWrapContent) {
    return;
  }
  if (TextUtils.isEmpty(mUrl)) {
    if (mImageContainer != null) {
      mImageContainer.cancelRequest();
      mImageContainer=null;
    }
    showErrorImage();
    return;
  }
  if (mImageContainer != null && mImageContainer.getRequestUrl() != null) {
    if (mImageContainer.getRequestUrl().equals(mUrl)) {
      return;
    }
 else {
      mImageContainer.cancelRequest();
      showDefaultImage();
    }
  }
  Point pt=DisplayUtils.getDisplayPixelSize(this.getContext());
  int maxSize=Math.max(pt.x,pt.y);
  if (mImageType == ImageType.PHOTO || mImageType == ImageType.PHOTO_FULL) {
    AppLog.i(AppLog.T.READER,mUrl);
  }
  ImageLoader.ImageContainer newContainer=WordPress.imageLoader.get(mUrl,new ImageLoader.ImageListener(){
    @Override public void onErrorResponse(    VolleyError error){
      if (mImageType == ImageType.MSHOT && mRetryCnt < MAX_RETRIES && VolleyUtils.statusCodeFromVolleyError(error) == 307) {
        mRetryCnt++;
        retry(isInLayoutPass);
      }
 else {
        showErrorImage();
        if (mImageListener != null) {
          mImageListener.onImageLoaded(false);
        }
      }
    }
    @Override public void onResponse(    final ImageLoader.ImageContainer response,    boolean isImmediate){
      if (isImmediate && isInLayoutPass) {
        post(new Runnable(){
          @Override public void run(){
            handleResponse(response,true,false);
          }
        }
);
      }
 else {
        handleResponse(response,isImmediate,true);
      }
    }
  }
,maxSize,maxSize);
  mImageContainer=newContainer;
}