Program: 14193
Project: 14193
Buggy source:
private void startTasks(final String blogId,final StatsTimeframe timeframe,final String date,final StatsEndpointsEnum sectionToUpdate,final int maxResultsRequested,final int pageRequested){
  String cachedStats=getCachedStats(blogId,timeframe,date,sectionToUpdate,maxResultsRequested,pageRequested);
  if (cachedStats != null) {
    BaseStatsModel mResponseObjectModel;
    try {
      JSONObject response=new JSONObject(cachedStats);
      mResponseObjectModel=StatsUtils.parseResponse(sectionToUpdate,blogId,response);
      EventBus.getDefault().post(sectionToUpdate.getEndpointUpdateEvent(blogId,timeframe,date,maxResultsRequested,pageRequested,mResponseObjectModel));
      updateWidgetsUI(blogId,sectionToUpdate,timeframe,date,pageRequested,mResponseObjectModel);
      checkAllRequestsFinished(null);
      return;
    }
 catch (    JSONException e) {
      AppLog.e(AppLog.T.STATS,e);
    }
  }
  final RestClientUtils restClientUtils=WordPress.getRestClientUtilsV1_1();
  String period=timeframe.getLabelForRestCall();
  EventBus.getDefault().post(new StatsEvents.UpdateStatusChanged(true));
  RestListener vListener=new RestListener(sectionToUpdate,blogId,timeframe,date,maxResultsRequested,pageRequested);
  final String periodDateMaxPlaceholder="String_Node_Str";
  String path=String.format("String_Node_Str" + sectionToUpdate.getRestEndpointPath(),blogId);
synchronized (mStatsNetworkRequests) {
switch (sectionToUpdate) {
case VISITS:
      path=String.format(path + "String_Node_Str",period,date);
    break;
case TOP_POSTS:
case REFERRERS:
case CLICKS:
case GEO_VIEWS:
case AUTHORS:
case VIDEO_PLAYS:
case SEARCH_TERMS:
  path=String.format(path + periodDateMaxPlaceholder,period,date,maxResultsRequested);
break;
case TAGS_AND_CATEGORIES:
case PUBLICIZE:
path=String.format(path + "String_Node_Str",maxResultsRequested);
break;
case COMMENTS:
break;
case FOLLOWERS_WPCOM:
if (pageRequested < 1) {
path=String.format(path + "String_Node_Str",maxResultsRequested);
}
 else {
path=String.format(path + "String_Node_Str",period,date,maxResultsRequested,pageRequested);
}
break;
case FOLLOWERS_EMAIL:
if (pageRequested < 1) {
path=String.format(path + "String_Node_Str",maxResultsRequested);
}
 else {
path=String.format(path + "String_Node_Str",period,date,maxResultsRequested,pageRequested);
}
break;
case COMMENT_FOLLOWERS:
if (pageRequested < 1) {
path=String.format(path + "String_Node_Str",maxResultsRequested);
}
 else {
path=String.format(path + "String_Node_Str",period,date,maxResultsRequested,pageRequested);
}
break;
case INSIGHTS_ALL_TIME:
case INSIGHTS_POPULAR:
break;
case INSIGHTS_TODAY:
path=String.format(path + "String_Node_Str",date);
break;
case INSIGHTS_LATEST_POST_SUMMARY:
path=String.format("String_Node_Str",blogId,sectionToUpdate.getRestEndpointPath() + "String_Node_Str");
break;
case INSIGHTS_LATEST_POST_VIEWS:
path=String.format(path + "String_Node_Str",pageRequested);
break;
default :
AppLog.i(T.STATS,"String_Node_Str" + sectionToUpdate.name());
return;
}
if (checkIfRequestShouldBeEnqueued(restClientUtils,path)) {
AppLog.d(AppLog.T.STATS,"String_Node_Str" + path);
Request<JSONObject> currentRequest=restClientUtils.get(path,vListener,vListener);
vListener.currentRequest=currentRequest;
currentRequest.setTag("String_Node_Str");
mStatsNetworkRequests.add(currentRequest);
}
 else {
AppLog.d(AppLog.T.STATS,"String_Node_Str" + path);
}
}
}

