logger.warn("failed to parse retweeted_status:" + json);
}
}
if (!json.isNull("contributors")) {
try {
JSONArray contributorsArray = json.getJSONArray("contributors");
contributorsIDs = new long[contributorsArray.length()];
for (int i = 0; i < contributorsArray.length(); i++) {
contributorsIDs[i] = Long.parseLong(contributorsArray.getString(i));
}
} catch (NumberFormatException ignore) {
ignore.printStackTrace();
logger.warn("failed to parse contributors:" + json);
} catch (JSONException ignore) {
ignore.printStackTrace();
logger.warn("failed to parse contributors:" + json);
}
} else {
contributors = null;
}
if (!json.isNull("entities")) {
try {
JSONObject entities = json.getJSONObject("entities");
int len;
if (!entities.isNull("user_mentions")) {
JSONArray userMentionsArray = entities.getJSONArray("user_mentions");
len = userMentionsArray.length();
userMentionEntities = new UserMentionEntity[len];
for (int i = 0; i < len; i++) {
userMentionEntities[i] = new UserMentionEntityJSONImpl(userMentionsArray.getJSONObject(i));
}
}
if (!entities.isNull("urls")) {
JSONArray urlsArray = entities.getJSONArray("urls");
len = urlsArray.length();
urlEntities = new URLEntity[len];
for (int i = 0; i < len; i++) {
urlEntities[i] = new URLEntityJSONImpl(urlsArray.getJSONObject(i));
}
}
if (!entities.isNull("hashtags")) {
JSONArray hashtagsArray = entities.getJSONArray("hashtags");
len = hashtagsArray.length();
hashtagEntities = new HashtagEntity[len];
for (int i = 0; i < len; i++) {
hashtagEntities[i] = new HashtagEntityJSONImpl(hashtagsArray.getJSONObject(i));
}
}
if (!entities.isNull("media")) {
JSONArray mediaArray = entities.getJSONArray("media");
len = mediaArray.length();
mediaEntities = new MediaEntity[len];
for (int i = 0; i < len; i++) {
mediaEntities[i] = new MediaEntityJSONImpl(mediaArray.getJSONObject(i));
}
}
} catch (JSONException jsone) {
throw new TwitterException(jsone);
}
}
if (!json.isNull("annotations")) {
try {
JSONArray annotationsArray = json.getJSONArray("annotations");
annotations = new Annotations(annotationsArray);
} catch (JSONException ignore) {
}
}
if (!json.isNull("current_user_retweet")) {