Program: 87526
Project: 87526
Buggy source:
private List<JSONObject> getNextLevelChildCategories(JSONObject parentCategory){
  List<JSONObject> childCategories=new ArrayList<JSONObject>();
  try {
    int childrenCount=parentCategory.getInt(JSONKeys.CHILDREN_COUNT.getKey());
    if (childrenCount != 0) {
      int pageCount=(childrenCount / COUNT_MAX_VALUE) + 1;
      for (Integer pageNum=1; pageNum <= pageCount; pageNum++) {
        long currId=parentCategory.getLong(JSONKeys.ID.getKey());
        CategoryRequestBuilder categoryRequestBuilder=new CategoryRequestBuilder();
        Map<String,String> parameters=new HashMap<String,String>();
        parameters.put(RequestParams.COUNT.getKey(),COUNT_MAX_VALUE.toString());
        parameters.put(RequestParams.PAGE.getKey(),pageNum.toString());
        UrlRequest urlRequest=categoryRequestBuilder.requestForListOfChildrenCategoriesById(currId,parameters);
        try {
          JSONObject mainObject=getContentApiProvider().provide(urlRequest);
          childCategories.addAll(JSONUtil.extractList(mainObject,JSONKeys.ITEMS.getKey(),JSONKeys.CATEGORIES.getKey()));
        }
 catch (        HTTPException e) {
          log.error("String_Node_Str" + e.getMessage());
        }
catch (        IOException e) {
          log.error("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ urlRequest.getUrl());
        }
catch (        JSONException e) {
          log.error("String_Node_Str" + "String_Node_Str" + urlRequest.getUrl(),e);
        }
      }
    }
  }
 catch (  JSONException e) {
    log.error("String_Node_Str",e);
  }
  return childCategories;
}

Fixed version (ground truth):
private List<JSONObject> getNextLevelChildCategories(JSONObject parentCategory){
  List<JSONObject> childCategories=new ArrayList<JSONObject>();
  try {
    int childrenCount=parentCategory.getInt(JSONKeys.CHILDREN_COUNT.getKey());
    if (childrenCount != 0) {
      int pageCount=(childrenCount % COUNT_MAX_VALUE == 0) ? (childrenCount / COUNT_MAX_VALUE) : (childrenCount / COUNT_MAX_VALUE) + 1;
      for (Integer pageNum=1; pageNum <= pageCount; pageNum++) {
        long currId=parentCategory.getLong(JSONKeys.ID.getKey());
        CategoryRequestBuilder categoryRequestBuilder=new CategoryRequestBuilder();
        Map<String,String> parameters=new HashMap<String,String>();
        parameters.put(RequestParams.COUNT.getKey(),COUNT_MAX_VALUE.toString());
        parameters.put(RequestParams.PAGE.getKey(),pageNum.toString());
        UrlRequest urlRequest=categoryRequestBuilder.requestForListOfChildrenCategoriesById(currId,parameters);
        try {
          JSONObject mainObject=getContentApiProvider().provide(urlRequest);
          childCategories.addAll(JSONUtil.extractList(mainObject,JSONKeys.ITEMS.getKey(),JSONKeys.CATEGORIES.getKey()));
        }
 catch (        HTTPException e) {
          log.error("String_Node_Str" + e.getMessage());
        }
catch (        IOException e) {
          log.error("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ urlRequest.getUrl());
        }
catch (        JSONException e) {
          log.error("String_Node_Str" + "String_Node_Str" + urlRequest.getUrl(),e);
        }
      }
    }
  }
 catch (  JSONException e) {
    log.error("String_Node_Str",e);
  }
  return childCategories;
}