Program: 15369
Project: 15369
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  final SharedPreferences sharedPreferences=PreferenceManager.getDefaultSharedPreferences(this);
  final boolean solidblack=PrefsUtility.appearance_solidblack(this,sharedPreferences);
  if (solidblack)   getWindow().setBackgroundDrawable(new ColorDrawable(Color.BLACK));
  final Intent intent=getIntent();
  mUrl=intent.getDataString();
  if (mUrl == null) {
    finish();
    return;
  }
  mPost=intent.getParcelableExtra("String_Node_Str");
  if (intent.hasExtra("String_Node_Str")) {
    ImgurAPI.getAlbumInfo(this,intent.getStringExtra("String_Node_Str"),Constants.Priority.IMAGE_VIEW,0,new GetAlbumInfoListener(){
      @Override public void onFailure(      final RequestFailureType type,      final Throwable t,      final StatusLine status,      final String readableMessage){
      }
      @Override public void onSuccess(      final ImgurAPI.AlbumInfo info){
        AndroidApi.UI_THREAD_HANDLER.post(new Runnable(){
          @Override public void run(){
            mAlbumInfo=info;
            mAlbumImageIndex=intent.getIntExtra("String_Node_Str",0);
          }
        }
);
      }
    }
);
  }
  Log.i("String_Node_Str","String_Node_Str" + mUrl);
  final DonutProgress progressBar=new DonutProgress(this);
  progressBar.setIndeterminate(true);
  progressBar.setFinishedStrokeColor(Color.rgb(200,200,200));
  progressBar.setUnfinishedStrokeColor(Color.rgb(50,50,50));
  final int progressStrokeWidthPx=General.dpToPixels(this,15);
  progressBar.setUnfinishedStrokeWidth(progressStrokeWidthPx);
  progressBar.setFinishedStrokeWidth(progressStrokeWidthPx);
  progressBar.setStartingDegree(-90);
  progressBar.initPainters();
  final RelativeLayout progressLayout=new RelativeLayout(this);
  progressLayout.addView(progressBar);
  final int progressDimensionsPx=General.dpToPixels(this,150);
  progressBar.getLayoutParams().width=progressDimensionsPx;
  progressBar.getLayoutParams().height=progressDimensionsPx;
  ((RelativeLayout.LayoutParams)progressBar.getLayoutParams()).addRule(RelativeLayout.CENTER_IN_PARENT);
  mLayout=new FrameLayout(this);
  mLayout.addView(progressLayout);
  LinkHandler.getImageInfo(this,mUrl,Constants.Priority.IMAGE_VIEW,0,new GetImageInfoListener(){
    @Override public void onFailure(    final RequestFailureType type,    final Throwable t,    final StatusLine status,    final String readableMessage){
      revertToWeb();
    }
    @Override public void onSuccess(    final ImgurAPI.ImageInfo info){
      Log.i("String_Node_Str","String_Node_Str" + info.urlOriginal);
      final URI uri=General.uriFromString(info.urlOriginal);
      if (uri == null) {
        revertToWeb();
        return;
      }
      CacheManager.getInstance(ImageViewActivity.this).makeRequest(mRequest=new CacheRequest(uri,RedditAccountManager.getAnon(),null,Constants.Priority.IMAGE_VIEW,0,CacheRequest.DownloadType.IF_NECESSARY,Constants.FileType.IMAGE,false,false,false,ImageViewActivity.this){
        @Override protected void onCallbackException(        Throwable t){
          BugReportActivity.handleGlobalError(context.getApplicationContext(),new RRError(null,null,t));
        }
        @Override protected void onDownloadNecessary(){
          AndroidApi.UI_THREAD_HANDLER.post(new Runnable(){
            @Override public void run(){
              progressBar.setVisibility(View.VISIBLE);
              progressBar.setIndeterminate(true);
            }
          }
);
        }
        @Override protected void onDownloadStarted(){
        }
        @Override protected void onFailure(        final RequestFailureType type,        Throwable t,        StatusLine status,        final String readableMessage){
          final RRError error=General.getGeneralErrorForFailure(context,type,t,status,url.toString());
          AndroidApi.UI_THREAD_HANDLER.post(new Runnable(){
            public void run(){
              mRequest=null;
              setMainView(new ErrorView(ImageViewActivity.this,error));
            }
          }
);
        }
        @Override protected void onProgress(        final boolean authorizationInProgress,        final long bytesRead,        final long totalBytes){
          AndroidApi.UI_THREAD_HANDLER.post(new Runnable(){
            @Override public void run(){
              progressBar.setVisibility(View.VISIBLE);
              progressBar.setIndeterminate(authorizationInProgress);
              progressBar.setProgress(((float)((1000 * bytesRead) / totalBytes)) / 1000);
            }
          }
);
        }
        @Override protected void onSuccess(        final CacheManager.ReadableCacheFile cacheFile,        long timestamp,        UUID session,        boolean fromCache,        final String mimetype){
          onImageLoaded(cacheFile,mimetype);
        }
      }
);
    }
    @Override public void onNotAnImage(){
      revertToWeb();
    }
  }
);
  final RedditPreparedPost post=mPost == null ? null : new RedditPreparedPost(this,CacheManager.getInstance(this),0,mPost,-1,false,false,false,false,RedditAccountManager.getInstance(this).getDefaultAccount(),false);
  final FrameLayout outerFrame=new FrameLayout(this);
  outerFrame.addView(mLayout);
  if (post != null) {
    final SideToolbarOverlay toolbarOverlay=new SideToolbarOverlay(this);
    final BezelSwipeOverlay bezelOverlay=new BezelSwipeOverlay(this,new BezelSwipeOverlay.BezelSwipeListener(){
      public boolean onSwipe(      BezelSwipeOverlay.SwipeEdge edge){
        toolbarOverlay.setContents(post.generateToolbar(ImageViewActivity.this,false,toolbarOverlay));
        toolbarOverlay.show(edge == BezelSwipeOverlay.SwipeEdge.LEFT ? SideToolbarOverlay.SideToolbarPosition.LEFT : SideToolbarOverlay.SideToolbarPosition.RIGHT);
        return true;
      }
      public boolean onTap(){
        if (toolbarOverlay.isShown()) {
          toolbarOverlay.hide();
          return true;
        }
        return false;
      }
    }
);
    outerFrame.addView(bezelOverlay);
    outerFrame.addView(toolbarOverlay);
    bezelOverlay.getLayoutParams().width=android.widget.FrameLayout.LayoutParams.MATCH_PARENT;
    bezelOverlay.getLayoutParams().height=android.widget.FrameLayout.LayoutParams.MATCH_PARENT;
    toolbarOverlay.getLayoutParams().width=android.widget.FrameLayout.LayoutParams.MATCH_PARENT;
    toolbarOverlay.getLayoutParams().height=android.widget.FrameLayout.LayoutParams.MATCH_PARENT;
  }
  setContentView(outerFrame);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  final SharedPreferences sharedPreferences=PreferenceManager.getDefaultSharedPreferences(this);
  final boolean solidblack=PrefsUtility.appearance_solidblack(this,sharedPreferences);
  if (solidblack)   getWindow().setBackgroundDrawable(new ColorDrawable(Color.BLACK));
  final Intent intent=getIntent();
  mUrl=intent.getDataString();
  if (mUrl == null) {
    finish();
    return;
  }
  mPost=intent.getParcelableExtra("String_Node_Str");
  if (intent.hasExtra("String_Node_Str")) {
    ImgurAPI.getAlbumInfo(this,intent.getStringExtra("String_Node_Str"),Constants.Priority.IMAGE_VIEW,0,new GetAlbumInfoListener(){
      @Override public void onFailure(      final RequestFailureType type,      final Throwable t,      final StatusLine status,      final String readableMessage){
      }
      @Override public void onSuccess(      final ImgurAPI.AlbumInfo info){
        AndroidApi.UI_THREAD_HANDLER.post(new Runnable(){
          @Override public void run(){
            mAlbumInfo=info;
            mAlbumImageIndex=intent.getIntExtra("String_Node_Str",0);
          }
        }
);
      }
    }
);
  }
  Log.i("String_Node_Str","String_Node_Str" + mUrl);
  final DonutProgress progressBar=new DonutProgress(this);
  progressBar.setIndeterminate(true);
  progressBar.setFinishedStrokeColor(Color.rgb(200,200,200));
  progressBar.setUnfinishedStrokeColor(Color.rgb(50,50,50));
  final int progressStrokeWidthPx=General.dpToPixels(this,15);
  progressBar.setUnfinishedStrokeWidth(progressStrokeWidthPx);
  progressBar.setFinishedStrokeWidth(progressStrokeWidthPx);
  progressBar.setStartingDegree(-90);
  progressBar.initPainters();
  final RelativeLayout progressLayout=new RelativeLayout(this);
  progressLayout.addView(progressBar);
  final int progressDimensionsPx=General.dpToPixels(this,150);
  progressBar.getLayoutParams().width=progressDimensionsPx;
  progressBar.getLayoutParams().height=progressDimensionsPx;
  ((RelativeLayout.LayoutParams)progressBar.getLayoutParams()).addRule(RelativeLayout.CENTER_IN_PARENT);
  mLayout=new FrameLayout(this);
  mLayout.addView(progressLayout);
  LinkHandler.getImageInfo(this,mUrl,Constants.Priority.IMAGE_VIEW,0,new GetImageInfoListener(){
    @Override public void onFailure(    final RequestFailureType type,    final Throwable t,    final StatusLine status,    final String readableMessage){
      revertToWeb();
    }
    @Override public void onSuccess(    final ImgurAPI.ImageInfo info){
      Log.i("String_Node_Str","String_Node_Str" + info.urlOriginal);
      final URI uri=General.uriFromString(info.urlOriginal);
      if (uri == null) {
        revertToWeb();
        return;
      }
      CacheManager.getInstance(ImageViewActivity.this).makeRequest(mRequest=new CacheRequest(uri,RedditAccountManager.getAnon(),null,Constants.Priority.IMAGE_VIEW,0,CacheRequest.DownloadType.IF_NECESSARY,Constants.FileType.IMAGE,false,false,false,ImageViewActivity.this){
        @Override protected void onCallbackException(        Throwable t){
          BugReportActivity.handleGlobalError(context.getApplicationContext(),new RRError(null,null,t));
        }
        @Override protected void onDownloadNecessary(){
          AndroidApi.UI_THREAD_HANDLER.post(new Runnable(){
            @Override public void run(){
              progressBar.setVisibility(View.VISIBLE);
              progressBar.setIndeterminate(true);
            }
          }
);
        }
        @Override protected void onDownloadStarted(){
        }
        @Override protected void onFailure(        final RequestFailureType type,        Throwable t,        StatusLine status,        final String readableMessage){
          final RRError error=General.getGeneralErrorForFailure(context,type,t,status,url.toString());
          AndroidApi.UI_THREAD_HANDLER.post(new Runnable(){
            public void run(){
              mRequest=null;
              final LinearLayout layout=new LinearLayout(context);
              layout.addView(new ErrorView(ImageViewActivity.this,error));
              setMainView(layout);
            }
          }
);
        }
        @Override protected void onProgress(        final boolean authorizationInProgress,        final long bytesRead,        final long totalBytes){
          AndroidApi.UI_THREAD_HANDLER.post(new Runnable(){
            @Override public void run(){
              progressBar.setVisibility(View.VISIBLE);
              progressBar.setIndeterminate(authorizationInProgress);
              progressBar.setProgress(((float)((1000 * bytesRead) / totalBytes)) / 1000);
            }
          }
);
        }
        @Override protected void onSuccess(        final CacheManager.ReadableCacheFile cacheFile,        long timestamp,        UUID session,        boolean fromCache,        final String mimetype){
          onImageLoaded(cacheFile,mimetype);
        }
      }
);
    }
    @Override public void onNotAnImage(){
      revertToWeb();
    }
  }
);
  final RedditPreparedPost post=mPost == null ? null : new RedditPreparedPost(this,CacheManager.getInstance(this),0,mPost,-1,false,false,false,false,RedditAccountManager.getInstance(this).getDefaultAccount(),false);
  final FrameLayout outerFrame=new FrameLayout(this);
  outerFrame.addView(mLayout);
  if (post != null) {
    final SideToolbarOverlay toolbarOverlay=new SideToolbarOverlay(this);
    final BezelSwipeOverlay bezelOverlay=new BezelSwipeOverlay(this,new BezelSwipeOverlay.BezelSwipeListener(){
      public boolean onSwipe(      BezelSwipeOverlay.SwipeEdge edge){
        toolbarOverlay.setContents(post.generateToolbar(ImageViewActivity.this,false,toolbarOverlay));
        toolbarOverlay.show(edge == BezelSwipeOverlay.SwipeEdge.LEFT ? SideToolbarOverlay.SideToolbarPosition.LEFT : SideToolbarOverlay.SideToolbarPosition.RIGHT);
        return true;
      }
      public boolean onTap(){
        if (toolbarOverlay.isShown()) {
          toolbarOverlay.hide();
          return true;
        }
        return false;
      }
    }
);
    outerFrame.addView(bezelOverlay);
    outerFrame.addView(toolbarOverlay);
    bezelOverlay.getLayoutParams().width=android.widget.FrameLayout.LayoutParams.MATCH_PARENT;
    bezelOverlay.getLayoutParams().height=android.widget.FrameLayout.LayoutParams.MATCH_PARENT;
    toolbarOverlay.getLayoutParams().width=android.widget.FrameLayout.LayoutParams.MATCH_PARENT;
    toolbarOverlay.getLayoutParams().height=android.widget.FrameLayout.LayoutParams.MATCH_PARENT;
  }
  setContentView(outerFrame);
}