public BVResponse update(JSONObject json, BVResponse elementToUpdate) {
List<BVElement> productStatisticsList = new ArrayList<BVElement>();
JSONArray results = this.getResults(json);
int numberOfEntries = results.length();
for (int i = 0; i < numberOfEntries; i++) {
BVProductStatistic responseProductStatistics = new BVProductStatistic();
JSONObject productStatistics = null;
try {
productStatistics = results.getJSONObject(i).getJSONObject(BVConstants.JSON_PRODUCT_STATISTICS.toString());
} catch (JSONException e) {
logJSONException(String.format(ITERATIVE_EXCEPTION_PATTERN, BVConstants.JSON_PRODUCT_STATISTICS, i), e);
}
try {
responseProductStatistics.setProductId(productStatistics.getString(BVConstants.JSON_PRODUCT_ID.toString()));
} catch (JSONException e) {
logJSONException(String.format(ITERATIVE_EXCEPTION_PATTERN, BVConstants.JSON_PRODUCT_ID, i), e);
}
try {
responseProductStatistics.setReviewStatistics(
processReviewStatistics(
productStatistics.getJSONObject(
BVConstants.JSON_REVIEW_STATISTICS.toString())));
} catch (JSONException e) {
logJSONException(String.format(ITERATIVE_EXCEPTION_PATTERN, BVConstants.JSON_REVIEW_STATISTICS, i), e);
} catch (BVJSONProcessingException e) {
logJSONException(String.format(ITERATIVE_EXCEPTION_PATTERN, e.getValueInError(), i), e.getOriginalJSONException());
}
try {
responseProductStatistics.setNativeReviewStatistics(
processReviewStatistics(
productStatistics.getJSONObject(
BVConstants.JSON_NATIVE_REVIEW_STATISTICS.toString())));
} catch (JSONException e) {
logJSONException(String.format(ITERATIVE_EXCEPTION_PATTERN, BVConstants.JSON_NATIVE_REVIEW_STATISTICS, i), e);