Program: 15441
Project: 15441
Buggy source:
@Override public View onCreateView(final LayoutInflater inflater,final ViewGroup container,final Bundle savedInstanceState){
  final Context context=container.getContext();
  final RedditAccount user=RedditAccountManager.getInstance(context).getDefaultAccount();
  final LinearLayout outer=new LinearLayout(context);
  outer.setOrientation(LinearLayout.VERTICAL);
  notifications=new LinearLayout(context);
  notifications.setOrientation(LinearLayout.VERTICAL);
  outer.addView(notifications);
  loadingView=new LoadingView(context,R.string.download_waiting,true,true);
  final ListView lv=new ListView(context);
  lv.setDivider(null);
  final int paddingPx=General.dpToPixels(context,8);
  lv.setPadding(paddingPx,0,paddingPx,0);
  adapter=new MainMenuAdapter(context,user,this);
  lv.setAdapter(adapter);
  lv.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    public void onItemClick(    final AdapterView<?> adapterView,    final View view,    final int position,    final long id){
      adapter.clickOn(position);
    }
  }
);
  final AtomicReference<APIResponseHandler.SubredditResponseHandler> accessibleSubredditResponseHandler=new AtomicReference<APIResponseHandler.SubredditResponseHandler>(null);
  final APIResponseHandler.SubredditResponseHandler responseHandler=new APIResponseHandler.SubredditResponseHandler(context){
    @Override protected void onDownloadNecessary(){
      new Handler(Looper.getMainLooper()).post(new Runnable(){
        public void run(){
          notifications.addView(loadingView);
        }
      }
);
    }
    @Override protected void onDownloadStarted(){
      loadingView.setIndeterminate("String_Node_Str");
    }
    @Override protected void onSuccess(    final List<RedditSubreddit> result,    final long timestamp){
      if (result.size() == 0) {
        new Handler(Looper.getMainLooper()).post(new Runnable(){
          public void run(){
            notifications.removeView(loadingView);
            RedditAPI.getUserSubreddits(CacheManager.getInstance(context),accessibleSubredditResponseHandler.get(),RedditAccountManager.getAnon(),force ? CacheRequest.DownloadType.FORCE : CacheRequest.DownloadType.IF_NECESSARY,force,context);
          }
        }
);
      }
 else {
        adapter.setSubreddits(result);
        if (loadingView != null)         loadingView.setDone(R.string.download_done);
      }
    }
    @Override protected void onCallbackException(    final Throwable t){
      BugReportActivity.handleGlobalError(context,t);
    }
    @Override protected void onFailure(    final RequestFailureType type,    final Throwable t,    final StatusLine status,    final String readableMessage){
      if (loadingView != null)       loadingView.setDone(R.string.download_failed);
      final RRError error=General.getGeneralErrorForFailure(context,type,t,status);
      new Handler(Looper.getMainLooper()).post(new Runnable(){
        public void run(){
          notifications.addView(new ErrorView(getSupportActivity(),error));
        }
      }
);
    }
    @Override protected void onFailure(    final APIFailureType type){
      if (loadingView != null)       loadingView.setDone(R.string.download_failed);
      final RRError error=General.getGeneralErrorForFailure(context,type);
      new Handler(Looper.getMainLooper()).post(new Runnable(){
        public void run(){
          notifications.addView(new ErrorView(getSupportActivity(),error));
        }
      }
);
    }
  }
;
  accessibleSubredditResponseHandler.set(responseHandler);
  RedditAPI.getUserSubreddits(CacheManager.getInstance(context),responseHandler,user,force ? CacheRequest.DownloadType.FORCE : CacheRequest.DownloadType.IF_NECESSARY,force,context);
  outer.addView(lv);
  return outer;
}

Fixed version (ground truth):
@Override public View onCreateView(final LayoutInflater inflater,final ViewGroup container,final Bundle savedInstanceState){
  final Context context;
  if (container != null) {
    context=container.getContext();
  }
 else {
    context=inflater.getContext();
  }
  final RedditAccount user=RedditAccountManager.getInstance(context).getDefaultAccount();
  final LinearLayout outer=new LinearLayout(context);
  outer.setOrientation(LinearLayout.VERTICAL);
  notifications=new LinearLayout(context);
  notifications.setOrientation(LinearLayout.VERTICAL);
  outer.addView(notifications);
  loadingView=new LoadingView(context,R.string.download_waiting,true,true);
  final ListView lv=new ListView(context);
  lv.setDivider(null);
  final int paddingPx=General.dpToPixels(context,8);
  lv.setPadding(paddingPx,0,paddingPx,0);
  adapter=new MainMenuAdapter(context,user,this);
  lv.setAdapter(adapter);
  lv.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    public void onItemClick(    final AdapterView<?> adapterView,    final View view,    final int position,    final long id){
      adapter.clickOn(position);
    }
  }
);
  final AtomicReference<APIResponseHandler.SubredditResponseHandler> accessibleSubredditResponseHandler=new AtomicReference<APIResponseHandler.SubredditResponseHandler>(null);
  final APIResponseHandler.SubredditResponseHandler responseHandler=new APIResponseHandler.SubredditResponseHandler(context){
    @Override protected void onDownloadNecessary(){
      new Handler(Looper.getMainLooper()).post(new Runnable(){
        public void run(){
          notifications.addView(loadingView);
        }
      }
);
    }
    @Override protected void onDownloadStarted(){
      loadingView.setIndeterminate("String_Node_Str");
    }
    @Override protected void onSuccess(    final List<RedditSubreddit> result,    final long timestamp){
      if (result.size() == 0) {
        new Handler(Looper.getMainLooper()).post(new Runnable(){
          public void run(){
            notifications.removeView(loadingView);
            RedditAPI.getUserSubreddits(CacheManager.getInstance(context),accessibleSubredditResponseHandler.get(),RedditAccountManager.getAnon(),force ? CacheRequest.DownloadType.FORCE : CacheRequest.DownloadType.IF_NECESSARY,force,context);
          }
        }
);
      }
 else {
        adapter.setSubreddits(result);
        if (loadingView != null)         loadingView.setDone(R.string.download_done);
      }
    }
    @Override protected void onCallbackException(    final Throwable t){
      BugReportActivity.handleGlobalError(context,t);
    }
    @Override protected void onFailure(    final RequestFailureType type,    final Throwable t,    final StatusLine status,    final String readableMessage){
      if (loadingView != null)       loadingView.setDone(R.string.download_failed);
      final RRError error=General.getGeneralErrorForFailure(context,type,t,status);
      new Handler(Looper.getMainLooper()).post(new Runnable(){
        public void run(){
          notifications.addView(new ErrorView(getSupportActivity(),error));
        }
      }
);
    }
    @Override protected void onFailure(    final APIFailureType type){
      if (loadingView != null)       loadingView.setDone(R.string.download_failed);
      final RRError error=General.getGeneralErrorForFailure(context,type);
      new Handler(Looper.getMainLooper()).post(new Runnable(){
        public void run(){
          notifications.addView(new ErrorView(getSupportActivity(),error));
        }
      }
);
    }
  }
;
  accessibleSubredditResponseHandler.set(responseHandler);
  RedditAPI.getUserSubreddits(CacheManager.getInstance(context),responseHandler,user,force ? CacheRequest.DownloadType.FORCE : CacheRequest.DownloadType.IF_NECESSARY,force,context);
  outer.addView(lv);
  return outer;
}