Program: 15387
Project: 15387
Buggy source:
private void makeFirstRequest(final Context context){
  final RedditAccount user=RedditAccountManager.getInstance(context).getDefaultAccount();
  final CacheManager cm=CacheManager.getInstance(context);
  final URI url;
  if (!isModmail) {
    url=Constants.Reddit.getUri("String_Node_Str");
  }
 else {
    url=Constants.Reddit.getUri("String_Node_Str");
  }
  request=new CacheRequest(url,user,null,Constants.Priority.API_INBOX_LIST,0,CacheRequest.DownloadType.FORCE,Constants.FileType.INBOX_LIST,true,true,true,context){
    @Override protected void onDownloadNecessary(){
    }
    @Override protected void onDownloadStarted(){
    }
    @Override protected void onCallbackException(    final Throwable t){
      request=null;
      BugReportActivity.handleGlobalError(context,t);
    }
    @Override protected void onFailure(    final RequestFailureType type,    final Throwable t,    final StatusLine status,    final String readableMessage){
      request=null;
      if (loadingView != null)       loadingView.setDone(R.string.download_failed);
      final RRError error=General.getGeneralErrorForFailure(context,type,t,status,url.toString());
      General.UI_THREAD_HANDLER.post(new Runnable(){
        public void run(){
          notifications.addView(new ErrorView(InboxListingActivity.this,error));
        }
      }
);
      if (t != null)       t.printStackTrace();
    }
    @Override protected void onProgress(    final boolean authorizationInProgress,    final long bytesRead,    final long totalBytes){
    }
    @Override protected void onSuccess(    final CacheManager.ReadableCacheFile cacheFile,    final long timestamp,    final UUID session,    final boolean fromCache,    final String mimetype){
      request=null;
    }
    @Override public void onJsonParseStarted(    final JsonValue value,    final long timestamp,    final UUID session,    final boolean fromCache){
      if (loadingView != null)       loadingView.setIndeterminate(R.string.download_downloading);
      if (fromCache && RRTime.since(timestamp) > 10 * 60 * 1000) {
        General.UI_THREAD_HANDLER.post(new Runnable(){
          public void run(){
            final TextView cacheNotif=new TextView(context);
            cacheNotif.setText(context.getString(R.string.listing_cached) + RRTime.formatDateTime(timestamp,context));
            final int paddingPx=General.dpToPixels(context,6);
            final int sidePaddingPx=General.dpToPixels(context,10);
            cacheNotif.setPadding(sidePaddingPx,paddingPx,sidePaddingPx,paddingPx);
            cacheNotif.setTextSize(13f);
            notifications.addView(cacheNotif);
            adapter.notifyDataSetChanged();
          }
        }
);
      }
      try {
        final JsonBufferedObject root=value.asObject();
        final JsonBufferedObject data=root.getObject("String_Node_Str");
        final JsonBufferedArray children=data.getArray("String_Node_Str");
        for (        JsonValue child : children) {
          final RedditThing thing=child.asObject(RedditThing.class);
switch (thing.getKind()) {
case COMMENT:
            final RedditPreparedComment comment=new RedditPreparedComment(InboxListingActivity.this,thing.asComment(),timestamp,false,null,user,headerItems);
          itemHandler.sendMessage(General.handlerMessage(0,comment));
        break;
case MESSAGE:
      final RedditPreparedMessage message=new RedditPreparedMessage(InboxListingActivity.this,thing.asMessage(),timestamp);
    itemHandler.sendMessage(General.handlerMessage(0,message));
  if (message.src.replies != null && message.src.replies.getType() == JsonValue.Type.OBJECT) {
    final JsonBufferedArray replies=message.src.replies.asObject().getObject("String_Node_Str").getArray("String_Node_Str");
    for (    JsonValue childMsgValue : replies) {
      final RedditMessage childMsgRaw=childMsgValue.asObject(RedditThing.class).asMessage();
      final RedditPreparedMessage childMsg=new RedditPreparedMessage(InboxListingActivity.this,childMsgRaw,timestamp);
      itemHandler.sendMessage(General.handlerMessage(0,childMsg));
    }
  }
break;
default :
throw new RuntimeException("String_Node_Str");
}
}
}
 catch (Throwable t) {
notifyFailure(RequestFailureType.PARSE,t,null,"String_Node_Str");
return;
}
if (loadingView != null) loadingView.setDone(R.string.download_done);
}
}
;
cm.makeRequest(request);
}