Fixed version (ground truth):
private void startTasks(final String blogId,final StatsTimeframe timeframe,final String date,final StatsEndpointsEnum sectionToUpdate,final int maxResultsRequested,final int pageRequested){
  EventBus.getDefault().post(new StatsEvents.UpdateStatusChanged(true));
  String cachedStats=getCachedStats(blogId,timeframe,date,sectionToUpdate,maxResultsRequested,pageRequested);
  if (cachedStats != null) {
    BaseStatsModel mResponseObjectModel;
    try {
      JSONObject response=new JSONObject(cachedStats);
      mResponseObjectModel=StatsUtils.parseResponse(sectionToUpdate,blogId,response);
      EventBus.getDefault().post(sectionToUpdate.getEndpointUpdateEvent(blogId,timeframe,date,maxResultsRequested,pageRequested,mResponseObjectModel));
      updateWidgetsUI(blogId,sectionToUpdate,timeframe,date,pageRequested,mResponseObjectModel);
      checkAllRequestsFinished(null);
      return;
    }
 catch (    JSONException e) {
      AppLog.e(AppLog.T.STATS,e);
    }
  }
  final RestClientUtils restClientUtils=WordPress.getRestClientUtilsV1_1();
  String period=timeframe.getLabelForRestCall();
  RestListener vListener=new RestListener(sectionToUpdate,blogId,timeframe,date,maxResultsRequested,pageRequested);
  final String periodDateMaxPlaceholder="String_Node_Str";
  String path=String.format("String_Node_Str" + sectionToUpdate.getRestEndpointPath(),blogId);
synchronized (mStatsNetworkRequests) {
switch (sectionToUpdate) {
case VISITS:
      path=String.format(path + "String_Node_Str",period,date);
    break;
case TOP_POSTS:
case REFERRERS:
case CLICKS:
case GEO_VIEWS:
case AUTHORS:
case VIDEO_PLAYS:
case SEARCH_TERMS:
  path=String.format(path + periodDateMaxPlaceholder,period,date,maxResultsRequested);
break;
case TAGS_AND_CATEGORIES:
case PUBLICIZE:
path=String.format(path + "String_Node_Str",maxResultsRequested);
break;
case COMMENTS:
break;
case FOLLOWERS_WPCOM:
if (pageRequested < 1) {
path=String.format(path + "String_Node_Str",maxResultsRequested);
}
 else {
path=String.format(path + "String_Node_Str",period,date,maxResultsRequested,pageRequested);
}
break;
case FOLLOWERS_EMAIL:
if (pageRequested < 1) {
path=String.format(path + "String_Node_Str",maxResultsRequested);
}
 else {
path=String.format(path + "String_Node_Str",period,date,maxResultsRequested,pageRequested);
}
break;
case COMMENT_FOLLOWERS:
if (pageRequested < 1) {
path=String.format(path + "String_Node_Str",maxResultsRequested);
}
 else {
path=String.format(path + "String_Node_Str",period,date,maxResultsRequested,pageRequested);
}
break;
case INSIGHTS_ALL_TIME:
case INSIGHTS_POPULAR:
break;
case INSIGHTS_TODAY:
path=String.format(path + "String_Node_Str",date);
break;
case INSIGHTS_LATEST_POST_SUMMARY:
path=String.format("String_Node_Str",blogId,sectionToUpdate.getRestEndpointPath() + "String_Node_Str");
break;
case INSIGHTS_LATEST_POST_VIEWS:
path=String.format(path + "String_Node_Str",pageRequested);
break;
default :
AppLog.i(T.STATS,"String_Node_Str" + sectionToUpdate.name());
return;
}
if (checkIfRequestShouldBeEnqueued(restClientUtils,path)) {
AppLog.d(AppLog.T.STATS,"String_Node_Str" + path);
Request<JSONObject> currentRequest=restClientUtils.get(path,vListener,vListener);
vListener.currentRequest=currentRequest;
currentRequest.setTag("String_Node_Str");
mStatsNetworkRequests.add(currentRequest);
}
 else {
AppLog.d(AppLog.T.STATS,"String_Node_Str" + path);
}
}
}