Source:
public synchronized void reportResults(List<Survey> newSurveys, List<InAppNotification> newNotifications, JSONArray eventBindings, JSONArray variants) { boolean newContent = false; mUpdatesFromMixpanel.setEventBindings(eventBindings); for (final Survey s : newSurveys) { final int id = s.getId(); if (! mSurveyIds.contains(id)) { mSurveyIds.add(id); mUnseenSurveys.add(s); newContent = true; } } for (final InAppNotification n : newNotifications) { final int id = n.getId(); if (! mNotificationIds.contains(id)) { mNotificationIds.add(id); mUnseenNotifications.add(n); newContent = true; } } int newVariantsLength = variants.length(); for (int i = 0; i < newVariantsLength; i++) { try { JSONObject variant = variants.getJSONObject(i); if (!mLoadedVariants.contains(variant.getInt("id"))) { mVariants = variants; newContent = true; break; } } catch(JSONException e) { Log.e(LOGTAG, "Could not convert variants[" + i + "] into a JSONObject while comparing the new variants", e); } } if (mVariants == variants) { mLoadedVariants.clear(); for (int i = 0; i < newVariantsLength; i++) { try { JSONObject variant = mVariants.getJSONObject(i); mLoadedVariants.add(variant.getInt("id")); } catch(JSONException e) { Log.e(LOGTAG, "Could not convert variants[" + i + "] into a JSONObject while updating the map", e); } } } if (MPConfig.DEBUG) { Log.v(LOGTAG, "New Decide content has become available. " + newSurveys.size() + " surveys and " + newNotifications.size() + " notifications and " + variants.length() + " experiments have been added."); } if (newContent && hasUpdatesAvailable() && null != mListener) { mListener.onNewResults(); } }

Target:
public synchronized void reportResults(List<Survey> newSurveys, List<InAppNotification> newNotifications, JSONArray eventBindings, JSONArray variants) { boolean newContent = false; mUpdatesFromMixpanel.setEventBindings(eventBindings); for (final Survey s : newSurveys) { final int id = s.getId(); if (! mSurveyIds.contains(id)) { mSurveyIds.add(id); mUnseenSurveys.add(s); newContent = true; } } for (final InAppNotification n : newNotifications) { final int id = n.getId(); if (! mNotificationIds.contains(id)) { mNotificationIds.add(id); mUnseenNotifications.add(n); newContent = true; } } int newVariantsLength = variants.length(); boolean hasNewVariants = false; for (int i = 0; i < newVariantsLength; i++) { try { JSONObject variant = variants.getJSONObject(i); if (!mLoadedVariants.contains(variant.getInt("id"))) { mVariants = variants; newContent = true; hasNewVariants = true; break; } } catch(JSONException e) { Log.e(LOGTAG, "Could not convert variants[" + i + "] into a JSONObject while comparing the new variants", e); } } if (hasNewVariants) { mLoadedVariants.clear(); for (int i = 0; i < newVariantsLength; i++) { try { JSONObject variant = mVariants.getJSONObject(i); mLoadedVariants.add(variant.getInt("id")); } catch(JSONException e) { Log.e(LOGTAG, "Could not convert variants[" + i + "] into a JSONObject while updating the map", e); } } } if (MPConfig.DEBUG) { Log.v(LOGTAG, "New Decide content has become available. " + newSurveys.size() + " surveys, " + newNotifications.size() + " notifications and " + variants.length() + " experiments have been added."); } if (newContent && hasUpdatesAvailable() && null != mListener) { mListener.onNewResults(); } }