Fixed version (ground truth):
private void makeFirstRequest(final Context context){
  final RedditAccount user=RedditAccountManager.getInstance(context).getDefaultAccount();
  final CacheManager cm=CacheManager.getInstance(context);
  final URI url;
  if (!isModmail) {
    url=Constants.Reddit.getUri("String_Node_Str");
  }
 else {
    url=Constants.Reddit.getUri("String_Node_Str");
  }
  request=new CacheRequest(url,user,null,Constants.Priority.API_INBOX_LIST,0,CacheRequest.DownloadType.FORCE,Constants.FileType.INBOX_LIST,true,true,true,context){
    @Override protected void onDownloadNecessary(){
    }
    @Override protected void onDownloadStarted(){
    }
    @Override protected void onCallbackException(    final Throwable t){
      request=null;
      BugReportActivity.handleGlobalError(context,t);
    }
    @Override protected void onFailure(    final RequestFailureType type,    final Throwable t,    final StatusLine status,    final String readableMessage){
      request=null;
      if (loadingView != null)       loadingView.setDone(R.string.download_failed);
      final RRError error=General.getGeneralErrorForFailure(context,type,t,status,url.toString());
      AndroidApi.UI_THREAD_HANDLER.post(new Runnable(){
        public void run(){
          notifications.addView(new ErrorView(InboxListingActivity.this,error));
        }
      }
);
      if (t != null)       t.printStackTrace();
    }
    @Override protected void onProgress(    final boolean authorizationInProgress,    final long bytesRead,    final long totalBytes){
    }
    @Override protected void onSuccess(    final CacheManager.ReadableCacheFile cacheFile,    final long timestamp,    final UUID session,    final boolean fromCache,    final String mimetype){
      request=null;
    }
    @Override public void onJsonParseStarted(    final JsonValue value,    final long timestamp,    final UUID session,    final boolean fromCache){
      if (loadingView != null)       loadingView.setIndeterminate(R.string.download_downloading);
      if (fromCache && RRTime.since(timestamp) > 10 * 60 * 1000) {
        AndroidApi.UI_THREAD_HANDLER.post(new Runnable(){
          public void run(){
            final TextView cacheNotif=new TextView(context);
            cacheNotif.setText(context.getString(R.string.listing_cached) + RRTime.formatDateTime(timestamp,context));
            final int paddingPx=General.dpToPixels(context,6);
            final int sidePaddingPx=General.dpToPixels(context,10);
            cacheNotif.setPadding(sidePaddingPx,paddingPx,sidePaddingPx,paddingPx);
            cacheNotif.setTextSize(13f);
            notifications.addView(cacheNotif);
            adapter.notifyDataSetChanged();
          }
        }
);
      }
      try {
        final JsonBufferedObject root=value.asObject();
        final JsonBufferedObject data=root.getObject("String_Node_Str");
        final JsonBufferedArray children=data.getArray("String_Node_Str");
        for (        JsonValue child : children) {
          final RedditThing thing=child.asObject(RedditThing.class);
switch (thing.getKind()) {
case COMMENT:
            final RedditPreparedComment comment=new RedditPreparedComment(InboxListingActivity.this,thing.asComment(),timestamp,false,null,user,headerItems);
          itemHandler.sendMessage(General.handlerMessage(0,comment));
        break;
case MESSAGE:
      final RedditPreparedMessage message=new RedditPreparedMessage(InboxListingActivity.this,thing.asMessage(),timestamp);
    itemHandler.sendMessage(General.handlerMessage(0,message));
  if (message.src.replies != null && message.src.replies.getType() == JsonValue.Type.OBJECT) {
    final JsonBufferedArray replies=message.src.replies.asObject().getObject("String_Node_Str").getArray("String_Node_Str");
    for (    JsonValue childMsgValue : replies) {
      final RedditMessage childMsgRaw=childMsgValue.asObject(RedditThing.class).asMessage();
      final RedditPreparedMessage childMsg=new RedditPreparedMessage(InboxListingActivity.this,childMsgRaw,timestamp);
      itemHandler.sendMessage(General.handlerMessage(0,childMsg));
    }
  }
break;
default :
throw new RuntimeException("String_Node_Str");
}
}
}
 catch (Throwable t) {
notifyFailure(RequestFailureType.PARSE,t,null,"String_Node_Str");
return;
}
if (loadingView != null) loadingView.setDone(R.string.download_done);
}
}
;
cm.makeRequest(request);
}